[PC-BSD Commits] r17911 - pcbsd/current/src-qt4/pc-installgui

svn at pcbsd.org svn at pcbsd.org
Tue Jul 24 10:34:32 PDT 2012


Author: kris
Date: 2012-07-24 17:34:32 +0000 (Tue, 24 Jul 2012)
New Revision: 17911

Modified:
   pcbsd/current/src-qt4/pc-installgui/installer.cpp
   pcbsd/current/src-qt4/pc-installgui/installer.h
Log:

Intercept closeEvent, and prompt if we really want to exit the install



Modified: pcbsd/current/src-qt4/pc-installgui/installer.cpp
===================================================================
--- pcbsd/current/src-qt4/pc-installgui/installer.cpp	2012-07-24 17:31:36 UTC (rev 17910)
+++ pcbsd/current/src-qt4/pc-installgui/installer.cpp	2012-07-24 17:34:32 UTC (rev 17911)
@@ -1,3 +1,4 @@
+#include <QCloseEvent>
 #include <QProcess>
 #include <QTimer>
 #include <QGraphicsPixmapItem>
@@ -779,18 +780,7 @@
 
 void Installer::slotAbort()
 {
-    int ret = QMessageBox::question(this, tr("PC-BSD Installer"),
-                                tr("Are you sure you want to abort this installation?"),
-                                QMessageBox::No | QMessageBox::Yes,
-                                QMessageBox::No);
-    switch (ret) {
-    case QMessageBox::Yes:
-        //exit the installer :(
-        close();
-        break;
-    case QMessageBox::No: // :)
-        break;
-    }
+   close();
 }
 
 void Installer::slotChangeLanguage()
@@ -1556,3 +1546,19 @@
  
    return userList;
 }
+
+void Installer::closeEvent(QCloseEvent *event)
+{
+    int ret = QMessageBox::question(this, tr("PC-BSD Installer"),
+                                tr("Are you sure you want to abort this installation?"),
+                                QMessageBox::No | QMessageBox::Yes,
+                                QMessageBox::No);
+    switch (ret) {
+    case QMessageBox::Yes:
+        //exit the installer :(
+        break;
+    case QMessageBox::No: // :)
+        event->ignore();
+        break;
+    }
+}

Modified: pcbsd/current/src-qt4/pc-installgui/installer.h
===================================================================
--- pcbsd/current/src-qt4/pc-installgui/installer.h	2012-07-24 17:31:36 UTC (rev 17910)
+++ pcbsd/current/src-qt4/pc-installgui/installer.h	2012-07-24 17:34:32 UTC (rev 17911)
@@ -164,6 +164,9 @@
     // Disk setup wizard
     wizardDisk *wDisk;
 
+protected:
+    void closeEvent(QCloseEvent *event);
+
 };
 
 #endif // INSTALLER_H



More information about the Commits mailing list