diff --git a/src/slic3r/GUI/GUI.cpp b/src/slic3r/GUI/GUI.cpp index 8fe9512926..fb7fa00f1a 100644 --- a/src/slic3r/GUI/GUI.cpp +++ b/src/slic3r/GUI/GUI.cpp @@ -352,7 +352,7 @@ void show_substitutions_info(const PresetsConfigSubstitutions& presets_config_su add_config_substitutions(substitution.substitutions, changes); } - InfoDialog msg(nullptr, _L("Configuration bundle was loaded, however some configuration values were not recognized."), substitution_message(changes)); + InfoDialog msg(nullptr, _L("Configuration bundle was loaded, however some configuration values were not recognized."), substitution_message(changes), true); msg.ShowModal(); } @@ -363,7 +363,7 @@ void show_substitutions_info(const ConfigSubstitutions& config_substitutions, co InfoDialog msg(nullptr, format_wxstr(_L("Configuration file \"%1%\" was loaded, however some configuration values were not recognized."), from_u8(filename)), - substitution_message(changes)); + substitution_message(changes), true); msg.ShowModal(); } diff --git a/src/slic3r/GUI/GUI_App.cpp b/src/slic3r/GUI/GUI_App.cpp index 0c40000e50..2e8231cc57 100644 --- a/src/slic3r/GUI/GUI_App.cpp +++ b/src/slic3r/GUI/GUI_App.cpp @@ -948,24 +948,31 @@ bool GUI_App::check_older_app_config(Semver current_version, bool backup) return false; BOOST_LOG_TRIVIAL(info) << "last app config file used: " << m_older_data_dir_path; // ask about using older data folder - RichMessageDialog msg(nullptr, backup ? - wxString::Format(_L( - "Current configuration folder: %s" - "\n\n%s found another configuration for version %s." - "\nIt is found at %s." - "\n\nDo you wish to copy and use the configuration file for version %s (overwriting any file with the same name)? A backup of your current configuration will be created." - "\nIf you select no, you will continue with the configuration file for version %s (may not be fully compatible).") - , current_version.to_string(), SLIC3R_APP_NAME, last_semver.to_string(), m_older_data_dir_path, last_semver.to_string(), current_version.to_string()) - : wxString::Format(_L( - "%s found another configuration for version %s." - "\nIt is found at %s." - "\nThere is no configuration file in current configuration folder." - "\n\nDo you wish to copy and use the configuration file for version %s?" - "\nIf you select no, you will start with clean installation with configuration wizard.") - , SLIC3R_APP_NAME, last_semver.to_string(), m_older_data_dir_path, last_semver.to_string()) - , _L("PrusaSlicer") - , wxYES_NO - , wxString::Format(_L("Load configuration from version %s?"), last_semver.to_string())); + + InfoDialog msg(nullptr + , format_wxstr(_L("You are opening %1% version %2%."), SLIC3R_APP_NAME, SLIC3R_VERSION) + , backup ? + format_wxstr(_L( + "The active configuration was created by %1% %2%," + "\nwhile a newer configuration was found in %3%" + "\ncreated by %1% %4%." + "\n\nShall the newer configuration be imported?" + "\nIf so, your active configuration will backed up before importing the new configuration." + ) + , SLIC3R_APP_NAME, current_version.to_string(), m_older_data_dir_path, last_semver.to_string()) + : format_wxstr(_L( + "An existing configuration was found in %3%" + "\ncreated by %1% %2%." + "\n\nShall this configuration be imported?" + ) + , SLIC3R_APP_NAME, last_semver.to_string(), m_older_data_dir_path) + , true, wxYES_NO); + + if (backup) { + msg.SetButtonLabel(wxID_YES, _L("Import")); + msg.SetButtonLabel(wxID_NO, _L("Don't import")); + } + if (msg.ShowModal() == wxID_YES) { std::string snapshot_id; if (backup) { diff --git a/src/slic3r/GUI/MsgDialog.cpp b/src/slic3r/GUI/MsgDialog.cpp index 9343bb741b..4e2462d4be 100644 --- a/src/slic3r/GUI/MsgDialog.cpp +++ b/src/slic3r/GUI/MsgDialog.cpp @@ -63,6 +63,15 @@ MsgDialog::MsgDialog(wxWindow *parent, const wxString &title, const wxString &he SetSizerAndFit(main_sizer); } +void MsgDialog::SetButtonLabel(wxWindowID btn_id, const wxString& label, bool set_focus/* = false*/) +{ + if (wxButton* btn = get_button(btn_id)) { + btn->SetLabel(label); + if (set_focus) + btn->SetFocus(); + } +} + wxButton* MsgDialog::add_button(wxWindowID btn_id, bool set_focus /*= false*/, const wxString& label/* = wxString()*/) { wxButton* btn = new wxButton(this, btn_id, label); @@ -98,7 +107,7 @@ void MsgDialog::finalize() // Text shown as HTML, so that mouse selection and Ctrl-V to copy will work. -static void add_msg_content(wxWindow* parent, wxBoxSizer* content_sizer, wxString msg, bool monospaced_font = false) +static void add_msg_content(wxWindow* parent, wxBoxSizer* content_sizer, wxString msg, bool monospaced_font = false, bool is_marked_msg = false) { wxHtmlWindow* html = new wxHtmlWindow(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHW_SCROLLBAR_AUTO); @@ -136,8 +145,7 @@ static void add_msg_content(wxWindow* parent, wxBoxSizer* content_sizer, wxStrin int em = wxGetApp().em_unit(); // if message containes the table - bool is_marked = msg.Contains("