mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-12-01 09:22:58 -05:00
fix: revert native device tab flag (#17162)
This commit is contained in:
1 parent
d9f6b69506
commit
fcab66ca9e
8 files changed
+20
-78
No files matched your search
@@ -1660,14 +1660,6 @@ void MainFrame::show_device(bool should_use_native) {
|
||||
// get it — otherwise a Bambu user sees two Device tabs, one of them permanently empty.
|
||||
const bool want_web_device_tab = use_printer_agents && wxGetApp().preset_bundle != nullptr &&
|
||||
!wxGetApp().preset_bundle->use_bbl_device_tab();
|
||||
// An agent whose printers have nothing for the native Device and Calibration tabs leaves the web page as the only Device tab
|
||||
bool want_native_device_tabs = true;
|
||||
if (want_web_device_tab) {
|
||||
const std::string agent_id = wxGetApp().resolve_printer_agent_id(
|
||||
wxGetApp().preset_bundle->printers.get_edited_preset().config.opt_string("printer_agent"));
|
||||
const PrinterAgentInfo* agent_info = NetworkAgentFactory::get_printer_agent_info(agent_id);
|
||||
want_native_device_tabs = agent_info == nullptr || agent_info->native_device_tab;
|
||||
}
|
||||
|
||||
// Remove the extra page before switching to any layout that shouldn't have it.
|
||||
if (!want_web_device_tab) {
|
||||
@@ -1678,16 +1670,7 @@ void MainFrame::show_device(bool should_use_native) {
|
||||
}
|
||||
|
||||
if (use_printer_agents) {
|
||||
if (!want_native_device_tabs) {
|
||||
if ((idx = m_tabpanel->FindPage(m_monitor_page)) != wxNOT_FOUND) {
|
||||
m_monitor_page->Show(false);
|
||||
m_tabpanel->RemovePage(idx);
|
||||
}
|
||||
if ((idx = m_tabpanel->FindPage(m_calibration_page)) != wxNOT_FOUND) {
|
||||
m_calibration_page->Show(false);
|
||||
m_tabpanel->RemovePage(idx);
|
||||
}
|
||||
} else if (!m_monitor_page->in_book()) {
|
||||
if (!m_monitor_page->in_book()) {
|
||||
if ((idx = m_tabpanel->FindPage(m_printer_view_page)) != wxNOT_FOUND) {
|
||||
m_printer_view_page->Show(false);
|
||||
m_tabpanel->RemovePage(idx);
|
||||
@@ -1707,29 +1690,20 @@ void MainFrame::show_device(bool should_use_native) {
|
||||
TAB_ID_MULTI_DEVICE, m_multi_machine_page, _L("Multi-device"), "tab_multi_active");
|
||||
}
|
||||
}
|
||||
if (want_native_device_tabs && !m_calibration_page->in_book()) {
|
||||
if (!m_calibration_page->in_book()) {
|
||||
m_calibration_page->Show(false);
|
||||
m_tabpanel->InsertPage(m_tabpanel->PositionAfter({TAB_ID_PROJECT}), TAB_ID_CALIBRATION, m_calibration_page,
|
||||
_L("Calibration"), "tab_calibration_active");
|
||||
}
|
||||
|
||||
if (want_web_device_tab) {
|
||||
// Without the native Device tab the web page takes its id, so every way to the Device tab leads here
|
||||
const char* id = want_native_device_tabs ? TAB_ID_MONITOR_WEB : TAB_ID_MONITOR;
|
||||
const wxString label = want_native_device_tabs ? _L("Device (Web)") : _L("Device");
|
||||
idx = m_tabpanel->FindPage(m_printer_view_page);
|
||||
if (idx != wxNOT_FOUND && m_tabpanel->FindPageByName(id) != idx) {
|
||||
if ((idx = m_tabpanel->FindPage(m_printer_view_page)) == wxNOT_FOUND) {
|
||||
m_printer_view_page->Show(false);
|
||||
m_tabpanel->RemovePage(idx);
|
||||
idx = wxNOT_FOUND;
|
||||
}
|
||||
if (idx == wxNOT_FOUND) {
|
||||
m_printer_view_page->Show(false);
|
||||
// Immediately right of the native Device tab, or of Preview without it, not at the end of the tab bar.
|
||||
m_tabpanel->InsertPage(m_tabpanel->PositionAfter({TAB_ID_MONITOR, TAB_ID_PREVIEW}), id, m_printer_view_page, label,
|
||||
"tab_monitor_active");
|
||||
// Immediately right of the native Device tab, not at the end of the tab bar.
|
||||
m_tabpanel->InsertPage(m_tabpanel->PositionAfter({TAB_ID_MONITOR}), TAB_ID_MONITOR_WEB,
|
||||
m_printer_view_page, _L("Device (Web)"), "tab_monitor_active");
|
||||
} else {
|
||||
m_tabpanel->SetPageText(idx, label);
|
||||
m_tabpanel->SetPageText(idx, _L("Device (Web)"));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user