>From c7f4db82284018df7d175f32317fc674b2159ed4 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 5 Dec 2014 23:50:09 +0100 Subject: [PATCH 2/2] Don't use "untimely" warnings and errors. wxMessageBox() can be used even if there is no top level window to use as its parent, so don't complain about this, but just use it without parent in the wxWidgets-based warning_alert() and hobsons_choice_alert() implementations. --- alert_wx.cpp | 16 ++-------------- 1 files changed, 2 insertions(+), 14 deletions(-) diff --git a/alert_wx.cpp b/alert_wx.cpp index 69c6b70..61c024e 100644 --- a/alert_wx.cpp +++ b/alert_wx.cpp @@ -70,14 +70,7 @@ void status_alert(std::string const& s) void warning_alert(std::string const& s) { - if(wxTheApp && wxTheApp->GetTopWindow()) - { - wxMessageBox(s, "Warning", wxOK, wxTheApp->GetTopWindow()); - } - else - { - safely_show_message("Untimely warning:\n" + s); - } + wxMessageBox(s, "Warning", wxOK, wxTheApp ? wxTheApp->GetTopWindow() : 0); } /// It seems silly to offer an option that should never be declined, @@ -91,15 +84,10 @@ void warning_alert(std::string const& s) void hobsons_choice_alert(std::string const& s) { wxWindow* w = 0; - if(wxTheApp && wxTheApp->GetTopWindow()) + if(wxTheApp) { w = wxTheApp->GetTopWindow(); } - else - { - safely_show_message("Untimely error:\n" + s); - throw hobsons_choice_exception(); - } if(configurable_settings::instance().offer_hobsons_choice()) { -- 1.7.9