Fixed a bug with a "gear" button near the filament preset (part of #2440)
This commit is contained in:
parent
3d8bd85187
commit
0ee0b546df
3 changed files with 11 additions and 1 deletions
|
@ -939,6 +939,7 @@ wxNotebook* GUI_App::tab_panel() const
|
|||
return mainframe->m_tabpanel;
|
||||
}
|
||||
|
||||
// extruders count from selected printer preset
|
||||
int GUI_App::extruders_cnt() const
|
||||
{
|
||||
const Preset& preset = preset_bundle->printers.get_selected_preset();
|
||||
|
@ -946,6 +947,14 @@ int GUI_App::extruders_cnt() const
|
|||
preset.config.option<ConfigOptionFloats>("nozzle_diameter")->values.size();
|
||||
}
|
||||
|
||||
// extruders count from edited printer preset
|
||||
int GUI_App::extruders_edited_cnt() const
|
||||
{
|
||||
const Preset& preset = preset_bundle->printers.get_edited_preset();
|
||||
return preset.printer_technology() == ptSLA ? 1 :
|
||||
preset.config.option<ConfigOptionFloats>("nozzle_diameter")->values.size();
|
||||
}
|
||||
|
||||
void GUI_App::open_web_page_localized(const std::string &http_address)
|
||||
{
|
||||
wxLaunchDefaultBrowser(http_address + "&lng=" + this->current_language_code());
|
||||
|
|
|
@ -166,6 +166,7 @@ public:
|
|||
|
||||
wxNotebook* tab_panel() const ;
|
||||
int extruders_cnt() const;
|
||||
int extruders_edited_cnt() const;
|
||||
|
||||
std::vector<Tab *> tabs_list;
|
||||
|
||||
|
|
|
@ -321,7 +321,7 @@ wxBitmapComboBox(parent, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(15 *
|
|||
/* In a case of a multi-material printing, for editing another Filament Preset
|
||||
* it's needed to select this preset for the "Filament settings" Tab
|
||||
*/
|
||||
if (preset_type == Preset::TYPE_FILAMENT && wxGetApp().extruders_cnt() > 1)
|
||||
if (preset_type == Preset::TYPE_FILAMENT && wxGetApp().extruders_edited_cnt() > 1)
|
||||
{
|
||||
const std::string& selected_preset = GetString(GetSelection()).ToUTF8().data();
|
||||
|
||||
|
|
Loading…
Reference in a new issue