diff options
Diffstat (limited to 'gui')
-rw-r--r-- | gui/basewindow.cc | 10 | ||||
-rw-r--r-- | gui/basewindow.h | 6 | ||||
-rw-r--r-- | gui/ice40/mainwindow.h | 3 |
3 files changed, 13 insertions, 6 deletions
diff --git a/gui/basewindow.cc b/gui/basewindow.cc index 53720156..98dc9e20 100644 --- a/gui/basewindow.cc +++ b/gui/basewindow.cc @@ -302,8 +302,7 @@ void BaseMainWindow::load_json(std::string filename) if (parse_json_file(f, filename, ctx.get())) {
log("Loading design successful.\n");
Q_EMIT updateTreeView();
- actionPack->setEnabled(true);
- onJsonLoaded();
+ updateJsonLoaded();
} else {
actionLoadJSON->setEnabled(true);
log("Loading design failed.\n");
@@ -425,4 +424,11 @@ void BaseMainWindow::disableActions() onDisableActions();
}
+void BaseMainWindow::updateJsonLoaded()
+{
+ disableActions();
+ actionPack->setEnabled(true);
+ onJsonLoaded();
+}
+
NEXTPNR_NAMESPACE_END
diff --git a/gui/basewindow.h b/gui/basewindow.h index 341cc8e2..67f39ac2 100644 --- a/gui/basewindow.h +++ b/gui/basewindow.h @@ -48,12 +48,12 @@ class BaseMainWindow : public QMainWindow explicit BaseMainWindow(std::unique_ptr<Context> context, ArchArgs args, QWidget *parent = 0);
virtual ~BaseMainWindow();
Context *getContext() { return ctx.get(); }
-
- void load_json(std::string filename);
-
+ void updateJsonLoaded();
protected:
void createMenusAndBars();
void disableActions();
+ void load_json(std::string filename);
+
virtual void onDisableActions(){};
virtual void onJsonLoaded(){};
virtual void onPackFinished(){};
diff --git a/gui/ice40/mainwindow.h b/gui/ice40/mainwindow.h index 829375e2..c235f0a4 100644 --- a/gui/ice40/mainwindow.h +++ b/gui/ice40/mainwindow.h @@ -34,9 +34,10 @@ class MainWindow : public BaseMainWindow public:
void createMenu();
- void load_pcf(std::string filename);
protected:
+ void load_pcf(std::string filename);
+
void onDisableActions() override;
void onJsonLoaded() override;
void onRouteFinished() override;
|