# HG changeset patch # User Andre Heinecke # Date 1404222030 -7200 # Node ID e4abb41484a068f17c5ceb27f8f4a5643572ee87 # Parent 6df31cb47d544dfa35b1cec1c8985d1c65c6b624 (issue 27)Only close if no new list is available diff -r 6df31cb47d54 -r e4abb41484a0 ui/mainwindow.cpp --- 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(); +} diff -r 6df31cb47d54 -r e4abb41484a0 ui/mainwindow.h --- 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