Disable menu options on json load
This commit is contained in:
parent
7794bbfb3f
commit
9510c444c9
@ -170,6 +170,7 @@ int CommandHandler::executeMain(std::unique_ptr<Context> ctx)
|
|||||||
log_error("Loading design failed.\n");
|
log_error("Loading design failed.\n");
|
||||||
|
|
||||||
customAfterLoad(w.getContext());
|
customAfterLoad(w.getContext());
|
||||||
|
w.updateJsonLoaded();
|
||||||
}
|
}
|
||||||
} catch (log_execution_error_exception) {
|
} catch (log_execution_error_exception) {
|
||||||
// show error is handled by gui itself
|
// show error is handled by gui itself
|
||||||
|
@ -302,8 +302,7 @@ void BaseMainWindow::load_json(std::string filename)
|
|||||||
if (parse_json_file(f, filename, ctx.get())) {
|
if (parse_json_file(f, filename, ctx.get())) {
|
||||||
log("Loading design successful.\n");
|
log("Loading design successful.\n");
|
||||||
Q_EMIT updateTreeView();
|
Q_EMIT updateTreeView();
|
||||||
actionPack->setEnabled(true);
|
updateJsonLoaded();
|
||||||
onJsonLoaded();
|
|
||||||
} else {
|
} else {
|
||||||
actionLoadJSON->setEnabled(true);
|
actionLoadJSON->setEnabled(true);
|
||||||
log("Loading design failed.\n");
|
log("Loading design failed.\n");
|
||||||
@ -425,4 +424,11 @@ void BaseMainWindow::disableActions()
|
|||||||
onDisableActions();
|
onDisableActions();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void BaseMainWindow::updateJsonLoaded()
|
||||||
|
{
|
||||||
|
disableActions();
|
||||||
|
actionPack->setEnabled(true);
|
||||||
|
onJsonLoaded();
|
||||||
|
}
|
||||||
|
|
||||||
NEXTPNR_NAMESPACE_END
|
NEXTPNR_NAMESPACE_END
|
||||||
|
@ -48,12 +48,12 @@ class BaseMainWindow : public QMainWindow
|
|||||||
explicit BaseMainWindow(std::unique_ptr<Context> context, ArchArgs args, QWidget *parent = 0);
|
explicit BaseMainWindow(std::unique_ptr<Context> context, ArchArgs args, QWidget *parent = 0);
|
||||||
virtual ~BaseMainWindow();
|
virtual ~BaseMainWindow();
|
||||||
Context *getContext() { return ctx.get(); }
|
Context *getContext() { return ctx.get(); }
|
||||||
|
void updateJsonLoaded();
|
||||||
void load_json(std::string filename);
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void createMenusAndBars();
|
void createMenusAndBars();
|
||||||
void disableActions();
|
void disableActions();
|
||||||
|
void load_json(std::string filename);
|
||||||
|
|
||||||
virtual void onDisableActions(){};
|
virtual void onDisableActions(){};
|
||||||
virtual void onJsonLoaded(){};
|
virtual void onJsonLoaded(){};
|
||||||
virtual void onPackFinished(){};
|
virtual void onPackFinished(){};
|
||||||
|
@ -34,9 +34,10 @@ class MainWindow : public BaseMainWindow
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
void createMenu();
|
void createMenu();
|
||||||
void load_pcf(std::string filename);
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
void load_pcf(std::string filename);
|
||||||
|
|
||||||
void onDisableActions() override;
|
void onDisableActions() override;
|
||||||
void onJsonLoaded() override;
|
void onJsonLoaded() override;
|
||||||
void onRouteFinished() override;
|
void onRouteFinished() override;
|
||||||
|
Loading…
Reference in New Issue
Block a user