Improved error handling when installing configuration updates:

In case the configuration snapshot cannot be taken before installing
configuration updates (because the current configuration state
is invalid), ask user whether to continue or abort.
This commit is contained in:
Vojtech Bubnik 2021-07-07 15:17:21 +02:00
parent 5ca4848980
commit 1c078b1f47
7 changed files with 103 additions and 39 deletions

View file

@ -127,6 +127,13 @@ private:
std::vector<Snapshot> m_snapshots;
};
// Take snapshot on SnapshotDB::singleton(). If taking snapshot fails, report an error and return nullptr.
const Snapshot* take_config_snapshot_report_error(const AppConfig &app_config, Snapshot::Reason reason, const std::string &comment);
// Take snapshot on SnapshotDB::singleton(). If taking snapshot fails, report "message", and present a "Continue" or "Abort" buttons to respond.
// Return true on success and on "Continue" to continue with the process (for example installation of presets).
bool take_config_snapshot_cancel_on_error(const AppConfig &app_config, Snapshot::Reason reason, const std::string &comment, const std::string &message);
} // namespace Config
} // namespace GUI
} // namespace Slic3r