[smuxi: 3/5] Frontend-GNOME-XMPP: there was no context menu entry to remove contacts from the roster
- From: Mirco M. M. Bauer <mmmbauer src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [smuxi: 3/5] Frontend-GNOME-XMPP: there was no context menu entry to remove contacts from the roster
- Date: Fri, 4 Apr 2014 10:19:29 +0000 (UTC)
commit ee5d3f0038fcf0fa8275adad9313c09479eea848
Author: Oliver Schneider <mail oli-obk de>
Date: Tue Jan 21 17:01:17 2014 +0100
Frontend-GNOME-XMPP: there was no context menu entry to remove contacts from the roster
src/Frontend-GNOME-XMPP/XmppGroupChatView.cs | 32 ++++++++++++++++++++++++++
1 files changed, 32 insertions(+), 0 deletions(-)
---
diff --git a/src/Frontend-GNOME-XMPP/XmppGroupChatView.cs b/src/Frontend-GNOME-XMPP/XmppGroupChatView.cs
index 5228e12..0c51e0a 100644
--- a/src/Frontend-GNOME-XMPP/XmppGroupChatView.cs
+++ b/src/Frontend-GNOME-XMPP/XmppGroupChatView.cs
@@ -114,6 +114,34 @@ namespace Smuxi.Frontend.Gnome
}
}
+ void OnUserListMenuRemoveActivated(object sender, EventArgs e)
+ {
+ Trace.Call(sender, e);
+
+ IList<PersonModel> persons = GetSelectedPersons();
+ if (persons == null) {
+ return;
+ }
+
+ foreach (PersonModel person in persons) {
+ var per = person;
+
+ ThreadPool.QueueUserWorkItem(delegate {
+ try {
+ XmppProtocolManager.CommandContact(
+ new CommandModel(
+ Frontend.FrontendManager,
+ ChatModel,
+ "remove " + per.ID
+ )
+ );
+ } catch (Exception ex) {
+ Frontend.ShowException(ex);
+ }
+ });
+ }
+ }
+
void _OnUserListMenuQueryActivated (object sender, EventArgs e)
{
Trace.Call(sender, e);
@@ -265,6 +293,10 @@ namespace Smuxi.Frontend.Gnome
PersonTreeView.SetCursor(path, IdentityNameColumn, true);
};
PersonMenu.Append(rename_item);
+
+ Gtk.ImageMenuItem remove_item = new Gtk.ImageMenuItem(_("Remove"));
+ remove_item.Activated += OnUserListMenuRemoveActivated;
+ PersonMenu.Append(remove_item);
}
PersonMenu.ShowAll();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]