Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/prusa3d/PrusaSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorYuSanka <yusanka@gmail.com>2019-06-03 15:52:15 +0300
committerYuSanka <yusanka@gmail.com>2019-06-03 15:59:16 +0300
commit0ee0b546df7f2f002543d580c9860b14611f1af4 (patch)
tree6b39bb83776c4d18b8c635ff4ea2a2ea388f3dd3 /src
parent3d8bd85187674f18f2fd2fde4479eee707f33bd3 (diff)
Fixed a bug with a "gear" button near the filament preset (part of #2440)
Diffstat (limited to 'src')
-rw-r--r--src/slic3r/GUI/GUI_App.cpp9
-rw-r--r--src/slic3r/GUI/GUI_App.hpp1
-rw-r--r--src/slic3r/GUI/Plater.cpp2
3 files changed, 11 insertions, 1 deletions
diff --git a/src/slic3r/GUI/GUI_App.cpp b/src/slic3r/GUI/GUI_App.cpp
index b75b946e6..3aada45f3 100644
--- a/src/slic3r/GUI/GUI_App.cpp
+++ b/src/slic3r/GUI/GUI_App.cpp
@@ -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());
diff --git a/src/slic3r/GUI/GUI_App.hpp b/src/slic3r/GUI/GUI_App.hpp
index b70f0dc16..3f8b23e2d 100644
--- a/src/slic3r/GUI/GUI_App.hpp
+++ b/src/slic3r/GUI/GUI_App.hpp
@@ -166,6 +166,7 @@ public:
wxNotebook* tab_panel() const ;
int extruders_cnt() const;
+ int extruders_edited_cnt() const;
std::vector<Tab *> tabs_list;
diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp
index 64c698a9b..44f77b3f7 100644
--- a/src/slic3r/GUI/Plater.cpp
+++ b/src/slic3r/GUI/Plater.cpp
@@ -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();