aboutsummaryrefslogtreecommitdiffstats
path: root/gui/ice40/mainwindow.cc
diff options
context:
space:
mode:
authorMiodrag Milanovic <mmicko@gmail.com>2018-08-08 21:15:54 +0200
committerMiodrag Milanovic <mmicko@gmail.com>2018-08-08 21:15:54 +0200
commit5dd7a74b874cae0bb8b22ef8a385e2546d3bd531 (patch)
tree3c9425eccdf9696f94ed8b0690cfb0110978103a /gui/ice40/mainwindow.cc
parentbc378fc3e4bbb16251f4076384eb6aaf25ef79e3 (diff)
downloadnextpnr-5dd7a74b874cae0bb8b22ef8a385e2546d3bd531.tar.gz
nextpnr-5dd7a74b874cae0bb8b22ef8a385e2546d3bd531.tar.bz2
nextpnr-5dd7a74b874cae0bb8b22ef8a385e2546d3bd531.zip
Make loading works nice and use settings
Diffstat (limited to 'gui/ice40/mainwindow.cc')
-rw-r--r--gui/ice40/mainwindow.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/gui/ice40/mainwindow.cc b/gui/ice40/mainwindow.cc
index bf6e4b4c..9fe80717 100644
--- a/gui/ice40/mainwindow.cc
+++ b/gui/ice40/mainwindow.cc
@@ -46,8 +46,6 @@ MainWindow::MainWindow(std::unique_ptr<Context> context, ArchArgs args, QWidget
connect(this, &BaseMainWindow::contextChanged, this, &MainWindow::newContext);
createMenu();
-
- Q_EMIT contextChanged(ctx.get());
}
MainWindow::~MainWindow() {}
@@ -133,8 +131,6 @@ void MainWindow::new_proj()
if (ok && !item.isEmpty()) {
currentProj = "";
- currentJson = "";
- currentPCF = "";
disableActions();
chipArgs.package = package.toStdString().c_str();
ctx = std::unique_ptr<Context>(new Context(chipArgs));
@@ -148,7 +144,6 @@ void MainWindow::new_proj()
void MainWindow::load_pcf(std::string filename)
{
disableActions();
- currentPCF = filename;
std::ifstream f(filename);
if (apply_pcf(ctx.get(), filename, f)) {
log("Loading PCF successful.\n");
@@ -193,6 +188,11 @@ void MainWindow::onDisableActions()
void MainWindow::onJsonLoaded() { actionLoadPCF->setEnabled(true); }
void MainWindow::onRouteFinished() { actionSaveAsc->setEnabled(true); }
-void MainWindow::onProjectLoaded() { actionLoadPCF->setEnabled(false); }
+
+void MainWindow::onProjectLoaded()
+{
+ if (ctx->settings.find(ctx->id("project/input/pcf")) != ctx->settings.end())
+ actionLoadPCF->setEnabled(false);
+}
NEXTPNR_NAMESPACE_END