diff options
author | YuSanka <yusanka@gmail.com> | 2018-04-30 17:30:23 +0300 |
---|---|---|
committer | YuSanka <yusanka@gmail.com> | 2018-04-30 17:30:23 +0300 |
commit | 6d34db352d6d14bb71654a4291d02171eb40b3db (patch) | |
tree | 9dc94c211955116747a6c833d5c77573e05c6f20 /xs/src/slic3r/GUI/GUI.cpp | |
parent | 2d4cac00189aa75cf75637d0345a5befb2d80b8a (diff) | |
parent | 3c13c4f10301912c1459620fecc2efc8074c8ea2 (diff) |
Merge branch 'updating' of https://github.com/prusa3d/Slic3r into updating
Diffstat (limited to 'xs/src/slic3r/GUI/GUI.cpp')
-rw-r--r-- | xs/src/slic3r/GUI/GUI.cpp | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/xs/src/slic3r/GUI/GUI.cpp b/xs/src/slic3r/GUI/GUI.cpp index d743d8708..8d8818126 100644 --- a/xs/src/slic3r/GUI/GUI.cpp +++ b/xs/src/slic3r/GUI/GUI.cpp @@ -50,6 +50,7 @@ #include "AppConfig.hpp" #include "ConfigSnapshotDialog.hpp" #include "Utils.hpp" +#include "MsgDialog.hpp" #include "ConfigWizard.hpp" #include "Preferences.hpp" #include "PresetBundle.hpp" @@ -668,21 +669,26 @@ void add_created_tab(Tab* panel) g_wxTabPanel->AddPage(panel, panel->title()); } -void show_error(wxWindow* parent, const wxString& message){ - auto msg_wingow = new wxMessageDialog(parent, message, _(L("Error")), wxOK | wxICON_ERROR); - msg_wingow->ShowModal(); +void show_error(wxWindow* parent, const wxString& message) { + ErrorDialog msg(parent, message); + msg.ShowModal(); +} + +void show_error_id(int id, const std::string& message) { + auto *parent = id != 0 ? wxWindow::FindWindowById(id) : nullptr; + show_error(parent, message); } void show_info(wxWindow* parent, const wxString& message, const wxString& title){ - auto msg_wingow = new wxMessageDialog(parent, message, title.empty() ? _(L("Notice")) : title, wxOK | wxICON_INFORMATION); - msg_wingow->ShowModal(); + wxMessageDialog msg_wingow(parent, message, title.empty() ? _(L("Notice")) : title, wxOK | wxICON_INFORMATION); + msg_wingow.ShowModal(); } void warning_catcher(wxWindow* parent, const wxString& message){ if (message == _(L("GLUquadricObjPtr | Attempt to free unreferenced scalar")) ) return; - auto msg = new wxMessageDialog(parent, message, _(L("Warning")), wxOK | wxICON_WARNING); - msg->ShowModal(); + wxMessageDialog msg(parent, message, _(L("Warning")), wxOK | wxICON_WARNING); + msg.ShowModal(); } wxApp* get_app(){ |