Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/prusa3d/PrusaSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/slic3r/GUI/Plater.cpp')
-rw-r--r--src/slic3r/GUI/Plater.cpp29
1 files changed, 27 insertions, 2 deletions
diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp
index 60efb3fae..734cb7f0c 100644
--- a/src/slic3r/GUI/Plater.cpp
+++ b/src/slic3r/GUI/Plater.cpp
@@ -1720,8 +1720,33 @@ struct Plater::priv
fs::path output_file = get_export_file_path(FT_3MF);
suggested_project_name = output_file.empty() ? _L("Untitled") : from_u8(output_file.stem().string());
}
- res = MessageDialog(mainframe, reason + "\n" + format_wxstr(_L("Do you want to save the changes to \"%1%\"?"), suggested_project_name),
- wxString(SLIC3R_APP_NAME), wxYES_NO | wxCANCEL).ShowModal();
+
+ std::string act_key = "default_action_on_dirty_project";
+ std::string act = wxGetApp().app_config->get(act_key);
+ if (act.empty()) {
+ RichMessageDialog dialog(mainframe, reason + "\n" + format_wxstr(_L("Do you want to save the changes to \"%1%\"?"), suggested_project_name), wxString(SLIC3R_APP_NAME), wxYES_NO | wxCANCEL);
+ dialog.ShowCheckBox(_L("Remember my choice"));
+ res = dialog.ShowModal();
+ if (res != wxID_CANCEL)
+ if (dialog.IsCheckBoxChecked()) {
+ wxString preferences_item = _L("Ask for unsaved changes in project");
+ wxString msg =
+ _L("PrusaSlicer will remember your choice.") + "\n\n" +
+ _L("You will not be asked about it again, when: \n"
+ "- Closing PrusaSlicer,\n"
+ "- Loading or creating a new project") + "\n\n" +
+ format_wxstr(_L("Visit \"Preferences\" and check \"%1%\"\nto changes your choice."), preferences_item);
+
+ MessageDialog msg_dlg(mainframe, msg, _L("PrusaSlicer: Don't ask me again"), wxOK | wxCANCEL | wxICON_INFORMATION);
+ if (msg_dlg.ShowModal() == wxID_CANCEL)
+ return wxID_CANCEL;
+
+ get_app_config()->set(act_key, res == wxID_YES ? "1" : "0");
+ }
+ }
+ else
+ res = (act == "1") ? wxID_YES : wxID_NO;
+
if (res == wxID_YES)
if (!mainframe->save_project_as(project_name))
res = wxID_CANCEL;