mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-06-14 16:02:55 +00:00
2.2.0 dev lxy 1218 (#73)
* Modification: Migrate login interface * Change 'China' to 'Chinese Mainland' * Add: wcp_networktestdialog * Optimization: Main process freezing when connecting devices * Add: wcp_gettimelapseinstance & wcp_defectdetactionconfig * Change: network test level * Optimization: U1 piece-by-piece printing alarm alert * Optimization: Adjust the display order of brands for the selected models * Fix: WebpresetDialog now loads presets synchronously to prevent crashes * Add: wcp_sw_SubscribePageStateChange & wcp_sw_UnsubscribePageStateChange
This commit is contained in:
@@ -1058,6 +1058,46 @@ void MainFrame::init_tabpanel() {
|
||||
}
|
||||
#endif
|
||||
|
||||
// Notify WCP page state change subscribers
|
||||
static int prev_monitored_tab = -1;
|
||||
|
||||
// Send "inactive" to previous tab if leaving a monitored tab
|
||||
if (prev_monitored_tab == tpHome && sel != tpHome) {
|
||||
// Leaving homepage
|
||||
if (m_webview) {
|
||||
wxWebView* home_webview = m_webview->getWebView();
|
||||
wxGetApp().page_state_notify_webview(home_webview, "inactive");
|
||||
}
|
||||
} else if (prev_monitored_tab == tpMonitor && sel != tpMonitor) {
|
||||
// Leaving device page (PrinterWebView)
|
||||
if (m_printer_view) {
|
||||
wxWebView* printer_webview = m_printer_view->get_browser();
|
||||
wxGetApp().page_state_notify_webview(printer_webview, "inactive");
|
||||
}
|
||||
}
|
||||
|
||||
// Send "active" to current tab if entering a monitored tab
|
||||
if (sel == tpHome) {
|
||||
// Entering homepage
|
||||
if (m_webview) {
|
||||
wxWebView* home_webview = m_webview->getWebView();
|
||||
wxGetApp().page_state_notify_webview(home_webview, "active");
|
||||
}
|
||||
prev_monitored_tab = tpHome;
|
||||
} else if (sel == tpMonitor) {
|
||||
// Entering device page (PrinterWebView)
|
||||
if (m_printer_view) {
|
||||
wxWebView* printer_webview = m_printer_view->get_browser();
|
||||
wxGetApp().page_state_notify_webview(printer_webview, "active");
|
||||
}
|
||||
prev_monitored_tab = tpMonitor;
|
||||
} else {
|
||||
// Update prev_monitored_tab only when leaving a monitored tab
|
||||
if (prev_monitored_tab != tpHome && prev_monitored_tab != tpMonitor) {
|
||||
prev_monitored_tab = -1;
|
||||
}
|
||||
}
|
||||
|
||||
if (panel)
|
||||
panel->SetFocus();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user