diff options
Diffstat (limited to 'src/slic3r/GUI')
-rw-r--r-- | src/slic3r/GUI/GUI_ObjectList.cpp | 144 | ||||
-rw-r--r-- | src/slic3r/GUI/GUI_ObjectList.hpp | 6 | ||||
-rw-r--r-- | src/slic3r/GUI/GUI_ObjectSettings.cpp | 6 | ||||
-rw-r--r-- | src/slic3r/GUI/MsgDialog.cpp | 2 | ||||
-rw-r--r-- | src/slic3r/GUI/Tab.cpp | 26 | ||||
-rw-r--r-- | src/slic3r/GUI/UpdateDialogs.cpp | 2 | ||||
-rw-r--r-- | src/slic3r/GUI/wxExtensions.cpp | 15 | ||||
-rw-r--r-- | src/slic3r/GUI/wxExtensions.hpp | 7 |
8 files changed, 102 insertions, 106 deletions
diff --git a/src/slic3r/GUI/GUI_ObjectList.cpp b/src/slic3r/GUI/GUI_ObjectList.cpp index f9f04ba43..80ca63fff 100644 --- a/src/slic3r/GUI/GUI_ObjectList.cpp +++ b/src/slic3r/GUI/GUI_ObjectList.cpp @@ -31,18 +31,18 @@ wxDEFINE_EVENT(EVT_OBJ_LIST_OBJECT_SELECT, SimpleEvent); // pt_FFF static SettingsBundle FREQ_SETTINGS_BUNDLE_FFF = { - { L("Layers and Perimeters"), { "layer_height" , "perimeters", "top_solid_layers", "bottom_solid_layers" } }, - { L("Infill") , { "fill_density", "fill_pattern" } }, - { L("Support material") , { "support_material", "support_material_auto", "support_material_threshold", + { OptionCategory::perimeter , { "layer_height" , "perimeters", "top_solid_layers", "bottom_solid_layers" } }, + { OptionCategory::infill , { "fill_density", "fill_pattern" } }, + { OptionCategory::support , { "support_material", "support_material_auto", "support_material_threshold", "support_material_pattern", "support_material_interface_pattern", "support_material_buildplate_only", "support_material_spacing" } }, - { L("Wipe options") , { "wipe_into_infill", "wipe_into_objects" } } + { OptionCategory::wipe , { "wipe_into_infill", "wipe_into_objects" } } }; // pt_SLA static SettingsBundle FREQ_SETTINGS_BUNDLE_SLA = { - { L("Pad and Support") , { "supports_enable", "pad_enable" } } + { OptionCategory::padSupp , { "supports_enable", "pad_enable" } } }; // Note: id accords to type of the sub-object (adding volume), so sequence of the menu items is important @@ -75,30 +75,36 @@ static void take_snapshot(const wxString& snapshot_name) wxGetApp().plater()->take_snapshot(snapshot_name); } +void fill_CATEGORY_ICON(std::map<OptionCategory, wxBitmap> &CATEGORY_ICON) +{ + // Note: `this` isn't passed to create_scaled_bitmap() here because of bugs in the widget, + // see note in PresetBundle::load_compatible_bitmaps() + + // ptFFF + CATEGORY_ICON[OptionCategory::perimeter] = create_scaled_bitmap(nullptr, "shell"); + CATEGORY_ICON[OptionCategory::slicing] = create_scaled_bitmap(nullptr, "layers"); + CATEGORY_ICON[OptionCategory::infill] = create_scaled_bitmap(nullptr, "infill"); + CATEGORY_ICON[OptionCategory::support] = create_scaled_bitmap(nullptr, "support"); + CATEGORY_ICON[OptionCategory::speed] = create_scaled_bitmap(nullptr, "time"); + CATEGORY_ICON[OptionCategory::extruders] = create_scaled_bitmap(nullptr, "funnel"); + CATEGORY_ICON[OptionCategory::width] = create_scaled_bitmap(nullptr, "funnel"); + CATEGORY_ICON[OptionCategory::wipe] = create_scaled_bitmap(nullptr, "funnel"); + CATEGORY_ICON[OptionCategory::skirtBrim] = create_scaled_bitmap(nullptr, "skirt+brim"); + CATEGORY_ICON[OptionCategory::width] = create_scaled_bitmap(nullptr, "width"); + CATEGORY_ICON[OptionCategory::advanced] = create_scaled_bitmap(nullptr, "wrench"); + CATEGORY_ICON[OptionCategory::output] = create_scaled_bitmap(nullptr, "output+page_white"); + CATEGORY_ICON[OptionCategory::notes] = create_scaled_bitmap(nullptr, "note"); + CATEGORY_ICON[OptionCategory::dependencies] = create_scaled_bitmap(nullptr, "wrench"); + // ptSLA + CATEGORY_ICON[OptionCategory::support] = create_scaled_bitmap(nullptr, "support"/*"sla_supports"*/); + CATEGORY_ICON[OptionCategory::pad] = create_scaled_bitmap(nullptr, "pad"); +} + ObjectList::ObjectList(wxWindow* parent) : wxDataViewCtrl(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxDV_MULTIPLE), m_parent(parent) { - // Fill CATEGORY_ICON - { - // Note: `this` isn't passed to create_scaled_bitmap() here because of bugs in the widget, - // see note in PresetBundle::load_compatible_bitmaps() - - // ptFFF - CATEGORY_ICON[L("Layers and Perimeters")] = create_scaled_bitmap(nullptr, "layers"); - CATEGORY_ICON[L("Infill")] = create_scaled_bitmap(nullptr, "infill"); - CATEGORY_ICON[L("Support material")] = create_scaled_bitmap(nullptr, "support"); - CATEGORY_ICON[L("Speed")] = create_scaled_bitmap(nullptr, "time"); - CATEGORY_ICON[L("Extruders")] = create_scaled_bitmap(nullptr, "funnel"); - CATEGORY_ICON[L("Extrusion Width")] = create_scaled_bitmap(nullptr, "funnel"); - CATEGORY_ICON[L("Wipe options")] = create_scaled_bitmap(nullptr, "funnel"); -// CATEGORY_ICON[L("Skirt and brim")] = create_scaled_bitmap(nullptr, "skirt+brim"); -// CATEGORY_ICON[L("Speed > Acceleration")] = create_scaled_bitmap(nullptr, "time"); - CATEGORY_ICON[L("Advanced")] = create_scaled_bitmap(nullptr, "wrench"); - // ptSLA - CATEGORY_ICON[L("Supports")] = create_scaled_bitmap(nullptr, "support"/*"sla_supports"*/); - CATEGORY_ICON[L("Pad")] = create_scaled_bitmap(nullptr, "pad"); - } + fill_CATEGORY_ICON(CATEGORY_ICON); // create control create_objects_ctrl(); @@ -613,25 +619,7 @@ void ObjectList::msw_rescale_icons() // Update CATEGORY_ICON according to new scale - { - // Note: `this` isn't passed to create_scaled_bitmap() here because of bugs in the widget, - // see note in PresetBundle::load_compatible_bitmaps() - - // ptFFF - CATEGORY_ICON[L("Layers and Perimeters")] = create_scaled_bitmap(nullptr, "layers"); - CATEGORY_ICON[L("Infill")] = create_scaled_bitmap(nullptr, "infill"); - CATEGORY_ICON[L("Support material")] = create_scaled_bitmap(nullptr, "support"); - CATEGORY_ICON[L("Speed")] = create_scaled_bitmap(nullptr, "time"); - CATEGORY_ICON[L("Extruders")] = create_scaled_bitmap(nullptr, "funnel"); - CATEGORY_ICON[L("Extrusion Width")] = create_scaled_bitmap(nullptr, "funnel"); - CATEGORY_ICON[L("Wipe options")] = create_scaled_bitmap(nullptr, "funnel"); -// CATEGORY_ICON[L("Skirt and brim")] = create_scaled_bitmap(nullptr, "skirt+brim"); -// CATEGORY_ICON[L("Speed > Acceleration")] = create_scaled_bitmap(nullptr, "time"); - CATEGORY_ICON[L("Advanced")] = create_scaled_bitmap(nullptr, "wrench"); - // ptSLA - CATEGORY_ICON[L("Supports")] = create_scaled_bitmap(nullptr, "support"/*"sla_supports"*/); - CATEGORY_ICON[L("Pad")] = create_scaled_bitmap(nullptr, "pad"); - } + fill_CATEGORY_ICON(CATEGORY_ICON); } @@ -1064,19 +1052,20 @@ void ObjectList::OnDrop(wxDataViewEvent &event) std::vector<std::string> ObjectList::get_options(const bool is_part) { + std::vector<std::string> options; if (printer_technology() == ptSLA) { SLAPrintObjectConfig full_sla_config; - auto options = full_sla_config.keys(); + options = full_sla_config.keys(); options.erase(find(options.begin(), options.end(), "layer_height")); - return options; - } - - PrintRegionConfig reg_config; - auto options = reg_config.keys(); - if (!is_part) { - PrintObjectConfig obj_config; - std::vector<std::string> obj_options = obj_config.keys(); - options.insert(options.end(), obj_options.begin(), obj_options.end()); + std::sort(options.begin(), options.end()); + } else { + PrintRegionConfig reg_config; + options = reg_config.keys(); + if (!is_part) { + PrintObjectConfig obj_config; + std::vector<std::string> obj_options = obj_config.keys(); + options.insert(options.end(), obj_options.begin(), obj_options.end()); + } } return options; } @@ -1088,7 +1077,7 @@ const std::vector<std::string>& ObjectList::get_options_for_bundle(const wxStrin for (auto& it : bundle) { - if (bundle_name == _(it.first)) + if (bundle_name == _(toString(it.first))) return it.second; } #if 0 @@ -1107,31 +1096,32 @@ const std::vector<std::string>& ObjectList::get_options_for_bundle(const wxStrin return empty; } -static bool improper_category(const std::string& category, const int extruders_cnt, const bool is_object_settings = true) +static bool improper_category(const OptionCategory& category, const int extruders_cnt, const bool is_object_settings = true) { - return category.empty() || - (extruders_cnt == 1 && (category == "Extruders" || category == "Wipe options" )) || - (!is_object_settings && category == "Support material"); + return category == OptionCategory::none || + (extruders_cnt == 1 && (category == OptionCategory::extruders || category == OptionCategory::wipe )) || + (!is_object_settings && category == OptionCategory::support); } void ObjectList::get_options_menu(settings_menu_hierarchy& settings_menu, const bool is_part) { - auto options = get_options(is_part); + std::vector<std::string> options = get_options(is_part); const int extruders_cnt = extruders_count(); DynamicPrintConfig config; - for (auto& option : options) + for (std::string& option : options) { - auto const opt = config.def()->get(option); - auto category = opt->category; + const ConfigOptionDef* opt = config.def()->get(option); + OptionCategory category = opt->category; if (improper_category(category, extruders_cnt, !is_part)) continue; const std::string& label = !opt->full_label.empty() ? opt->full_label : opt->label; std::pair<std::string, std::string> option_label(option, label); std::vector< std::pair<std::string, std::string> > new_category; - auto& cat_opt_label = settings_menu.find(category) == settings_menu.end() ? new_category : settings_menu.at(category); + std::vector< std::pair<std::string, std::string> >& cat_opt_label = + settings_menu.find(category) == settings_menu.end() ? new_category : settings_menu.at(category); cat_opt_label.push_back(option_label); if (cat_opt_label.size() == 1) settings_menu[category] = cat_opt_label; @@ -1157,17 +1147,20 @@ void ObjectList::get_settings_choice(const wxString& category_name) assert(m_config); auto opt_keys = m_config->keys(); - for (auto& cat : settings_menu) + for (auto& cat2idname : settings_menu) { - if (_(cat.first) == category_name) { + if (_(toString(cat2idname.first)) == category_name) { int sel = 0; - for (auto& pair : cat.second) { - names.Add(_(pair.second)); - if (find(opt_keys.begin(), opt_keys.end(), pair.first) != opt_keys.end()) + //sort per label, because there isn't a better one. + std::sort(cat2idname.second.begin(), cat2idname.second.end(), + [](const std::pair< std::string, std::string> &e1, const std::pair< std::string, std::string> &e2)->bool {return e1.second<e2.second; }); + for (auto& pair_strid_strname : cat2idname.second) { + names.Add(_(pair_strid_strname.second)); + if (find(opt_keys.begin(), opt_keys.end(), pair_strid_strname.first) != opt_keys.end()) selections.Add(sel); sel++; } - settings_list = &cat.second; + settings_list = &cat2idname.second; break; } } @@ -1404,13 +1397,13 @@ wxMenuItem* ObjectList::append_menu_item_settings(wxMenu* menu_) for (auto& it : FREQ_SETTINGS_BUNDLE_FFF) { - settings_id = menu->FindItem(_(it.first)); + settings_id = menu->FindItem(_(toString(it.first))); if (settings_id != wxNOT_FOUND) menu->Destroy(settings_id); } for (auto& it : FREQ_SETTINGS_BUNDLE_SLA) { - settings_id = menu->FindItem(_(it.first)); + settings_id = menu->FindItem(_(toString(it.first))); if (settings_id != wxNOT_FOUND) menu->Destroy(settings_id); } @@ -1637,8 +1630,9 @@ wxMenu* ObjectList::create_settings_popupmenu(wxMenu *parent_menu) const bool is_part = m_objects_model->GetParent(GetSelection()) != wxDataViewItem(nullptr); get_options_menu(settings_menu, is_part); + //note: as settings_menu_hierarchy is a map<OptionCategory,...>, it's automatically sorted by enum order for (auto cat : settings_menu) { - append_menu_item(menu, wxID_ANY, _(cat.first), "", + append_menu_item(menu, wxID_ANY, _(toString(cat.first)), "", [menu, this](wxCommandEvent& event) { get_settings_choice(menu->GetLabel(event.GetId())); }, CATEGORY_ICON.find(cat.first) == CATEGORY_ICON.end() ? wxNullBitmap : CATEGORY_ICON.at(cat.first), parent_menu); } @@ -1658,7 +1652,7 @@ void ObjectList::create_freq_settings_popupmenu(wxMenu *menu, const bool is_obje if (improper_category(it.first, extruders_cnt, is_object_settings)) continue; - append_menu_item(menu, wxID_ANY, _(it.first), "", + append_menu_item(menu, wxID_ANY, _(toString(it.first)), "", [menu, this](wxCommandEvent& event) { get_freq_settings_choice(menu->GetLabel(event.GetId())); }, CATEGORY_ICON.find(it.first) == CATEGORY_ICON.end() ? wxNullBitmap : CATEGORY_ICON.at(it.first), menu); } @@ -2404,7 +2398,7 @@ wxDataViewItem ObjectList::add_settings_item(wxDataViewItem parent_item, const D if (cat_options.empty()) return ret; - std::vector<std::string> categories; + std::vector<Slic3r::OptionCategory> categories; categories.reserve(cat_options.size()); for (auto& cat : cat_options) categories.push_back(cat.first); diff --git a/src/slic3r/GUI/GUI_ObjectList.hpp b/src/slic3r/GUI/GUI_ObjectList.hpp index 4dd618a90..a894d32e5 100644 --- a/src/slic3r/GUI/GUI_ObjectList.hpp +++ b/src/slic3r/GUI/GUI_ObjectList.hpp @@ -26,10 +26,10 @@ enum class ModelVolumeType : int; // FIXME: broken build on mac os because of this is missing: typedef std::vector<std::string> t_config_option_keys; -typedef std::map<std::string, std::vector<std::string>> SettingsBundle; +typedef std::map<OptionCategory, std::vector<std::string>> SettingsBundle; // category -> vector ( option ; label ) -typedef std::map< std::string, std::vector< std::pair<std::string, std::string> > > settings_menu_hierarchy; +typedef std::map< OptionCategory, std::vector< std::pair<std::string, std::string> > > settings_menu_hierarchy; typedef std::vector<ModelVolume*> ModelVolumePtrs; @@ -173,7 +173,7 @@ public: ~ObjectList(); - std::map<std::string, wxBitmap> CATEGORY_ICON; + std::map<OptionCategory, wxBitmap> CATEGORY_ICON; ObjectDataViewModel* GetModel() const { return m_objects_model; } DynamicPrintConfig* config() const { return m_config; } diff --git a/src/slic3r/GUI/GUI_ObjectSettings.cpp b/src/slic3r/GUI/GUI_ObjectSettings.cpp index 58daec8b7..a537ab994 100644 --- a/src/slic3r/GUI/GUI_ObjectSettings.cpp +++ b/src/slic3r/GUI/GUI_ObjectSettings.cpp @@ -84,7 +84,7 @@ bool ObjectSettings::update_settings_list() if (!cat_options.empty()) { - std::vector<std::string> categories; + std::vector<Slic3r::OptionCategory> categories; categories.reserve(cat_options.size()); auto extra_column = [config, this](wxWindow* parent, const Line& line) @@ -120,7 +120,7 @@ bool ObjectSettings::update_settings_list() { categories.push_back(cat.first); - auto optgroup = std::make_shared<ConfigOptionsGroup>(m_og->ctrl_parent(), _(cat.first), config, false, extra_column); + auto optgroup = std::make_shared<ConfigOptionsGroup>(m_og->ctrl_parent(), _(toString(cat.first)), config, false, extra_column); optgroup->label_width = 15; optgroup->sidetext_width = 5; @@ -138,7 +138,7 @@ bool ObjectSettings::update_settings_list() ctrl->SetBitmapHover(m_bmp_delete_focus.bmp()); }; - const bool is_extruders_cat = cat.first == "Extruders"; + const bool is_extruders_cat = cat.first == OptionCategory::extruders; for (auto& opt : cat.second) { Option option = optgroup->get_option(opt); diff --git a/src/slic3r/GUI/MsgDialog.cpp b/src/slic3r/GUI/MsgDialog.cpp index ba2c5ed0c..b7ce4df86 100644 --- a/src/slic3r/GUI/MsgDialog.cpp +++ b/src/slic3r/GUI/MsgDialog.cpp @@ -99,7 +99,7 @@ ErrorDialog::ErrorDialog(wxWindow *parent, const wxString &msg) btn_ok->SetFocus(); btn_sizer->Add(btn_ok, 0, wxRIGHT, HORIZ_SPACING); - logo->SetBitmap(create_scaled_bitmap(this, "Slic3r_192px_grayscale.png", 192)); + logo->SetBitmap(create_scaled_bitmap(this, "Slic3r_192px.png", 192)); SetMaxSize(wxSize(-1, CONTENT_MAX_HEIGHT*wxGetApp().em_unit())); Fit(); diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index 78c7808bb..ab81044ef 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -1030,7 +1030,7 @@ void TabPrint::build() m_presets = &m_preset_bundle->prints; Line line{ "", "" }; load_initial_data(); - auto page = add_options_page(_(L("Perimeters & shell")), "shell"); + auto page = add_options_page(_(L(toString(OptionCategory::perimeter))), "shell"); auto optgroup = page->new_optgroup(_(L("Vertical shells"))); optgroup->append_single_option_line("perimeters"); @@ -1084,7 +1084,7 @@ void TabPrint::build() line.append_option(optgroup->get_option("perimeter_loop_seam")); optgroup->append_line(line); - page = add_options_page(_(L("Slicing")), "layers"); + page = add_options_page(_(L(toString(OptionCategory::slicing))), "layers"); optgroup = page->new_optgroup(_(L("Layer height"))); optgroup->append_single_option_line("layer_height"); @@ -1114,7 +1114,7 @@ void TabPrint::build() optgroup = page->new_optgroup(_(L("Other"))); optgroup->append_single_option_line("clip_multipart_objects"); - page = add_options_page(_(L("Infill")), "infill"); + page = add_options_page(_(L(toString(OptionCategory::infill))), "infill"); optgroup = page->new_optgroup(_(L("Infill"))); optgroup->append_single_option_line("fill_density"); optgroup->append_single_option_line("fill_pattern"); @@ -1153,7 +1153,7 @@ void TabPrint::build() line.append_option(optgroup->get_option("fill_smooth_distribution")); optgroup->append_line(line); - page = add_options_page(_(L("Skirt and brim")), "skirt+brim"); + page = add_options_page(_(L(toString(OptionCategory::skirtBrim))), "skirt+brim"); optgroup = page->new_optgroup(_(L("Skirt"))); optgroup->append_single_option_line("skirts"); optgroup->append_single_option_line("skirt_distance"); @@ -1169,7 +1169,7 @@ void TabPrint::build() line.append_option(optgroup->get_option("brim_ears_max_angle")); optgroup->append_line(line); - page = add_options_page(_(L("Support material")), "support"); + page = add_options_page(_(L(toString(OptionCategory::support))), "support"); optgroup = page->new_optgroup(_(L("Support material"))); optgroup->append_single_option_line("support_material"); optgroup->append_single_option_line("support_material_auto"); @@ -1202,7 +1202,7 @@ void TabPrint::build() optgroup->append_single_option_line("support_material_interface_spacing"); optgroup->append_single_option_line("support_material_interface_contact_loops"); - page = add_options_page(_(L("Speed")), "time"); + page = add_options_page(_(L(toString(OptionCategory::speed))), "time"); optgroup = page->new_optgroup(_(L("Speed for print moves"))); line = { _(L("Perimeter speed")), "" }; line.append_option(optgroup->get_option("perimeter_speed")); @@ -1245,7 +1245,7 @@ void TabPrint::build() optgroup->append_single_option_line("max_volumetric_extrusion_rate_slope_negative"); #endif /* HAS_PRESSURE_EQUALIZER */ - page = add_options_page(_(L("Width & flow")), "width"); + page = add_options_page(_(L(toString(OptionCategory::width))), "width"); optgroup = page->new_optgroup(_(L("Extrusion width"))); optgroup->append_single_option_line("extrusion_width"); optgroup->append_single_option_line("first_layer_extrusion_width"); @@ -1266,7 +1266,7 @@ void TabPrint::build() line.append_option(optgroup->get_option("fill_top_flow_ratio")); optgroup->append_line(line); - page = add_options_page(_(L("Multiple extruders")), "funnel"); + page = add_options_page(_(L(toString(OptionCategory::extruders))), "funnel"); optgroup = page->new_optgroup(_(L("Extruders"))); optgroup->append_single_option_line("perimeter_extruder"); optgroup->append_single_option_line("infill_extruder"); @@ -1292,7 +1292,7 @@ void TabPrint::build() optgroup = page->new_optgroup(_(L("Advanced"))); optgroup->append_single_option_line("interface_shells"); - page = add_options_page(_(L("Output options")), "output+page_white"); + page = add_options_page(_(L(toString(OptionCategory::output))), "output+page_white"); optgroup = page->new_optgroup(_(L("Sequential printing"))); optgroup->append_single_option_line("complete_objects"); line = { _(L("Extruder clearance (mm)")), "" }; @@ -1317,14 +1317,14 @@ void TabPrint::build() option.opt.height = 5;//50; optgroup->append_single_option_line(option); - page = add_options_page(_(L("Notes")), "note"); + page = add_options_page(_(L(toString(OptionCategory::notes))), "note"); optgroup = page->new_optgroup(_(L("Notes")), 0); option = optgroup->get_option("notes"); option.opt.full_width = true; option.opt.height = 25;//250; optgroup->append_single_option_line(option); - page = add_options_page(_(L("Dependencies")), "wrench"); + page = add_options_page(_(L(toString(OptionCategory::dependencies))), "wrench"); optgroup = page->new_optgroup(_(L("Profile dependencies"))); line = optgroup->create_single_option_line("compatible_printers"); line.widget = [this](wxWindow* parent) { @@ -2997,8 +2997,8 @@ bool Tab::may_discard_current_dirty_preset(PresetCollection* presets /*= nullptr for (const std::string &opt_key : presets->current_dirty_options()) { const ConfigOptionDef &opt = m_config->def()->options.at(opt_key); /*std::string*/wxString name = ""; - if (! opt.category.empty()) - name += _(opt.category) + " > "; + if (opt.category != OptionCategory::none) + name += _(toString(opt.category)) + " > "; name += !opt.full_label.empty() ? _(opt.full_label) : _(opt.label); diff --git a/src/slic3r/GUI/UpdateDialogs.cpp b/src/slic3r/GUI/UpdateDialogs.cpp index db33226b1..4ab6edf48 100644 --- a/src/slic3r/GUI/UpdateDialogs.cpp +++ b/src/slic3r/GUI/UpdateDialogs.cpp @@ -149,7 +149,7 @@ MsgDataIncompatible::MsgDataIncompatible(const std::unordered_map<std::string, w MsgDialog(nullptr, wxString::Format(_(L("%s incompatibility")), SLIC3R_APP_NAME), wxString::Format(_(L("%s configuration is incompatible")), SLIC3R_APP_NAME), wxID_NONE) { - logo->SetBitmap(create_scaled_bitmap(this, "Slic3r_192px_grayscale.png", 192)); + logo->SetBitmap(create_scaled_bitmap(this, "Slic3r_192px.png", 192)); auto *text = new wxStaticText(this, wxID_ANY, wxString::Format(_(L( "This version of %s is not compatible with currently installed configuration bundles.\n" diff --git a/src/slic3r/GUI/wxExtensions.cpp b/src/slic3r/GUI/wxExtensions.cpp index bf5500cf4..04cdcae8c 100644 --- a/src/slic3r/GUI/wxExtensions.cpp +++ b/src/slic3r/GUI/wxExtensions.cpp @@ -18,6 +18,7 @@ #include "GUI_App.hpp" #include "GUI_ObjectList.hpp" #include "libslic3r/GCode/PreviewData.hpp" +#include "libslic3r/Config.hpp" #include "I18N.hpp" #include "GUI_Utils.hpp" #include "../Utils/MacDarkMode.hpp" @@ -544,7 +545,7 @@ void ObjectDataViewModelNode::update_settings_digest_bitmaps() { m_bmp = m_empty_bmp; - std::map<std::string, wxBitmap>& categories_icon = Slic3r::GUI::wxGetApp().obj_list()->CATEGORY_ICON; + std::map<Slic3r::OptionCategory, wxBitmap>& categories_icon = Slic3r::GUI::wxGetApp().obj_list()->CATEGORY_ICON; std::string scaled_bitmap_name = m_name.ToUTF8().data(); scaled_bitmap_name += "-em" + std::to_string(Slic3r::GUI::wxGetApp().em_unit()); @@ -552,7 +553,7 @@ void ObjectDataViewModelNode::update_settings_digest_bitmaps() wxBitmap *bmp = m_bitmap_cache->find(scaled_bitmap_name); if (bmp == nullptr) { std::vector<wxBitmap> bmps; - for (auto& cat : m_opt_categories) + for (Slic3r::OptionCategory& cat : m_opt_categories) bmps.emplace_back( categories_icon.find(cat) == categories_icon.end() ? wxNullBitmap : categories_icon.at(cat)); bmp = m_bitmap_cache->insert(scaled_bitmap_name, bmps); @@ -561,7 +562,7 @@ void ObjectDataViewModelNode::update_settings_digest_bitmaps() m_bmp = *bmp; } -bool ObjectDataViewModelNode::update_settings_digest(const std::vector<std::string>& categories) +bool ObjectDataViewModelNode::update_settings_digest(const std::vector<Slic3r::OptionCategory>& categories) { if (m_type != itSettings || m_opt_categories == categories) return false; @@ -569,10 +570,10 @@ bool ObjectDataViewModelNode::update_settings_digest(const std::vector<std::stri m_opt_categories = categories; m_name = wxEmptyString; - for (auto& cat : m_opt_categories) - m_name += _(cat) + "; "; + for (Slic3r::OptionCategory& cat : m_opt_categories) + m_name += _(toString(cat)) + "; "; if (!m_name.IsEmpty()) - m_name.erase(m_name.Length()-2, 2); // Delete last "; " + m_name.erase(m_name.Length()-2, 2); // Delete last "; " <- ??? you just added it!! update_settings_digest_bitmaps(); @@ -1700,7 +1701,7 @@ bool ObjectDataViewModel::IsSettingsItem(const wxDataViewItem &item) const } void ObjectDataViewModel::UpdateSettingsDigest(const wxDataViewItem &item, - const std::vector<std::string>& categories) + const std::vector<Slic3r::OptionCategory>& categories) { if (!item.IsOk()) return; ObjectDataViewModelNode *node = (ObjectDataViewModelNode*)item.GetID(); diff --git a/src/slic3r/GUI/wxExtensions.hpp b/src/slic3r/GUI/wxExtensions.hpp index 54d1bf7cb..f4468f4bb 100644 --- a/src/slic3r/GUI/wxExtensions.hpp +++ b/src/slic3r/GUI/wxExtensions.hpp @@ -19,6 +19,7 @@ namespace Slic3r { enum class ModelVolumeType : int; + //enum class OptionCategory : int; }; typedef double coordf_t; @@ -200,7 +201,7 @@ class ObjectDataViewModelNode MyObjectTreeModelNodePtrArray m_children; wxBitmap m_empty_bmp; size_t m_volumes_cnt = 0; - std::vector< std::string > m_opt_categories; + std::vector< Slic3r::OptionCategory > m_opt_categories; t_layer_height_range m_layer_range = { 0.0f, 0.0f }; wxString m_name; @@ -361,7 +362,7 @@ public: void set_printable_icon(PrintIndicator printable); void update_settings_digest_bitmaps(); - bool update_settings_digest(const std::vector<std::string>& categories); + bool update_settings_digest(const std::vector<Slic3r::OptionCategory>& categories); int volume_type() const { return int(m_volume_type); } void msw_rescale(); @@ -481,7 +482,7 @@ public: wxDataViewItem GetLayerRootItem(const wxDataViewItem &item) const; bool IsSettingsItem(const wxDataViewItem &item) const; void UpdateSettingsDigest( const wxDataViewItem &item, - const std::vector<std::string>& categories); + const std::vector<Slic3r::OptionCategory>& categories); bool IsPrintable(const wxDataViewItem &item) const; void UpdateObjectPrintable(wxDataViewItem parent_item); |