From d19a45d5928882b096674dad467f8818076297e2 Mon Sep 17 00:00:00 2001 From: Latif Khalifa Date: Sat, 8 Mar 2014 16:17:22 +0100 Subject: [PATCH] RAD-451: Allow IM ding on every message --- Radegast/Core/IMTextManager.cs | 24 +++++++++++++++--------- Radegast/GUI/Consoles/IMTabWindow.Designer.cs | 16 +++++++++++++++- Radegast/GUI/Consoles/IMTabWindow.cs | 5 +++++ 3 files changed, 35 insertions(+), 10 deletions(-) diff --git a/Radegast/Core/IMTextManager.cs b/Radegast/Core/IMTextManager.cs index 4d9cc84..8e3c2c2 100644 --- a/Radegast/Core/IMTextManager.cs +++ b/Radegast/Core/IMTextManager.cs @@ -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") diff --git a/Radegast/GUI/Consoles/IMTabWindow.Designer.cs b/Radegast/GUI/Consoles/IMTabWindow.Designer.cs index 98894dd..e276df4 100644 --- a/Radegast/GUI/Consoles/IMTabWindow.Designer.cs +++ b/Radegast/GUI/Consoles/IMTabWindow.Designer.cs @@ -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; } } diff --git a/Radegast/GUI/Consoles/IMTabWindow.cs b/Radegast/GUI/Consoles/IMTabWindow.cs index 046054f..5f8d4d9 100644 --- a/Radegast/GUI/Consoles/IMTabWindow.cs +++ b/Radegast/GUI/Consoles/IMTabWindow.cs @@ -289,5 +289,10 @@ namespace Radegast { pnlChatInput.Height = cbxInput.Height + 9; } + + private void cbAlwaysDing_CheckedChanged(object sender, EventArgs e) + { + textManager.DingOnAllIncoming = ((CheckBox)sender).Checked; + } } } -- 2.11.0