OSDN Git Service

RAD-123: Ban/Eject controls within Radegast
authorLatif Khalifa <latifer@streamgrid.net>
Wed, 12 May 2010 11:16:39 +0000 (11:16 +0000)
committerLatif Khalifa <latifer@streamgrid.net>
Wed, 12 May 2010 11:16:39 +0000 (11:16 +0000)
git-svn-id: https://radegast.googlecode.com/svn/trunk@622 f7a694da-4d33-11de-9ad6-1127a62b9fcd

Radegast/GUI/Consoles/ChatConsole.Designer.cs
Radegast/GUI/Consoles/ChatConsole.cs

index 9c5293c..8b82241 100644 (file)
@@ -102,6 +102,7 @@ namespace Radegast
             this.pnlChatInput = new System.Windows.Forms.Panel();
             this.cbChatType = new System.Windows.Forms.ComboBox();
             this.cbxInput = new Radegast.ChatInputBox();
+            this.ctxEstateEject = new System.Windows.Forms.ToolStripMenuItem();
             this.splitContainer1.Panel1.SuspendLayout();
             this.splitContainer1.Panel2.SuspendLayout();
             this.splitContainer1.SuspendLayout();
@@ -197,15 +198,16 @@ namespace Radegast
             this.ctxOfferTP,
             this.ctxTeleportTo,
             this.ctxEject,
-            this.ctxBan});
+            this.ctxBan,
+            this.ctxEstateEject});
             this.avatarContext.Name = "avatarContext";
-            this.avatarContext.Size = new System.Drawing.Size(157, 334);
+            this.avatarContext.Size = new System.Drawing.Size(163, 356);
             this.avatarContext.Opening += new System.ComponentModel.CancelEventHandler(this.avatarContext_Opening);
             // 
             // ctxProfile
             // 
             this.ctxProfile.Name = "ctxProfile";
-            this.ctxProfile.Size = new System.Drawing.Size(156, 22);
+            this.ctxProfile.Size = new System.Drawing.Size(162, 22);
             this.ctxProfile.Text = "Profile";
             this.ctxProfile.Click += new System.EventHandler(this.tbtnProfile_Click);
             // 
@@ -213,63 +215,63 @@ namespace Radegast
             // 
             this.ctxPay.Enabled = false;
             this.ctxPay.Name = "ctxPay";
-            this.ctxPay.Size = new System.Drawing.Size(156, 22);
+            this.ctxPay.Size = new System.Drawing.Size(162, 22);
             this.ctxPay.Text = "Pay";
             this.ctxPay.Click += new System.EventHandler(this.ctxPay_Click);
             // 
             // ctxStartIM
             // 
             this.ctxStartIM.Name = "ctxStartIM";
-            this.ctxStartIM.Size = new System.Drawing.Size(156, 22);
+            this.ctxStartIM.Size = new System.Drawing.Size(162, 22);
             this.ctxStartIM.Text = "Start IM";
             this.ctxStartIM.Click += new System.EventHandler(this.tbtnStartIM_Click);
             // 
             // ctxFollow
             // 
             this.ctxFollow.Name = "ctxFollow";
-            this.ctxFollow.Size = new System.Drawing.Size(156, 22);
+            this.ctxFollow.Size = new System.Drawing.Size(162, 22);
             this.ctxFollow.Text = "Follow";
             this.ctxFollow.Click += new System.EventHandler(this.tbtnFollow_Click);
             // 
             // ctxTextures
             // 
             this.ctxTextures.Name = "ctxTextures";
-            this.ctxTextures.Size = new System.Drawing.Size(156, 22);
+            this.ctxTextures.Size = new System.Drawing.Size(162, 22);
             this.ctxTextures.Text = "Textures";
             this.ctxTextures.Click += new System.EventHandler(this.dumpOufitBtn_Click);
             // 
             // ctxAttach
             // 
             this.ctxAttach.Name = "ctxAttach";
-            this.ctxAttach.Size = new System.Drawing.Size(156, 22);
+            this.ctxAttach.Size = new System.Drawing.Size(162, 22);
             this.ctxAttach.Text = "Attachments";
             this.ctxAttach.Click += new System.EventHandler(this.tbtnAttach_Click);
             // 
             // ctxMaster
             // 
             this.ctxMaster.Name = "ctxMaster";
-            this.ctxMaster.Size = new System.Drawing.Size(156, 22);
+            this.ctxMaster.Size = new System.Drawing.Size(162, 22);
             this.ctxMaster.Text = "Master controls";
             this.ctxMaster.Click += new System.EventHandler(this.tbtnMaster_Click);
             // 
             // ctxAnim
             // 
             this.ctxAnim.Name = "ctxAnim";
-            this.ctxAnim.Size = new System.Drawing.Size(156, 22);
+            this.ctxAnim.Size = new System.Drawing.Size(162, 22);
             this.ctxAnim.Text = "Animations";
             this.ctxAnim.Click += new System.EventHandler(this.tbtnAnim_Click);
             // 
             // ctxPoint
             // 
             this.ctxPoint.Name = "ctxPoint";
-            this.ctxPoint.Size = new System.Drawing.Size(156, 22);
+            this.ctxPoint.Size = new System.Drawing.Size(162, 22);
             this.ctxPoint.Text = "Point at";
             this.ctxPoint.Click += new System.EventHandler(this.ctxPoint_Click);
             // 
             // ctxSource
             // 
             this.ctxSource.Name = "ctxSource";
-            this.ctxSource.Size = new System.Drawing.Size(156, 22);
+            this.ctxSource.Size = new System.Drawing.Size(162, 22);
             this.ctxSource.Text = "Set as source";
             this.ctxSource.ToolTipText = " Set as source ";
             this.ctxSource.Click += new System.EventHandler(this.ctxSource_Click);
@@ -277,7 +279,7 @@ namespace Radegast
             // ctxOfferTP
             // 
             this.ctxOfferTP.Name = "ctxOfferTP";
-            this.ctxOfferTP.Size = new System.Drawing.Size(156, 22);
+            this.ctxOfferTP.Size = new System.Drawing.Size(162, 22);
             this.ctxOfferTP.Text = "Offer Teleport";
             this.ctxOfferTP.ToolTipText = " Offer Teleport ";
             this.ctxOfferTP.Click += new System.EventHandler(this.ctxOfferTP_Click);
@@ -285,7 +287,7 @@ namespace Radegast
             // ctxTeleportTo
             // 
             this.ctxTeleportTo.Name = "ctxTeleportTo";
-            this.ctxTeleportTo.Size = new System.Drawing.Size(156, 22);
+            this.ctxTeleportTo.Size = new System.Drawing.Size(162, 22);
             this.ctxTeleportTo.Text = "Teleport To";
             this.ctxTeleportTo.ToolTipText = " Teleport To ";
             this.ctxTeleportTo.Click += new System.EventHandler(this.ctxTeleportTo_Click);
@@ -293,16 +295,18 @@ namespace Radegast
             // ctxEject
             // 
             this.ctxEject.Name = "ctxEject";
-            this.ctxEject.Size = new System.Drawing.Size(156, 22);
+            this.ctxEject.Size = new System.Drawing.Size(162, 22);
             this.ctxEject.Text = "Eject";
             this.ctxEject.ToolTipText = " Eject ";
+            this.ctxEject.Click += new System.EventHandler(this.ctxEject_Click);
             // 
             // ctxBan
             // 
             this.ctxBan.Name = "ctxBan";
-            this.ctxBan.Size = new System.Drawing.Size(156, 22);
+            this.ctxBan.Size = new System.Drawing.Size(162, 22);
             this.ctxBan.Text = "Ban";
             this.ctxBan.ToolTipText = " Ban ";
+            this.ctxBan.Click += new System.EventHandler(this.ctxBan_Click);
             // 
             // toolStrip1
             // 
@@ -556,6 +560,14 @@ namespace Radegast
             this.cbxInput.KeyDown += new System.Windows.Forms.KeyEventHandler(this.cbxInput_KeyDown);
             this.cbxInput.SizeChanged += new System.EventHandler(this.cbxInput_SizeChanged);
             // 
+            // ctxEstateEject
+            // 
+            this.ctxEstateEject.Name = "ctxEstateEject";
+            this.ctxEstateEject.Size = new System.Drawing.Size(162, 22);
+            this.ctxEstateEject.Text = "Eject from estate";
+            this.ctxEstateEject.ToolTipText = " Eject from estate ";
+            this.ctxEstateEject.Click += new System.EventHandler(this.ctxEstateEject_Click);
+            // 
             // ChatConsole
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@@ -622,5 +634,6 @@ namespace Radegast
         private ToolStripMenuItem ctxTeleportTo;
         private ToolStripMenuItem ctxEject;
         private ToolStripMenuItem ctxBan;
+        private ToolStripMenuItem ctxEstateEject;
     }
 }
index 757d1e6..c1f37e3 100644 (file)
@@ -858,6 +858,27 @@ namespace Radegast
                 tabConsole.DisplayNotificationInChat(string.Format("Could not locate {0}", pname));
             }
         }
+
+        private void ctxEject_Click(object sender, EventArgs e)
+        {
+            if (lvwObjects.SelectedItems.Count != 1) return;
+            UUID av = (UUID)lvwObjects.SelectedItems[0].Tag;
+            client.Parcels.EjectUser(av, false);
+        }
+
+        private void ctxBan_Click(object sender, EventArgs e)
+        {
+            if (lvwObjects.SelectedItems.Count != 1) return;
+            UUID av = (UUID)lvwObjects.SelectedItems[0].Tag;
+            client.Parcels.EjectUser(av, true);
+        }
+
+        private void ctxEstateEject_Click(object sender, EventArgs e)
+        {
+            if (lvwObjects.SelectedItems.Count != 1) return;
+            UUID av = (UUID)lvwObjects.SelectedItems[0].Tag;
+            client.Estate.KickUser(av);
+        }
     }
 
     public class SorterClass : System.Collections.IComparer