From cd159ef298ea06e3e0df49d2df79a6a74d61ea4e Mon Sep 17 00:00:00 2001 From: YuSanka Date: Wed, 12 Jan 2022 12:54:54 +0100 Subject: [PATCH] Fix for #7734 - Saving Dialog: Values are truncated Info line was "lost" after big code refactoring 4cdcfe60 + MsgDialog: Added missed include --- src/slic3r/GUI/MsgDialog.cpp | 1 + src/slic3r/GUI/UnsavedChangesDialog.cpp | 2 +- src/slic3r/GUI/UnsavedChangesDialog.hpp | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/slic3r/GUI/MsgDialog.cpp b/src/slic3r/GUI/MsgDialog.cpp index f64923c9b..4b0a9d863 100644 --- a/src/slic3r/GUI/MsgDialog.cpp +++ b/src/slic3r/GUI/MsgDialog.cpp @@ -15,6 +15,7 @@ #include "libslic3r/libslic3r.h" #include "libslic3r/Utils.hpp" #include "GUI.hpp" +#include "format.hpp" #include "I18N.hpp" #include "ConfigWizard.hpp" #include "wxExtensions.hpp" diff --git a/src/slic3r/GUI/UnsavedChangesDialog.cpp b/src/slic3r/GUI/UnsavedChangesDialog.cpp index 3afedbd68..f9fb2c468 100644 --- a/src/slic3r/GUI/UnsavedChangesDialog.cpp +++ b/src/slic3r/GUI/UnsavedChangesDialog.cpp @@ -927,7 +927,7 @@ void UnsavedChangesDialog::build(Preset::Type type, PresetCollection* dependent_ void UnsavedChangesDialog::show_info_line(Action action, std::string preset_name) { - if (action == Action::Undef && !m_has_long_strings) + if (action == Action::Undef && !m_tree->has_long_strings()) m_info_line->Hide(); else { wxString text; diff --git a/src/slic3r/GUI/UnsavedChangesDialog.hpp b/src/slic3r/GUI/UnsavedChangesDialog.hpp index 42f93f660..d9154850e 100644 --- a/src/slic3r/GUI/UnsavedChangesDialog.hpp +++ b/src/slic3r/GUI/UnsavedChangesDialog.hpp @@ -221,6 +221,7 @@ public: void item_value_changed(wxDataViewEvent& event); void set_em_unit(int em) { m_em_unit = em; } bool has_unselected_options(); + bool has_long_strings() { return m_has_long_strings; } std::vector options(Preset::Type type, bool selected); std::vector selected_options(); @@ -240,7 +241,6 @@ class UnsavedChangesDialog : public DPIDialog wxStaticText* m_info_line { nullptr }; wxCheckBox* m_remember_choice { nullptr }; - bool m_has_long_strings { false }; int m_save_btn_id { wxID_ANY }; int m_move_btn_id { wxID_ANY }; int m_continue_btn_id { wxID_ANY };