OSDN Git Service

Fix the voice plugin with the new friend list control.
authorLatif Khalifa <latifer@streamgrid.net>
Mon, 18 Apr 2011 13:34:42 +0000 (13:34 +0000)
committerLatif Khalifa <latifer@streamgrid.net>
Mon, 18 Apr 2011 13:34:42 +0000 (13:34 +0000)
git-svn-id: https://radegast.googlecode.com/svn/trunk@854 f7a694da-4d33-11de-9ad6-1127a62b9fcd

Radegast/GUI/Consoles/FriendsConsole.Designer.cs
Radegast/GUI/Consoles/FriendsConsole.resx
plugins/Radegast.Plugin.Speech/RadSpeech/Conversation/Friends.cs

index fedf616..afacdc7 100644 (file)
@@ -256,6 +256,6 @@ namespace Radegast
         public Button btnRemove;
         public GroupBox pnlFriendsRights;
         public ImageList imageList1;
-        private ListBox listFriends;
+        public ListBox listFriends;
     }
 }
index 347a2e3..f3911f7 100644 (file)
         AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj0yLjAuMC4w\r
         LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0\r
         ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAACI\r
-        CAAAAk1TRnQBSQFMAgEBAgEAARABAQEQAQEBEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo\r
+        CAAAAk1TRnQBSQFMAgEBAgEAARgBAQEYAQEBEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo\r
         AwABQAMAARADAAEBAQABCAYAAQQYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA\r
         AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5\r
         AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA\r
index 4b02983..3d24db3 100644 (file)
@@ -41,7 +41,7 @@ namespace RadegastSpeech.Conversation
     {
         private FriendsConsole frTab;
         public bool Announce { get; set; }
-        private System.Windows.Forms.ListView friends;
+        private System.Windows.Forms.ListBox friends;
 
         #region statechange
         internal Friends(PluginControl pc)
@@ -50,7 +50,7 @@ namespace RadegastSpeech.Conversation
             Title = "friends";
             Announce = false;
             frTab = (FriendsConsole)control.instance.TabConsole.Tabs["friends"].Control;
-            friends = frTab.lvwFriends;
+            friends = frTab.listFriends;
 
             control.instance.Client.Friends.FriendOffline +=
                 new EventHandler<FriendInfoEventArgs>(Friends_OnFriendOffline);
@@ -64,7 +64,7 @@ namespace RadegastSpeech.Conversation
         internal override void Start()
         {
             base.Start();
-            friends.ItemSelectionChanged += new System.Windows.Forms.ListViewItemSelectionChangedEventHandler(friends_ItemSelectionChanged);
+            friends.SelectedIndexChanged += new EventHandler(friends_ItemSelectionChanged);
             Talker.SayMore("Friends");
         }
 
@@ -73,7 +73,7 @@ namespace RadegastSpeech.Conversation
         /// </summary>
         internal override void Stop()
         {
-            friends.ItemSelectionChanged -= new System.Windows.Forms.ListViewItemSelectionChangedEventHandler(friends_ItemSelectionChanged);
+            friends.SelectedIndexChanged -= new EventHandler(friends_ItemSelectionChanged);
             base.Stop();
         }
         #endregion
@@ -121,18 +121,19 @@ namespace RadegastSpeech.Conversation
         /// </summary>
         /// <param name="sender"></param>
         /// <param name="e"></param>
-        void friends_ItemSelectionChanged(object sender, System.Windows.Forms.ListViewItemSelectionChangedEventArgs e)
+        void friends_ItemSelectionChanged(object sender, EventArgs e)
         {
-            FriendInfo f = (FriendInfo)e.Item.Tag;
+            FriendInfo f = (FriendInfo)friends.SelectedItem;
             bool multiple = friends.SelectedItems.Count > 1;
             string desc = f.Name;
-            
+            bool IsSelected = true;
+
             if (multiple || prevMultiple)
             {
-                desc += e.IsSelected ? " selected" : " deselected";
+                desc += IsSelected ? " selected" : " deselected";
                 Talker.SayMore(desc);
             }
-            else if (e.IsSelected)
+            else if (IsSelected)
             {
                 if (!f.IsOnline)
                     desc += " is off line.";