From 4a192bc9f70d20ac0a509dff1994d3aad812cb2d Mon Sep 17 00:00:00 2001 From: Kevin Smith Date: Thu, 13 May 2010 12:36:48 +0000 Subject: Remove the old Join MUC dialog diff --git a/Swift/QtUI/QtJoinMUCDialog.cpp b/Swift/QtUI/QtJoinMUCDialog.cpp deleted file mode 100644 index d459947..0000000 --- a/Swift/QtUI/QtJoinMUCDialog.cpp +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2010 Kevin Smith - * Licensed under the GNU General Public License v3. - * See Documentation/Licenses/GPLv3.txt for more information. - */ - -#include "QtJoinMUCDialog.h" -#include "QtSwiftUtil.h" - -namespace Swift { - -QtJoinMUCDialog::QtJoinMUCDialog(const QString&, const QString&, QWidget* parent) : QDialog(parent) { - setupUi(this); - errorLabel_->hide(); - setAttribute(Qt::WA_DeleteOnClose, true); - connect(buttons_, SIGNAL(accepted()), SLOT(accept())); - connect(buttons_, SIGNAL(rejected()), SLOT(reject())); -} - -void QtJoinMUCDialog::accept() { - if (mucJID_->displayText().isEmpty()) { - showError("You must specify a room to join."); - return; - } - if (nick_->displayText().isEmpty()) { - showError("You must specify a nickname to join a room."); - return; - } - errorLabel_->hide(); - emit onJoinCommand(JID(Q2PSTRING(mucJID_->displayText())), nick_->displayText()); - QDialog::accept(); -} - -void QtJoinMUCDialog::showError(const QString& error) { - errorLabel_->setText(QString("%1").arg(error)); - errorLabel_->show(); -} -} diff --git a/Swift/QtUI/QtJoinMUCDialog.h b/Swift/QtUI/QtJoinMUCDialog.h deleted file mode 100644 index 99df46d..0000000 --- a/Swift/QtUI/QtJoinMUCDialog.h +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2010 Kevin Smith - * Licensed under the GNU General Public License v3. - * See Documentation/Licenses/GPLv3.txt for more information. - */ - -#ifndef SWIFT_QtJoinMUCDialog_H -#define SWIFT_QtJoinMUCDialog_H - -#include "ui_QtJoinMUCDialog.h" -#include "Swiften/JID/JID.h" - -#include - -namespace Swift { - -class QtJoinMUCDialog : public QDialog, private Ui::QtJoinMUCDialog { - Q_OBJECT - - public: - QtJoinMUCDialog(const QString& muc, const QString& nick, QWidget* parent); - signals: - void onJoinCommand(const JID& muc, const QString& nick); - public slots: - void accept(); - private: - void showError(const QString& error); -}; - -} - -#endif diff --git a/Swift/QtUI/QtJoinMUCDialog.ui b/Swift/QtUI/QtJoinMUCDialog.ui deleted file mode 100644 index 881d4c5..0000000 --- a/Swift/QtUI/QtJoinMUCDialog.ui +++ /dev/null @@ -1,72 +0,0 @@ - - - QtJoinMUCDialog - - - - 0 - 0 - 232 - 110 - - - - Join Room - - - - - - - - Room - - - - - - - - - - - - - - Nickname - - - - - - - - - - - - - - - Qt::RichText - - - - - - - Qt::Horizontal - - - QDialogButtonBox::Cancel|QDialogButtonBox::Ok - - - false - - - - - - - - diff --git a/Swift/QtUI/QtMainWindow.cpp b/Swift/QtUI/QtMainWindow.cpp index 7d987c6..b407f86 100644 --- a/Swift/QtUI/QtMainWindow.cpp +++ b/Swift/QtUI/QtMainWindow.cpp @@ -20,7 +20,6 @@ #include #include "QtAddContactDialog.h" -#include "QtJoinMUCDialog.h" #include "QtSwiftUtil.h" #include "QtTabWidget.h" #include "Roster/QtTreeWidget.h" @@ -136,18 +135,9 @@ void QtMainWindow::handleAddContactDialogComplete(const JID& contact, const QStr } 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(); uiEventStream_->send(boost::shared_ptr(new RequestMUCSearchUIEvent())); } -void QtMainWindow::handleJoinMUCDialogComplete(const JID& muc, const QString& nick) { - boost::optional maybeNick(Q2PSTRING(nick)); - boost::shared_ptr event(new JoinMUCUIEvent(muc, maybeNick)); - uiEventStream_->send(event); -} - void QtMainWindow::handleStatusChanged(StatusShow::Type showType, const QString &statusMessage) { onChangeStatusRequest(showType, Q2PSTRING(statusMessage)); } diff --git a/Swift/QtUI/QtMainWindow.h b/Swift/QtUI/QtMainWindow.h index 3c20d66..b61a84d 100644 --- a/Swift/QtUI/QtMainWindow.h +++ b/Swift/QtUI/QtMainWindow.h @@ -50,15 +50,11 @@ namespace Swift { void handleShowOfflineToggled(bool); void handleJoinMUCAction(); void handleSignOutAction(); - void handleJoinMUCDialogComplete(const JID& muc, const QString& nick); void handleAddContactDialogComplete(const JID& contact, const QString& name); void handleAddActionTriggered(bool checked); void handleEventCountUpdated(int count); private: std::vector menus_; - QLineEdit* muc_; - QLineEdit* mucNick_; - QPushButton* mucButton_; QtTreeWidget* treeWidget_; QtRosterHeader* meView_; QAction* addAction_; diff --git a/Swift/QtUI/SConscript b/Swift/QtUI/SConscript index 4ccb301..1c7f20b 100644 --- a/Swift/QtUI/SConscript +++ b/Swift/QtUI/SConscript @@ -54,7 +54,6 @@ sources = [ "QtAddContactDialog.cpp", "QtChatWindow.cpp", "QtChatWindowFactory.cpp", - "QtJoinMUCDialog.cpp", "QtLoginWindow.cpp", "QtLoginWindowFactory.cpp", "QtMainWindow.cpp", @@ -119,7 +118,6 @@ if env["PLATFORM"] == "darwin" or env["PLATFORM"] == "win32" : else : swiftProgram = myenv.Program("swift", sources) -myenv.Uic4("QtJoinMUCDialog.ui") myenv.Uic4("MUCSearch/QtMUCSearchWindow.ui") myenv.Uic4("QtAddContactDialog.ui") myenv.Uic4("QtBookmarkDetailWindow.ui") -- cgit v0.10.2-6-g49f6