GUI: Add support for warning and performance -error types.
This commit is contained in:
parent
e54129fa8d
commit
bee8d15848
|
@ -30,7 +30,9 @@
|
|||
typedef enum
|
||||
{
|
||||
SHOW_STYLE = 0,
|
||||
SHOW_ERRORS,
|
||||
SHOW_WARNINGS,
|
||||
SHOW_PERFORMANCE,
|
||||
SHOW_ERRORS, // Keep this as last real item
|
||||
SHOW_NONE
|
||||
}
|
||||
ShowTypes;
|
||||
|
@ -43,6 +45,8 @@ ShowTypes;
|
|||
#define SETTINGS_WINDOW_HEIGHT "Window height"
|
||||
#define SETTINGS_SHOW_STYLE "Show style"
|
||||
#define SETTINGS_SHOW_ERRORS "Show errors"
|
||||
#define SETTINGS_SHOW_WARNINGS "Show warnings"
|
||||
#define SETTINGS_SHOW_PERFORMANCE "Show performance"
|
||||
#define SETTINGS_CHECK_PATH "Check path"
|
||||
#define SETTINGS_CHECK_FORCE "Check force"
|
||||
#define SETTINGS_CHECK_THREADS "Check threads"
|
||||
|
|
36
gui/main.ui
36
gui/main.ui
|
@ -66,7 +66,7 @@
|
|||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>640</width>
|
||||
<height>25</height>
|
||||
<height>21</height>
|
||||
</rect>
|
||||
</property>
|
||||
<widget class="QMenu" name="mMenuFile">
|
||||
|
@ -96,8 +96,10 @@
|
|||
</widget>
|
||||
<addaction name="mMenuToolbars"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="mActionShowStyle"/>
|
||||
<addaction name="mActionShowErrors"/>
|
||||
<addaction name="mActionShowWarnings"/>
|
||||
<addaction name="mActionShowStyle"/>
|
||||
<addaction name="mActionShowPerformance"/>
|
||||
<addaction name="mActionCheckAll"/>
|
||||
<addaction name="mActionUncheckAll"/>
|
||||
<addaction name="separator"/>
|
||||
|
@ -284,7 +286,7 @@
|
|||
<normaloff>:/images/showstylewarnings.png</normaloff>:/images/showstylewarnings.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Show style errors</string>
|
||||
<string>Show style warnings</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="mActionShowErrors">
|
||||
|
@ -409,6 +411,34 @@
|
|||
<string>&Statistics</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="mActionShowWarnings">
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Warnings</string>
|
||||
</property>
|
||||
<property name="iconText">
|
||||
<string>Show warnings</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Show warnings</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="mActionShowPerformance">
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Performance warnings</string>
|
||||
</property>
|
||||
<property name="iconText">
|
||||
<string>Show performance warnings</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Show performance warnings</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
|
|
|
@ -63,6 +63,8 @@ MainWindow::MainWindow() :
|
|||
|
||||
connect(mUI.mActionShowStyle, SIGNAL(toggled(bool)), this, SLOT(ShowStyle(bool)));
|
||||
connect(mUI.mActionShowErrors, SIGNAL(toggled(bool)), this, SLOT(ShowErrors(bool)));
|
||||
connect(mUI.mActionShowWarnings, SIGNAL(toggled(bool)), this, SLOT(ShowWarnings(bool)));
|
||||
connect(mUI.mActionShowPerformance, SIGNAL(toggled(bool)), this, SLOT(ShowPerformance(bool)));
|
||||
connect(mUI.mActionCheckAll, SIGNAL(triggered()), this, SLOT(CheckAll()));
|
||||
connect(mUI.mActionUncheckAll, SIGNAL(triggered()), this, SLOT(UncheckAll()));
|
||||
connect(mUI.mActionCollapseAll, SIGNAL(triggered()), mUI.mResults, SLOT(CollapseAllResults()));
|
||||
|
@ -169,6 +171,8 @@ void MainWindow::LoadSettings()
|
|||
|
||||
mUI.mActionShowStyle->setChecked(mSettings->value(SETTINGS_SHOW_STYLE, true).toBool());
|
||||
mUI.mActionShowErrors->setChecked(mSettings->value(SETTINGS_SHOW_ERRORS, true).toBool());
|
||||
mUI.mActionShowWarnings->setChecked(mSettings->value(SETTINGS_SHOW_WARNINGS, true).toBool());
|
||||
mUI.mActionShowPerformance->setChecked(mSettings->value(SETTINGS_SHOW_PERFORMANCE, true).toBool());
|
||||
|
||||
mUI.mResults->ShowResults(SHOW_ERRORS, mUI.mActionShowErrors->isChecked());
|
||||
mUI.mResults->ShowResults(SHOW_STYLE, mUI.mActionShowStyle->isChecked());
|
||||
|
@ -193,6 +197,8 @@ void MainWindow::SaveSettings()
|
|||
|
||||
mSettings->setValue(SETTINGS_SHOW_STYLE, mUI.mActionShowStyle->isChecked());
|
||||
mSettings->setValue(SETTINGS_SHOW_ERRORS, mUI.mActionShowErrors->isChecked());
|
||||
mSettings->setValue(SETTINGS_SHOW_WARNINGS, mUI.mActionShowWarnings->isChecked());
|
||||
mSettings->setValue(SETTINGS_SHOW_PERFORMANCE, mUI.mActionShowPerformance->isChecked());
|
||||
mSettings->setValue(SETTINGS_TOOLBARS_MAIN_SHOW, mUI.mToolBarMain->isVisible());
|
||||
mSettings->setValue(SETTINGS_TOOLBARS_VIEW_SHOW, mUI.mToolBarView->isVisible());
|
||||
|
||||
|
@ -473,6 +479,16 @@ void MainWindow::ShowErrors(bool checked)
|
|||
mUI.mResults->ShowResults(SHOW_ERRORS, checked);
|
||||
}
|
||||
|
||||
void MainWindow::ShowWarnings(bool checked)
|
||||
{
|
||||
mUI.mResults->ShowResults(SHOW_WARNINGS, checked);
|
||||
}
|
||||
|
||||
void MainWindow::ShowPerformance(bool checked)
|
||||
{
|
||||
mUI.mResults->ShowResults(SHOW_PERFORMANCE, checked);
|
||||
}
|
||||
|
||||
void MainWindow::CheckAll()
|
||||
{
|
||||
ToggleAllChecked(true);
|
||||
|
@ -523,9 +539,12 @@ void MainWindow::ToggleAllChecked(bool checked)
|
|||
{
|
||||
mUI.mActionShowStyle->setChecked(checked);
|
||||
ShowStyle(checked);
|
||||
|
||||
mUI.mActionShowErrors->setChecked(checked);
|
||||
ShowErrors(checked);
|
||||
mUI.mActionShowWarnings->setChecked(checked);
|
||||
ShowWarnings(checked);
|
||||
mUI.mActionShowPerformance->setChecked(checked);
|
||||
ShowPerformance(checked);
|
||||
}
|
||||
|
||||
void MainWindow::About()
|
||||
|
|
|
@ -91,6 +91,18 @@ public slots:
|
|||
*/
|
||||
void ShowErrors(bool checked);
|
||||
|
||||
/**
|
||||
* @brief Show errors with type "warning"
|
||||
* @param checked Should errors be shown (true) or hidden (false)
|
||||
*/
|
||||
void ShowWarnings(bool checked);
|
||||
|
||||
/**
|
||||
* @brief Show errors with type "performance"
|
||||
* @param checked Should errors be shown (true) or hidden (false)
|
||||
*/
|
||||
void ShowPerformance(bool checked);
|
||||
|
||||
/**
|
||||
* @brief Slot to check all "Show errors" menu items
|
||||
*/
|
||||
|
|
|
@ -226,6 +226,10 @@ ShowTypes ResultsTree::SeverityToShowType(const QString & severity) const
|
|||
return SHOW_ERRORS;
|
||||
if (severity == "style")
|
||||
return SHOW_STYLE;
|
||||
if (severity == "warning")
|
||||
return SHOW_WARNINGS;
|
||||
if (severity == "performance")
|
||||
return SHOW_PERFORMANCE;
|
||||
|
||||
return SHOW_NONE;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue