summaryrefslogtreecommitdiff
path: root/RealtimeSync/application.cpp
diff options
context:
space:
mode:
authorDaniel Wilhelm <daniel@wili.li>2014-04-18 17:15:39 +0200
committerDaniel Wilhelm <daniel@wili.li>2014-04-18 17:15:39 +0200
commitd2854834e18443876c8f75e0a7f3b88d1d549fc4 (patch)
treee967b628081e50abc7c34cd264e6586271c7e728 /RealtimeSync/application.cpp
parent4.1 (diff)
downloadFreeFileSync-d2854834e18443876c8f75e0a7f3b88d1d549fc4.tar.gz
FreeFileSync-d2854834e18443876c8f75e0a7f3b88d1d549fc4.tar.bz2
FreeFileSync-d2854834e18443876c8f75e0a7f3b88d1d549fc4.zip
4.2
Diffstat (limited to 'RealtimeSync/application.cpp')
-rw-r--r--RealtimeSync/application.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/RealtimeSync/application.cpp b/RealtimeSync/application.cpp
index 55c2e9c3..2f1a8848 100644
--- a/RealtimeSync/application.cpp
+++ b/RealtimeSync/application.cpp
@@ -26,6 +26,7 @@ using namespace zen;
IMPLEMENT_APP(Application);
+
bool Application::OnInit()
{
//do not call wxApp::OnInit() to avoid using default commandline parser
@@ -45,7 +46,12 @@ void Application::OnStartApplication(wxIdleEvent& event)
//if appname is not set, the default is the executable's name!
SetAppName(wxT("FreeFileSync")); //use a different app name, to have "GetUserDataDir()" return the same directory as for FreeFileSync
-#ifdef FFS_LINUX
+#ifdef FFS_WIN
+ //Quote: "Best practice is that all applications call the process-wide SetErrorMode function with a parameter of
+ //SEM_FAILCRITICALERRORS at startup. This is to prevent error mode dialogs from hanging the application."
+ ::SetErrorMode(SEM_FAILCRITICALERRORS);
+
+#elif defined FFS_LINUX
::gtk_rc_parse((zen::utf8CvrtTo<std::string>(zen::getResourceDir()) + "styles.rc").c_str()); //remove inner border from bitmap buttons
#endif
@@ -98,7 +104,7 @@ int Application::OnRun()
catch (const std::exception& e) //catch all STL exceptions
{
//unfortunately it's not always possible to display a message box in this erroneous situation, however (non-stream) file output always works!
- wxFile safeOutput(zen::getConfigDir() + wxT("LastError.txt"), wxFile::write);
+ wxFile safeOutput(toWx(zen::getConfigDir()) + wxT("LastError.txt"), wxFile::write);
safeOutput.Write(wxString::FromAscii(e.what()));
wxSafeShowMessage(_("An exception occurred!") + L" - RTS", wxString::FromAscii(e.what()));
bgstack15