summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'UI/Qt/QtMainWindow.cpp')
-rw-r--r--UI/Qt/QtMainWindow.cpp71
1 files changed, 0 insertions, 71 deletions
diff --git a/UI/Qt/QtMainWindow.cpp b/UI/Qt/QtMainWindow.cpp
deleted file mode 100644
index a9ffc51..0000000
--- a/UI/Qt/QtMainWindow.cpp
+++ /dev/null
@@ -1,71 +0,0 @@
-#include "QtMainWindow.h"
-
-#include "QtJoinMUCDialog.h"
-#include "QtSwiftUtil.h"
-#include "QtTreeWidgetFactory.h"
-#include "QtTreeWidget.h"
-#include "QtStatusWidget.h"
-
-#include <QBoxLayout>
-#include <QComboBox>
-#include <QLineEdit>
-#include <QListWidget>
-#include <QListWidgetItem>
-#include <QPushButton>
-#include <QMenuBar>
-#include <QToolBar>
-
-namespace Swift {
-
-QtMainWindow::QtMainWindow(QtTreeWidgetFactory *treeWidgetFactory) : QWidget() {
- setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding));
- QBoxLayout *mainLayout = new QBoxLayout(QBoxLayout::TopToBottom, this);
- mainLayout->setContentsMargins(0,0,0,0);
- mainLayout->setSpacing(0);
- statusWidget_ = new QtStatusWidget(this);
- connect(statusWidget_, SIGNAL(onChangeStatusRequest(StatusShow::Type, const QString&)), this, SLOT(handleStatusChanged(StatusShow::Type, const QString&)));
- mainLayout->addWidget(statusWidget_);
- treeWidget_ = dynamic_cast<QtTreeWidget*>(treeWidgetFactory->createTreeWidget());
- mainLayout->addWidget(treeWidget_);
-
- this->setLayout(mainLayout);
-
- QMenu* viewMenu = new QMenu(tr("View"), this);
- menus_.push_back(viewMenu);
- QAction* showOfflineAction = new QAction("Show offline contacts", this);
- showOfflineAction->setCheckable(true);
- showOfflineAction->setChecked(false);
- connect(showOfflineAction, SIGNAL(toggled(bool)), SLOT(handleShowOfflineToggled(bool)));
- viewMenu->addAction(showOfflineAction);
-
- QMenu* chatMenu = new QMenu(tr("Chat"), this);
- menus_.push_back(chatMenu);
- QAction* joinMUCAction = new QAction("Join chatroom", this);
- connect(joinMUCAction, SIGNAL(triggered()), SLOT(handleJoinMUCAction()));
- chatMenu->addAction(joinMUCAction);
-}
-
-TreeWidget* QtMainWindow::getTreeWidget() {
- return treeWidget_;
-}
-
-void QtMainWindow::handleJoinMUCAction() {
- QtJoinMUCDialog* joinMUC = new QtJoinMUCDialog("jabber@conference.jabber.org", "SwiftUser", this);
- connect(joinMUC, SIGNAL(onJoinCommand(const JID&, const QString&)), SLOT(handleJoinMUCDialogComplete(const JID&, const QString&)));
- joinMUC->show();
-}
-
-void QtMainWindow::handleJoinMUCDialogComplete(const JID& muc, const QString& nick) {
- onJoinMUCRequest(muc, Q2PSTRING(nick));
-}
-
-void QtMainWindow::handleStatusChanged(StatusShow::Type showType, const QString &statusMessage) {
- onChangeStatusRequest(showType, Q2PSTRING(statusMessage));
-}
-
-void QtMainWindow::handleShowOfflineToggled(bool state) {
- onShowOfflineToggled(state);
-}
-
-}
-