OSDN Git Service

RAD-51: In profile, partner name often shows wrong name
authorLatif Khalifa <latifer@streamgrid.net>
Thu, 15 Oct 2009 16:25:20 +0000 (16:25 +0000)
committerLatif Khalifa <latifer@streamgrid.net>
Thu, 15 Oct 2009 16:25:20 +0000 (16:25 +0000)
git-svn-id: https://radegast.googlecode.com/svn/trunk@349 f7a694da-4d33-11de-9ad6-1127a62b9fcd

Radegast/GUI/Dialogs/Profile.Designer.cs
Radegast/GUI/Dialogs/Profile.cs
Radegast/GUI/Dialogs/Profile.resx

index 2bc34d5..4aeb6b9 100644 (file)
@@ -61,6 +61,7 @@ namespace Radegast
             System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmProfile));\r
             this.tabProfile = new System.Windows.Forms.TabControl();\r
             this.tpgProfile = new System.Windows.Forms.TabPage();\r
+            this.anPartner = new Radegast.AgentNameTextBox();\r
             this.btnIM = new System.Windows.Forms.Button();\r
             this.btnFriend = new System.Windows.Forms.Button();\r
             this.slPicPanel = new System.Windows.Forms.Panel();\r
@@ -70,12 +71,10 @@ namespace Radegast
             this.rtbAbout = new System.Windows.Forms.RichTextBox();\r
             this.txtUUID = new System.Windows.Forms.TextBox();\r
             this.label9 = new System.Windows.Forms.Label();\r
-            this.txtPartner = new System.Windows.Forms.TextBox();\r
             this.label5 = new System.Windows.Forms.Label();\r
             this.label4 = new System.Windows.Forms.Label();\r
             this.label3 = new System.Windows.Forms.Label();\r
             this.txtBornOn = new System.Windows.Forms.TextBox();\r
-            this.txtFullName = new System.Windows.Forms.TextBox();\r
             this.label2 = new System.Windows.Forms.Label();\r
             this.label1 = new System.Windows.Forms.Label();\r
             this.tpgWeb = new System.Windows.Forms.TabPage();\r
@@ -101,6 +100,7 @@ namespace Radegast
             this.label7 = new System.Windows.Forms.Label();\r
             this.btnClose = new System.Windows.Forms.Button();\r
             this.textBox1 = new System.Windows.Forms.TextBox();\r
+            this.txtFullName = new System.Windows.Forms.TextBox();\r
             this.tabProfile.SuspendLayout();\r
             this.tpgProfile.SuspendLayout();\r
             this.tpgWeb.SuspendLayout();\r
@@ -128,6 +128,8 @@ namespace Radegast
             // \r
             // tpgProfile\r
             // \r
+            this.tpgProfile.Controls.Add(this.txtFullName);\r
+            this.tpgProfile.Controls.Add(this.anPartner);\r
             this.tpgProfile.Controls.Add(this.btnIM);\r
             this.tpgProfile.Controls.Add(this.btnFriend);\r
             this.tpgProfile.Controls.Add(this.slPicPanel);\r
@@ -137,12 +139,10 @@ namespace Radegast
             this.tpgProfile.Controls.Add(this.rtbAbout);\r
             this.tpgProfile.Controls.Add(this.txtUUID);\r
             this.tpgProfile.Controls.Add(this.label9);\r
-            this.tpgProfile.Controls.Add(this.txtPartner);\r
             this.tpgProfile.Controls.Add(this.label5);\r
             this.tpgProfile.Controls.Add(this.label4);\r
             this.tpgProfile.Controls.Add(this.label3);\r
             this.tpgProfile.Controls.Add(this.txtBornOn);\r
-            this.tpgProfile.Controls.Add(this.txtFullName);\r
             this.tpgProfile.Controls.Add(this.label2);\r
             this.tpgProfile.Controls.Add(this.label1);\r
             this.tpgProfile.Location = new System.Drawing.Point(4, 22);\r
@@ -153,6 +153,15 @@ namespace Radegast
             this.tpgProfile.Text = "Profile";\r
             this.tpgProfile.UseVisualStyleBackColor = true;\r
             // \r
+            // anPartner\r
+            // \r
+            this.anPartner.AgentID = ((OpenMetaverse.UUID)(resources.GetObject("anPartner.AgentID")));\r
+            this.anPartner.Location = new System.Drawing.Point(306, 34);\r
+            this.anPartner.Name = "anPartner";\r
+            this.anPartner.ReadOnly = true;\r
+            this.anPartner.Size = new System.Drawing.Size(148, 21);\r
+            this.anPartner.TabIndex = 20;\r
+            // \r
             // btnIM\r
             // \r
             this.btnIM.Location = new System.Drawing.Point(312, 368);\r
@@ -243,15 +252,6 @@ namespace Radegast
             this.label9.TabIndex = 9;\r
             this.label9.Text = "Key:";\r
             // \r
-            // txtPartner\r
-            // \r
-            this.txtPartner.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));\r
-            this.txtPartner.Location = new System.Drawing.Point(306, 33);\r
-            this.txtPartner.Name = "txtPartner";\r
-            this.txtPartner.ReadOnly = true;\r
-            this.txtPartner.Size = new System.Drawing.Size(148, 21);\r
-            this.txtPartner.TabIndex = 10;\r
-            // \r
             // label5\r
             // \r
             this.label5.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));\r
@@ -291,16 +291,6 @@ namespace Radegast
             this.txtBornOn.Size = new System.Drawing.Size(148, 21);\r
             this.txtBornOn.TabIndex = 5;\r
             // \r
-            // txtFullName\r
-            // \r
-            this.txtFullName.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)\r
-                        | System.Windows.Forms.AnchorStyles.Right)));\r
-            this.txtFullName.Location = new System.Drawing.Point(50, 6);\r
-            this.txtFullName.Name = "txtFullName";\r
-            this.txtFullName.ReadOnly = true;\r
-            this.txtFullName.Size = new System.Drawing.Size(196, 21);\r
-            this.txtFullName.TabIndex = 4;\r
-            // \r
             // label2\r
             // \r
             this.label2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));\r
@@ -563,6 +553,14 @@ namespace Radegast
             this.textBox1.DragDrop += new System.Windows.Forms.DragEventHandler(this.textBox1_DragDrop);\r
             this.textBox1.DragEnter += new System.Windows.Forms.DragEventHandler(this.textBox1_DragEnter);\r
             // \r
+            // txtFullName\r
+            // \r
+            this.txtFullName.Location = new System.Drawing.Point(50, 6);\r
+            this.txtFullName.Name = "txtFullName";\r
+            this.txtFullName.ReadOnly = true;\r
+            this.txtFullName.Size = new System.Drawing.Size(196, 21);\r
+            this.txtFullName.TabIndex = 4;\r
+            // \r
             // frmProfile\r
             // \r
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);\r
@@ -598,12 +596,10 @@ namespace Radegast
         public System.Windows.Forms.TabPage tpgWeb;\r
         public System.Windows.Forms.TabPage tpgFirstLife;\r
         public System.Windows.Forms.Label label1;\r
-        public System.Windows.Forms.TextBox txtFullName;\r
         public System.Windows.Forms.Label label2;\r
         public System.Windows.Forms.Label label4;\r
         public System.Windows.Forms.Label label3;\r
         public System.Windows.Forms.TextBox txtBornOn;\r
-        public System.Windows.Forms.TextBox txtPartner;\r
         public System.Windows.Forms.Label label5;\r
         public System.Windows.Forms.Button btnClose;\r
         public System.Windows.Forms.Panel pnlWeb;\r
@@ -635,6 +631,8 @@ namespace Radegast
         public System.Windows.Forms.TextBox pickLocation;\r
         public System.Windows.Forms.Button btnShowOnMap;\r
         public System.Windows.Forms.Button btnTeleport;\r
+        public AgentNameTextBox anPartner;\r
+        public System.Windows.Forms.TextBox txtFullName;\r
 \r
     }\r
 }
\ No newline at end of file
index 890ee1c..abe8e5f 100644 (file)
@@ -78,7 +78,6 @@ namespace Radegast
             }\r
 \r
             // Callbacks\r
-            client.Avatars.OnAvatarNames += new AvatarManager.AvatarNamesCallback(Avatars_OnAvatarNames);\r
             client.Avatars.OnAvatarProperties += new AvatarManager.AvatarPropertiesCallback(Avatars_OnAvatarProperties);\r
             client.Avatars.OnAvatarPicks += new AvatarManager.AvatarPicksCallback(Avatars_OnAvatarPicks);\r
             client.Avatars.OnPickInfo += new AvatarManager.PickInfoCallback(Avatars_OnPickInfo);\r
@@ -90,7 +89,6 @@ namespace Radegast
 \r
         void frmProfile_Disposed(object sender, EventArgs e)\r
         {\r
-            client.Avatars.OnAvatarNames -= new AvatarManager.AvatarNamesCallback(Avatars_OnAvatarNames);\r
             client.Avatars.OnAvatarProperties -= new AvatarManager.AvatarPropertiesCallback(Avatars_OnAvatarProperties);\r
             client.Avatars.OnAvatarPicks -= new AvatarManager.AvatarPicksCallback(Avatars_OnAvatarPicks);\r
             client.Avatars.OnPickInfo -= new AvatarManager.PickInfoCallback(Avatars_OnPickInfo);\r
@@ -241,21 +239,6 @@ namespace Radegast
             Close();\r
         }\r
 \r
-        private void Avatars_OnAvatarNames(Dictionary<UUID, string> names)\r
-        {\r
-            foreach (KeyValuePair<UUID, string> kvp in names)\r
-            {\r
-                BeginInvoke(new OnSetPartnerText(SetPartnerText), new object[] { kvp.Value });\r
-                break;\r
-            }\r
-        }\r
-\r
-        private delegate void OnSetPartnerText(string partner);\r
-        private void SetPartnerText(string partner)\r
-        {\r
-            txtPartner.Text = partner;\r
-        }\r
-\r
         //comes in on separate thread\r
         private void Avatars_OnAvatarProperties(UUID avatarID, Avatar.AvatarProperties properties)\r
         {\r
@@ -308,7 +291,7 @@ namespace Radegast
         private void SetProfileProperties(Avatar.AvatarProperties properties)\r
         {\r
             txtBornOn.Text = properties.BornOn;\r
-            if (properties.Partner != UUID.Zero) client.Avatars.RequestAvatarName(properties.Partner);\r
+            anPartner.AgentID = properties.Partner;\r
 \r
             if (fullName.EndsWith("Linden")) rtbAccountInfo.AppendText("Linden Lab Employee\n");\r
             if (properties.Identified) rtbAccountInfo.AppendText("Identified\n");\r
index 8d714a7..ea4f193 100644 (file)
   <resheader name="writer">\r
     <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\r
   </resheader>\r
+  <data name="anPartner.AgentID" mimetype="application/x-microsoft.net.object.binary.base64">\r
+    <value>\r
+        AAEAAAD/////AQAAAAAAAAAMAgAAAElPcGVuTWV0YXZlcnNlVHlwZXMsIFZlcnNpb249MC4wLjAuMCwg\r
+        Q3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1udWxsBQEAAAAST3Blbk1ldGF2ZXJzZS5VVUlE\r
+        AQAAAARHdWlkAwtTeXN0ZW0uR3VpZAIAAAAE/f///wtTeXN0ZW0uR3VpZAsAAAACX2ECX2ICX2MCX2QC\r
+        X2UCX2YCX2cCX2gCX2kCX2oCX2sAAAAAAAAAAAAAAAgHBwICAgICAgICAAAAAAAAAAAAAAAAAAAAAAs=\r
+</value>\r
+  </data>\r
   <metadata name="tbpPicks.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">\r
     <value>True</value>\r
   </metadata>\r