aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiodrag Milanovic <mmicko@gmail.com>2018-06-27 11:12:05 +0200
committerMiodrag Milanovic <mmicko@gmail.com>2018-06-27 11:12:05 +0200
commit9bb489936078980e98fc873845b2ca64ddb490fb (patch)
tree7c34681985ed8fafc3ce7ce0e8a04f6ddb9109a8
parent09c0d96105c82d9a1c6b2dfb93e3da912ec910d5 (diff)
downloadnextpnr-9bb489936078980e98fc873845b2ca64ddb490fb.tar.gz
nextpnr-9bb489936078980e98fc873845b2ca64ddb490fb.tar.bz2
nextpnr-9bb489936078980e98fc873845b2ca64ddb490fb.zip
disable new and open while tasks are running
-rw-r--r--gui/basewindow.cc4
-rw-r--r--gui/basewindow.h2
-rw-r--r--gui/ice40/mainwindow.cc9
3 files changed, 13 insertions, 2 deletions
diff --git a/gui/basewindow.cc b/gui/basewindow.cc
index dd456e07..69f4f622 100644
--- a/gui/basewindow.cc
+++ b/gui/basewindow.cc
@@ -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);
diff --git a/gui/basewindow.h b/gui/basewindow.h
index 601f6acb..6180e795 100644
--- a/gui/basewindow.h
+++ b/gui/basewindow.h
@@ -65,6 +65,8 @@ class BaseMainWindow : public QMainWindow
QMenuBar *menuBar;
QToolBar *mainToolBar;
QStatusBar *statusBar;
+ QAction *actionNew;
+ QAction *actionOpen;
};
NEXTPNR_NAMESPACE_END
diff --git a/gui/ice40/mainwindow.cc b/gui/ice40/mainwindow.cc
index 32074adc..2563a767 100644
--- a/gui/ice40/mainwindow.cc
+++ b/gui/ice40/mainwindow.cc
@@ -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()