diff options
author | Kevin Smith <git@kismith.co.uk> | 2011-09-21 12:25:27 (GMT) |
---|---|---|
committer | Kevin Smith <git@kismith.co.uk> | 2011-09-23 16:47:57 (GMT) |
commit | f9c432ca127d6e7d87b49d2fbf6aace34bea0e06 (patch) | |
tree | d7f069d3c48cc3d768e770df614fe87ade6f3902 /Swift/QtUI/QtChatWindow.cpp | |
parent | 20d3385909a2f9d886e7e0781357b23474e9f8dc (diff) | |
download | swift-contrib-f9c432ca127d6e7d87b49d2fbf6aace34bea0e06.zip swift-contrib-f9c432ca127d6e7d87b49d2fbf6aace34bea0e06.tar.bz2 |
Add support for kicking people from MUCs.
This also introduces a new DOM-like parser structure, used for the
MUC parsers.
Partially
Resolves: #689
Diffstat (limited to 'Swift/QtUI/QtChatWindow.cpp')
-rw-r--r-- | Swift/QtUI/QtChatWindow.cpp | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/Swift/QtUI/QtChatWindow.cpp b/Swift/QtUI/QtChatWindow.cpp index a52d2de..a36bc32 100644 --- a/Swift/QtUI/QtChatWindow.cpp +++ b/Swift/QtUI/QtChatWindow.cpp @@ -7,7 +7,9 @@ #include "QtChatWindow.h" #include "QtSwiftUtil.h" #include "Swift/Controllers/Roster/Roster.h" -#include "Roster/QtTreeWidget.h" +#include "Swift/Controllers/Roster/RosterItem.h" +#include "Swift/Controllers/Roster/ContactRosterItem.h" +#include "Roster/QtOccupantListWidget.h" #include "SwifTools/Linkify.h" #include "QtChatView.h" #include "MessageSnippet.h" @@ -70,7 +72,7 @@ QtChatWindow::QtChatWindow(const QString &contact, QtChatTheme* theme, UIEventSt messageLog_ = new QtChatView(theme, this); logRosterSplitter_->addWidget(messageLog_); - treeWidget_ = new QtTreeWidget(eventStream_); + treeWidget_ = new QtOccupantListWidget(eventStream_, this); treeWidget_->hide(); logRosterSplitter_->addWidget(treeWidget_); logRosterSplitter_->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); @@ -115,7 +117,8 @@ QtChatWindow::QtChatWindow(const QString &contact, QtChatTheme* theme, UIEventSt connect(messageLog_, SIGNAL(gotFocus()), input_, SLOT(setFocus())); resize(400,300); connect(messageLog_, SIGNAL(fontResized(int)), this, SIGNAL(fontResized(int))); - + treeWidget_->onSomethingSelectedChanged.connect(boost::bind(&QtChatWindow::handleOccupantSelectionChanged, this, _1)); + treeWidget_->onOccupantActionSelected.connect(boost::bind(boost::ref(onOccupantActionSelected), _1, _2)); } @@ -123,6 +126,9 @@ QtChatWindow::~QtChatWindow() { } +void QtChatWindow::handleOccupantSelectionChanged(RosterItem* item) { + onOccupantSelectionChanged(dynamic_cast<ContactRosterItem*>(item)); +} void QtChatWindow::handleFontResized(int fontSizeSteps) { messageLog_->resizeFont(fontSizeSteps); @@ -530,4 +536,8 @@ void QtChatWindow::replaceLastMessage(const std::string& message) { messageLog_->replaceLastMessage(P2QSTRING(Linkify::linkify(message))); } +void QtChatWindow::setAvailableOccupantActions(const std::vector<OccupantAction>& actions) { + treeWidget_->setAvailableOccupantActions(actions); +} + } |