GUI: Add View-menu item for showing/hiding Categories-toolbar.
This commit is contained in:
parent
1faf3b0078
commit
3f04aebf7c
|
@ -57,6 +57,7 @@ ShowTypes;
|
|||
#define SETTINGS_RESULT_COLUMN_WIDTH "Result column %1 width"
|
||||
#define SETTINGS_LANGUAGE "Application language"
|
||||
#define SETTINGS_TOOLBARS_SHOW "Toolbars/ShowStandard"
|
||||
#define SETTINGS_TOOLBARS_VIEW_SHOW "Toolbars/ShowView"
|
||||
|
||||
/// @}
|
||||
#endif
|
||||
|
|
16
gui/main.ui
16
gui/main.ui
|
@ -85,6 +85,7 @@
|
|||
<string>&Toolbars</string>
|
||||
</property>
|
||||
<addaction name="mActionToolbar"/>
|
||||
<addaction name="mActionToolBarView"/>
|
||||
</widget>
|
||||
<addaction name="mMenuToolbars"/>
|
||||
<addaction name="separator"/>
|
||||
|
@ -153,9 +154,9 @@
|
|||
<addaction name="mActionSettings"/>
|
||||
<addaction name="mActionAbout"/>
|
||||
</widget>
|
||||
<widget class="QToolBar" name="mToolbarView">
|
||||
<widget class="QToolBar" name="mToolBarView">
|
||||
<property name="windowTitle">
|
||||
<string>toolBar</string>
|
||||
<string>Categories</string>
|
||||
</property>
|
||||
<attribute name="toolBarArea">
|
||||
<enum>TopToolBarArea</enum>
|
||||
|
@ -335,6 +336,17 @@
|
|||
<string>Toolbar</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="mActionToolBarView">
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Categories</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Error categories</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
|
|
|
@ -72,6 +72,7 @@ MainWindow::MainWindow() :
|
|||
connect(mUI.mActionAbout, SIGNAL(triggered()), this, SLOT(About()));
|
||||
connect(mUI.mActionLicense, SIGNAL(triggered()), this, SLOT(ShowLicense()));
|
||||
connect(mUI.mActionToolbar, SIGNAL(toggled(bool)), this, SLOT(ToggleToolbar()));
|
||||
connect(mUI.mActionToolBarView, SIGNAL(toggled(bool)), this, SLOT(ToggleViewToolBar()));
|
||||
|
||||
connect(mUI.mActionAuthors, SIGNAL(triggered()), this, SLOT(ShowAuthors()));
|
||||
connect(mThread, SIGNAL(Done()), this, SLOT(CheckDone()));
|
||||
|
@ -163,6 +164,7 @@ void MainWindow::LoadSettings()
|
|||
|
||||
mUI.mActionToolbar->setChecked(mSettings->value(SETTINGS_TOOLBARS_SHOW, true).toBool());
|
||||
mUI.mToolBarMain->setVisible(mSettings->value(SETTINGS_TOOLBARS_SHOW, true).toBool());
|
||||
mUI.mToolBarView->setVisible(mSettings->value(SETTINGS_TOOLBARS_VIEW_SHOW, true).toBool());
|
||||
|
||||
mApplications->LoadSettings(mSettings);
|
||||
|
||||
|
@ -181,6 +183,7 @@ void MainWindow::SaveSettings()
|
|||
mSettings->setValue(SETTINGS_SHOW_STYLE, mUI.mActionShowStyle->isChecked());
|
||||
mSettings->setValue(SETTINGS_SHOW_ERRORS, mUI.mActionShowErrors->isChecked());
|
||||
mSettings->setValue(SETTINGS_TOOLBARS_SHOW, mUI.mToolBarMain->isVisible());
|
||||
mSettings->setValue(SETTINGS_TOOLBARS_VIEW_SHOW, mUI.mToolBarView->isVisible());
|
||||
|
||||
mApplications->SaveSettings(mSettings);
|
||||
|
||||
|
@ -568,6 +571,11 @@ void MainWindow::ToggleToolbar()
|
|||
mUI.mToolBarMain->setVisible(mUI.mActionToolbar->isChecked());
|
||||
}
|
||||
|
||||
void MainWindow::ToggleViewToolBar()
|
||||
{
|
||||
mUI.mToolBarView->setVisible(mUI.mActionToolBarView->isChecked());
|
||||
}
|
||||
|
||||
void MainWindow::FormatAndSetTitle(const QString &text)
|
||||
{
|
||||
QString title;
|
||||
|
@ -631,6 +639,7 @@ void MainWindow::MapLanguage(QAction *action)
|
|||
void MainWindow::AboutToShowViewMenu()
|
||||
{
|
||||
mUI.mActionToolbar->setChecked(mUI.mToolBarMain->isVisible());
|
||||
mUI.mActionToolBarView->setChecked(mUI.mToolBarView->isVisible());
|
||||
}
|
||||
|
||||
void MainWindow::StopChecking()
|
||||
|
|
|
@ -150,6 +150,11 @@ protected slots:
|
|||
*/
|
||||
void ToggleToolbar();
|
||||
|
||||
/**
|
||||
* @brief Slot for showing/hiding Categories toolbar
|
||||
*/
|
||||
void ToggleViewToolBar();
|
||||
|
||||
/**
|
||||
* @brief Slot for updating View-menu before it is shown.
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue