diff ui/mainwindow.cpp @ 2:cf88cc432b9d

Add quit action
author Andre Heinecke <aheinecke@intevation.de>
date Mon, 10 Feb 2014 16:23:15 +0000
parents cb0cde2c5eb9
children 992c0ec57660
line wrap: on
line diff
--- a/ui/mainwindow.cpp	Mon Feb 10 16:14:55 2014 +0000
+++ b/ui/mainwindow.cpp	Mon Feb 10 16:23:15 2014 +0000
@@ -6,6 +6,7 @@
 #include <QAction>
 #include <QDialog>
 #include <QMenu>
+#include <QApplication>
 
 MainWindow::MainWindow() {
     createActions();
@@ -45,15 +46,17 @@
 {
     mCheckUpdates = new QAction(tr("Check for Updates"), this);
     connect(mCheckUpdates, SIGNAL(triggered()), this, SLOT(manualCheck()));
+    mQuitAction = new QAction(tr("Quit"), this);
+    connect(mQuitAction, SIGNAL(triggered()), qApp, SLOT(quit()));
 }
 
 void MainWindow::createTrayIcon()
 {
     QIcon trayImg = QIcon(":/img/tray_22.png");
 
-    qDebug() << "Creating tray icon";
     mTrayMenu = new QMenu(this);
     mTrayMenu->addAction(mCheckUpdates);
+    mTrayMenu->addAction(mQuitAction);
 
     mTrayIcon = new QSystemTrayIcon(this);
     mTrayIcon->setContextMenu(mTrayMenu);

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