Merge pull request #199 from Snapmaker/dev_2.3.0_alves

fix modify machine and switch page bug
This commit is contained in:
Alves
2026-03-13 12:26:05 +08:00
committed by GitHub
4 changed files with 6 additions and 14 deletions

View File

@@ -2016,8 +2016,8 @@ void GUI_App::init_app_config()
std::time_t t = std::time(0);
std::tm * now_time = std::localtime(&t);
std::stringstream buf;
buf << std::put_time(now_time, "debug_%a_%b_%d_%H_%M_%S_");
buf << get_current_pid() << ".log";
buf << std::put_time(now_time, "%Y-%m-%d-%H-%M-%S");
buf << ".log";
std::string log_filename = buf.str();
#if !BBL_RELEASE_TO_PUBLIC
set_log_path_and_level(log_filename, 5);

View File

@@ -1155,10 +1155,11 @@ void MainFrame::init_tabpanel() {
Bind(EVT_LOAD_PRINTER_URL, [this](LoadPrinterViewEvent &evt) {
wxString url = evt.GetString();
wxString key = evt.GetAPIkey();
m_printer_view->Show();
m_printer_view->load_url(url, key);
});
m_printer_view->Hide();
if (wxGetApp().is_enable_multi_machine()) {
m_multi_machine = new MultiMachinePage(m_tabpanel, wxID_ANY, wxDefaultPosition, wxDefaultSize);
m_multi_machine->SetBackgroundColour(*wxWHITE);
@@ -1196,7 +1197,7 @@ void MainFrame::show_device(bool bBBLPrinter) {
return;
// Remove printer view
if ((idx = m_tabpanel->FindPage(m_printer_view)) != wxNOT_FOUND) {
//m_printer_view->Show(false);
m_printer_view->Show(false);
m_tabpanel->RemovePage(idx);
}
@@ -1253,12 +1254,10 @@ void MainFrame::show_device(bool bBBLPrinter) {
Bind(EVT_LOAD_PRINTER_URL, [this](LoadPrinterViewEvent& evt) {
wxString url = evt.GetString();
wxString key = evt.GetAPIkey();
// select_tab(MainFrame::tpMonitor);
m_printer_view->Show();
m_printer_view->load_url(url, key);
});
}
//m_printer_view->Show(false);
m_printer_view->Show(false);
m_tabpanel->InsertPage(tpMonitor, m_printer_view, _L("Device"), std::string("tab_monitor_active"),
std::string("tab_monitor_active"));
}

View File

@@ -69,8 +69,6 @@ PrinterWebView::~PrinterWebView()
void PrinterWebView::load_url(wxString& url, wxString apikey)
{
// this->Show();
// this->Raise();
if (m_browser == nullptr)
return;
m_apikey = apikey;

View File

@@ -253,12 +253,7 @@ void WebViewPanel::reload() {
void WebViewPanel::load_url(wxString& url)
{
this->Show();
this->Raise();
/*m_url->SetLabelText(url);
if (wxGetApp().get_mode() == comDevelop)
wxLogMessage(m_url->GetValue());*/
m_browser->LoadURL(url);
wxGetApp().fltviews().add_webview_panel(this, url);