Skip to content

Commit

Permalink
Fix: The "Unsaved Changes Dialog" pops up, but the content display se…
Browse files Browse the repository at this point in the history
…ction is empty. (#7482)

fix:The Unsaved Changes Dialog pops up, but the content display section is empty.
  • Loading branch information
womendoushihaoyin authored Nov 30, 2024
1 parent 449785e commit 2a61cea
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/slic3r/GUI/GUI_App.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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]() {
Expand All @@ -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
{
Expand Down
2 changes: 2 additions & 0 deletions src/slic3r/GUI/UnsavedChangesDialog.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,8 @@ class UnsavedChangesDialog : public DPIDialog
{
}
};
public:
int getUpdateItemCount() { return m_presetitems.size(); }

private:
std::vector<PresetItem> m_presetitems;
Expand Down

0 comments on commit 2a61cea

Please sign in to comment.