Merge branch 'ys_spe2210_11_16':

- SPE-2210
- SPE-2211
- missing menu item in GCodeViewer
- showing of Physical Printer tab

None of the issues were in a public release.
This commit is contained in:
Lukas Matena 2024-04-08 12:31:19 +02:00
commit f769db569f
3 changed files with 13 additions and 9 deletions

View File

@ -887,7 +887,7 @@ void MainFrame::add_printer_webview_tab(const wxString& url)
} }
m_printer_webview_added = true; m_printer_webview_added = true;
// add as the last (rightmost) panel // add as the last (rightmost) panel
dynamic_cast<TopBar*>(m_tabpanel)->AddPage(m_printer_webview, L"Physical Printer", "", false); dynamic_cast<TopBar*>(m_tabpanel)->AddPage(m_printer_webview, _L("Physical Printer"), "", false);
m_printer_webview->set_default_url(url); m_printer_webview->set_default_url(url);
m_printer_webview->load_default_url_delayed(); m_printer_webview->load_default_url_delayed();
} }
@ -1187,8 +1187,10 @@ void MainFrame::on_sys_color_changed()
for (auto tab : wxGetApp().tabs_list) for (auto tab : wxGetApp().tabs_list)
tab->sys_color_changed(); tab->sys_color_changed();
m_connect_webview->sys_color_changed(); if (m_connect_webview)
m_printer_webview->sys_color_changed(); m_connect_webview->sys_color_changed();
if (m_printer_webview)
m_printer_webview->sys_color_changed();
MenuFactory::sys_color_changed(m_menubar); MenuFactory::sys_color_changed(m_menubar);
@ -1749,7 +1751,7 @@ void MainFrame::init_menubar_as_gcodeviewer()
m_menubar->Append(fileMenu, _L("&File")); m_menubar->Append(fileMenu, _L("&File"));
if (viewMenu != nullptr) m_menubar->Append(viewMenu, _L("&View")); if (viewMenu != nullptr) m_menubar->Append(viewMenu, _L("&View"));
// Add additional menus from C++ // Add additional menus from C++
// wxGetApp().add_config_menu(m_menubar); m_menubar->Append(wxGetApp().get_config_menu(), _L("&Configuration"));
m_menubar->Append(helpMenu, _L("&Help")); m_menubar->Append(helpMenu, _L("&Help"));
SetMenuBar(m_menubar); SetMenuBar(m_menubar);

View File

@ -380,8 +380,10 @@ void PresetComboBox::edit_physical_printer()
void PresetComboBox::add_physical_printer() void PresetComboBox::add_physical_printer()
{ {
if (PhysicalPrinterDialog(this->GetParent(), wxEmptyString).ShowModal() == wxID_OK) if (PhysicalPrinterDialog(this->GetParent(), wxEmptyString).ShowModal() == wxID_OK) {
update(); update();
wxGetApp().show_printer_webview_tab();
}
} }
void PresetComboBox::open_physical_printer_url() void PresetComboBox::open_physical_printer_url()
@ -782,9 +784,7 @@ void PlaterPresetComboBox::show_add_menu()
append_menu_item(menu, wxID_ANY, _L("Add physical printer"), "", append_menu_item(menu, wxID_ANY, _L("Add physical printer"), "",
[this](wxCommandEvent&) { [this](wxCommandEvent&) {
PhysicalPrinterDialog dlg(this->GetParent(), wxEmptyString); add_physical_printer();
if (dlg.ShowModal() == wxID_OK)
update();
}, "edit_uni", menu, []() { return true; }, wxGetApp().plater()); }, "edit_uni", menu, []() { return true; }, wxGetApp().plater());
wxGetApp().plater()->PopupMenu(menu); wxGetApp().plater()->PopupMenu(menu);

View File

@ -493,7 +493,9 @@ void TopBarItemsCtrl::RemovePage(size_t n)
ScalableButton* btn = m_pageButtons[n]; ScalableButton* btn = m_pageButtons[n];
m_pageButtons.erase(m_pageButtons.begin() + n); m_pageButtons.erase(m_pageButtons.begin() + n);
m_buttons_sizer->Remove(n); m_buttons_sizer->Remove(n);
btn->Reparent(nullptr);
// Under OSX call of btn->Reparent(nullptr) causes a crash, so as a workaround use RemoveChild() instead
this->RemoveChild(btn);
btn->Destroy(); btn->Destroy();
m_sizer->Layout(); m_sizer->Layout();
} }