mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-09 07:56:24 -06:00
ENH:notify the user to save the project before switching languages
Change-Id: Ife8acc0aeaef013d9dbbb753686ad4b4a319bf80
This commit is contained in:
parent
ee187f2f78
commit
a316bdfa22
1 changed files with 11 additions and 0 deletions
|
@ -153,6 +153,17 @@ wxBoxSizer *PreferencesDialog::create_item_language_combobox(
|
|||
|
||||
if (e.GetString().mb_str() != app_config->get(param)) {
|
||||
{
|
||||
//check if the project has changed
|
||||
if (wxGetApp().plater()->is_project_dirty()) {
|
||||
auto result = MessageDialog(static_cast<wxWindow*>(this), _L("The current project has unsaved changes, save it before continue?"),
|
||||
wxString(SLIC3R_APP_FULL_NAME) + " - " + _L("Save"), wxYES_NO | wxCANCEL | wxYES_DEFAULT | wxCENTRE).ShowModal();
|
||||
|
||||
if (result == wxID_YES) {
|
||||
wxGetApp().plater()->save_project();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// the dialog needs to be destroyed before the call to switch_language()
|
||||
// or sometimes the application crashes into wxDialogBase() destructor
|
||||
// so we put it into an inner scope
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue