Fixed show "Physical Printer" tab in TopBar after adding of the physical printer

This commit is contained in:
YuSanka 2024-04-04 14:32:07 +02:00 committed by Lukas Matena
parent a672b9587c
commit 22d3ad6590
2 changed files with 5 additions and 5 deletions

View File

@ -887,7 +887,7 @@ void MainFrame::add_printer_webview_tab(const wxString& url)
}
m_printer_webview_added = true;
// 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->load_default_url_delayed();
}

View File

@ -380,8 +380,10 @@ void PresetComboBox::edit_physical_printer()
void PresetComboBox::add_physical_printer()
{
if (PhysicalPrinterDialog(this->GetParent(), wxEmptyString).ShowModal() == wxID_OK)
if (PhysicalPrinterDialog(this->GetParent(), wxEmptyString).ShowModal() == wxID_OK) {
update();
wxGetApp().show_printer_webview_tab();
}
}
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"), "",
[this](wxCommandEvent&) {
PhysicalPrinterDialog dlg(this->GetParent(), wxEmptyString);
if (dlg.ShowModal() == wxID_OK)
update();
add_physical_printer();
}, "edit_uni", menu, []() { return true; }, wxGetApp().plater());
wxGetApp().plater()->PopupMenu(menu);