From 592ff8ba3cb836263fb55cfa1c702c2f63b06c7d Mon Sep 17 00:00:00 2001 From: Vesa Pikki Date: Sun, 22 Mar 2009 18:46:51 +0200 Subject: [PATCH] Added view menu and buttons for it. --- gui/mainwindow.cpp | 30 ++++++++++++++++++++++++++++++ gui/mainwindow.h | 7 +++++++ 2 files changed, 37 insertions(+) diff --git a/gui/mainwindow.cpp b/gui/mainwindow.cpp index d1c1e7f66..646c456da 100644 --- a/gui/mainwindow.cpp +++ b/gui/mainwindow.cpp @@ -34,6 +34,11 @@ MainWindow::MainWindow() : mActionReCheck(tr("Recheck files"), this), mActionCheckDirectory(tr("Check &directory"), this), mActionSettings(tr("&Settings"), this), + mActionShowAll(tr("Show &more errors"), this), + mActionShowSecurity(tr("Show &security errors"), this), + mActionShowStyle(tr("Show s&tyle errors"), this), + mActionShowUnused(tr("Show errors on &unused functions"), this), + mActionShowErrors(tr("Show &common errors"), this), mResults(mSettings) { QMenu *menu = menuBar()->addMenu(tr("&File")); @@ -44,6 +49,19 @@ MainWindow::MainWindow() : menu->addSeparator(); menu->addAction(&mActionExit); + QMenu *menuview = menuBar()->addMenu(tr("&View")); + mActionShowAll.setCheckable(true); + mActionShowSecurity.setCheckable(true); + mActionShowStyle.setCheckable(true); + mActionShowUnused.setCheckable(true); + mActionShowErrors.setCheckable(true); + + menuview->addAction(&mActionShowAll); + menuview->addAction(&mActionShowSecurity); + menuview->addAction(&mActionShowStyle); + menuview->addAction(&mActionShowUnused); + menuview->addAction(&mActionShowErrors); + QMenu *menuprogram = menuBar()->addMenu(tr("&Program")); menuprogram->addAction(&mActionSettings); @@ -77,6 +95,12 @@ void MainWindow::LoadSettings() resize(mSettings.value(tr("Window width"), 800).toInt(), mSettings.value(tr("Window height"), 600).toInt()); } + + mActionShowAll.setChecked(mSettings.value(tr("Show all"), true).toBool()); + mActionShowSecurity.setChecked(mSettings.value(tr("Show security"), true).toBool()); + mActionShowStyle.setChecked(mSettings.value(tr("Show style"), true).toBool()); + mActionShowUnused.setChecked(mSettings.value(tr("Show unused"), true).toBool()); + mActionShowErrors.setChecked(mSettings.value(tr("Show errors"), true).toBool()); } void MainWindow::SaveSettings() @@ -84,6 +108,12 @@ void MainWindow::SaveSettings() mSettings.setValue(tr("Window width"), size().width()); mSettings.setValue(tr("Window height"), size().height()); mSettings.setValue(tr("Window maximized"), isMaximized()); + + mSettings.setValue(tr("Show all"), mActionShowAll.isChecked()); + mSettings.setValue(tr("Show security"), mActionShowSecurity.isChecked()); + mSettings.setValue(tr("Show style"), mActionShowStyle.isChecked()); + mSettings.setValue(tr("Show unused"), mActionShowUnused.isChecked()); + mSettings.setValue(tr("Show errors"), mActionShowErrors.isChecked()); } diff --git a/gui/mainwindow.h b/gui/mainwindow.h index c735fd0f5..b4df26580 100644 --- a/gui/mainwindow.h +++ b/gui/mainwindow.h @@ -130,6 +130,13 @@ protected: */ QAction mActionSettings; + QAction mActionShowAll; + QAction mActionShowSecurity; + QAction mActionShowStyle; + QAction mActionShowUnused; + QAction mActionShowErrors; + + /** * @brief Results for checking