disable new and open while tasks are running

This commit is contained in:
Miodrag Milanovic 2018-06-27 11:12:05 +02:00
parent 09c0d96105
commit 9bb4899360
3 changed files with 13 additions and 2 deletions

View File

@ -95,7 +95,7 @@ void BaseMainWindow::writeInfo(std::string text) { info->info(text); }
void BaseMainWindow::createMenusAndBars()
{
QAction *actionNew = new QAction("New", this);
actionNew = new QAction("New", this);
QIcon iconNew;
iconNew.addFile(QStringLiteral(":/icons/resources/new.png"));
actionNew->setIcon(iconNew);
@ -103,7 +103,7 @@ void BaseMainWindow::createMenusAndBars()
actionNew->setStatusTip("New project file");
connect(actionNew, SIGNAL(triggered()), this, SLOT(new_proj()));
QAction *actionOpen = new QAction("Open", this);
actionOpen = new QAction("Open", this);
QIcon iconOpen;
iconOpen.addFile(QStringLiteral(":/icons/resources/open.png"));
actionOpen->setIcon(iconOpen);

View File

@ -65,6 +65,8 @@ class BaseMainWindow : public QMainWindow
QMenuBar *menuBar;
QToolBar *mainToolBar;
QStatusBar *statusBar;
QAction *actionNew;
QAction *actionOpen;
};
NEXTPNR_NAMESPACE_END

View File

@ -260,6 +260,9 @@ void MainWindow::disableActions()
actionPlay->setEnabled(false);
actionPause->setEnabled(false);
actionStop->setEnabled(false);
actionNew->setEnabled(true);
actionOpen->setEnabled(true);
}
void MainWindow::loadfile_finished(bool status)
@ -349,6 +352,9 @@ void MainWindow::taskStarted()
disableActions();
actionPause->setEnabled(true);
actionStop->setEnabled(true);
actionNew->setEnabled(false);
actionOpen->setEnabled(false);
}
void MainWindow::taskPaused()
@ -356,6 +362,9 @@ void MainWindow::taskPaused()
disableActions();
actionPlay->setEnabled(true);
actionStop->setEnabled(true);
actionNew->setEnabled(false);
actionOpen->setEnabled(false);
}
void MainWindow::budget()