Skip to content

Commit 7f6ef52

Browse files
Phase 3: Add Compare button to Batch Preset Management
- Compare button in bottom bar opens the existing DiffPresetDialog - Auto-selects the correct preset type tab (Printer/Filament/Process) - Reuses the built-in diff tree view with left/right preset selection
1 parent 6ca9ab1 commit 7f6ef52

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

src/slic3r/GUI/UserPresetsDialog.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#include "UserPresetsDialog.hpp"
33
#include "I18N.hpp"
44
#include "GUI_App.hpp"
5+
#include "MainFrame.hpp"
56
#include "libslic3r/Preset.hpp"
67

78
#include <slic3r/GUI/Widgets/CheckBox.hpp>
@@ -90,10 +91,20 @@ UserPresetsDialog::UserPresetsDialog(wxWindow *parent)
9091
on_all_checked(checked, true);
9192
});
9293
m_button_delete->Bind(wxEVT_COMMAND_BUTTON_CLICKED, [this](auto &evt) { delete_checked(); });
94+
95+
m_button_compare = new Button(this, _L("Compare"));
96+
m_button_compare->SetBorderColorNormal(wxColor("#00AE42"));
97+
m_button_compare->SetTextColorNormal(wxColor("#00AE42"));
98+
m_button_compare->Bind(wxEVT_COMMAND_BUTTON_CLICKED, [this](auto &) {
99+
Preset::Type types[] = {Preset::TYPE_PRINTER, Preset::TYPE_FILAMENT, Preset::TYPE_PRINT};
100+
wxGetApp().mainframe->diff_dialog.show(types[m_collection]);
101+
});
102+
93103
wxSizer *sizer_bottom = new wxBoxSizer(wxHORIZONTAL);
94104
sizer_bottom->Add(m_check_all, 0, wxALIGN_CENTER | wxLEFT, FromDIP(20));
95105
sizer_bottom->Add(label, 0, wxALIGN_CENTER | wxLEFT, FromDIP(8));
96106
sizer_bottom->Add(m_label_check_count, 1, wxALIGN_CENTER | wxLEFT, FromDIP(8));
107+
sizer_bottom->Add(m_button_compare, 0, wxALIGN_CENTER | wxRIGHT, FromDIP(8));
97108
sizer_bottom->Add(m_button_delete, 0, wxALIGN_CENTER | wxLEFT | wxRIGHT, FromDIP(20));
98109

99110
wxSizer *sizer = new wxBoxSizer(wxVERTICAL);

src/slic3r/GUI/UserPresetsDialog.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ class UserPresetsDialog : public DPIDialog
8282
CheckBox * m_check_all;
8383
Label * m_label_check_count;
8484
Button * m_button_delete;
85+
Button * m_button_compare;
8586

8687
// Phase 1: nozzle filter
8788
wxBoxSizer * m_nozzle_filter_sizer = nullptr;

0 commit comments

Comments
 (0)