# HG changeset patch # User Andre Heinecke # Date 1392049395 0 # Node ID cf88cc432b9dc51947c2bb2125fbb9668dc99d07 # Parent 524cd4908656d61fe9f0e2c6f20a950922b82cb3 Add quit action diff -r 524cd4908656 -r cf88cc432b9d ui/mainwindow.cpp --- 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 #include #include +#include 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); diff -r 524cd4908656 -r cf88cc432b9d ui/mainwindow.h --- a/ui/mainwindow.h Mon Feb 10 16:14:55 2014 +0000 +++ b/ui/mainwindow.h Mon Feb 10 16:23:15 2014 +0000 @@ -24,12 +24,14 @@ private: void createTrayIcon(); void createActions(); - + QString mCurMessage; QSystemTrayIcon *mTrayIcon; + QMenu *mTrayMenu; QAction *mCheckUpdates; + QAction *mQuitAction; }; #endif // MAINWINDOW_H