Fix: The "Unsaved Changes Dialog" pops up, but the content display section is empty. (#7482)

fix:The Unsaved Changes Dialog pops up, but the content display section is empty.
This commit is contained in:
xiaoyeliu 2024-11-30 22:23:07 +08:00 committed by GitHub
parent 449785e138
commit 2a61ceae5b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 2 deletions

View file

@ -5647,7 +5647,8 @@ bool GUI_App::check_and_keep_current_preset_changes(const wxString& caption, con
bool is_called_from_configwizard = postponed_apply_of_keeped_changes != nullptr;
UnsavedChangesDialog dlg(caption, header, "", action_buttons);
if (dlg.ShowModal() == wxID_CANCEL)
bool no_need_change = dlg.getUpdateItemCount() == 0 ? true : false;
if (!no_need_change && dlg.ShowModal() == wxID_CANCEL)
return false;
auto reset_modifications = [this, is_called_from_configwizard]() {
@ -5662,7 +5663,7 @@ bool GUI_App::check_and_keep_current_preset_changes(const wxString& caption, con
load_current_presets(false);
};
if (dlg.discard())
if (dlg.discard() || no_need_change)
reset_modifications();
else // save selected changes
{