Some code refactoring

This commit is contained in:
YuSanka 2019-03-20 10:14:49 +01:00
parent b7a1bd927a
commit 438010f0f8
2 changed files with 3 additions and 3 deletions

View File

@ -281,7 +281,7 @@ wxBitmapComboBox(parent, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(15 *
edit_btn->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW));
#endif
edit_btn->SetBitmap(create_scaled_bitmap("cog.png"));
edit_btn->SetToolTip(_(L("Click to Edit a selected Filament Preset")));
edit_btn->SetToolTip(_(L("Click to edit preset")));
edit_btn->Bind(wxEVT_BUTTON, ([preset_type, this](wxCommandEvent)
{
@ -303,7 +303,7 @@ wxBitmapComboBox(parent, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(15 *
const std::string& selected_preset = GetString(GetSelection()).ToUTF8().data();
// Call select_preset() only if there is new preset and not just modified
if ( !boost::algorithm::ends_with(selected_preset, "(modified)") )
if ( !boost::algorithm::ends_with(selected_preset, Preset::suffix_modified()) )
tab->select_preset(selected_preset);
}
}));

View File

@ -201,6 +201,7 @@ public:
static const std::vector<std::string>& sla_print_options();
static void update_suffix_modified();
static const std::string& suffix_modified();
static void normalize(DynamicPrintConfig &config);
// Report configuration fields, which are misplaced into a wrong group, remove them from the config.
static std::string remove_invalid_keys(DynamicPrintConfig &config, const DynamicPrintConfig &default_config);
@ -210,7 +211,6 @@ protected:
friend class PresetBundle;
// Resize the extruder specific vectors ()
static void set_num_extruders(DynamicPrintConfig &config, unsigned int n);
static const std::string& suffix_modified();
static std::string remove_suffix_modified(const std::string &name);
};