From bc2088eb78a5285dbfbb8c9ff895c484233d5a98 Mon Sep 17 00:00:00 2001 From: YuSanka Date: Fri, 16 Oct 2020 16:30:46 +0200 Subject: [PATCH] Add info for the removed "Print host upload" group --- src/slic3r/GUI/OptionsGroup.cpp | 10 ++++++++++ src/slic3r/GUI/OptionsGroup.hpp | 3 ++- src/slic3r/GUI/Tab.cpp | 33 +++++++++++++++++++++++++++++---- src/slic3r/GUI/Tab.hpp | 7 +++++-- 4 files changed, 46 insertions(+), 7 deletions(-) diff --git a/src/slic3r/GUI/OptionsGroup.cpp b/src/slic3r/GUI/OptionsGroup.cpp index 1d3980c05f..f1215474d6 100644 --- a/src/slic3r/GUI/OptionsGroup.cpp +++ b/src/slic3r/GUI/OptionsGroup.cpp @@ -867,6 +867,16 @@ void ConfigOptionsGroup::change_opt_value(const t_config_option_key& opt_key, co m_modelconfig->touch(); } +ogStaticText::ogStaticText(wxWindow* parent, const wxString& text) : + wxStaticText(parent, wxID_ANY, text, wxDefaultPosition, wxDefaultSize) +{ + if (!text.IsEmpty()) { + Wrap(60 * wxGetApp().em_unit()); + GetParent()->Layout(); + } +} + + void ogStaticText::SetText(const wxString& value, bool wrap/* = true*/) { SetLabel(value); diff --git a/src/slic3r/GUI/OptionsGroup.hpp b/src/slic3r/GUI/OptionsGroup.hpp index 0446e2f162..3ea94fa362 100644 --- a/src/slic3r/GUI/OptionsGroup.hpp +++ b/src/slic3r/GUI/OptionsGroup.hpp @@ -296,7 +296,8 @@ private: class ogStaticText :public wxStaticText{ public: ogStaticText() {} - ogStaticText(wxWindow* parent, const char *text) : wxStaticText(parent, wxID_ANY, text, wxDefaultPosition, wxDefaultSize) {} +// ogStaticText(wxWindow* parent, const char *text) : wxStaticText(parent, wxID_ANY, text, wxDefaultPosition, wxDefaultSize) {} + ogStaticText(wxWindow* parent, const wxString& text); ~ogStaticText() {} void SetText(const wxString& value, bool wrap = true); diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index 253d4c5d83..539d79852f 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -1991,9 +1991,9 @@ void TabFilament::clear_pages() m_cooling_description_line = nullptr; } -wxSizer* Tab::description_line_widget(wxWindow* parent, ogStaticText* *StaticText) +wxSizer* Tab::description_line_widget(wxWindow* parent, ogStaticText* *StaticText, wxString text /*= wxEmptyString*/) { - *StaticText = new ogStaticText(parent, ""); + *StaticText = new ogStaticText(parent, text); // auto font = (new wxSystemSettings)->GetFont(wxSYS_DEFAULT_GUI_FONT); (*StaticText)->SetFont(wxGetApp().normal_font()); @@ -2018,6 +2018,27 @@ void TabPrinter::build() m_presets->get_selected_preset().printer_technology() == ptSLA ? build_sla() : build_fff(); } +void TabPrinter::build_print_host_upload_group(Page* page) +{ + ConfigOptionsGroupShp optgroup = page->new_optgroup(L("Print Host upload")); + + wxString description_line_text = _L("" + "Note: All parameters from this group are moved to the Physical Printer settings (see changelog).\n\n" + "A new Physical Printer profile is created by clicking on the \"cog\" icon right of the Printer profiles combo box, " + "by selecting the \"add or remove printers\" item in the Printer combo box. The Physical Printer profile editor opens " + "also when clicking on the \"cog\" icon in the Printer settings tab. The Physical Printer profiles are being stored " + "into PrusaSlicer/physical_printer directory."); + + Line line = { "", "" }; + line.full_width = 1; + line.widget = [this, description_line_text](wxWindow* parent) { + return description_line_widget(parent, m_presets->get_selected_preset().printer_technology() == ptFFF ? + &m_fff_print_host_upload_description_line : &m_sla_print_host_upload_description_line, + description_line_text); + }; + optgroup->append_line(line); +} + void TabPrinter::build_fff() { if (!m_pages.empty()) @@ -2105,6 +2126,8 @@ void TabPrinter::build_fff() }); }; + build_print_host_upload_group(page.get()); + optgroup = page->new_optgroup(L("Firmware")); optgroup->append_single_option_line("gcode_flavor"); optgroup->append_single_option_line("silent_mode"); @@ -2266,6 +2289,8 @@ void TabPrinter::build_sla() optgroup->append_single_option_line("min_initial_exposure_time"); optgroup->append_single_option_line("max_initial_exposure_time"); + build_print_host_upload_group(page.get()); + const int notes_field_height = 25; // 250 page = add_options_page(L("Notes"), "note.png"); @@ -2744,6 +2769,8 @@ void TabPrinter::update() m_presets->get_edited_preset().printer_technology() == ptFFF ? update_fff() : update_sla(); m_update_cnt--; + Layout(); + if (m_update_cnt == 0) wxGetApp().mainframe->on_config_changed(m_config); } @@ -3641,8 +3668,6 @@ void TabPrinter::update_machine_limits_description(const MachineLimitsUsage usag default: assert(false); } m_machine_limits_description_line->SetText(text); - - Layout(); } void Tab::compatible_widget_reload(PresetDependencies &deps) diff --git a/src/slic3r/GUI/Tab.hpp b/src/slic3r/GUI/Tab.hpp index 0aaadb7d7e..54c137b2cd 100644 --- a/src/slic3r/GUI/Tab.hpp +++ b/src/slic3r/GUI/Tab.hpp @@ -335,8 +335,7 @@ public: Field* get_field(const t_config_option_key& opt_key, int opt_index = -1) const; Field* get_field(const t_config_option_key &opt_key, Page** selected_page, int opt_index = -1); void toggle_option(const std::string& opt_key, bool toggle, int opt_index = -1); -// bool set_value(const t_config_option_key& opt_key, const boost::any& value); - wxSizer* description_line_widget(wxWindow* parent, ogStaticText** StaticText); + wxSizer* description_line_widget(wxWindow* parent, ogStaticText** StaticText, wxString text = wxEmptyString); bool current_preset_is_dirty(); DynamicPrintConfig* get_config() { return m_config; } @@ -429,6 +428,9 @@ private: ogStaticText* m_machine_limits_description_line {nullptr}; void update_machine_limits_description(const MachineLimitsUsage usage); + ogStaticText* m_fff_print_host_upload_description_line {nullptr}; + ogStaticText* m_sla_print_host_upload_description_line {nullptr}; + std::vector m_pages_fff; std::vector m_pages_sla; @@ -452,6 +454,7 @@ public: ~TabPrinter() {} void build() override; + void build_print_host_upload_group(Page* page); void build_fff(); void build_sla(); void activate_selected_page(std::function throw_if_canceled) override;