diff --git a/gui/mainwindow.cpp b/gui/mainwindow.cpp index 112b10262..ef27c0fcc 100644 --- a/gui/mainwindow.cpp +++ b/gui/mainwindow.cpp @@ -89,6 +89,7 @@ MainWindow::MainWindow() : mUI.mActionClearResults->setEnabled(false); mUI.mActionSave->setEnabled(false); + mUI.mActionRecheck->setEnabled(false); @@ -419,7 +420,10 @@ void MainWindow::EnableCheckButtons(bool enable) { mUI.mActionStop->setEnabled(!enable); mUI.mActionCheckFiles->setEnabled(enable); - mUI.mActionRecheck->setEnabled(enable); + + if (!enable || mThread->HasPreviousFiles()) + mUI.mActionRecheck->setEnabled(enable); + mUI.mActionCheckDirectory->setEnabled(enable); } diff --git a/gui/threadhandler.cpp b/gui/threadhandler.cpp index 0c18f0b62..8f6ea916c 100644 --- a/gui/threadhandler.cpp +++ b/gui/threadhandler.cpp @@ -166,3 +166,10 @@ void ThreadHandler::SaveSettings(QSettings &settings) settings.setValue(SETTINGS_CHECK_THREADS, mThreads.size()); } +bool ThreadHandler::HasPreviousFiles() const +{ + if (mLastFiles.size() > 0) + return true; + + return false; +} diff --git a/gui/threadhandler.h b/gui/threadhandler.h index d90dace28..b8ce9c6bf 100644 --- a/gui/threadhandler.h +++ b/gui/threadhandler.h @@ -96,6 +96,13 @@ public: */ bool IsChecking() const; + /** + * @brief Have we checked files already? + * + * @return true check has been previously run and recheck can be done + */ + bool HasPreviousFiles() const; + signals: /** * @brief Signal that all threads are done