changeset 690:e4abb41484a0

(issue 27)Only close if no new list is available
author Andre Heinecke <andre.heinecke@intevation.de>
date Tue, 01 Jul 2014 15:40:30 +0200
parents 6df31cb47d54
children 315103410002
files ui/mainwindow.cpp ui/mainwindow.h
diffstat 2 files changed, 11 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/ui/mainwindow.cpp	Tue Jul 01 14:37:45 2014 +0200
+++ b/ui/mainwindow.cpp	Tue Jul 01 15:40:30 2014 +0200
@@ -1134,3 +1134,13 @@
         mUpdatesWidget->resize(old.width(), old.height() - mUpdatesManual->height());
     }
 }
+
+void MainWindow::closeEvent(QCloseEvent *event)
+{
+    if (getState() == NewListAvailable) {
+        /* Only minimize to tray if there is a new list */
+        QMainWindow::closeEvent(event);
+        return;
+    }
+    return closeApp();
+}
--- a/ui/mainwindow.h	Tue Jul 01 14:37:45 2014 +0200
+++ b/ui/mainwindow.h	Tue Jul 01 15:40:30 2014 +0200
@@ -130,7 +130,7 @@
     void loadUnselectedCertificates();
 
 protected:
-    virtual void closeEvent(QCloseEvent *event) {return closeApp();}
+    virtual void closeEvent(QCloseEvent *event);
 
 protected slots:
     /** @brief cleanup and close the main window

http://wald.intevation.org/projects/trustbridge/