Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Nov 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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