summaryrefslogtreecommitdiffstats
path: root/Swift
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2009-08-28 19:24:11 (GMT)
committerKevin Smith <git@kismith.co.uk>2009-08-28 19:24:11 (GMT)
commita039c692131ff70fe2e65429cc37de21aa530fc2 (patch)
tree27a686280c8fab52e6bc374ea64b217ba39865cc /Swift
parent451279c7debea59517dae1fa5c99f036b31f2199 (diff)
downloadswift-contrib-a039c692131ff70fe2e65429cc37de21aa530fc2.zip
swift-contrib-a039c692131ff70fe2e65429cc37de21aa530fc2.tar.bz2
Include Quit option in Swift menu.
Diffstat (limited to 'Swift')
-rw-r--r--Swift/QtUI/QtLoginWindow.cpp12
-rw-r--r--Swift/QtUI/QtLoginWindow.h2
2 files changed, 14 insertions, 0 deletions
diff --git a/Swift/QtUI/QtLoginWindow.cpp b/Swift/QtUI/QtLoginWindow.cpp
index 8b53499..dbe6bb2 100644
--- a/Swift/QtUI/QtLoginWindow.cpp
+++ b/Swift/QtUI/QtLoginWindow.cpp
@@ -2,6 +2,7 @@
#include "QtSwiftUtil.h"
#include "QtMainWindow.h"
+#include <QApplication>
#include <QBoxLayout>
#include <QFileDialog>
#include <QStatusBar>
@@ -80,6 +81,12 @@ QtLoginWindow::QtLoginWindow(const String& defaultJID, const String& defaultPass
connect(loginButton_, SIGNAL(clicked()), SLOT(loginClicked()));
stack_->addWidget(wrapperWidget);
menuBar_ = new QMenuBar(NULL);
+
+ swiftMenu_ = new QMenu(tr("Swift"), this);
+ QAction* quitAction = new QAction("Quit", this);
+ connect(quitAction, SIGNAL(activated()), SLOT(handleQuit()));
+ swiftMenu_->addAction(quitAction);
+
setInitialMenus();
this->show();
}
@@ -111,8 +118,13 @@ void QtLoginWindow::handleCertficateChecked(bool checked) {
}
}
+void QtLoginWindow::handleQuit() {
+ QApplication::quit();
+}
+
void QtLoginWindow::setInitialMenus() {
menuBar_->clear();
+ menuBar_->addMenu(swiftMenu_);
}
void QtLoginWindow::morphInto(MainWindow *mainWindow) {
diff --git a/Swift/QtUI/QtLoginWindow.h b/Swift/QtUI/QtLoginWindow.h
index 9b190e9..e880ace 100644
--- a/Swift/QtUI/QtLoginWindow.h
+++ b/Swift/QtUI/QtLoginWindow.h
@@ -27,6 +27,7 @@ namespace Swift {
private slots:
void loginClicked();
void handleCertficateChecked(bool);
+ void handleQuit();
private:
void setInitialMenus();
@@ -39,6 +40,7 @@ namespace Swift {
QString certificateFile_;
QToolButton* certificateButton_;
QMenuBar* menuBar_;
+ QMenu* swiftMenu_;
};
}