Replace F5 with Ctrl+Shift+R as shortcut key for reload from disk commands on MAC

This commit is contained in:
enricoturri1966 2020-12-07 08:39:43 +01:00
parent ac05849582
commit 10be5d1361
2 changed files with 30 additions and 2 deletions

View File

@ -118,7 +118,11 @@ void KBShortcutsDialog::fill_shortcuts()
{ ctrl + "Y", L("Redo") }, { ctrl + "Y", L("Redo") },
{ ctrl + "C", L("Copy to clipboard") }, { ctrl + "C", L("Copy to clipboard") },
{ ctrl + "V", L("Paste from clipboard") }, { ctrl + "V", L("Paste from clipboard") },
#ifdef __APPLE__
{ ctrl + "Shift+" + "R", L("Reload plater from disk") },
#else
{ "F5", L("Reload plater from disk") }, { "F5", L("Reload plater from disk") },
#endif // __APPLE__
{ ctrl + "F", L("Search") }, { ctrl + "F", L("Search") },
// Window // Window
{ ctrl + "1", L("Select Plater Tab") }, { ctrl + "1", L("Select Plater Tab") },
@ -201,6 +205,18 @@ void KBShortcutsDialog::fill_shortcuts()
m_full_shortcuts.push_back(std::make_pair(_L("Gizmos"), gizmos_shortcuts)); m_full_shortcuts.push_back(std::make_pair(_L("Gizmos"), gizmos_shortcuts));
} }
else {
Shortcuts commands_shortcuts = {
{ ctrl + "O", L("Open a G-code file") },
#ifdef __APPLE__
{ ctrl + "Shift+" + "R", L("Reload the plater from disk") },
#else
{ "F5", L("Reload plater from disk") },
#endif // __APPLE__
};
m_full_shortcuts.push_back(std::make_pair(_L("Commands"), commands_shortcuts));
}
Shortcuts preview_shortcuts = { Shortcuts preview_shortcuts = {
#if ENABLE_ARROW_KEYS_WITH_SLIDERS #if ENABLE_ARROW_KEYS_WITH_SLIDERS

View File

@ -1018,11 +1018,11 @@ void MainFrame::init_menubar_as_editor()
append_submenu(fileMenu, import_menu, wxID_ANY, _L("&Import"), ""); append_submenu(fileMenu, import_menu, wxID_ANY, _L("&Import"), "");
wxMenu* export_menu = new wxMenu(); wxMenu* export_menu = new wxMenu();
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"), 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](wxCommandEvent&) { if (m_plater) m_plater->export_gcode(false); }, "export_gcode", nullptr,
[this](){return can_export_gcode(); }, this); [this](){return can_export_gcode(); }, this);
m_changeable_menu_items.push_back(item_export_gcode); 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 +"\tCtrl+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](wxCommandEvent&) { if (m_plater) m_plater->send_gcode(); }, "export_gcode", nullptr,
[this](){return can_send_gcode(); }, this); [this](){return can_send_gcode(); }, this);
m_changeable_menu_items.push_back(item_send_gcode); m_changeable_menu_items.push_back(item_send_gcode);
@ -1140,9 +1140,15 @@ void MainFrame::init_menubar_as_editor()
"paste_menu", nullptr, [this](){return m_plater->can_paste_from_clipboard(); }, this); "paste_menu", nullptr, [this](){return m_plater->can_paste_from_clipboard(); }, this);
editMenu->AppendSeparator(); editMenu->AppendSeparator();
#ifdef __APPLE__
append_menu_item(editMenu, wxID_ANY, _L("Re&load from disk") + dots + "\tCtrl+Shift+R",
_L("Reload the plater from disk"), [this](wxCommandEvent&) { m_plater->reload_all_from_disk(); },
"", nullptr, [this]() {return !m_plater->model().objects.empty(); }, this);
#else
append_menu_item(editMenu, wxID_ANY, _L("Re&load from disk") + sep + "F5", append_menu_item(editMenu, wxID_ANY, _L("Re&load from disk") + sep + "F5",
_L("Reload the plater from disk"), [this](wxCommandEvent&) { m_plater->reload_all_from_disk(); }, _L("Reload the plater from disk"), [this](wxCommandEvent&) { m_plater->reload_all_from_disk(); },
"", nullptr, [this]() {return !m_plater->model().objects.empty(); }, this); "", nullptr, [this]() {return !m_plater->model().objects.empty(); }, this);
#endif // __APPLE__
editMenu->AppendSeparator(); editMenu->AppendSeparator();
append_menu_item(editMenu, wxID_ANY, _L("Searc&h") + "\tCtrl+F", append_menu_item(editMenu, wxID_ANY, _L("Searc&h") + "\tCtrl+F",
@ -1242,9 +1248,15 @@ void MainFrame::init_menubar_as_gcodeviewer()
append_menu_item(fileMenu, wxID_ANY, _L("&Open G-code") + dots + "\tCtrl+O", _L("Open a G-code file"), append_menu_item(fileMenu, wxID_ANY, _L("&Open G-code") + dots + "\tCtrl+O", _L("Open a G-code file"),
[this](wxCommandEvent&) { if (m_plater != nullptr) m_plater->load_gcode(); }, "open", nullptr, [this](wxCommandEvent&) { if (m_plater != nullptr) m_plater->load_gcode(); }, "open", nullptr,
[this]() {return m_plater != nullptr; }, this); [this]() {return m_plater != nullptr; }, this);
#ifdef __APPLE__
append_menu_item(fileMenu, wxID_ANY, _L("Re&load from disk") + dots + "\tCtrl+Shift+R",
_L("Reload the plater from disk"), [this](wxCommandEvent&) { m_plater->reload_gcode_from_disk(); },
"", nullptr, [this]() { return !m_plater->get_last_loaded_gcode().empty(); }, this);
#else
append_menu_item(fileMenu, wxID_ANY, _L("Re&load from disk") + sep + "F5", append_menu_item(fileMenu, wxID_ANY, _L("Re&load from disk") + sep + "F5",
_L("Reload the plater from disk"), [this](wxCommandEvent&) { m_plater->reload_gcode_from_disk(); }, _L("Reload the plater from disk"), [this](wxCommandEvent&) { m_plater->reload_gcode_from_disk(); },
"", nullptr, [this]() { return !m_plater->get_last_loaded_gcode().empty(); }, this); "", nullptr, [this]() { return !m_plater->get_last_loaded_gcode().empty(); }, this);
#endif // __APPLE__
fileMenu->AppendSeparator(); fileMenu->AppendSeparator();
append_menu_item(fileMenu, wxID_ANY, _L("Export &toolpaths as OBJ") + dots, _L("Export toolpaths as OBJ"), append_menu_item(fileMenu, wxID_ANY, _L("Export &toolpaths as OBJ") + dots, _L("Export toolpaths as OBJ"),
[this](wxCommandEvent&) { if (m_plater != nullptr) m_plater->export_toolpaths_to_obj(); }, "export_plater", nullptr, [this](wxCommandEvent&) { if (m_plater != nullptr) m_plater->export_toolpaths_to_obj(); }, "export_plater", nullptr,