mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-10-26 18:21:18 -06:00
If taking configuration snapshot before importing newer configuration fails,
offer to stop importing configuration.
This commit is contained in:
parent
56d50d7707
commit
5ba9d59307
3 changed files with 15 additions and 13 deletions
|
|
@ -586,10 +586,12 @@ const Snapshot* take_config_snapshot_report_error(const AppConfig &app_config, S
|
|||
}
|
||||
}
|
||||
|
||||
bool take_config_snapshot_cancel_on_error(const AppConfig &app_config, Snapshot::Reason reason, const std::string &comment, const std::string &message)
|
||||
bool take_config_snapshot_cancel_on_error(const AppConfig &app_config, Snapshot::Reason reason, const std::string &comment, const std::string &message, Snapshot const **psnapshot)
|
||||
{
|
||||
try {
|
||||
SnapshotDB::singleton().take_snapshot(app_config, reason, comment);
|
||||
const Snapshot *snapshot = &SnapshotDB::singleton().take_snapshot(app_config, reason, comment);
|
||||
if (*psnapshot)
|
||||
*psnapshot = snapshot;
|
||||
return true;
|
||||
} catch (std::exception &err) {
|
||||
RichMessageDialog dlg(static_cast<wxWindow*>(wxGetApp().mainframe),
|
||||
|
|
|
|||
|
|
@ -132,7 +132,7 @@ const Snapshot* take_config_snapshot_report_error(const AppConfig &app_config, S
|
|||
|
||||
// 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);
|
||||
bool take_config_snapshot_cancel_on_error(const AppConfig &app_config, Snapshot::Reason reason, const std::string &comment, const std::string &message, Snapshot const **psnapshot = nullptr);
|
||||
|
||||
} // namespace Config
|
||||
} // namespace GUI
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue