aboutsummaryrefslogtreecommitdiffstats
path: root/common/command.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 /common/command.cc
parentbc378fc3e4bbb16251f4076384eb6aaf25ef79e3 (diff)
downloadnextpnr-5dd7a74b874cae0bb8b22ef8a385e2546d3bd531.tar.gz
nextpnr-5dd7a74b874cae0bb8b22ef8a385e2546d3bd531.tar.bz2
nextpnr-5dd7a74b874cae0bb8b22ef8a385e2546d3bd531.zip
Make loading works nice and use settings
Diffstat (limited to 'common/command.cc')
-rw-r--r--common/command.cc10
1 files changed, 7 insertions, 3 deletions
diff --git a/common/command.cc b/common/command.cc
index 736f6201..54111130 100644
--- a/common/command.cc
+++ b/common/command.cc
@@ -168,12 +168,16 @@ int CommandHandler::executeMain(std::unique_ptr<Context> ctx)
if (vm.count("json")) {
std::string filename = vm["json"].as<std::string>();
std::ifstream f(filename);
+ w.notifyChangeContext();
if (!parse_json_file(f, filename, w.getContext()))
log_error("Loading design failed.\n");
customAfterLoad(w.getContext());
- w.updateJsonLoaded();
- }
+ w.updateLoaded();
+ } else if (vm.count("load")) {
+ w.projectLoad(vm["load"].as<std::string>());
+ } else
+ w.notifyChangeContext();
} catch (log_execution_error_exception) {
// show error is handled by gui itself
}
@@ -247,7 +251,7 @@ int CommandHandler::exec()
return 0;
std::unique_ptr<Context> ctx;
- if (vm.count("load")) {
+ if (vm.count("load") && vm.count("gui") == 0) {
ctx = project.load(vm["load"].as<std::string>());
} else {
ctx = createContext();