FIX: record dialog stack and EndModal on system session end
Change-Id: Ie0a7de7cf467f5b9e88881d3894dbb7a0790d500
This commit is contained in:
parent
0f8ad6d5e6
commit
56a61bfcf5
3 changed files with 17 additions and 0 deletions
|
@ -1836,6 +1836,11 @@ bool GUI_App::on_init_inner()
|
||||||
CBaseException::set_log_folder(data_dir());
|
CBaseException::set_log_folder(data_dir());
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
wxGetApp().Bind(wxEVT_QUERY_END_SESSION, [](auto & e) {
|
||||||
|
for (auto d : dialogStack)
|
||||||
|
d->EndModal(1);
|
||||||
|
});
|
||||||
|
|
||||||
std::map<std::string, std::string> extra_headers = get_extra_header();
|
std::map<std::string, std::string> extra_headers = get_extra_header();
|
||||||
Slic3r::Http::set_extra_headers(extra_headers);
|
Slic3r::Http::set_extra_headers(extra_headers);
|
||||||
|
|
||||||
|
|
|
@ -469,5 +469,7 @@ bool generate_image(const std::string &filename, wxImage &image, wxSize img_size
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::vector<wxDialog*> dialogStack;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -104,6 +104,8 @@ struct DpiChangedEvent : public wxEvent {
|
||||||
wxDECLARE_EVENT(EVT_DPI_CHANGED_SLICER, DpiChangedEvent);
|
wxDECLARE_EVENT(EVT_DPI_CHANGED_SLICER, DpiChangedEvent);
|
||||||
#endif // !wxVERSION_EQUAL_OR_GREATER_THAN
|
#endif // !wxVERSION_EQUAL_OR_GREATER_THAN
|
||||||
|
|
||||||
|
extern std::vector<wxDialog*> dialogStack;
|
||||||
|
|
||||||
template<class P> class DPIAware : public P
|
template<class P> class DPIAware : public P
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
@ -222,6 +224,14 @@ public:
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
int ShowModal()
|
||||||
|
{
|
||||||
|
dialogStack.push_back(this);
|
||||||
|
int r = wxDialog::ShowModal();
|
||||||
|
dialogStack.pop_back();
|
||||||
|
return r;
|
||||||
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void on_dpi_changed(const wxRect &suggested_rect) = 0;
|
virtual void on_dpi_changed(const wxRect &suggested_rect) = 0;
|
||||||
virtual void on_sys_color_changed() {};
|
virtual void on_sys_color_changed() {};
|
||||||
|
|
Loading…
Reference in a new issue