Fixed #1861 (GUI: Allow hiding error) Disabled menu item when not applicable

This commit is contained in:
Zachary Blair 2010-11-24 00:48:07 -08:00
parent 22a4dd2cc3
commit 6b9d9188c9
6 changed files with 23 additions and 0 deletions

View File

@ -464,6 +464,9 @@
</property>
</action>
<action name="mActionShowHidden">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Show &amp;hidden</string>
</property>

View File

@ -86,6 +86,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.mResults, SIGNAL(ResultsHidden(bool)), mUI.mActionShowHidden, SLOT(setEnabled(bool)));
connect(mUI.mMenuView, SIGNAL(aboutToShow()), this, SLOT(AboutToShowViewMenu()));
connect(mUI.mActionNewProjectFile, SIGNAL(triggered()), this, SLOT(NewProjectFile()));

View File

@ -341,6 +341,7 @@ void ResultsTree::ShowHiddenResults()
}
}
RefreshTree();
emit ResultsHidden(false);
}
@ -670,6 +671,7 @@ void ResultsTree::HideResult()
mContextItem->setData(QVariant(data));
RefreshTree();
emit ResultsHidden(true);
}
}

View File

@ -122,6 +122,15 @@ public:
*
*/
void Translate();
signals:
/**
* @brief Signal that results have been hidden or shown
*
* @param hidden true if there are some hidden results, or false if there are not
*/
void ResultsHidden(bool hidden);
protected slots:
/**
* @brief Slot to quickstart an error with default application

View File

@ -33,6 +33,8 @@ ResultsView::ResultsView(QWidget * parent) :
mShowNoErrorsMessage(true)
{
mUI.setupUi(this);
connect(mUI.mTree, SIGNAL(ResultsHidden(bool)), this, SIGNAL(ResultsHidden(bool)));
}
void ResultsView::Initialize(QSettings *settings, ApplicationList *list)

View File

@ -146,6 +146,12 @@ signals:
*/
void GotResults();
/**
* @brief Signal that results have been hidden or shown
*
* @param hidden true if there are some hidden results, or false if there are not
*/
void ResultsHidden(bool hidden);
public slots: