diff options
author | Vojtech Bubnik <bubnikv@gmail.com> | 2021-12-15 16:27:25 +0300 |
---|---|---|
committer | Vojtech Bubnik <bubnikv@gmail.com> | 2021-12-15 16:27:25 +0300 |
commit | 5ba9d59307ff590bc71926d3c5e3ebddab9f9835 (patch) | |
tree | b2da226e65a169029d3b6f299af0cc4017f11c11 /src/slic3r/GUI | |
parent | 56d50d7707a0801ee5b193843fc582ef0e6c3033 (diff) |
If taking configuration snapshot before importing newer configuration fails,
offer to stop importing configuration.
Diffstat (limited to 'src/slic3r/GUI')
-rw-r--r-- | src/slic3r/GUI/GUI_App.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/slic3r/GUI/GUI_App.cpp b/src/slic3r/GUI/GUI_App.cpp index 13f76443c..c947cecb9 100644 --- a/src/slic3r/GUI/GUI_App.cpp +++ b/src/slic3r/GUI/GUI_App.cpp @@ -977,17 +977,17 @@ std::string GUI_App::check_older_app_config(Semver current_version, bool backup) if (msg.ShowModal() == wxID_YES) { std::string snapshot_id; if (backup) { - // configuration snapshot - std::string comment; - if (const Config::Snapshot* snapshot = Config::take_config_snapshot_report_error( - *app_config, - Config::Snapshot::SNAPSHOT_USER, - comment); - snapshot != nullptr) - // Is thos correct? Save snapshot id for later, when new app config is loaded. + const Config::Snapshot* snapshot{ nullptr }; + if (! GUI::Config::take_config_snapshot_cancel_on_error(*app_config, Config::Snapshot::SNAPSHOT_USER, "", + _u8L("Continue and import newer configuration?")), &snapshot) + return {}; + if (snapshot) { + // Save snapshot ID before loading the alternate AppConfig, as loading the alternate AppConfig may fail. snapshot_id = snapshot->id; - else - BOOST_LOG_TRIVIAL(error) << "Failed to take congiguration snapshot: "; + assert(! snapshot_id.empty()); + app_config->set("on_snapshot", snapshot_id); + } else + BOOST_LOG_TRIVIAL(error) << "Failed to take congiguration snapshot"; } // load app config from older file |