From 9ec2fe3c451674cfd9e50b34262f502f84001e41 Mon Sep 17 00:00:00 2001 From: Ian Bassi Date: Sat, 16 May 2026 10:28:15 -0300 Subject: [PATCH] Add tooltips to Transfer buttons (#13535) * Add tooltips to Transfer buttons Set contextual tooltips for the Discard, Transfer and Save buttons when a dependent preset is present. The code computes the previous and new profile names and provides localized explanatory tooltips that clarify that switching will discard changes, transfer "New Value" settings, or save changes into the current profile. This improves UX by making the consequences of each action explicit. * added some endlines Co-Authored-By: yw4z --------- Co-authored-by: yw4z --- src/slic3r/GUI/UnsavedChangesDialog.cpp | 26 +++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/slic3r/GUI/UnsavedChangesDialog.cpp b/src/slic3r/GUI/UnsavedChangesDialog.cpp index 85e3261afa..78c1f16b6c 100644 --- a/src/slic3r/GUI/UnsavedChangesDialog.cpp +++ b/src/slic3r/GUI/UnsavedChangesDialog.cpp @@ -1009,6 +1009,32 @@ void UnsavedChangesDialog::build(Preset::Type type, PresetCollection *dependent_ // "Save" button if (ActionButtons::SAVE & m_buttons) add_btn(&m_save_btn, m_save_btn_id, "save", Action::Save, _L("Save"), false); + if (dependent_presets != nullptr) { + const wxString previous_profile = from_u8(dependent_presets->get_edited_preset().name); + const wxString new_profile = new_selected_preset.empty() ? _L("the new profile") : from_u8(new_selected_preset); + + if (m_discard_btn) { + m_discard_btn->SetToolTip(format_wxstr( + _L("Switch to\n\"%1%\"\ndiscarding any changes made in\n\"%2%\"."), + new_profile, + previous_profile)); + } + + if (m_transfer_btn) { + m_transfer_btn->SetToolTip(format_wxstr( + _L("All \"New Value\" settings modified in\n\"%1%\"\nwill be transferred to\n\"%2%\"."), + previous_profile, + new_profile)); + } + + if (m_save_btn) { + m_save_btn->SetToolTip(format_wxstr( + _L("All \"New Value\" settings are saved in\n\"%1%\"\nand \"%2%\" will open without any changes."), + previous_profile, + new_profile)); + } + } + /* ScalableButton *cancel_btn = new ScalableButton(this, wxID_CANCEL, "cross", _L("Cancel"), wxDefaultSize, wxDefaultPosition, wxBORDER_DEFAULT, true, 24); buttons->Add(cancel_btn, 1, wxLEFT | wxRIGHT, 5); cancel_btn->SetFont(btn_font);*/