From 5dd7a74b874cae0bb8b22ef8a385e2546d3bd531 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Wed, 8 Aug 2018 21:15:54 +0200 Subject: Make loading works nice and use settings --- common/command.cc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'common/command.cc') 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 ctx) if (vm.count("json")) { std::string filename = vm["json"].as(); 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()); + } 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 ctx; - if (vm.count("load")) { + if (vm.count("load") && vm.count("gui") == 0) { ctx = project.load(vm["load"].as()); } else { ctx = createContext(); -- cgit v1.2.3