Storing the active printer technology onto the Undo / Redo stack,

remembering the last selected Printer profile for the SLA and FDM
technologies separately, and activating them on Undo / Redo.

When switching the technologies, user is asked whether to discard
the modified profiles or not.
This commit is contained in:
bubnikv 2019-07-18 17:41:47 +02:00
parent 631a952f94
commit a0ea96968d
14 changed files with 141 additions and 119 deletions

View file

@ -854,7 +854,7 @@ void GUI_App::add_config_menu(wxMenuBar *menu)
// This is called when closing the application, when loading a config file or when starting the config wizard
// to notify the user whether he is aware that some preset changes will be lost.
bool GUI_App::check_unsaved_changes()
bool GUI_App::check_unsaved_changes(const wxString &header)
{
wxString dirty;
PrinterTechnology printer_technology = preset_bundle->printers.get_edited_preset().printer_technology();
@ -868,8 +868,12 @@ bool GUI_App::check_unsaved_changes()
// No changes, the application may close or reload presets.
return true;
// Ask the user.
wxString message;
if (! header.empty())
message = header + "\n\n";
message += _(L("The presets on the following tabs were modified")) + ": " + dirty + "\n\n" + _(L("Discard changes and continue anyway?"));
wxMessageDialog dialog(mainframe,
_(L("The presets on the following tabs were modified")) + ": " + dirty + "\n\n" + _(L("Discard changes and continue anyway?")),
message,
wxString(SLIC3R_APP_NAME) + " - " + _(L("Unsaved Presets")),
wxICON_QUESTION | wxYES_NO | wxNO_DEFAULT);
return dialog.ShowModal() == wxID_YES;
@ -944,9 +948,9 @@ Plater* GUI_App::plater()
return plater_;
}
ModelObjectPtrs* GUI_App::model_objects()
Model& GUI_App::model()
{
return &plater_->model().objects;
return plater_->model();
}
wxNotebook* GUI_App::tab_panel() const