From 4bcc109ce13932bfd22c019412910e82b0e6e4f6 Mon Sep 17 00:00:00 2001 From: yw4z Date: Sat, 18 May 2024 15:10:46 +0300 Subject: [PATCH] Add "Add Models" to plate and background context menu (#5319) * Add "Add Model" on plate and background context menu * Fix icon usage if its not windows os * Update item name with an existed translation "Add models" --- src/slic3r/GUI/GUI_Factories.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/slic3r/GUI/GUI_Factories.cpp b/src/slic3r/GUI/GUI_Factories.cpp index 30bbbd85944..20d9ea3a3bd 100644 --- a/src/slic3r/GUI/GUI_Factories.cpp +++ b/src/slic3r/GUI/GUI_Factories.cpp @@ -1241,11 +1241,17 @@ void MenuFactory::create_default_menu() []() {return true; }, m_parent); append_submenu(&m_default_menu, sub_menu_handy, wxID_ANY, _L("Add Handy models"), "", "menu_add_part", []() {return true; }, m_parent); + append_menu_item(&m_default_menu, wxID_ANY, _L("Add Models"), "", // ORCA: Add Models + [](wxCommandEvent&) { plater()->add_file(); }, "menu_add_part", &m_default_menu, + []() {return wxGetApp().plater()->can_add_model(); }, m_parent); #else append_submenu(&m_default_menu, sub_menu_primitives, wxID_ANY, _L("Add Primitive"), "", "", []() {return true; }, m_parent); append_submenu(&m_default_menu, sub_menu_handy, wxID_ANY, _L("Add Handy models"), "", "", []() {return true; }, m_parent); + append_menu_item(&m_default_menu, wxID_ANY, _L("Add Models"), "", // ORCA: Add Models + [](wxCommandEvent&) { plater()->add_file(); }, "", &m_default_menu, + []() {return wxGetApp().plater()->can_add_model(); }, m_parent); #endif m_default_menu.AppendSeparator(); @@ -1547,11 +1553,17 @@ void MenuFactory::create_plate_menu() []() {return true; }, m_parent); append_submenu(menu, sub_menu_handy, wxID_ANY, _L("Add Handy models"), "", "menu_add_part", []() {return true; }, m_parent); + append_menu_item(menu, wxID_ANY, _L("Add Models"), "", // ORCA: Add Models + [](wxCommandEvent&) { plater()->add_file(); }, "menu_add_part", menu, + []() {return wxGetApp().plater()->can_add_model(); }, m_parent); #else append_submenu(menu, sub_menu_primitives, wxID_ANY, _L("Add Primitive"), "", "", []() {return true; }, m_parent); append_submenu(menu, sub_menu_handy, wxID_ANY, _L("Add Handy models"), "", "", []() {return true; }, m_parent); + append_menu_item(menu, wxID_ANY, _L("Add Models"), "", // ORCA: Add Models + [](wxCommandEvent&) { plater()->add_file(); }, "", menu, + []() {return wxGetApp().plater()->can_add_model(); }, m_parent); #endif