From 7372f3a6f224e108714516b0d754ad04e3335861 Mon Sep 17 00:00:00 2001 From: remi durand Date: Wed, 9 Jun 2021 17:35:27 +0200 Subject: Fix missing temp / layer time / chronology from bad merge with ps2.3.1 --- src/slic3r/GUI/GCodeViewer.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/slic3r/GUI/GCodeViewer.cpp b/src/slic3r/GUI/GCodeViewer.cpp index 138db1348..55d31f684 100644 --- a/src/slic3r/GUI/GCodeViewer.cpp +++ b/src/slic3r/GUI/GCodeViewer.cpp @@ -151,11 +151,13 @@ bool GCodeViewer::Path::matches(const GCodeProcessor::MoveVertex& move) const #if ENABLE_TOOLPATHS_WIDTH_HEIGHT_FROM_GCODE return type == move.type && extruder_id == move.extruder_id && cp_color_id == move.cp_color_id && role == move.extrusion_role && move.position[2] <= sub_paths.front().first.position[2] && feedrate == move.feedrate && fan_speed == move.fan_speed && + layer_time == move.layer_duration && elapsed_time == move.time && extruder_temp == move.temperature && height == round_to_nearest(move.height, 2) && width == round_to_nearest(move.width, 2) && matches_percent(volumetric_rate, move.volumetric_rate(), 0.05f); #else return type == move.type && move.position[2] <= sub_paths.front().position[2] && role == move.extrusion_role && height == round_to_nearest(move.height, 2) && width == round_to_nearest(move.width, 2) && feedrate == move.feedrate && fan_speed == move.fan_speed && + layer_time == move.layer_duration && elapsed_time == move.time && extruder_temp == move.temperature && volumetric_rate == round_to_nearest(move.volumetric_rate(), 2) && extruder_id == move.extruder_id && cp_color_id == move.cp_color_id; #endif // ENABLE_TOOLPATHS_WIDTH_HEIGHT_FROM_GCODE @@ -163,13 +165,15 @@ bool GCodeViewer::Path::matches(const GCodeProcessor::MoveVertex& move) const #if ENABLE_TOOLPATHS_WIDTH_HEIGHT_FROM_GCODE return type == move.type && extruder_id == move.extruder_id && cp_color_id == move.cp_color_id && role == move.extrusion_role && move.position[2] <= first.position[2] && feedrate == move.feedrate && fan_speed == move.fan_speed && + layer_time == move.layer_duration && elapsed_time == move.time && extruder_temp == move.temperature && height == round_to_nearest(move.height, 2) && width == round_to_nearest(move.width, 2) && matches_percent(volumetric_rate, move.volumetric_rate(), 0.05f); #else return type == move.type && move.position[2] <= first.position[2] && role == move.extrusion_role && height == round_to_nearest(move.height, 2) && width == round_to_nearest(move.width, 2) && feedrate == move.feedrate && fan_speed == move.fan_speed && + layer_time == move.layer_duration && elapsed_time == move.time && extruder_temp == move.temperature && volumetric_rate == round_to_nearest(move.volumetric_rate(), 2) && extruder_id == move.extruder_id && - cp_color_id == move.cp_color_id && extruder_temp == move.temperature; + cp_color_id == move.cp_color_id; #endif // ENABLE_TOOLPATHS_WIDTH_HEIGHT_FROM_GCODE #endif // ENABLE_SPLITTED_VERTEX_BUFFER } @@ -202,11 +206,11 @@ void GCodeViewer::TBuffer::add_path(const GCodeProcessor::MoveVertex& move, unsi #if ENABLE_TOOLPATHS_WIDTH_HEIGHT_FROM_GCODE paths.push_back({ move.type, move.extrusion_role, move.delta_extruder, round_to_nearest(move.height, 2), round_to_nearest(move.width, 2), move.feedrate, move.fan_speed, - move.volumetric_rate(), move.extruder_id, move.cp_color_id, { { endpoint, endpoint } } }); + move.volumetric_rate(), move.extruder_id, move.cp_color_id, { { endpoint, endpoint } }, move.layer_duration, move.time, move.temperature }); #else paths.push_back({ move.type, move.extrusion_role, move.delta_extruder, round_to_nearest(move.height, 2), round_to_nearest(move.width, 2), move.feedrate, move.fan_speed, - round_to_nearest(move.volumetric_rate(), 2), move.extruder_id, move.cp_color_id, { { endpoint, endpoint } } }); + round_to_nearest(move.volumetric_rate(), 2), move.extruder_id, move.cp_color_id, { { endpoint, endpoint } }, move.layer_duration, move.time, move.temperature }); #endif // ENABLE_TOOLPATHS_WIDTH_HEIGHT_FROM_GCODE #else #if ENABLE_TOOLPATHS_WIDTH_HEIGHT_FROM_GCODE @@ -3285,8 +3289,13 @@ void GCodeViewer::refresh_render_paths(bool keep_sequential_current_first, bool case EViewType::Width: { color = m_extrusions.ranges.width.get_color_at(path.width); break; } case EViewType::Feedrate: { color = m_extrusions.ranges.feedrate.get_color_at(path.feedrate); break; } case EViewType::FanSpeed: { color = m_extrusions.ranges.fan_speed.get_color_at(path.fan_speed); break; } + case EViewType::LayerTime: { color = m_extrusions.ranges.layer_duration.get_color_at(path.layer_time); break; } + case EViewType::LayerTimeLog: { color = m_extrusions.ranges.layer_duration.get_color_at(path.layer_time, true); break; } + case EViewType::Chronology: { color = m_extrusions.ranges.elapsed_time.get_color_at(path.elapsed_time); break; } case EViewType::VolumetricRate: { color = m_extrusions.ranges.volumetric_rate.get_color_at(path.volumetric_rate); break; } case EViewType::Tool: { color = m_tool_colors[path.extruder_id]; break; } + case EViewType::Filament: { color = m_filament_colors[path.extruder_id]; break; } + case EViewType::ExtruderTemp: { color = m_extrusions.ranges.extruder_temp.get_color_at(path.extruder_temp); break; } case EViewType::ColorPrint: { if (path.cp_color_id >= static_cast(m_tool_colors.size())) { color = { 0.5f, 0.5f, 0.5f }; -- cgit v1.2.3 From dc9b18e1b930bf7d1a4f037a56506af54e07177f Mon Sep 17 00:00:00 2001 From: remi durand Date: Wed, 9 Jun 2021 18:54:58 +0200 Subject: fix for tab shortcut in tabbed layout also fix a bug for unfreeze when switching tab --- src/slic3r/GUI/GLCanvas3D.cpp | 3 +- src/slic3r/GUI/KBShortcutsDialog.cpp | 1 + src/slic3r/GUI/MainFrame.cpp | 54 +++++++++++++++++++++++------------- src/slic3r/GUI/MainFrame.hpp | 3 +- src/slic3r/GUI/Plater.cpp | 21 +++++++------- 5 files changed, 50 insertions(+), 32 deletions(-) diff --git a/src/slic3r/GUI/GLCanvas3D.cpp b/src/slic3r/GUI/GLCanvas3D.cpp index 2f80db816..8cf055446 100644 --- a/src/slic3r/GUI/GLCanvas3D.cpp +++ b/src/slic3r/GUI/GLCanvas3D.cpp @@ -2812,7 +2812,8 @@ void GLCanvas3D::on_key(wxKeyEvent& evt) } else if (keyCode == WXK_TAB && evt.ShiftDown() && !evt.ControlDown() && ! wxGetApp().is_gcode_viewer()) { // Collapse side-panel with Shift+Tab - post_event(SimpleEvent(EVT_GLCANVAS_COLLAPSE_SIDEBAR)); + // already done with the menu entry, don't re-do the call here. + //post_event(SimpleEvent(EVT_GLCANVAS_COLLAPSE_SIDEBAR)); } else if (keyCode == WXK_SHIFT) { translationProcessor.process(evt); diff --git a/src/slic3r/GUI/KBShortcutsDialog.cpp b/src/slic3r/GUI/KBShortcutsDialog.cpp index 2bc3eddfc..6a5c235dd 100644 --- a/src/slic3r/GUI/KBShortcutsDialog.cpp +++ b/src/slic3r/GUI/KBShortcutsDialog.cpp @@ -146,6 +146,7 @@ void KBShortcutsDialog::fill_shortcuts() { "I", L("Zoom in") }, { "O", L("Zoom out") }, { "Tab", L("Switch between Editor/Preview") }, + { "Ctrl+Tab", L("Switch between Tab") }, { "Shift+Tab", L("Collapse/Expand the sidebar") }, #if ENABLE_CTRL_M_ON_WINDOWS #ifdef _WIN32 diff --git a/src/slic3r/GUI/MainFrame.cpp b/src/slic3r/GUI/MainFrame.cpp index 8e3ac9693..9d945be0e 100644 --- a/src/slic3r/GUI/MainFrame.cpp +++ b/src/slic3r/GUI/MainFrame.cpp @@ -749,12 +749,13 @@ void MainFrame::init_tabpanel() m_last_selected_plater_tab = m_tabpanel->GetSelection(); if (need_freeze) Thaw(); - else if (need_freeze_plater) m_plater->Freeze(); + else if (need_freeze_plater) m_plater->Thaw(); #ifdef __APPLE__ m_tabpanel->ChangeSelection(new_tab); m_tabpanel->Refresh(); BOOST_LOG_TRIVIAL(debug) << "Macos: force tab selection to "<< new_tab <<" : " << m_tabpanel->GetSelection() << "\n"; #endif + m_plater->SetFocus(); } else { select_tab(MainFrame::ETabType::LastPlater); // select Plater m_last_selected_plater_tab = 999; @@ -1324,6 +1325,7 @@ void MainFrame::init_menubar_as_editor() } // Edit menu + //some are protected by can_change_view() to be able to use them differently in setting items wxMenu* editMenu = nullptr; if (m_plater != nullptr) { @@ -1336,33 +1338,33 @@ void MainFrame::init_menubar_as_editor() #endif append_menu_item(editMenu, wxID_ANY, _L("&Select all") + "\t" + GUI::shortkey_ctrl_prefix() + "A", _L("Selects all objects"), [this](wxCommandEvent&) { m_plater->select_all(); }, - "", nullptr, [this](){return can_select(); }, this); + "", nullptr, [this](){return can_select() && can_change_view(); }, this); append_menu_item(editMenu, wxID_ANY, _L("D&eselect all") + sep + "Esc", _L("Deselects all objects"), [this](wxCommandEvent&) { m_plater->deselect_all(); }, - "", nullptr, [this](){return can_deselect(); }, this); + "", nullptr, [this](){return can_deselect() && can_change_view(); }, this); editMenu->AppendSeparator(); append_menu_item(editMenu, wxID_ANY, _L("&Delete selected") + "\t" + hotkey_delete, _L("Deletes the current selection"),[this](wxCommandEvent&) { m_plater->remove_selected(); }, - "remove_menu", nullptr, [this](){return can_delete(); }, this); + "remove_menu", nullptr, [this](){return can_delete() && can_change_view(); }, this); append_menu_item(editMenu, wxID_ANY, _L("Delete &all") + "\t" + GUI::shortkey_ctrl_prefix() + hotkey_delete, _L("Deletes all objects"), [this](wxCommandEvent&) { m_plater->reset_with_confirm(); }, - "delete_all_menu", nullptr, [this](){return can_delete_all(); }, this); + "delete_all_menu", nullptr, [this](){return can_delete_all() && can_change_view(); }, this); editMenu->AppendSeparator(); append_menu_item(editMenu, wxID_ANY, _L("&Undo") + "\t" + GUI::shortkey_ctrl_prefix() + "Z", _L("Undo"), [this](wxCommandEvent&) { m_plater->undo(); }, - "undo_menu", nullptr, [this](){return m_plater->can_undo(); }, this); + "undo_menu", nullptr, [this](){return m_plater->can_undo() && can_change_view(); }, this); append_menu_item(editMenu, wxID_ANY, _L("&Redo") + "\t" + GUI::shortkey_ctrl_prefix() + "Y", _L("Redo"), [this](wxCommandEvent&) { m_plater->redo(); }, - "redo_menu", nullptr, [this](){return m_plater->can_redo(); }, this); + "redo_menu", nullptr, [this](){return m_plater->can_redo() && can_change_view(); }, this); editMenu->AppendSeparator(); append_menu_item(editMenu, wxID_ANY, _L("&Copy") + "\t" + GUI::shortkey_ctrl_prefix() + "C", _L("Copy selection to clipboard"), [this](wxCommandEvent&) { m_plater->copy_selection_to_clipboard(); }, - "copy_menu", nullptr, [this](){return m_plater->can_copy_to_clipboard(); }, this); + "copy_menu", nullptr, [this](){return m_plater->can_copy_to_clipboard() && can_change_view(); }, this); append_menu_item(editMenu, wxID_ANY, _L("&Paste") + "\t" + GUI::shortkey_ctrl_prefix() + "V", _L("Paste clipboard"), [this](wxCommandEvent&) { m_plater->paste_from_clipboard(); }, - "paste_menu", nullptr, [this](){return m_plater->can_paste_from_clipboard(); }, this); + "paste_menu", nullptr, [this](){return m_plater->can_paste_from_clipboard() && can_change_view(); }, this); editMenu->AppendSeparator(); #ifdef __APPLE__ @@ -1423,19 +1425,12 @@ void MainFrame::init_menubar_as_editor() viewMenu = new wxMenu(); add_common_view_menu_items(viewMenu, this, std::bind(&MainFrame::can_change_view, this)); viewMenu->AppendSeparator(); - append_menu_check_item(viewMenu, wxID_ANY, _L("Show &labels") + "\t" + GUI::shortkey_ctrl_prefix() + "E", _L("Show object/instance labels in 3D scene"), + append_menu_check_item(viewMenu, wxID_ANY, _L("Show &labels") + "\t" + "E", _L("Show object/instance labels in 3D scene"), [this](wxCommandEvent&) { m_plater->show_view3D_labels(!m_plater->are_view3D_labels_shown()); }, this, - [this]() { return m_plater->is_view3D_shown(); }, [this]() { return m_plater->are_view3D_labels_shown(); }, this); + [this]() { return m_plater->is_view3D_shown() && can_change_view(); }, [this]() { return m_plater->are_view3D_labels_shown(); }, this); append_menu_check_item(viewMenu, wxID_ANY, _L("&Collapse sidebar") + "\t" + "Shift+" + sep_space + "Tab", _L("Collapse sidebar"), - [this](wxCommandEvent&) { - //fix for trigger on pressed & release - static time_t last_time_called = 0; - time_t now = Slic3r::Utils::get_current_time_utc(); - if(now - last_time_called > 2) - m_plater->collapse_sidebar(!m_plater->is_sidebar_collapsed()); - last_time_called = now; - }, this, - []() { return true; }, [this]() { return m_plater->is_sidebar_collapsed(); }, this); + [this](wxCommandEvent&) { m_plater->collapse_sidebar(!m_plater->is_sidebar_collapsed()); }, this, + [this]() { return can_change_view(); }, [this]() { return m_plater->is_sidebar_collapsed(); }, this); } // calibration menu @@ -1919,6 +1914,25 @@ void MainFrame::select_tab(Tab* tab) } +MainFrame::ETabType MainFrame::next_preview_tab() +{ + if (m_layout == ESettingsLayout::Tabs) { + MainFrame::ETabType current_tab = selected_tab(); + MainFrame::ETabType next_tab = MainFrame::ETabType(uint8_t(current_tab) + 1); + if (next_tab == MainFrame::ETabType::LastPlater) next_tab = MainFrame::ETabType::Plater3D; + select_tab(next_tab, true); + return next_tab; + } else { + if (m_plater->is_view3D_shown()) { + m_plater->select_view_3D("Preview"); + return /*m_plater->can_display_gcode()*/ MainFrame::ETabType::PlaterGcode; + } else { + m_plater->select_view_3D("3D"); + return MainFrame::ETabType::Plater3D; + } + } +} + MainFrame::ETabType MainFrame::selected_tab() const { if (m_layout == ESettingsLayout::Old) { diff --git a/src/slic3r/GUI/MainFrame.hpp b/src/slic3r/GUI/MainFrame.hpp index c4e3b5e1f..584f02d5e 100644 --- a/src/slic3r/GUI/MainFrame.hpp +++ b/src/slic3r/GUI/MainFrame.hpp @@ -201,7 +201,8 @@ public: // 0 = a plater tab, 1 = print setting, 2 = filament settign, 3 = printer setting void select_tab(Tab* tab); void select_tab(ETabType tab = ETabType::Any, bool keep_tab_type = false); - ETabType selected_tab() const; + ETabType selected_tab() const; + ETabType next_preview_tab(); void select_view(const std::string& direction); // Propagate changed configuration from the Tab to the Plater and save changes to the AppConfig void on_config_changed(DynamicPrintConfig* cfg) const ; diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 991c0f7e2..fd9084d11 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -2281,16 +2281,17 @@ void Plater::priv::select_view_3D(const std::string& name) void Plater::priv::select_next_view_3D() { - for (int i = 0; i < panels.size(); i++) { - if (panels[i] == current_panel) { - if (i + 1 == panels.size()) { - set_current_panel(panels[0]); - } else { - set_current_panel(panels[i+1]); - } - return; - } - } + main_frame->next_preview_tab(); + //for (int i = 0; i < panels.size(); i++) { + // if (panels[i] == current_panel) { + // if (i + 1 == panels.size()) { + // set_current_panel(panels[0]); + // } else { + // set_current_panel(panels[i+1]); + // } + // return; + // } + // } } void Plater::priv::collapse_sidebar(bool collapse) -- cgit v1.2.3 From f6fdc362db27fa56eda50eb0356b94c5951f31e4 Mon Sep 17 00:00:00 2001 From: remi durand Date: Wed, 9 Jun 2021 21:49:22 +0200 Subject: other try to fix shortcut --- src/slic3r/GUI/MainFrame.cpp | 66 ++++++++++++++++++++++---------------------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/src/slic3r/GUI/MainFrame.cpp b/src/slic3r/GUI/MainFrame.cpp index 9d945be0e..8b8f1f6db 100644 --- a/src/slic3r/GUI/MainFrame.cpp +++ b/src/slic3r/GUI/MainFrame.cpp @@ -1200,13 +1200,13 @@ void MainFrame::init_menubar_as_editor() Bind(wxEVT_UPDATE_UI, [this](wxUpdateUIEvent& evt) { evt.Enable(m_recent_projects.GetCount() > 0); }, recent_projects_submenu->GetId()); - append_menu_item(fileMenu, wxID_ANY, _L("&Save Project") + "\t" + GUI::shortkey_ctrl_prefix() + "S", _L("Save current project file"), + append_menu_item(fileMenu, wxID_ANY, _L("&Save Project") + "\tCtrl+S", _L("Save current project file"), [this](wxCommandEvent&) { if (m_plater) m_plater->save_project_as_3mf(into_path(m_plater->get_project_filename(".3mf"))); }, "save", nullptr, [this](){return m_plater != nullptr && can_save(); }, this); #ifdef __APPLE__ - append_menu_item(fileMenu, wxID_ANY, _L("Save Project &as") + dots + "\t" + GUI::shortkey_ctrl_prefix() + "Shift+S", _L("Save current project file as"), + append_menu_item(fileMenu, wxID_ANY, _L("Save Project &as") + dots + "\tCtrl+Shift+S", _L("Save current project file as"), #else - append_menu_item(fileMenu, wxID_ANY, _L("Save Project &as") + dots + "\t" + GUI::shortkey_ctrl_prefix() + "Alt+S", _L("Save current project file as"), + append_menu_item(fileMenu, wxID_ANY, _L("Save Project &as") + dots + "\tCtrl+Alt+S", _L("Save current project file as"), #endif // __APPLE__ [this](wxCommandEvent&) { if (m_plater) m_plater->save_project_as_3mf(); }, "save", nullptr, [this](){return m_plater != nullptr && can_save(); }, this); @@ -1214,7 +1214,7 @@ void MainFrame::init_menubar_as_editor() fileMenu->AppendSeparator(); wxMenu* import_menu = new wxMenu(); - append_menu_item(import_menu, wxID_ANY, _L("Import STL/OBJ/AM&F/3MF") + dots + "\t" + GUI::shortkey_ctrl_prefix() + "I", _L("Load a model"), + append_menu_item(import_menu, wxID_ANY, _L("Import STL/OBJ/AM&F/3MF") + dots + "\tCtrl+I", _L("Load a model"), [this](wxCommandEvent&) { if (m_plater) m_plater->add_model(); }, "import_plater", nullptr, [this](){return m_plater != nullptr; }, this); @@ -1227,10 +1227,10 @@ void MainFrame::init_menubar_as_editor() [this](){return m_plater != nullptr; }, this); import_menu->AppendSeparator(); - append_menu_item(import_menu, wxID_ANY, _L("Import &Config") + dots + "\t" + GUI::shortkey_ctrl_prefix() + "L", _L("Load exported configuration file"), + append_menu_item(import_menu, wxID_ANY, _L("Import &Config") + dots + "\tCtrl+L", _L("Load exported configuration file"), [this](wxCommandEvent&) { load_config_file(); }, "import_config", nullptr, []() {return true; }, this); - append_menu_item(import_menu, wxID_ANY, _L("Import Config from &project") + dots +"\t" + GUI::shortkey_ctrl_prefix() + "Alt+L", _L("Load configuration from project file"), + append_menu_item(import_menu, wxID_ANY, _L("Import Config from &project") + dots +"\tCtrl+Alt+L", _L("Load configuration from project file"), [this](wxCommandEvent&) { if (m_plater) m_plater->extract_config_from_project(); }, "import_config", nullptr, []() {return true; }, this); import_menu->AppendSeparator(); @@ -1240,15 +1240,15 @@ void MainFrame::init_menubar_as_editor() append_submenu(fileMenu, import_menu, wxID_ANY, _L("&Import"), ""); wxMenu* export_menu = new wxMenu(); - wxMenuItem* item_export_gcode = append_menu_item(export_menu, wxID_ANY, _L("Export &G-code") + dots +"\t" + GUI::shortkey_ctrl_prefix() + "G", _L("Export current plate as G-code"), + wxMenuItem* item_export_gcode = append_menu_item(export_menu, wxID_ANY, _L("Export &G-code") + dots +"\tCtrl+G", _L("Export current plate as G-code"), [this](wxCommandEvent&) { if (m_plater) m_plater->export_gcode(false); }, "export_gcode", nullptr, [this](){return can_export_gcode(); }, this); m_changeable_menu_items.push_back(item_export_gcode); - wxMenuItem* item_send_gcode = append_menu_item(export_menu, wxID_ANY, _L("S&end G-code") + dots +"\t" + GUI::shortkey_ctrl_prefix() + "Shift+G", _L("Send to print current plate as G-code"), + wxMenuItem* item_send_gcode = append_menu_item(export_menu, wxID_ANY, _L("S&end G-code") + dots +"\tCtrl+Shift+G", _L("Send to print current plate as G-code"), [this](wxCommandEvent&) { if (m_plater) m_plater->send_gcode(); }, "export_gcode", nullptr, [this](){return can_send_gcode(); }, this); m_changeable_menu_items.push_back(item_send_gcode); - append_menu_item(export_menu, wxID_ANY, _L("Export G-code to SD card / Flash drive") + dots + "\t" + GUI::shortkey_ctrl_prefix() + "U", _L("Export current plate as G-code to SD card / Flash drive"), + append_menu_item(export_menu, wxID_ANY, _L("Export G-code to SD card / Flash drive") + dots + "\tCtrl+U", _L("Export current plate as G-code to SD card / Flash drive"), [this](wxCommandEvent&) { if (m_plater) m_plater->export_gcode(true); }, "export_to_sd", nullptr, [this]() {return can_export_gcode_sd(); }, this); export_menu->AppendSeparator(); @@ -1266,7 +1266,7 @@ void MainFrame::init_menubar_as_editor() [this](wxCommandEvent&) { if (m_plater) m_plater->export_toolpaths_to_obj(); }, "export_plater", nullptr, [this]() {return can_export_toolpaths(); }, this); export_menu->AppendSeparator(); - append_menu_item(export_menu, wxID_ANY, _L("Export &Config") + dots +"\t" + GUI::shortkey_ctrl_prefix() + "E", _L("Export current configuration to file"), + append_menu_item(export_menu, wxID_ANY, _L("Export &Config") + dots +"\tCtrl+E", _L("Export current configuration to file"), [this](wxCommandEvent&) { export_config(); }, "export_config", nullptr, []() {return true; }, this); append_menu_item(export_menu, wxID_ANY, _L("Export Config &Bundle") + dots, _L("Export all presets to file"), @@ -1281,7 +1281,7 @@ void MainFrame::init_menubar_as_editor() []() {return true; }, this); append_submenu(fileMenu, export_menu, wxID_ANY, _L("&Export"), ""); - append_menu_item(fileMenu, wxID_ANY, _L("Ejec&t SD card / Flash drive") + dots + "\t" + GUI::shortkey_ctrl_prefix() + "T", _L("Eject SD card / Flash drive after the G-code was exported to it."), + append_menu_item(fileMenu, wxID_ANY, _L("Ejec&t SD card / Flash drive") + dots + "\tCtrl+T", _L("Eject SD card / Flash drive after the G-code was exported to it."), [this](wxCommandEvent&) { if (m_plater) m_plater->eject_drive(); }, "eject_sd", nullptr, [this]() {return can_eject(); }, this); @@ -1289,19 +1289,19 @@ void MainFrame::init_menubar_as_editor() #if 0 m_menu_item_repeat = nullptr; - append_menu_item(fileMenu, wxID_ANY, _L("Quick Slice") +dots+ "\t" + GUI::shortkey_ctrl_prefix() + "U", _L("Slice a file into a G-code"), + append_menu_item(fileMenu, wxID_ANY, _L("Quick Slice") +dots+ "\tCtrl+U", _L("Slice a file into a G-code"), [this](wxCommandEvent&) { wxTheApp->CallAfter([this]() { quick_slice(); m_menu_item_repeat->Enable(is_last_input_file()); }); }, "cog_go.png"); - append_menu_item(fileMenu, wxID_ANY, _L("Quick Slice and Save As") +dots +"\t" + GUI::shortkey_ctrl_prefix() + "Alt+U", _L("Slice a file into a G-code, save as"), + append_menu_item(fileMenu, wxID_ANY, _L("Quick Slice and Save As") +dots +"\tCtrl+Alt+U", _L("Slice a file into a G-code, save as"), [this](wxCommandEvent&) { wxTheApp->CallAfter([this]() { quick_slice(qsSaveAs); m_menu_item_repeat->Enable(is_last_input_file()); }); }, "cog_go.png"); - m_menu_item_repeat = append_menu_item(fileMenu, wxID_ANY, _L("Repeat Last Quick Slice") +"\t" + GUI::shortkey_ctrl_prefix() + "Shift+U", _L("Repeat last quick slice"), + m_menu_item_repeat = append_menu_item(fileMenu, wxID_ANY, _L("Repeat Last Quick Slice") +"\tCtrl+Shift+U", _L("Repeat last quick slice"), [this](wxCommandEvent&) { wxTheApp->CallAfter([this]() { quick_slice(qsReslice); @@ -1309,7 +1309,7 @@ void MainFrame::init_menubar_as_editor() m_menu_item_repeat->Enable(false); fileMenu->AppendSeparator(); #endif - m_menu_item_reslice_now = append_menu_item(fileMenu, wxID_ANY, _L("(Re)Slice No&w") + "\t" + GUI::shortkey_ctrl_prefix() + "R", _L("Start new slicing process"), + m_menu_item_reslice_now = append_menu_item(fileMenu, wxID_ANY, _L("(Re)Slice No&w") + "\tCtrl+R", _L("Start new slicing process"), [this](wxCommandEvent&) { reslice_now(); }, "re_slice", nullptr, [this]() { return m_plater != nullptr && can_reslice(); }, this); fileMenu->AppendSeparator(); @@ -1336,33 +1336,33 @@ void MainFrame::init_menubar_as_editor() #else wxString hotkey_delete = "Del"; #endif - append_menu_item(editMenu, wxID_ANY, _L("&Select all") + "\t" + GUI::shortkey_ctrl_prefix() + "A", + append_menu_item(editMenu, wxID_ANY, _L("&Select all") + "\tCtrl+A", _L("Selects all objects"), [this](wxCommandEvent&) { m_plater->select_all(); }, "", nullptr, [this](){return can_select() && can_change_view(); }, this); - append_menu_item(editMenu, wxID_ANY, _L("D&eselect all") + sep + "Esc", + append_menu_item(editMenu, wxID_ANY, _L("D&eselect all") + "\tEsc", _L("Deselects all objects"), [this](wxCommandEvent&) { m_plater->deselect_all(); }, "", nullptr, [this](){return can_deselect() && can_change_view(); }, this); editMenu->AppendSeparator(); append_menu_item(editMenu, wxID_ANY, _L("&Delete selected") + "\t" + hotkey_delete, _L("Deletes the current selection"),[this](wxCommandEvent&) { m_plater->remove_selected(); }, "remove_menu", nullptr, [this](){return can_delete() && can_change_view(); }, this); - append_menu_item(editMenu, wxID_ANY, _L("Delete &all") + "\t" + GUI::shortkey_ctrl_prefix() + hotkey_delete, + append_menu_item(editMenu, wxID_ANY, _L("Delete &all") + "\tCtrl+" + hotkey_delete, _L("Deletes all objects"), [this](wxCommandEvent&) { m_plater->reset_with_confirm(); }, "delete_all_menu", nullptr, [this](){return can_delete_all() && can_change_view(); }, this); editMenu->AppendSeparator(); - append_menu_item(editMenu, wxID_ANY, _L("&Undo") + "\t" + GUI::shortkey_ctrl_prefix() + "Z", + append_menu_item(editMenu, wxID_ANY, _L("&Undo") + "\tCtrl+Z", _L("Undo"), [this](wxCommandEvent&) { m_plater->undo(); }, "undo_menu", nullptr, [this](){return m_plater->can_undo() && can_change_view(); }, this); - append_menu_item(editMenu, wxID_ANY, _L("&Redo") + "\t" + GUI::shortkey_ctrl_prefix() + "Y", + append_menu_item(editMenu, wxID_ANY, _L("&Redo") + "\tCtrl+Y", _L("Redo"), [this](wxCommandEvent&) { m_plater->redo(); }, "redo_menu", nullptr, [this](){return m_plater->can_redo() && can_change_view(); }, this); editMenu->AppendSeparator(); - append_menu_item(editMenu, wxID_ANY, _L("&Copy") + "\t" + GUI::shortkey_ctrl_prefix() + "C", + append_menu_item(editMenu, wxID_ANY, _L("&Copy") + "\tCtrl+C", _L("Copy selection to clipboard"), [this](wxCommandEvent&) { m_plater->copy_selection_to_clipboard(); }, "copy_menu", nullptr, [this](){return m_plater->can_copy_to_clipboard() && can_change_view(); }, this); - append_menu_item(editMenu, wxID_ANY, _L("&Paste") + "\t" + GUI::shortkey_ctrl_prefix() + "V", + append_menu_item(editMenu, wxID_ANY, _L("&Paste") + "\tCtrl+V", _L("Paste clipboard"), [this](wxCommandEvent&) { m_plater->paste_from_clipboard(); }, "paste_menu", nullptr, [this](){return m_plater->can_paste_from_clipboard() && can_change_view(); }, this); @@ -1387,35 +1387,35 @@ void MainFrame::init_menubar_as_editor() auto windowMenu = new wxMenu(); { if (m_plater) { - append_menu_item(windowMenu, wxID_HIGHEST + 1, _L("3D &Plater Tab") + "\t" + GUI::shortkey_ctrl_prefix() + "1", _L("Show the editor of the input models"), + append_menu_item(windowMenu, wxID_HIGHEST + 1, _L("3D &Plater Tab") + "\tCtrl+1", _L("Show the editor of the input models"), [this](wxCommandEvent&) { select_tab(ETabType::Plater3D); }, "editor_menu", nullptr, []() {return true; }, this); - m_layerpreview_menu_item = append_menu_item(windowMenu, wxID_HIGHEST + 2, _L("Layer previe&w Tab") + "\t" + GUI::shortkey_ctrl_prefix() + "2", _L("Show the layers from the slicing process"), + m_layerpreview_menu_item = append_menu_item(windowMenu, wxID_HIGHEST + 2, _L("Layer previe&w Tab") + "\tCtrl+2", _L("Show the layers from the slicing process"), [this](wxCommandEvent&) { select_tab(ETabType::PlaterPreview); }, "layers", nullptr, []() {return true; }, this); - append_menu_item(windowMenu, wxID_HIGHEST + 3, _L("GCode Pre&view Tab") + "\t" + GUI::shortkey_ctrl_prefix() + "3", _L("Show the preview of the gcode output"), + append_menu_item(windowMenu, wxID_HIGHEST + 3, _L("GCode Pre&view Tab") + "\tCtrl+3", _L("Show the preview of the gcode output"), [this](wxCommandEvent&) { select_tab(ETabType::PlaterGcode); }, "preview_menu", nullptr, []() {return true; }, this); windowMenu->AppendSeparator(); } - append_menu_item(windowMenu, wxID_HIGHEST + 4, _L("P&rint Settings Tab") + "\t" + GUI::shortkey_ctrl_prefix() + "4", _L("Show the print settings"), + append_menu_item(windowMenu, wxID_HIGHEST + 4, _L("P&rint Settings Tab") + "\tCtrl+4", _L("Show the print settings"), [this/*, tab_offset*/](wxCommandEvent&) { select_tab(ETabType::PrintSettings); }, "cog", nullptr, []() {return true; }, this); - wxMenuItem* item_material_tab = append_menu_item(windowMenu, wxID_HIGHEST + 5, _L("&Filament Settings Tab") + "\t" + GUI::shortkey_ctrl_prefix() + "5", _L("Show the filament settings"), + wxMenuItem* item_material_tab = append_menu_item(windowMenu, wxID_HIGHEST + 5, _L("&Filament Settings Tab") + "\tCtrl+5", _L("Show the filament settings"), [this/*, tab_offset*/](wxCommandEvent&) { select_tab(ETabType::FilamentSettings); }, "spool", nullptr, []() {return true; }, this); m_changeable_menu_items.push_back(item_material_tab); - wxMenuItem* item_printer_tab = append_menu_item(windowMenu, wxID_HIGHEST + 6, _L("Print&er Settings Tab") + "\t" + GUI::shortkey_ctrl_prefix() + "6", _L("Show the printer settings"), + wxMenuItem* item_printer_tab = append_menu_item(windowMenu, wxID_HIGHEST + 6, _L("Print&er Settings Tab") + "\tCtrl+6", _L("Show the printer settings"), [this/*, tab_offset*/](wxCommandEvent&) { select_tab(ETabType::PrinterSettings); }, "printer", nullptr, []() {return true; }, this); m_changeable_menu_items.push_back(item_printer_tab); windowMenu->AppendSeparator(); - append_menu_item(windowMenu, wxID_ANY, _L("Print &Host Upload Queue") + "\t" + GUI::shortkey_ctrl_prefix() + "J", _L("Display the Print Host Upload Queue window"), + append_menu_item(windowMenu, wxID_ANY, _L("Print &Host Upload Queue") + "\tCtrl+J", _L("Display the Print Host Upload Queue window"), [this](wxCommandEvent&) { m_printhost_queue_dlg->Show(); }, "upload_queue", nullptr, []() {return true; }, this); windowMenu->AppendSeparator(); - append_menu_item(windowMenu, wxID_ANY, _L("Open new instance") + "\t" + GUI::shortkey_ctrl_prefix() + "Shift+" + "I", _L("Open a new " SLIC3R_APP_NAME " instance"), + append_menu_item(windowMenu, wxID_ANY, _L("Open new instance") + "\tCtrl+Shift+" + "I", _L("Open a new " SLIC3R_APP_NAME " instance"), [this](wxCommandEvent&) { start_new_slicer(); }, "", nullptr, [this]() {return m_plater != nullptr && wxGetApp().app_config->get("single_instance") != "1"; }, this); } @@ -1570,10 +1570,10 @@ void MainFrame::update_menubar() const bool is_fff = plater()->printer_technology() == ptFFF; - m_changeable_menu_items[miExport] ->SetItemLabel((is_fff ? _L("Export &G-code") : _L("E&xport")) + dots + "\t" + GUI::shortkey_ctrl_prefix() + "G"); - m_changeable_menu_items[miSend] ->SetItemLabel((is_fff ? _L("S&end G-code") : _L("S&end to print")) + dots + "\t" + GUI::shortkey_ctrl_prefix() + "Shift+G"); + m_changeable_menu_items[miExport] ->SetItemLabel((is_fff ? _L("Export &G-code") : _L("E&xport")) + dots + "\tCtrl+G"); + m_changeable_menu_items[miSend] ->SetItemLabel((is_fff ? _L("S&end G-code") : _L("S&end to print")) + dots + "\tCtrl+Shift+G"); - m_changeable_menu_items[miMaterialTab] ->SetItemLabel((is_fff ? _L("&Filament Settings Tab") : _L("Mate&rial Settings Tab")) + "\t" + GUI::shortkey_ctrl_prefix() + "5"); + m_changeable_menu_items[miMaterialTab] ->SetItemLabel((is_fff ? _L("&Filament Settings Tab") : _L("Mate&rial Settings Tab")) + "\tCtrl+5"); m_changeable_menu_items[miMaterialTab] ->SetBitmap(create_scaled_bitmap(is_fff ? "spool" : "resin")); m_changeable_menu_items[miPrinterTab] ->SetBitmap(create_scaled_bitmap(is_fff ? "printer" : "sla_printer")); -- cgit v1.2.3