summaryrefslogtreecommitdiffstats
path: root/Swift
diff options
context:
space:
mode:
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_;
};
}