diff 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
line wrap: on
line diff
--- a/ui/mainwindow.cpp	Tue Mar 25 08:59:58 2014 +0100
+++ b/ui/mainwindow.cpp	Tue Mar 25 09:22:55 2014 +0100
@@ -25,6 +25,7 @@
 MainWindow::MainWindow() {
     createActions();
     createTrayIcon();
+    createMenuBar();
     qRegisterMetaType<SSLConnection::ErrorCode>("SSLConnection::ErrorCode");
 
     connect(mTrayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)),
@@ -191,3 +192,37 @@
 
     connect(mTrayIcon, SIGNAL(messageClicked()), this, SLOT(messageClicked()));
 }
+
+void MainWindow::createMenuBar()
+{
+    mMenuBar = new QMenuBar(this);
+    QMenu *mMenu = new QMenu(tr("Menu"), mMenuBar);
+    mMenuBar->addMenu(mMenu);
+    QAction *update = mMenu->addAction(tr("Force Update"));
+    QAction *settings = mMenu->addAction(tr("Settings"));
+    mMenu->addSeparator();
+    QAction *help = mMenu->addAction(tr("Help"));
+    QAction *about = mMenu->addAction(tr("About"));
+    mMenu->addSeparator();
+    QAction *quit = mMenu->addAction(tr("Quit"));
+    connect(update, SIGNAL(triggered()), this, SLOT(checkUpdates()));
+    connect(settings, SIGNAL(triggered()), this, SLOT(showSettings()));
+    connect(help, SIGNAL(triggered()), this, SLOT(showHelp()));
+    connect(about, SIGNAL(triggered()), this, SLOT(showAbout()));
+    connect(quit, SIGNAL(triggered()), qApp, SLOT(quit()));
+    setMenuBar(mMenuBar);
+}
+
+void MainWindow::showSettings() {
+    qDebug() << "show settingsdialog";
+}
+
+void MainWindow::showHelp()
+{
+    qDebug() << "show helpdialog";
+}
+
+void MainWindow::showAbout()
+{
+    qDebug() << "show aboutdialog";
+}

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