Skip to content

Commit

Permalink
Fix for #12874 - Ctrl-P does not open preferences in 2.8.0-alpha5
Browse files Browse the repository at this point in the history
  • Loading branch information
YuSanka authored and lukasmatena committed Jun 24, 2024
1 parent 1c0cb70 commit 7519142
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
9 changes: 4 additions & 5 deletions src/slic3r/GUI/GUI_App.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2598,7 +2598,7 @@ void GUI_App::update_mode()
plater()->canvas3D()->update_gizmos_on_off_state();
}

wxMenu* GUI_App::get_config_menu()
wxMenu* GUI_App::get_config_menu(MainFrame* main_frame)
{
auto local_menu = new wxMenu();
wxWindowID config_id_base = wxWindow::NewControlId(int(ConfigMenuCnt));
Expand All @@ -2618,13 +2618,12 @@ wxMenu* GUI_App::get_config_menu()
#endif //(__linux__) && defined(SLIC3R_DESKTOP_INTEGRATION)
local_menu->AppendSeparator();
}
local_menu->Append(config_id_base + ConfigMenuPreferences, _L("&Preferences") + dots +
#ifdef __APPLE__
"\tCtrl+,",
local_menu->Append(config_id_base + ConfigMenuPreferences, _L("&Preferences") + dots + "\tCtrl+,", _L("Application preferences"));
#else
"\tCtrl+P",
append_menu_item(local_menu, config_id_base + ConfigMenuPreferences, _L("&Preferences") + "\tCtrl+P", _L("Application preferences"),
[](wxCommandEvent&) { wxGetApp().open_preferences(); }, "", nullptr, []() {return true; }, main_frame);
#endif
_L("Application preferences"));

local_menu->AppendSeparator();
local_menu->Append(config_id_base + ConfigMenuLanguage, _L("&Language"));
Expand Down
2 changes: 1 addition & 1 deletion src/slic3r/GUI/GUI_App.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ class GUI_App : public wxApp
bool save_mode(const /*ConfigOptionMode*/int mode) ;
void update_mode();

wxMenu* get_config_menu();
wxMenu* get_config_menu(MainFrame* main_frame);
bool has_unsaved_preset_changes() const;
bool has_current_preset_changes() const;
void update_saved_preset_from_current_preset();
Expand Down
6 changes: 3 additions & 3 deletions src/slic3r/GUI/MainFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1636,7 +1636,7 @@ void MainFrame::init_menubar_as_editor()
if (viewMenu)
m_bar_menus.AppendMenuItem(viewMenu, _L("&View"));

m_bar_menus.AppendMenuItem(wxGetApp().get_config_menu(), _L("&Configuration"));
m_bar_menus.AppendMenuItem(wxGetApp().get_config_menu(this), _L("&Configuration"));

m_bar_menus.AppendMenuSeparaorItem();

Expand All @@ -1654,7 +1654,7 @@ void MainFrame::init_menubar_as_editor()
m_menubar->Append(windowMenu, _L("&Window"));
if (viewMenu) m_menubar->Append(viewMenu, _L("&View"));
// Add additional menus from C++
m_menubar->Append(wxGetApp().get_config_menu(), _L("&Configuration"));
m_menubar->Append(wxGetApp().get_config_menu(this), _L("&Configuration"));
m_menubar->Append(helpMenu, _L("&Help"));

SetMenuBar(m_menubar);
Expand Down Expand Up @@ -1747,7 +1747,7 @@ void MainFrame::init_menubar_as_gcodeviewer()
m_menubar->Append(fileMenu, _L("&File"));
if (viewMenu != nullptr) m_menubar->Append(viewMenu, _L("&View"));
// Add additional menus from C++
m_menubar->Append(wxGetApp().get_config_menu(), _L("&Configuration"));
m_menubar->Append(wxGetApp().get_config_menu(this), _L("&Configuration"));
m_menubar->Append(helpMenu, _L("&Help"));
SetMenuBar(m_menubar);

Expand Down

0 comments on commit 7519142

Please sign in to comment.