From 71650a7ecf74f4f001b727efd53fe22cc969fd27 Mon Sep 17 00:00:00 2001 From: bubnikv Date: Thu, 20 Dec 2018 22:50:30 +0100 Subject: [PATCH 01/10] Fixed the "Ctrl-R" hotkey for Reslice. --- src/slic3r/GUI/MainFrame.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/slic3r/GUI/MainFrame.cpp b/src/slic3r/GUI/MainFrame.cpp index 5b38129de..41339262b 100644 --- a/src/slic3r/GUI/MainFrame.cpp +++ b/src/slic3r/GUI/MainFrame.cpp @@ -811,7 +811,7 @@ void MainFrame::on_value_changed(wxCommandEvent& event) void MainFrame::update_ui_from_settings() { bool bp_on = wxGetApp().app_config->get("background_processing") == "1"; - m_menu_item_reslice_now->Enable(bp_on); + m_menu_item_reslice_now->Enable(!bp_on); m_plater->sidebar().show_reslice(!bp_on); m_plater->sidebar().Layout(); if (m_plater) From b9ac016d89d5cc114cf0316709fdcbfac456494b Mon Sep 17 00:00:00 2001 From: YuSanka Date: Thu, 20 Dec 2018 16:29:24 +0100 Subject: [PATCH 02/10] Improve parameter validation for "something or %" settings --- src/slic3r/GUI/Field.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/slic3r/GUI/Field.cpp b/src/slic3r/GUI/Field.cpp index 0283b7c29..1bc4c7305 100644 --- a/src/slic3r/GUI/Field.cpp +++ b/src/slic3r/GUI/Field.cpp @@ -172,12 +172,14 @@ void Field::get_value_by_opt_type(wxString& str) show_error(m_parent, _(L("Input value contains incorrect symbol(s).\nUse, please, only digits"))); set_value(double_to_string(val), true); } - else if (val > 1) + else if (m_opt.sidetext.rfind("mm/s") != std::string::npos && val > m_opt.max || + m_opt.sidetext.rfind("mm ") != std::string::npos && val > 1) { + std::string sidetext = m_opt.sidetext.rfind("mm/s") != std::string::npos ? "mm/s" : "mm"; const int nVal = int(val); - wxString msg_text = wxString::Format(_(L("Do you mean %d%% instead of %dmm?\n" + wxString msg_text = wxString::Format(_(L("Do you mean %d%% instead of %d %s?\n" "Select YES if you want to change this value to %d%%, \n" - "or NO if you are sure that %dmm is a correct value.")), nVal, nVal, nVal, nVal); + "or NO if you are sure that %d %s is a correct value.")), nVal, nVal, sidetext, nVal, nVal, sidetext); auto dialog = new wxMessageDialog(m_parent, msg_text, _(L("Parameter validation")), wxICON_WARNING | wxYES | wxNO); if (dialog->ShowModal() == wxID_YES) { set_value(wxString::Format("%s%%", str), true); @@ -274,7 +276,6 @@ void TextCtrl::BUILD() { e.Skip(); temp->GetToolTip()->Enable(true); #endif // __WXGTK__ -// if (!is_defined_input_value()) if (is_defined_input_value(window, m_opt.type)) on_change_field(); else From 3182611ac2d00d847e6f2074f37e1fb2db1d02e9 Mon Sep 17 00:00:00 2001 From: YuSanka Date: Fri, 21 Dec 2018 09:19:00 +0100 Subject: [PATCH 03/10] Fixed page updating according to view_mode (after preset changing) --- src/slic3r/GUI/GUI_App.cpp | 11 ++++++++--- src/slic3r/GUI/GUI_App.hpp | 1 + src/slic3r/GUI/KBShortcutsDialog.cpp | 2 +- src/slic3r/GUI/Tab.cpp | 20 +++++++++++++------- src/slic3r/GUI/Tab.hpp | 2 +- 5 files changed, 24 insertions(+), 12 deletions(-) diff --git a/src/slic3r/GUI/GUI_App.cpp b/src/slic3r/GUI/GUI_App.cpp index 74ea52c64..6c24acd66 100644 --- a/src/slic3r/GUI/GUI_App.cpp +++ b/src/slic3r/GUI/GUI_App.cpp @@ -554,6 +554,13 @@ ConfigMenuIDs GUI_App::get_view_mode() mode == "simple" ? ConfigMenuModeSimple : ConfigMenuModeAdvanced; } +ConfigOptionMode GUI_App::get_opt_mode() { + const ConfigMenuIDs mode = wxGetApp().get_view_mode(); + + return mode == ConfigMenuModeSimple ? comSimple : + mode == ConfigMenuModeExpert ? comExpert : comAdvanced; +} + // Update view mode according to selected menu void GUI_App::update_mode() { @@ -568,10 +575,8 @@ void GUI_App::update_mode() sidebar().Layout(); - ConfigOptionMode opt_mode = mode == ConfigMenuModeSimple ? comSimple : - mode == ConfigMenuModeExpert ? comExpert : comAdvanced; for (auto tab : tabs_list) - tab->update_visibility(opt_mode); + tab->update_visibility(); plater()->update_object_menu(); } diff --git a/src/slic3r/GUI/GUI_App.hpp b/src/slic3r/GUI/GUI_App.hpp index bd64a3ac5..e388910d7 100644 --- a/src/slic3r/GUI/GUI_App.hpp +++ b/src/slic3r/GUI/GUI_App.hpp @@ -135,6 +135,7 @@ public: Tab* get_tab(Preset::Type type); ConfigMenuIDs get_view_mode(); + ConfigOptionMode get_opt_mode(); void update_mode(); void add_config_menu(wxMenuBar *menu); diff --git a/src/slic3r/GUI/KBShortcutsDialog.cpp b/src/slic3r/GUI/KBShortcutsDialog.cpp index 12929b2cc..6ebb1ef66 100644 --- a/src/slic3r/GUI/KBShortcutsDialog.cpp +++ b/src/slic3r/GUI/KBShortcutsDialog.cpp @@ -99,7 +99,7 @@ void KBShortcutsDialog::fill_shortcuts() main_shortcuts.reserve(25); main_shortcuts.push_back(Shortcut(ctrl+"O" ,L("Open project STL/OBJ/AMF/3MF with config, delete bed"))); - main_shortcuts.push_back(Shortcut(ctrl+"I" ,L("Import STL//OBJ/AMF/3MF without config, keep bed"))); + main_shortcuts.push_back(Shortcut(ctrl+"I" ,L("Import STL/OBJ/AMF/3MF without config, keep bed"))); main_shortcuts.push_back(Shortcut(ctrl+"L" ,L("Load Config from .ini/amf/3mf/gcode"))); main_shortcuts.push_back(Shortcut(ctrl+"G" ,L("Export Gcode"))); main_shortcuts.push_back(Shortcut(ctrl+"S" ,L("Save project (3MF)"))); diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index a4796778a..ae17eed38 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -667,8 +667,9 @@ void Tab::reload_config() Thaw(); } -void Tab::update_visibility(ConfigOptionMode mode) +void Tab::update_visibility() { + const ConfigOptionMode mode = wxGetApp().get_opt_mode(); Freeze(); for (auto page : m_pages) @@ -1988,6 +1989,7 @@ PageShp TabPrinter::build_kinematics_page() def.type = coString; def.width = 150; def.gui_type = "legend"; + def.mode = comAdvanced; def.tooltip = L("Values in this column are for Full Power mode"); def.default_value = new ConfigOptionString{ L("Full Power") }; @@ -2345,12 +2347,15 @@ void Tab::load_current_preset() init_options_list(); update_changed_ui(); }); + update_page_tree_visibility(); } //Regerenerate content of the page tree. void Tab::rebuild_page_tree(bool tree_sel_change_event /*= false*/) { Freeze(); + update_visibility(); + // get label of the currently selected item const auto sel_item = m_treectrl->GetSelection(); const auto selected = sel_item ? m_treectrl->GetItemText(sel_item) : ""; @@ -2363,8 +2368,8 @@ void Tab::rebuild_page_tree(bool tree_sel_change_event /*= false*/) auto itemId = m_treectrl->AppendItem(rootItem, p->title(), p->iconID()); m_treectrl->SetItemTextColour(itemId, p->get_item_colour()); if (p->title() == selected) { - if (!(p->title() == _(L("Machine limits")) || p->title() == _(L("Single extruder MM setup")))) // These Pages have to be updated inside OnTreeSelChange - m_disable_tree_sel_changed_event = !tree_sel_change_event; +// if (!(p->title() == _(L("Machine limits")) || p->title() == _(L("Single extruder MM setup")))) // These Pages have to be updated inside OnTreeSelChange +// m_disable_tree_sel_changed_event = !tree_sel_change_event; m_treectrl->SelectItem(itemId); m_disable_tree_sel_changed_event = false; have_selection = 1; @@ -2924,14 +2929,15 @@ ConfigOptionsGroupShp Page::new_optgroup(const wxString& title, int noncommon_la auto extra_column = [](wxWindow* parent, const Line& line) { std::string bmp_name; - if (line.get_options().size() == 0) - bmp_name = "error.png"; + const std::vector