ENH: add connected to printer preset list

and add group name
jira:none

Change-Id: Iecc4ec38ff071105f856c2034ceac0d5bde3b7b0
(cherry picked from commit c44cc2db1a4b27955e0099b06f2508faf824b538)
This commit is contained in:
zhimin.zeng
2024-11-29 14:39:10 +08:00
committed by Noisyfox
parent 7b81f21093
commit 6afd3a961b
4 changed files with 155 additions and 48 deletions

View File

@@ -58,7 +58,7 @@ public:
bool is_selected_physical_printer();
// Return true, if physical printer was selected
// Return true, if physical printer was selected
// and next internal selection was accomplished
bool selection_is_changed_according_to_physical_printers();
@@ -66,19 +66,25 @@ public:
// select preset which is selected in PreseBundle
void update_from_bundle();
// BBS: printer
void add_connected_printers(std::string selected, bool alias_name = false);
int selected_connected_printer() const;
// BBS: ams
void add_ams_filaments(std::string selected, bool alias_name = false);
int selected_ams_filament() const;
void set_filament_idx(const int extr_idx) { m_filament_idx = extr_idx; }
int get_filament_idx() const { return m_filament_idx; }
// BBS
wxString get_tooltip(const Preset& preset);
wxString get_preset_item_name(unsigned int index);
static wxColor different_color(wxColor const & color);
virtual wxString get_preset_name(const Preset& preset);
virtual wxString get_preset_name(const Preset& preset);
Preset::Type get_type() { return m_type; }
void show_all(bool show_all);
virtual void update();
@@ -122,6 +128,10 @@ protected:
int thin_space_icon_width;
int wide_space_icon_width;
// BBS: printer
int m_first_printer_idx = 0;
int m_last_printer_idx = 0;
PrinterTechnology printer_technology {ptAny};
void invalidate_selection();
@@ -134,13 +144,13 @@ protected:
#ifdef __linux__
static const char* separator_head() { return "------- "; }
static const char* separator_tail() { return " -------"; }
#else // __linux__
#else // __linux__
static const char* separator_head() { return "------ "; }
static const char* separator_tail() { return " ------"; }
#endif // __linux__
static wxString separator(const std::string& label);
wxBitmap* get_bmp( std::string bitmap_key, bool wide_icons, const std::string& main_icon_name,
wxBitmap* get_bmp( std::string bitmap_key, bool wide_icons, const std::string& main_icon_name,
bool is_compatible = true, bool is_system = false, bool is_single_bar = false,
const std::string& filament_rgb = "", const std::string& extruder_rgb = "", const std::string& material_rgb = "");
@@ -177,6 +187,7 @@ public:
void show_add_menu();
void show_edit_menu();
wxString get_preset_group_name(const Preset &preset);
wxString get_preset_name(const Preset& preset) override;
void update() override;
void msw_rescale() override;