From 4206a9d21870cff97817d5149f1d0e4f61a3f1c4 Mon Sep 17 00:00:00 2001 From: Vesa Pikki Date: Thu, 2 Jul 2009 11:46:26 +0300 Subject: [PATCH] Toolbar can now be hidden. Treeview's headers will now be translated when language changes. --- gui/mainwindow.cpp | 4 +++- gui/resultstree.cpp | 2 +- gui/resultstree.h | 2 +- gui/resultsview.cpp | 5 +++++ gui/resultsview.h | 6 ++++++ 5 files changed, 16 insertions(+), 3 deletions(-) diff --git a/gui/mainwindow.cpp b/gui/mainwindow.cpp index d5d4e02f8..2c334bc01 100644 --- a/gui/mainwindow.cpp +++ b/gui/mainwindow.cpp @@ -70,8 +70,9 @@ MainWindow::MainWindow() : connect(mUI.mActionAbout, SIGNAL(triggered()), this, SLOT(About())); connect(mUI.mActionLicense, SIGNAL(triggered()), this, SLOT(ShowLicense())); - connect(mUI.mActionAuthors, SIGNAL(triggered()), this, SLOT(ShowAuthors())); + connect(mUI.mActionToolbar, SIGNAL(toggled(bool)), this, SLOT(ToggleToolbar())); + connect(mUI.mActionAuthors, SIGNAL(triggered()), this, SLOT(ShowAuthors())); connect(mThread, SIGNAL(Done()), this, SLOT(CheckDone())); connect(mUI.mResults, SIGNAL(GotResults()), this, SLOT(ResultsAdded())); @@ -572,6 +573,7 @@ void MainWindow::SetLanguage(int index) else { mUI.retranslateUi(this); + mUI.mResults->Translate(); } } diff --git a/gui/resultstree.cpp b/gui/resultstree.cpp index adc9064fe..d4e4d48a8 100644 --- a/gui/resultstree.cpp +++ b/gui/resultstree.cpp @@ -746,7 +746,7 @@ bool ResultsTree::HasResults() const return mModel.rowCount() > 0; } -void ResultsTree::LanguageChanged() +void ResultsTree::Translate() { QStringList labels; labels << tr("File") << tr("Severity") << tr("Line") << tr("Message"); diff --git a/gui/resultstree.h b/gui/resultstree.h index 1f593fb3d..662749b95 100644 --- a/gui/resultstree.h +++ b/gui/resultstree.h @@ -119,7 +119,7 @@ public: * @brief Change all visible texts language * */ - void LanguageChanged(); + void Translate(); protected slots: /** * @brief Slot to quickstart an error with default application diff --git a/gui/resultsview.cpp b/gui/resultsview.cpp index b429730e2..02f9fb8e2 100644 --- a/gui/resultsview.cpp +++ b/gui/resultsview.cpp @@ -197,3 +197,8 @@ void ResultsView::SaveSettings() mUI.mTree->SaveSettings(); } +void ResultsView::Translate() +{ + mUI.mTree->Translate(); +} + diff --git a/gui/resultsview.h b/gui/resultsview.h index f10a50c47..b50b0d648 100644 --- a/gui/resultsview.h +++ b/gui/resultsview.h @@ -110,6 +110,12 @@ public: * */ void SaveSettings(); + + /** + * @brief Translate this view + * + */ + void Translate(); signals: /**