OSDN Git Service

RAD-451: Allow IM ding on every message
authorLatif Khalifa <latifer@streamgrid.net>
Sat, 8 Mar 2014 15:17:22 +0000 (16:17 +0100)
committerLatif Khalifa <latifer@streamgrid.net>
Sat, 8 Mar 2014 15:17:22 +0000 (16:17 +0100)
Radegast/Core/IMTextManager.cs
Radegast/GUI/Consoles/IMTabWindow.Designer.cs
Radegast/GUI/Consoles/IMTabWindow.cs

index 4d9cc84..8e3c2c2 100644 (file)
@@ -41,16 +41,18 @@ namespace Radegast
 {
     public class IMTextManager
     {
-        private RadegastInstance instance;
-        private RadegastNetcom netcom { get { return instance.Netcom; } }
-        private ITextPrinter textPrinter;
-        private IMTextManagerType Type;
-        private UUID sessionID;
-        private string sessionName;
-        private bool AutoResponseSent = false;
-        private ArrayList textBuffer;
+        public bool DingOnAllIncoming = false;
 
-        private bool showTimestamps;
+        RadegastInstance instance;
+        RadegastNetcom netcom { get { return instance.Netcom; } }
+        ITextPrinter textPrinter;
+        IMTextManagerType Type;
+        UUID sessionID;
+        string sessionName;
+        bool AutoResponseSent = false;
+        ArrayList textBuffer;
+
+        bool showTimestamps;
 
         public IMTextManager(RadegastInstance instance, ITextPrinter textPrinter, IMTextManagerType type, UUID sessionID, string sessionName)
         {
@@ -154,6 +156,10 @@ namespace Radegast
                 }
             }
 
+            if (DingOnAllIncoming)
+            {
+                instance.MediaManager.PlayUISound(UISounds.IM);
+            }
             PrintIM(DateTime.Now, instance.Names.Get(e.IM.FromAgentID, e.IM.FromAgentName), e.IM.FromAgentID, msg);
 
             if (!AutoResponseSent && Type == IMTextManagerType.Agent && e.IM.FromAgentID != UUID.Zero && e.IM.FromAgentName != "Second Life")
index 98894dd..e276df4 100644 (file)
@@ -66,6 +66,7 @@ namespace Radegast
             this.btnPay = new System.Windows.Forms.Button();
             this.btnOfferTeleport = new System.Windows.Forms.Button();
             this.btnProfile = new System.Windows.Forms.Button();
+            this.cbAlwaysDing = new System.Windows.Forms.CheckBox();
             this.pnlChatInput.SuspendLayout();
             this.SuspendLayout();
             // 
@@ -156,10 +157,22 @@ namespace Radegast
             this.btnProfile.UseVisualStyleBackColor = true;
             this.btnProfile.Click += new System.EventHandler(this.tbtnProfile_Click);
             // 
+            // cbAlwaysDing
+            // 
+            this.cbAlwaysDing.AutoSize = true;
+            this.cbAlwaysDing.Location = new System.Drawing.Point(280, 4);
+            this.cbAlwaysDing.Name = "cbAlwaysDing";
+            this.cbAlwaysDing.Size = new System.Drawing.Size(108, 17);
+            this.cbAlwaysDing.TabIndex = 9;
+            this.cbAlwaysDing.Text = "Ding on every IM";
+            this.cbAlwaysDing.UseVisualStyleBackColor = true;
+            this.cbAlwaysDing.CheckedChanged += new System.EventHandler(this.cbAlwaysDing_CheckedChanged);
+            // 
             // IMTabWindow
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.Controls.Add(this.cbAlwaysDing);
             this.Controls.Add(this.btnPay);
             this.Controls.Add(this.btnOfferTeleport);
             this.Controls.Add(this.btnProfile);
@@ -183,10 +196,11 @@ namespace Radegast
         public ChatInputBox cbxInput;
         public System.Windows.Forms.Button btnSend;
         public System.Windows.Forms.ToolStrip toolStrip1;
-        private System.Windows.Forms.Panel pnlChatInput;
         public System.Windows.Forms.Button btnPay;
         public System.Windows.Forms.Button btnOfferTeleport;
         public System.Windows.Forms.Button btnProfile;
+        public System.Windows.Forms.CheckBox cbAlwaysDing;
+        public System.Windows.Forms.Panel pnlChatInput;
 
     }
 }
index 046054f..5f8d4d9 100644 (file)
@@ -289,5 +289,10 @@ namespace Radegast
         {
             pnlChatInput.Height = cbxInput.Height + 9;
         }
+
+        private void cbAlwaysDing_CheckedChanged(object sender, EventArgs e)
+        {
+            textManager.DingOnAllIncoming = ((CheckBox)sender).Checked;
+        }
     }
 }