fix some bug

This commit is contained in:
QIDI TECH
2025-03-24 10:01:22 +08:00
parent 6f9a6b8462
commit 73f7cad391
4 changed files with 72 additions and 72 deletions

View File

@@ -280,10 +280,6 @@ DPIFrame(NULL, wxID_ANY, "", wxDefaultPosition, wxDefaultSize, wxDEFAULT_FRAME_S
//y22
Bind(wxEVT_ICONIZE, [this](wxIconizeEvent& event) {
if (event.IsIconized()) {
if (m_printer_view->GetHasLoadUrl()) {
printer_view_ip = m_printer_view->GetWebIp();
printer_view_url = m_printer_view->GetWeburl();
}
wxString url;
if (m_printer_view->GetNetMode()) {
url = wxString::Format("file://%s/web/qidi/link_missing_connection.html", from_u8(resources_dir()));
@@ -302,7 +298,7 @@ DPIFrame(NULL, wxID_ANY, "", wxDefaultPosition, wxDefaultSize, wxDEFAULT_FRAME_S
}
m_printer_view->Layout();
}
});
});
//FIXME it seems this method is not called on application start-up, at least not on Windows. Why?
// The same applies to wxEVT_CREATE, it is not being called on startup on Windows.
@@ -775,13 +771,8 @@ void MainFrame::init_tabpanel()
//y17
else
select_tab(size_t(0)); // select Plater
//y22
//y22 y24
if (current_selected_tab != 4) {
if (m_printer_view->GetHasLoadUrl()) {
printer_view_ip = m_printer_view->GetWebIp();
printer_view_url = m_printer_view->GetWeburl();
is_net_url = m_printer_view->IsNetUrl();
}
wxString url;
if (m_printer_view->GetNetMode()) {
url = wxString::Format("file://%s/web/qidi/link_missing_connection.html", from_u8(resources_dir()));
@@ -793,12 +784,14 @@ void MainFrame::init_tabpanel()
}
else {
if (!printer_view_ip.empty()) {
if (is_net_url)
m_printer_view->load_net_url(printer_view_url, printer_view_ip);
else
m_printer_view->load_url(printer_view_url);
if(!printer_view_ip.empty()){
if (is_net_url)
m_printer_view->load_net_url(printer_view_url, printer_view_ip);
else
m_printer_view->load_url(printer_view_url);
}
m_printer_view->Layout();
}
m_printer_view->Layout();
}
});

View File

@@ -473,9 +473,13 @@ void PrinterWebView::SetLoginStatus(bool status) {
std::vector<Device> devices;
wxGetApp().set_devices(devices);
#endif
//y3
if (webisNetMode == isNetWeb)
webisNetMode = isDisconnect;
//y3 y24
webisNetMode = isDisconnect;
if (wxGetApp().mainframe) {
wxGetApp().mainframe->is_net_url = false;
wxGetApp().mainframe->printer_view_ip = "";
wxGetApp().mainframe->printer_view_url = "";
}
m_user_head_name = "";
SetPresetChanged(true);
UpdateState();
@@ -999,8 +1003,6 @@ void PrinterWebView::load_disconnect_url(wxString& url)
webisNetMode = isDisconnect;
m_web = url;
m_ip = "";
//y22
has_load_url = false;
m_browser->LoadURL(url);
UpdateState();
}
@@ -1010,8 +1012,6 @@ void PrinterWebView::load_url(wxString &url)
if (m_browser == nullptr || m_web == url)
return;
m_web = url;
//y22
has_load_url = true;
m_browser->LoadURL(url);
webisNetMode = isLocalWeb;
// B55
@@ -1030,6 +1030,12 @@ void PrinterWebView::load_url(wxString &url)
else
button->SetIsSelected(false);
}
//y24
if (wxGetApp().mainframe) {
wxGetApp().mainframe->is_net_url = false;
wxGetApp().mainframe->printer_view_ip = m_ip;
wxGetApp().mainframe->printer_view_url = m_web;
}
UpdateState();
}
void PrinterWebView::load_net_url(wxString& url, wxString& ip)
@@ -1037,8 +1043,6 @@ void PrinterWebView::load_net_url(wxString& url, wxString& ip)
if (m_browser == nullptr || m_web == url)
return;
m_web = url;
//y22
has_load_url = true;
m_ip = ip;
webisNetMode = isNetWeb;
m_browser->LoadURL(url);
@@ -1053,6 +1057,12 @@ void PrinterWebView::load_net_url(wxString& url, wxString& ip)
else
button->SetIsSelected(false);
}
//y24
if (wxGetApp().mainframe) {
wxGetApp().mainframe->is_net_url = true;
wxGetApp().mainframe->printer_view_ip = m_ip;
wxGetApp().mainframe->printer_view_url = m_web;
}
UpdateState();
}
void PrinterWebView::UpdateState()

View File

@@ -141,7 +141,6 @@ public:
//y22
wxString GetWeburl() { return m_web; };
wxString GetWebIp() { return m_ip; };
bool GetHasLoadUrl() { return has_load_url; };
bool IsNetUrl() { return webisNetMode == isNetWeb; };
private:
@@ -190,8 +189,6 @@ private:
std::string m_user_head_name;
bool m_isfluidd_1;
//y22
bool has_load_url;
};
//y3