OSDN Git Service

RAD-32: Notice attachments shown incorrectly
authorLatif Khalifa <latifer@streamgrid.net>
Sun, 20 Sep 2009 11:23:49 +0000 (11:23 +0000)
committerLatif Khalifa <latifer@streamgrid.net>
Sun, 20 Sep 2009 11:23:49 +0000 (11:23 +0000)
git-svn-id: https://radegast.googlecode.com/svn/trunk@254 f7a694da-4d33-11de-9ad6-1127a62b9fcd

Radegast/GUI/Notifications/GroupNoticeNotification.Designer.cs
Radegast/GUI/Notifications/GroupNoticeNotification.cs
Radegast/RadegastBuild.cs

index 0017794..1dd9d5e 100644 (file)
@@ -147,6 +147,7 @@ namespace Radegast
             this.btnSave.TabIndex = 1;\r
             this.btnSave.Text = "Save";\r
             this.btnSave.UseVisualStyleBackColor = true;\r
+            this.btnSave.Visible = false;\r
             this.btnSave.Click += new System.EventHandler(this.btnSave_Click);\r
             // \r
             // icnItem\r
@@ -165,6 +166,7 @@ namespace Radegast
             this.txtItemName.ReadOnly = true;\r
             this.txtItemName.Size = new System.Drawing.Size(198, 20);\r
             this.txtItemName.TabIndex = 7;\r
+            this.txtItemName.Visible = false;\r
             // \r
             // ntfGroupNotice\r
             // \r
index 3e1332d..c32478e 100644 (file)
@@ -50,7 +50,7 @@ namespace Radegast
             this.instance = instance;\r
             this.msg = msg;\r
 \r
-            if (msg.BinaryBucket.Length > 1)\r
+            if (msg.BinaryBucket.Length > 18 && msg.BinaryBucket[0] != 0)\r
             {\r
                 type = (AssetType)msg.BinaryBucket[1];\r
                 destinationFolderID = client.Inventory.FindFolderForType(type);\r
@@ -60,11 +60,9 @@ namespace Radegast
                     icnItem.Image = frmMain.ResourceImages.Images[icoIndx];\r
                     icnItem.Visible = true;\r
                 }\r
-                if (msg.BinaryBucket.Length > 18)\r
-                {\r
-                    txtItemName.Text = Utils.BytesToString(msg.BinaryBucket, 18, msg.BinaryBucket.Length - 19);\r
-                    btnSave.Enabled = true;\r
-                }\r
+                txtItemName.Text = Utils.BytesToString(msg.BinaryBucket, 18, msg.BinaryBucket.Length - 19);\r
+                btnSave.Enabled = true;\r
+                btnSave.Visible = icnItem.Visible = txtItemName.Visible = true;\r
             }\r
 \r
             string group = string.Empty;\r
@@ -93,6 +91,11 @@ namespace Radegast
                 lblSentBy.Text, System.Environment.NewLine,\r
                 txtNotice.Text\r
                 );\r
+            if (btnSave.Visible == true)\r
+            {\r
+                args.Buttons.Add(btnSave);\r
+                args.Text += string.Format("{0}Attachment: {1}", System.Environment.NewLine, txtItemName.Text);\r
+            }\r
             args.Buttons.Add(btnOK);\r
             FireNotificationCallback(args);\r
         }\r
@@ -111,6 +114,7 @@ namespace Radegast
         {\r
             SendReply(InstantMessageDialog.GroupNoticeInventoryAccepted, destinationFolderID.GetBytes());\r
             btnSave.Enabled = false;\r
+            btnOK.Focus();\r
         }\r
     }\r
 }\r
index 117f70a..2d057b2 100644 (file)
@@ -1,5 +1,5 @@
 // Autogenerated: run updatebuildnr.bat/sh to update \r
 namespace Radegast \r
 { \r
-    public static class RadegastBuild { public static int CurrentRev = 232; } \r
+    public static class RadegastBuild { public static int CurrentRev = 254; } \r
 } \r