mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-12 04:49:01 +08:00
SPE-2681: Safely close app in webview callback.
+ handle unused event from Printables.
This commit is contained in:
parent
fe108a4d68
commit
79afab4467
@ -595,9 +595,10 @@ void WebViewPanel::sys_color_changed()
|
|||||||
void WebViewPanel::on_app_quit_event(const std::string& message_data)
|
void WebViewPanel::on_app_quit_event(const std::string& message_data)
|
||||||
{
|
{
|
||||||
// MacOS only suplement for cmd+Q
|
// MacOS only suplement for cmd+Q
|
||||||
wxGetApp().Exit();
|
if (wxGetApp().mainframe) {
|
||||||
|
wxGetApp().mainframe->Close();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void WebViewPanel::on_app_minimize_event(const std::string& message_data)
|
void WebViewPanel::on_app_minimize_event(const std::string& message_data)
|
||||||
{
|
{
|
||||||
// MacOS only suplement for cmd+M
|
// MacOS only suplement for cmd+M
|
||||||
@ -1150,6 +1151,7 @@ PrintablesWebViewPanel::PrintablesWebViewPanel(wxWindow* parent)
|
|||||||
m_events["reloadHomePage"] = std::bind(&PrintablesWebViewPanel::on_reload_event, this, std::placeholders::_1);
|
m_events["reloadHomePage"] = std::bind(&PrintablesWebViewPanel::on_reload_event, this, std::placeholders::_1);
|
||||||
m_events["appQuit"] = std::bind(&WebViewPanel::on_app_quit_event, this, std::placeholders::_1);
|
m_events["appQuit"] = std::bind(&WebViewPanel::on_app_quit_event, this, std::placeholders::_1);
|
||||||
m_events["appMinimize"] = std::bind(&WebViewPanel::on_app_minimize_event, this, std::placeholders::_1);
|
m_events["appMinimize"] = std::bind(&WebViewPanel::on_app_minimize_event, this, std::placeholders::_1);
|
||||||
|
m_events["ready"] = std::bind(&PrintablesWebViewPanel::on_printables_event_dummy, this, std::placeholders::_1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PrintablesWebViewPanel::handle_message(const std::string& message)
|
void PrintablesWebViewPanel::handle_message(const std::string& message)
|
||||||
|
@ -210,6 +210,7 @@ protected:
|
|||||||
void define_css() override;
|
void define_css() override;
|
||||||
private:
|
private:
|
||||||
void handle_message(const std::string& message);
|
void handle_message(const std::string& message);
|
||||||
|
void on_printables_event_dummy(const std::string& message_data) {}
|
||||||
void on_printables_event_access_token_expired(const std::string& message_data);
|
void on_printables_event_access_token_expired(const std::string& message_data);
|
||||||
void on_reload_event(const std::string& message_data);
|
void on_reload_event(const std::string& message_data);
|
||||||
void on_printables_event_print_gcode(const std::string& message_data);
|
void on_printables_event_print_gcode(const std::string& message_data);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user