GUI: Reanalyze all for projects

This commit is contained in:
Daniel Marjamäki 2017-07-30 23:02:30 +02:00
parent fec0c46af0
commit 5ef3de7c88
1 changed files with 11 additions and 6 deletions

View File

@ -121,7 +121,7 @@ MainWindow::MainWindow(TranslationHandler* th, QSettings* settings) :
connect(mUI.mActionToolBarFilter, SIGNAL(toggled(bool)), this, SLOT(toggleFilterToolBar())); connect(mUI.mActionToolBarFilter, SIGNAL(toggled(bool)), this, SLOT(toggleFilterToolBar()));
connect(mUI.mActionAuthors, SIGNAL(triggered()), this, SLOT(showAuthors())); connect(mUI.mActionAuthors, SIGNAL(triggered()), this, SLOT(showAuthors()));
connect(mThread, SIGNAL(done()), this, SLOT(checkDone())); connect(mThread, SIGNAL(done()), this, SLOT(analysisDone()));
connect(mUI.mResults, SIGNAL(gotResults()), this, SLOT(resultsAdded())); connect(mUI.mResults, SIGNAL(gotResults()), this, SLOT(resultsAdded()));
connect(mUI.mResults, SIGNAL(resultsHidden(bool)), mUI.mActionShowHidden, SLOT(setEnabled(bool))); connect(mUI.mResults, SIGNAL(resultsHidden(bool)), mUI.mActionShowHidden, SLOT(setEnabled(bool)));
connect(mUI.mResults, SIGNAL(checkSelected(QStringList)), this, SLOT(performSelectedFilesCheck(QStringList))); connect(mUI.mResults, SIGNAL(checkSelected(QStringList)), this, SLOT(performSelectedFilesCheck(QStringList)));
@ -151,8 +151,6 @@ MainWindow::MainWindow(TranslationHandler* th, QSettings* settings) :
mUI.mActionPrintPreview->setEnabled(false); mUI.mActionPrintPreview->setEnabled(false);
mUI.mActionClearResults->setEnabled(false); mUI.mActionClearResults->setEnabled(false);
mUI.mActionSave->setEnabled(false); mUI.mActionSave->setEnabled(false);
mUI.mActionReanalyzeModified->setEnabled(false);
mUI.mActionReanalyzeAll->setEnabled(false);
enableProjectOpenActions(true); enableProjectOpenActions(true);
enableProjectActions(false); enableProjectActions(false);
@ -322,6 +320,7 @@ void MainWindow::loadSettings()
if (!projectFile.isEmpty() && QCoreApplication::arguments().size()==1) { if (!projectFile.isEmpty() && QCoreApplication::arguments().size()==1) {
QFileInfo inf(projectFile); QFileInfo inf(projectFile);
if (inf.exists() && inf.isReadable()) { if (inf.exists() && inf.isReadable()) {
setPath(SETTINGS_LAST_PROJECT_PATH, projectFile);
mProject = new Project(projectFile, this); mProject = new Project(projectFile, this);
loadLastResults(); loadLastResults();
} }
@ -939,7 +938,10 @@ void MainWindow::reAnalyzeModified()
void MainWindow::reAnalyzeAll() void MainWindow::reAnalyzeAll()
{ {
reAnalyze(true); if (mProject)
analyzeProject(mProject);
else
reAnalyze(true);
} }
void MainWindow::reAnalyzeSelected(QStringList files, bool all) void MainWindow::reAnalyzeSelected(QStringList files, bool all)
@ -1061,8 +1063,11 @@ void MainWindow::enableCheckButtons(bool enable)
mUI.mActionStop->setEnabled(!enable); mUI.mActionStop->setEnabled(!enable);
mUI.mActionAnalyzeFiles->setEnabled(enable); mUI.mActionAnalyzeFiles->setEnabled(enable);
if (!enable || mProject || mThread->hasPreviousFiles()) { if (mProject) {
mUI.mActionReanalyzeModified->setEnabled(!mProject && enable); mUI.mActionReanalyzeModified->setEnabled(false);
mUI.mActionReanalyzeAll->setEnabled(enable);
} else if (!enable || mThread->hasPreviousFiles()) {
mUI.mActionReanalyzeModified->setEnabled(enable);
mUI.mActionReanalyzeAll->setEnabled(enable); mUI.mActionReanalyzeAll->setEnabled(enable);
} }