diff options
author | Kevin Smith <git@kismith.co.uk> | 2009-11-26 17:31:53 (GMT) |
---|---|---|
committer | Kevin Smith <git@kismith.co.uk> | 2009-11-26 17:46:21 (GMT) |
commit | eebdef9a7724ff7fa86a5d1cca37759d37bbb336 (patch) | |
tree | 7dd76b8e5d364eb1b019b2511a839a9eac8397e4 /Swift/QtUI/QtLoginWindow.cpp | |
parent | 39e58e4593f54a65f810e73728fe2490958fcba2 (diff) | |
download | swift-contrib-eebdef9a7724ff7fa86a5d1cca37759d37bbb336.zip swift-contrib-eebdef9a7724ff7fa86a5d1cca37759d37bbb336.tar.bz2 |
Plumbing to show a dummy XMLConsoleWidget in the chat tabs.
This should all work now, and the XMLConsoleController needs to talk to the QtXMLConsoleWidget through the XMLConsoleWidget interface.
Resolves: #256
Diffstat (limited to 'Swift/QtUI/QtLoginWindow.cpp')
-rw-r--r-- | Swift/QtUI/QtLoginWindow.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/Swift/QtUI/QtLoginWindow.cpp b/Swift/QtUI/QtLoginWindow.cpp index 6466692..2fd27c6 100644 --- a/Swift/QtUI/QtLoginWindow.cpp +++ b/Swift/QtUI/QtLoginWindow.cpp @@ -1,5 +1,7 @@ #include "QtLoginWindow.h" +#include "Swift/Controllers/UIEvents/UIEventStream.h" +#include "Swift/Controllers/UIEvents/RequestXMLConsoleUIEvent.h" #include "QtAboutWidget.h" #include "QtSwiftUtil.h" #include "QtMainWindow.h" @@ -20,7 +22,8 @@ namespace Swift{ -QtLoginWindow::QtLoginWindow() : QMainWindow() { +QtLoginWindow::QtLoginWindow(UIEventStream* uiEventStream) : QMainWindow() { + uiEventStream_ = uiEventStream; setWindowTitle("Swift"); resize(200, 500); setContentsMargins(0,0,0,0); @@ -104,6 +107,12 @@ QtLoginWindow::QtLoginWindow() : QMainWindow() { QAction* aboutAction = new QAction("About Swift", this); connect(aboutAction, SIGNAL(activated()), SLOT(handleAbout())); swiftMenu_->addAction(aboutAction); + + toolsMenu_ = new QMenu(tr("Tools"), this); + + QAction* xmlConsoleAction = new QAction(tr("Show Debug Console"), this); + connect(xmlConsoleAction, SIGNAL(activated()), SLOT(handleShowXMLConsole())); + toolsMenu_->addAction(xmlConsoleAction); QAction* quitAction = new QAction("Quit", this); connect(quitAction, SIGNAL(activated()), SLOT(handleQuit())); @@ -210,6 +219,10 @@ void QtLoginWindow::handleAbout() { } } +void QtLoginWindow::handleShowXMLConsole() { + uiEventStream_->send(boost::shared_ptr<RequestXMLConsoleUIEvent>(new RequestXMLConsoleUIEvent())); +} + void QtLoginWindow::handleQuit() { QApplication::quit(); } @@ -217,6 +230,7 @@ void QtLoginWindow::handleQuit() { void QtLoginWindow::setInitialMenus() { menuBar_->clear(); menuBar_->addMenu(swiftMenu_); + menuBar_->addMenu(toolsMenu_); } void QtLoginWindow::morphInto(MainWindow *mainWindow) { |