mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-13 18:35:52 +08:00
Extract "About" menu item creation to a dedicated function
This commit is contained in:
parent
eac0fa6271
commit
e9592a9b30
@ -1155,6 +1155,16 @@ static const wxString sep = " - ";
|
||||
static const wxString sep_space = "";
|
||||
#endif
|
||||
|
||||
static void append_about_menu_item(wxMenu* target_menu)
|
||||
{
|
||||
if (wxGetApp().is_editor())
|
||||
append_menu_item(target_menu, wxID_ANY, wxString::Format(_L("&About %s"), SLIC3R_APP_NAME), _L("Show about dialog"),
|
||||
[](wxCommandEvent&) { Slic3r::GUI::about(); });
|
||||
else
|
||||
append_menu_item(target_menu, wxID_ANY, wxString::Format(_L("&About %s"), GCODEVIEWER_APP_NAME), _L("Show about dialog"),
|
||||
[](wxCommandEvent&) { Slic3r::GUI::about(); });
|
||||
}
|
||||
|
||||
static wxMenu* generate_help_menu()
|
||||
{
|
||||
wxMenu* helpMenu = new wxMenu();
|
||||
@ -1189,13 +1199,8 @@ static wxMenu* generate_help_menu()
|
||||
[](wxCommandEvent&) { Slic3r::GUI::desktop_open_datadir_folder(); });
|
||||
append_menu_item(helpMenu, wxID_ANY, _L("Report an I&ssue"), wxString::Format(_L("Report an issue on %s"), SLIC3R_APP_NAME),
|
||||
[](wxCommandEvent&) { wxGetApp().open_browser_with_warning_dialog("https://github.com/prusa3d/slic3r/issues/new", nullptr, false); });
|
||||
if (wxGetApp().is_editor())
|
||||
append_menu_item(helpMenu, wxID_ANY, wxString::Format(_L("&About %s"), SLIC3R_APP_NAME), _L("Show about dialog"),
|
||||
[](wxCommandEvent&) { Slic3r::GUI::about(); });
|
||||
else
|
||||
append_menu_item(helpMenu, wxID_ANY, wxString::Format(_L("&About %s"), GCODEVIEWER_APP_NAME), _L("Show about dialog"),
|
||||
[](wxCommandEvent&) { Slic3r::GUI::about(); });
|
||||
append_menu_item(helpMenu, wxID_ANY, _L("Show Tip of the Day")
|
||||
append_about_menu_item(helpMenu);
|
||||
append_menu_item(helpMenu, wxID_ANY, _L("Show Tip of the Day")
|
||||
#if 0//debug
|
||||
+ "\tCtrl+Shift+T"
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user