diff options
author | Kevin Smith <git@kismith.co.uk> | 2010-04-04 11:55:11 (GMT) |
---|---|---|
committer | Kevin Smith <git@kismith.co.uk> | 2010-04-04 11:55:11 (GMT) |
commit | f1675c651a08c294447389176262ab890cc6e7b5 (patch) | |
tree | 5371b7db58ac31b22b747822b224db3565442084 /Swift/Controllers | |
parent | 03a5a0a4a6c7504acead164dc8334c36da86a888 (diff) | |
download | swift-f1675c651a08c294447389176262ab890cc6e7b5.zip swift-f1675c651a08c294447389176262ab890cc6e7b5.tar.bz2 |
Add 'remove' context menu item for rosters (not implemented).
Diffstat (limited to 'Swift/Controllers')
-rw-r--r-- | Swift/Controllers/RosterController.cpp | 11 | ||||
-rw-r--r-- | Swift/Controllers/UIEvents/RemoveItemRosterAction.h | 15 |
2 files changed, 26 insertions, 0 deletions
diff --git a/Swift/Controllers/RosterController.cpp b/Swift/Controllers/RosterController.cpp index 888d324..f05bc9f 100644 --- a/Swift/Controllers/RosterController.cpp +++ b/Swift/Controllers/RosterController.cpp @@ -19,6 +19,7 @@ #include "Swiften/Roster/TreeWidgetFactory.h" #include "Swiften/Roster/XMPPRoster.h" #include "Swift/Controllers/UIEvents/AddContactUIEvent.h" +#include "Swift/Controllers/UIEvents/RemoveItemRosterAction.h" namespace Swift { @@ -96,6 +97,15 @@ void RosterController::handleUserAction(boost::shared_ptr<UserRosterAction> acti ContactRosterItem *contactItem = dynamic_cast<ContactRosterItem*>(chatAction->getRosterItem()); assert(contactItem); onStartChatRequest(contactItem->getJID().toBare()); + return; + } + + boost::shared_ptr<RemoveItemRosterAction> removeAction = boost::dynamic_pointer_cast<RemoveItemRosterAction>(action); + if (removeAction.get() != NULL) { + ContactRosterItem *contactItem = dynamic_cast<ContactRosterItem*>(chatAction->getRosterItem()); + assert(contactItem); + //FIXME: remove it + return; } } @@ -142,6 +152,7 @@ void RosterController::handleOnJIDUpdated(const JID& jid, const String& oldName, void RosterController::handleUIEvent(boost::shared_ptr<UIEvent> event) { boost::shared_ptr<AddContactUIEvent> addContactEvent = boost::dynamic_pointer_cast<AddContactUIEvent>(event); if (addContactEvent) { + presenceOracle_->requestSubscription(addContactEvent->getJID()); } } diff --git a/Swift/Controllers/UIEvents/RemoveItemRosterAction.h b/Swift/Controllers/UIEvents/RemoveItemRosterAction.h new file mode 100644 index 0000000..6741bc6 --- /dev/null +++ b/Swift/Controllers/UIEvents/RemoveItemRosterAction.h @@ -0,0 +1,15 @@ +#pragma once + +#include "Swiften/Roster/UserRosterAction.h" + +namespace Swift { +class RosterItem; +class TreeWidgetItem; + +class RemoveItemRosterAction : public UserRosterAction { + public: + virtual ~RemoveItemRosterAction() {}; + +}; + +} |