comparison ui/mainwindow.cpp @ 155:c0fdb8d336cf

Added menubar/menu and method stubs to mainwindow.
author Raimund Renkert <rrenkert@intevation.de>
date Tue, 25 Mar 2014 09:22:55 +0100
parents 1f27d6db5ee3
children 0c06a608e15f
comparison
equal deleted inserted replaced
154:3349c9596043 155:c0fdb8d336cf
23 #include "listupdatedialog.h" 23 #include "listupdatedialog.h"
24 24
25 MainWindow::MainWindow() { 25 MainWindow::MainWindow() {
26 createActions(); 26 createActions();
27 createTrayIcon(); 27 createTrayIcon();
28 createMenuBar();
28 qRegisterMetaType<SSLConnection::ErrorCode>("SSLConnection::ErrorCode"); 29 qRegisterMetaType<SSLConnection::ErrorCode>("SSLConnection::ErrorCode");
29 30
30 connect(mTrayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), 31 connect(mTrayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)),
31 this, SLOT(iconActivated(QSystemTrayIcon::ActivationReason))); 32 this, SLOT(iconActivated(QSystemTrayIcon::ActivationReason)));
32 33
189 mTrayIcon->show(); 190 mTrayIcon->show();
190 mTrayIcon->setToolTip(tr("m13ui")); 191 mTrayIcon->setToolTip(tr("m13ui"));
191 192
192 connect(mTrayIcon, SIGNAL(messageClicked()), this, SLOT(messageClicked())); 193 connect(mTrayIcon, SIGNAL(messageClicked()), this, SLOT(messageClicked()));
193 } 194 }
195
196 void MainWindow::createMenuBar()
197 {
198 mMenuBar = new QMenuBar(this);
199 QMenu *mMenu = new QMenu(tr("Menu"), mMenuBar);
200 mMenuBar->addMenu(mMenu);
201 QAction *update = mMenu->addAction(tr("Force Update"));
202 QAction *settings = mMenu->addAction(tr("Settings"));
203 mMenu->addSeparator();
204 QAction *help = mMenu->addAction(tr("Help"));
205 QAction *about = mMenu->addAction(tr("About"));
206 mMenu->addSeparator();
207 QAction *quit = mMenu->addAction(tr("Quit"));
208 connect(update, SIGNAL(triggered()), this, SLOT(checkUpdates()));
209 connect(settings, SIGNAL(triggered()), this, SLOT(showSettings()));
210 connect(help, SIGNAL(triggered()), this, SLOT(showHelp()));
211 connect(about, SIGNAL(triggered()), this, SLOT(showAbout()));
212 connect(quit, SIGNAL(triggered()), qApp, SLOT(quit()));
213 setMenuBar(mMenuBar);
214 }
215
216 void MainWindow::showSettings() {
217 qDebug() << "show settingsdialog";
218 }
219
220 void MainWindow::showHelp()
221 {
222 qDebug() << "show helpdialog";
223 }
224
225 void MainWindow::showAbout()
226 {
227 qDebug() << "show aboutdialog";
228 }

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