From 8f516a5638d9cf8c4c3fbf7a2ad735da85dbf8ae Mon Sep 17 00:00:00 2001 From: Vesa Pikki Date: Thu, 2 Jul 2009 20:11:47 +0300 Subject: [PATCH] Checks if toolbar is closed when opening view menu. Basically just reverted back Kimmo's code that was lost in merge. --- gui/cppcheck_de.ts | 102 ++++++++++++++++++++++----------------------- gui/cppcheck_en.ts | 102 ++++++++++++++++++++++----------------------- gui/cppcheck_fi.ts | 102 ++++++++++++++++++++++----------------------- gui/cppcheck_ru.ts | 102 ++++++++++++++++++++++----------------------- gui/cppcheck_se.ts | 102 ++++++++++++++++++++++----------------------- gui/main.ui | 30 ++++++------- gui/mainwindow.cpp | 16 +++---- gui/mainwindow.h | 4 ++ 8 files changed, 282 insertions(+), 278 deletions(-) diff --git a/gui/cppcheck_de.ts b/gui/cppcheck_de.ts index daf990687..d0a75d01a 100644 --- a/gui/cppcheck_de.ts +++ b/gui/cppcheck_de.ts @@ -116,227 +116,227 @@ kate -l(line) (file) MainWindow - - - - + + + + Cppcheck - + + Standard + + + + Show possible false positives - + &File - + &View - + &Check - + &Edit - - toolBar - - - - + &License... - + A&uthors... - + &About... - + &Files... - + Ctrl+F - + &Directory... - + Ctrl+D - + &Recheck files - + Ctrl+R - + &Stop - + Esc - + &Save results to file... - + Ctrl+S - + &Quit - + &Clear results - + &Preferences - + Show security errors - + Show style errors - + Show common errors - + &Check all - + &Uncheck all - + Collapse &all - + &Expand all - + &Toolbar - + &Language - + &Help - + Select files to check - + Select directory to check - + No suitable files found to check! - + Cannot exit while checking. Stop the checking before exiting. - + License - + Authors - + XML files (*.xml);;Text files (*.txt) - + Save the report file - + XML files (*.xml) - + Cppcheck - %1 - + Failed to change language: %1 diff --git a/gui/cppcheck_en.ts b/gui/cppcheck_en.ts index b4b9e64bf..ebf21f0be 100644 --- a/gui/cppcheck_en.ts +++ b/gui/cppcheck_en.ts @@ -129,190 +129,190 @@ kate -l(line) (file) MainWindow - - - - + + + + Cppcheck Cppcheck - + + Standard + Standard + + + Show possible false positives Show possible false positives - + &File &File - + &View &View - + &Check &Check - + &Edit &Edit - - toolBar - toolBar - - - + &License... &License... - + A&uthors... A&uthors... - + &About... &About... - + &Files... &Files... - + Ctrl+F Ctrl+F - + &Directory... &Directory... - + Ctrl+D Ctrl+D - + &Recheck files &Recheck files - + Ctrl+R Ctrl+R - + &Stop &Stop - + Esc Esc - + &Save results to file... &Save results to file... - + Ctrl+S Ctrl+S - + &Quit &Quit - + &Clear results &Clear results - + &Preferences &Preferences - + Show security errors Show security errors - + Show style errors Show style errors - + Show common errors Show common errors - + &Check all &Check all - + &Uncheck all &Uncheck all - + Collapse &all Collapse &all - + &Expand all &Expand all - + &Toolbar &Toolbar - + &Language &Language - + &Help &Help - + Select files to check Select files to check - + Select directory to check Select directory to check - + No suitable files found to check! No suitable files found to check! - + Cannot exit while checking. Stop the checking before exiting. @@ -321,37 +321,37 @@ Stop the checking before exiting. Stop the checking before exiting. - + License License - + Authors Authors - + XML files (*.xml);;Text files (*.txt) XML files (*.xml);;Text files (*.txt) - + Save the report file Save the report file - + XML files (*.xml) XML files (*.xml) - + Cppcheck - %1 Cppcheck - %1 - + Failed to change language: %1 diff --git a/gui/cppcheck_fi.ts b/gui/cppcheck_fi.ts index d43228a9b..fbf65112a 100644 --- a/gui/cppcheck_fi.ts +++ b/gui/cppcheck_fi.ts @@ -131,190 +131,190 @@ kate -l(line) (file) MainWindow - - - - + + + + Cppcheck Cppcheck - + + Standard + Vakio + + + Show possible false positives Näytä epävarmat virheet - + &File &Tiedosto - + &View &Näytä - + &Check &Tarkista - + &Edit &Muokkaa - - toolBar - työkalupalkki - - - + &License... &Lisenssi... - + A&uthors... &Tekijät... - + &About... &Tietoa ohjelmasta Cppcheck... - + &Files... &Tiedostot... - + Ctrl+F Ctrl+F - + &Directory... &Hakemisto... - + Ctrl+D Ctrl+D - + &Recheck files Tarkista tiedostot &uudelleen - + Ctrl+R Ctrl+R - + &Stop &Pysäytä - + Esc Esc - + &Save results to file... &Tallenna tulokset tiedostoon... - + Ctrl+S Ctrl+S - + &Quit &Lopeta - + &Clear results &Tyhjennä tulokset - + &Preferences &Asetukset - + Show security errors Näytä tietoturvavirheet - + Show style errors Näytä tyylivirheet - + Show common errors Näytä yleiset virheet - + &Check all &Valitse kaikki - + &Uncheck all &Poista kaikista valinta - + Collapse &all &Pienennä kaikki - + &Expand all &Laajenna kaikki - + &Toolbar &Työkalupalkki - + &Language &Kieli - + &Help &Ohje - + Select files to check Valitse tarkistettavat tiedostot - + Select directory to check Valitse tarkistettava hakemisto - + No suitable files found to check! Tarkistettavaksi sopivia tiedostoja ei löytynyt! - + Cannot exit while checking. Stop the checking before exiting. @@ -323,37 +323,37 @@ Stop the checking before exiting. Lopeta tarkistus ennen ohjelman sammuttamista. - + License Lisenssi - + Authors Tekijät - + XML files (*.xml);;Text files (*.txt) XML-tiedostot (*.xml);;Tekstitiedostot (*.txt) - + Save the report file Tallenna raportti - + XML files (*.xml) XML-tiedostot (*xml) - + Cppcheck - %1 Cppcheck - %1 - + Failed to change language: %1 diff --git a/gui/cppcheck_ru.ts b/gui/cppcheck_ru.ts index da08c165a..2b0e02a14 100644 --- a/gui/cppcheck_ru.ts +++ b/gui/cppcheck_ru.ts @@ -118,227 +118,227 @@ kate -l(line) (file) MainWindow - - - - + + + + Cppcheck - + + Standard + + + + Show possible false positives - + &File - + &View - + &Check - + &Edit - - toolBar - - - - + &License... - + A&uthors... - + &About... - + &Files... - + Ctrl+F - + &Directory... - + Ctrl+D - + &Recheck files - + Ctrl+R - + &Stop - + Esc - + &Save results to file... - + Ctrl+S - + &Quit - + &Clear results - + &Preferences - + Show security errors - + Show style errors - + Show common errors - + &Check all - + &Uncheck all - + Collapse &all - + &Expand all - + &Toolbar - + &Language - + &Help - + Select files to check - + Select directory to check - + No suitable files found to check! - + Cannot exit while checking. Stop the checking before exiting. - + License - + Authors - + XML files (*.xml);;Text files (*.txt) - + Save the report file - + XML files (*.xml) - + Cppcheck - %1 - + Failed to change language: %1 diff --git a/gui/cppcheck_se.ts b/gui/cppcheck_se.ts index da08c165a..2b0e02a14 100644 --- a/gui/cppcheck_se.ts +++ b/gui/cppcheck_se.ts @@ -118,227 +118,227 @@ kate -l(line) (file) MainWindow - - - - + + + + Cppcheck - + + Standard + + + + Show possible false positives - + &File - + &View - + &Check - + &Edit - - toolBar - - - - + &License... - + A&uthors... - + &About... - + &Files... - + Ctrl+F - + &Directory... - + Ctrl+D - + &Recheck files - + Ctrl+R - + &Stop - + Esc - + &Save results to file... - + Ctrl+S - + &Quit - + &Clear results - + &Preferences - + Show security errors - + Show style errors - + Show common errors - + &Check all - + &Uncheck all - + Collapse &all - + &Expand all - + &Toolbar - + &Language - + &Help - + Select files to check - + Select directory to check - + No suitable files found to check! - + Cannot exit while checking. Stop the checking before exiting. - + License - + Authors - + XML files (*.xml);;Text files (*.txt) - + Save the report file - + XML files (*.xml) - + Cppcheck - %1 - + Failed to change language: %1 diff --git a/gui/main.ui b/gui/main.ui index 9447fa163..a4ef46453 100644 --- a/gui/main.ui +++ b/gui/main.ui @@ -63,7 +63,7 @@ - + 0 @@ -72,14 +72,14 @@ 24 - + &File - + &View @@ -95,12 +95,12 @@ - + &Language - + &Help @@ -108,7 +108,7 @@ - + &Check @@ -117,23 +117,23 @@ - + &Edit - - - - - - + + + + + + - + - toolBar + Standard TopToolBarArea diff --git a/gui/mainwindow.cpp b/gui/mainwindow.cpp index 30eb9b070..516d728c9 100644 --- a/gui/mainwindow.cpp +++ b/gui/mainwindow.cpp @@ -75,7 +75,7 @@ MainWindow::MainWindow() : connect(mUI.mActionAuthors, SIGNAL(triggered()), this, SLOT(ShowAuthors())); connect(mThread, SIGNAL(Done()), this, SLOT(CheckDone())); connect(mUI.mResults, SIGNAL(GotResults()), this, SLOT(ResultsAdded())); - + connect(mUI.mMenuView, SIGNAL(aboutToShow()), this, SLOT(AboutToShowViewMenu())); CreateLanguageMenuItems(); @@ -101,10 +101,6 @@ MainWindow::~MainWindow() void MainWindow::CreateLanguageMenuItems() { - - - - QStringList languages = mTranslation->GetNames(); for (int i = 0; i < languages.size(); i++) @@ -116,7 +112,7 @@ void MainWindow::CreateLanguageMenuItems() temp->setCheckable(true); //Add the action to menu - mUI.menu_Language->addAction(temp); + mUI.mMenuLanguage->addAction(temp); //Add action to the group mLanguages->addAction(temp); @@ -164,7 +160,7 @@ void MainWindow::LoadSettings() mUI.mResults->ShowResults(SHOW_STYLE, mUI.mActionShowStyle->isChecked()); mUI.mActionToolbar->setChecked(mSettings->value(SETTINGS_TOOLBARS_SHOW, true).toBool()); - mUI.toolBar->setVisible(mSettings->value(SETTINGS_TOOLBARS_SHOW, true).toBool()); + mUI.mToolBar->setVisible(mSettings->value(SETTINGS_TOOLBARS_SHOW, true).toBool()); mApplications->LoadSettings(mSettings); @@ -538,7 +534,7 @@ void MainWindow::ResultsAdded() void MainWindow::ToggleToolbar() { - mUI.toolBar->setVisible(mUI.mActionToolbar->isChecked()); + mUI.mToolBar->setVisible(mUI.mActionToolbar->isChecked()); } void MainWindow::FormatAndSetTitle(const QString &text) @@ -602,3 +598,7 @@ void MainWindow::MapLanguage(QAction *action) } } +void MainWindow::AboutToShowViewMenu() +{ + mUI.mActionToolbar->setChecked(mUI.mToolBar->isVisible()); +} diff --git a/gui/mainwindow.h b/gui/mainwindow.h index f01bad8d8..163bb1611 100644 --- a/gui/mainwindow.h +++ b/gui/mainwindow.h @@ -163,6 +163,10 @@ protected slots: */ void ToggleToolbar(); + /** + * @brief Slot for updating View-menu before it is shown. + */ + void AboutToShowViewMenu(); protected: