summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2011-09-21 08:12:21 (GMT)
committerKevin Smith <git@kismith.co.uk>2011-09-21 08:52:40 (GMT)
commit20d3385909a2f9d886e7e0781357b23474e9f8dc (patch)
tree4ca6a60e0c2d598534a0767cefa75f58dbac4afa /Swift/QtUI/Roster/QtOccupantListWidget.cpp
parent703a1c28c3c87ac0fb365ff0683d7c64fcdd2210 (diff)
downloadswift-contrib-20d3385909a2f9d886e7e0781357b23474e9f8dc.zip
swift-contrib-20d3385909a2f9d886e7e0781357b23474e9f8dc.tar.bz2
Distinguish between Roster and MUC list widgets
Diffstat (limited to 'Swift/QtUI/Roster/QtOccupantListWidget.cpp')
-rw-r--r--Swift/QtUI/Roster/QtOccupantListWidget.cpp59
1 files changed, 59 insertions, 0 deletions
diff --git a/Swift/QtUI/Roster/QtOccupantListWidget.cpp b/Swift/QtUI/Roster/QtOccupantListWidget.cpp
new file mode 100644
index 0000000..2f992bf
--- /dev/null
+++ b/Swift/QtUI/Roster/QtOccupantListWidget.cpp
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2011 Kevin Smith
+ * Licensed under the GNU General Public License v3.
+ * See Documentation/Licenses/GPLv3.txt for more information.
+ */
+
+
+#include "Roster/QtOccupantListWidget.h"
+
+#include <QContextMenuEvent>
+#include <QMenu>
+#include <QInputDialog>
+
+#include "Swift/Controllers/Roster/ContactRosterItem.h"
+#include "Swift/Controllers/Roster/GroupRosterItem.h"
+#include "Swift/Controllers/UIEvents/UIEventStream.h"
+#include "QtSwiftUtil.h"
+
+namespace Swift {
+
+QtOccupantListWidget::QtOccupantListWidget(UIEventStream* eventStream, QWidget* parent) : QtTreeWidget(eventStream, parent) {
+
+}
+
+QtOccupantListWidget::~QtOccupantListWidget() {
+
+}
+
+void QtOccupantListWidget::contextMenuEvent(QContextMenuEvent* event) {
+// QModelIndex index = indexAt(event->pos());
+// if (!index.isValid()) {
+// return;
+// }
+// RosterItem* item = static_cast<RosterItem*>(index.internalPointer());
+// QMenu contextMenu;
+// if (ContactRosterItem* contact = dynamic_cast<ContactRosterItem*>(item)) {
+// QAction* editContact = contextMenu.addAction(tr("Edit"));
+// QAction* removeContact = contextMenu.addAction(tr("Remove"));
+// QAction* result = contextMenu.exec(event->globalPos());
+// if (result == editContact) {
+// eventStream_->send(boost::make_shared<RequestContactEditorUIEvent>(contact->getJID()));
+// }
+// else if (result == removeContact) {
+// if (QtContactEditWindow::confirmContactDeletion(contact->getJID())) {
+// eventStream_->send(boost::make_shared<RemoveRosterItemUIEvent>(contact->getJID()));
+// }
+// }
+// }
+// else if (GroupRosterItem* group = dynamic_cast<GroupRosterItem*>(item)) {
+// QAction* renameGroupAction = contextMenu.addAction(tr("Rename"));
+// QAction* result = contextMenu.exec(event->globalPos());
+// if (result == renameGroupAction) {
+// renameGroup(group);
+// }
+// }
+}
+
+}
+