this.tbtnExit = new System.Windows.Forms.ToolStripMenuItem();\r
this.tbtnAttachments = new System.Windows.Forms.ToolStripDropDownButton();\r
this.tbtnAttach = new System.Windows.Forms.ToolStripButton();\r
+ this.tlblStatus = new System.Windows.Forms.ToolStripLabel();\r
this.toolStrip1.SuspendLayout();\r
this.SuspendLayout();\r
// \r
this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {\r
this.tbtnFile,\r
this.tbtnAttachments,\r
- this.tbtnAttach});\r
+ this.tbtnAttach,\r
+ this.tlblStatus});\r
this.toolStrip1.Location = new System.Drawing.Point(0, 0);\r
this.toolStrip1.Name = "toolStrip1";\r
this.toolStrip1.Size = new System.Drawing.Size(382, 25);\r
// tbtnSave\r
// \r
this.tbtnSave.Name = "tbtnSave";\r
- this.tbtnSave.Size = new System.Drawing.Size(152, 22);\r
+ this.tbtnSave.Size = new System.Drawing.Size(146, 22);\r
this.tbtnSave.Text = "Save";\r
this.tbtnSave.Click += new System.EventHandler(this.tbtnSave_Click);\r
// \r
// tbtnSaveToDisk\r
// \r
this.tbtnSaveToDisk.Name = "tbtnSaveToDisk";\r
- this.tbtnSaveToDisk.Size = new System.Drawing.Size(152, 22);\r
+ this.tbtnSaveToDisk.Size = new System.Drawing.Size(146, 22);\r
this.tbtnSaveToDisk.Text = "Save to Disk...";\r
// \r
// sprtExit\r
// \r
this.sprtExit.Name = "sprtExit";\r
- this.sprtExit.Size = new System.Drawing.Size(149, 6);\r
+ this.sprtExit.Size = new System.Drawing.Size(143, 6);\r
// \r
// tbtnExit\r
// \r
this.tbtnExit.Enabled = false;\r
this.tbtnExit.Name = "tbtnExit";\r
- this.tbtnExit.Size = new System.Drawing.Size(152, 22);\r
+ this.tbtnExit.Size = new System.Drawing.Size(146, 22);\r
this.tbtnExit.Text = "Exit";\r
this.tbtnExit.Click += new System.EventHandler(this.tbtnExit_Click);\r
// \r
this.tbtnAttach.Text = "Detach";\r
this.tbtnAttach.Click += new System.EventHandler(this.tbtnAttach_Click);\r
// \r
+ // tlblStatus\r
+ // \r
+ this.tlblStatus.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right;\r
+ this.tlblStatus.Name = "tlblStatus";\r
+ this.tlblStatus.Size = new System.Drawing.Size(38, 22);\r
+ this.tlblStatus.Text = "status";\r
+ // \r
// Notecard\r
// \r
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);\r
private System.Windows.Forms.ToolStripMenuItem tbtnExit;\r
private System.Windows.Forms.ToolStripDropDownButton tbtnAttachments;\r
private System.Windows.Forms.ToolStripButton tbtnAttach;\r
+ private System.Windows.Forms.ToolStripLabel tlblStatus;\r
}\r
}\r
Text = notecard.Name;\r
\r
rtbContent.DetectUrls = false;\r
- rtbContent.Text = "Loading...";\r
\r
// Callbacks\r
client.Assets.OnAssetReceived += new AssetManager.AssetReceivedCallback(Assets_OnAssetReceived);\r
\r
+ rtbContent.Text = " ";\r
+ UpdateStatus("Loading...");\r
client.Assets.RequestInventoryAsset(notecard, true);\r
}\r
\r
tbtnAttachments.DropDownItems.Add(titem);\r
}\r
}\r
+ UpdateStatus("OK");\r
}\r
else\r
{\r
+ UpdateStatus("Failed");\r
rtbContent.Text = "Failed to download notecard.";\r
}\r
}\r
\r
n.Encode();\r
\r
+ UpdateStatus("Saving...");\r
+\r
+\r
client.Inventory.RequestUploadNotecardAsset(n.AssetData, notecard.UUID,\r
delegate(bool uploadSuccess, string status, UUID itemID, UUID assetID)\r
{\r
success = uploadSuccess;\r
+ if (itemID == notecard.UUID)\r
+ {\r
+ if (success)\r
+ {\r
+ UpdateStatus("OK");\r
+ notecard.AssetUUID = assetID;\r
+ }\r
+ else\r
+ {\r
+ UpdateStatus("Failed");\r
+ }\r
+\r
+ }\r
message = status ?? "Unknown error uploading notecard asset";\r
}\r
);\r
}\r
\r
+ void UpdateStatus(string status)\r
+ {\r
+ if (InvokeRequired)\r
+ {\r
+ BeginInvoke(new MethodInvoker(delegate() { UpdateStatus(status); }));\r
+ return;\r
+ }\r
+\r
+ tlblStatus.Text = status;\r
+ }\r
+\r
}\r
}\r
{\r
// DisplayPartialImage(assetTexture);\r
}\r
- }, true);\r
+ });\r
}\r
\r
void SLImageHandler_Disposed(object sender, EventArgs e)\r
protected override void Detach()\r
{\r
base.Detach();\r
- ClientSize = pictureBox1.Size = new Size(image.Width, image.Height);\r
+ if (image != null)\r
+ {\r
+ ClientSize = pictureBox1.Size = new Size(image.Width, image.Height);\r
+ }\r
}\r
\r
private void saveToolStripMenuItem_Click(object sender, EventArgs e)\r
this.pnlDetail = new System.Windows.Forms.Panel();\r
this.panel1 = new System.Windows.Forms.Panel();\r
this.btnProfile = new System.Windows.Forms.Button();\r
- this.txtCreator = new System.Windows.Forms.TextBox();\r
+ this.txtCreator = new Radegast.AgentNameTextBox();\r
this.txtCreated = new System.Windows.Forms.TextBox();\r
this.txtAssetID = new System.Windows.Forms.TextBox();\r
this.lblCreated = new System.Windows.Forms.Label();\r
private System.Windows.Forms.TextBox txtItemName;\r
private System.Windows.Forms.Label lblCreator;\r
private System.Windows.Forms.Label lblItemName;\r
- private System.Windows.Forms.TextBox txtCreator;\r
+ private Radegast.AgentNameTextBox txtCreator;\r
private System.Windows.Forms.TextBox txtAssetID;\r
private System.Windows.Forms.Label lblAsset;\r
private System.Windows.Forms.Panel pnlDetail;\r
_EditTimer = new System.Threading.Timer(OnLabelEditTimer, null, System.Threading.Timeout.Infinite, System.Threading.Timeout.Infinite);\r
\r
// Callbacks\r
- client.Avatars.OnAvatarNames += new AvatarManager.AvatarNamesCallback(Avatars_OnAvatarNames);\r
Inventory.OnInventoryObjectAdded += new Inventory.InventoryObjectAdded(Store_OnInventoryObjectAdded);\r
Inventory.OnInventoryObjectUpdated += new Inventory.InventoryObjectUpdated(Store_OnInventoryObjectUpdated);\r
Inventory.OnInventoryObjectRemoved += new Inventory.InventoryObjectRemoved(Store_OnInventoryObjectRemoved);\r
\r
void InventoryConsole_Disposed(object sender, EventArgs e)\r
{\r
- client.Avatars.OnAvatarNames -= new AvatarManager.AvatarNamesCallback(Avatars_OnAvatarNames);\r
Inventory.OnInventoryObjectAdded -= new Inventory.InventoryObjectAdded(Store_OnInventoryObjectAdded);\r
Inventory.OnInventoryObjectUpdated -= new Inventory.InventoryObjectUpdated(Store_OnInventoryObjectUpdated);\r
Inventory.OnInventoryObjectRemoved -= new Inventory.InventoryObjectRemoved(Store_OnInventoryObjectRemoved);\r
AddBase(parent, newObject);\r
}\r
}\r
-\r
- void Avatars_OnAvatarNames(Dictionary<UUID, string> names)\r
- {\r
- if (txtCreator.Tag == null) return;\r
- if (InvokeRequired)\r
- {\r
- BeginInvoke(new MethodInvoker(delegate()\r
- {\r
- Avatars_OnAvatarNames(names);\r
- }));\r
- return;\r
- }\r
-\r
- if (names.ContainsKey((UUID)txtCreator.Tag))\r
- {\r
- txtCreator.Text = names[(UUID)txtCreator.Tag];\r
- }\r
- }\r
#endregion\r
\r
#region Node manipulation\r
\r
private void btnProfile_Click(object sender, EventArgs e)\r
{\r
- (new frmProfile(instance, txtCreator.Text, (UUID)txtCreator.Tag)).Show();\r
+ (new frmProfile(instance, txtCreator.Text, txtCreator.AgentID)).Show();\r
\r
}\r
\r
{\r
btnProfile.Enabled = true;\r
txtItemName.Text = item.Name;\r
- txtCreator.Text = instance.getAvatarName(item.CreatorID);\r
+ txtCreator.AgentID = item.CreatorID;\r
txtCreator.Tag = item.CreatorID;\r
txtCreated.Text = item.CreationDate.ToString();\r
\r