QTfrontend/main.cpp
changeset 8355 df0ea4323295
parent 8344 3d18f7f71d65
child 8363 0b4ac686fc44
child 8385 9e8924ff9813
--- a/QTfrontend/main.cpp	Wed Jan 02 12:39:50 2013 +0100
+++ b/QTfrontend/main.cpp	Wed Jan 02 23:13:14 2013 +0100
@@ -39,9 +39,11 @@
 
 #ifdef _WIN32
 #include <Shlobj.h>
+#elif defined __APPLE__
+#include "CocoaInitializer.h"
 #endif
-#ifdef __APPLE__
-#include "CocoaInitializer.h"
+#ifndef _WIN32
+#include <signal.h>
 #endif
 
 
@@ -87,6 +89,12 @@
     else
         season = SEASON_NONE;
 }
+#ifndef _WIN32
+void terminateFrontend(int signal)
+{
+    QCoreApplication::exit(0);
+}
+#endif
 
 bool checkForDir(const QString & dir)
 {
@@ -136,6 +144,10 @@
     atexit(releaseCocoaPool);
 #endif
 
+#ifndef _WIN32
+    signal(SIGINT, &terminateFrontend);
+#endif
+
     HWApplication app(argc, argv);
 
     QLabel *splash = NULL;