From: <che...@us...> - 2007-06-22 22:11:18
|
Revision: 603 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=603&view=rev Author: chef_koch Date: 2007-06-22 15:11:15 -0700 (Fri, 22 Jun 2007) Log Message: ----------- added new option to limit the notifies Modified Paths: -------------- trunk/plugins/FritzBox/FritzBox/FritzBox.cs trunk/plugins/FritzBox/FritzBox/FritzBoxSetupFrom.Designer.cs trunk/plugins/FritzBox/FritzBox/FritzBoxSetupFrom.cs trunk/plugins/FritzBox/FritzBox/FritzBoxWatch.cs Modified: trunk/plugins/FritzBox/FritzBox/FritzBox.cs =================================================================== --- trunk/plugins/FritzBox/FritzBox/FritzBox.cs 2007-06-22 21:34:44 UTC (rev 602) +++ trunk/plugins/FritzBox/FritzBox/FritzBox.cs 2007-06-22 22:11:15 UTC (rev 603) @@ -45,7 +45,7 @@ * - add more comments to code * - split code more in methods/classes */ - [PluginIcons("FritzBox.png", "FritzBoxDisabled.png")] + [PluginIcons("FritzBox.FritzBox.png", "FritzBox.FritzBoxDisabled.png")] public class FritzBox : ISetupForm, IPlugin { #region Variables @@ -110,6 +110,7 @@ FritzBoxWatch.fritzBoxPort = xmlreader.GetValueAsString("fritzbox", "port", "1012"); // notify settings + FritzBoxWatch.maxNotifies = xmlreader.GetValueAsInt("fritzbox", "maxNotifies", 20); _closeOnTimeout = xmlreader.GetValueAsBool("fritzbox", "closeOnTimeout", false); _timeout = xmlreader.GetValueAsInt("fritzbox", "timeout", 10); @@ -139,6 +140,7 @@ Log.Info("FRITZ!Box: closeOnTimeout = {0}", _closeOnTimeout.ToString()); Log.Info("FRITZ!Box: timeout = {0}", _timeout.ToString()); Log.Info("FRITZ!Box: showMsnOnHeading = {0}", _showMsnOnHeading.ToString()); + Log.Info("FRITZ!Box: maxNotifies = {0}", FritzBoxWatch.maxNotifies.ToString()); Log.Info("FRITZ!Box: stopMedia = {0}", _stopMedia.ToString()); Log.Info("FRITZ!Box: resumeMedia = {0}", _resumeMedia.ToString()); @@ -330,6 +332,7 @@ { case "RING": OnIncomingCall(strList[0], strList[3], strList[4]); + FritzBoxWatch.notifyCount--; break; case "CALL": Modified: trunk/plugins/FritzBox/FritzBox/FritzBoxSetupFrom.Designer.cs =================================================================== --- trunk/plugins/FritzBox/FritzBox/FritzBoxSetupFrom.Designer.cs 2007-06-22 21:34:44 UTC (rev 602) +++ trunk/plugins/FritzBox/FritzBox/FritzBoxSetupFrom.Designer.cs 2007-06-22 22:11:15 UTC (rev 603) @@ -33,7 +33,6 @@ this.tabGeneral = new System.Windows.Forms.TabPage(); this.checkBoxExtensiveLogging = new MediaPortal.UserInterface.Controls.MPCheckBox(); this.mpGroupBox1 = new MediaPortal.UserInterface.Controls.MPGroupBox(); - this.pictureBox1 = new System.Windows.Forms.PictureBox(); this.buttonTest = new MediaPortal.UserInterface.Controls.MPButton(); this.textBoxPort = new MediaPortal.UserInterface.Controls.MPTextBox(); this.textBoxAddress = new MediaPortal.UserInterface.Controls.MPTextBox(); @@ -58,7 +57,6 @@ this.checkBoxResumeMedia = new MediaPortal.UserInterface.Controls.MPCheckBox(); this.checkBoxStopMedia = new MediaPortal.UserInterface.Controls.MPCheckBox(); this.tabPhonebook = new System.Windows.Forms.TabPage(); - this.pictureBoxCaller = new System.Windows.Forms.PictureBox(); this.buttonCallerChange = new MediaPortal.UserInterface.Controls.MPButton(); this.checkBoxCallerShow = new MediaPortal.UserInterface.Controls.MPCheckBox(); this.textBoxCallerName = new MediaPortal.UserInterface.Controls.MPTextBox(); @@ -74,18 +72,23 @@ this.buttonSave = new MediaPortal.UserInterface.Controls.MPButton(); this.buttonCancel = new MediaPortal.UserInterface.Controls.MPButton(); this.openFileDialog = new System.Windows.Forms.OpenFileDialog(); + this.pictureBox1 = new System.Windows.Forms.PictureBox(); + this.pictureBoxCaller = new System.Windows.Forms.PictureBox(); + this.upDownMaxNotifies = new MediaPortal.UserInterface.Controls.MPNumericUpDown(); + this.lblMaxNotifies = new MediaPortal.UserInterface.Controls.MPLabel(); this.tabControlFritzBoxSettings.SuspendLayout(); this.tabGeneral.SuspendLayout(); this.mpGroupBox1.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); this.tabIncoming.SuspendLayout(); this.groupBoxPhonebook.SuspendLayout(); this.groupBoxNotify.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownTimeout)).BeginInit(); this.groupBoxMedia.SuspendLayout(); this.tabPhonebook.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.dataGridView)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.pictureBoxCaller)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.dataGridView)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.upDownMaxNotifies)).BeginInit(); this.SuspendLayout(); // // tabControlFritzBoxSettings @@ -144,16 +147,6 @@ this.mpGroupBox1.TabStop = false; this.mpGroupBox1.Text = "connection"; // - // pictureBox1 - // - this.pictureBox1.Image = global::FritzBox.Properties.Resources.FritzBox; - this.pictureBox1.Location = new System.Drawing.Point(6, 20); - this.pictureBox1.Name = "pictureBox1"; - this.pictureBox1.Size = new System.Drawing.Size(97, 99); - this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom; - this.pictureBox1.TabIndex = 2; - this.pictureBox1.TabStop = false; - // // buttonTest // this.buttonTest.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); @@ -291,6 +284,8 @@ // this.groupBoxNotify.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); + this.groupBoxNotify.Controls.Add(this.lblMaxNotifies); + this.groupBoxNotify.Controls.Add(this.upDownMaxNotifies); this.groupBoxNotify.Controls.Add(this.checkBoxShowMsnOnHeading); this.groupBoxNotify.Controls.Add(this.buttonMSNsRemove); this.groupBoxNotify.Controls.Add(this.checkBoxFilterMSNs); @@ -450,16 +445,6 @@ this.tabPhonebook.Text = "Phonebook"; this.tabPhonebook.UseVisualStyleBackColor = true; // - // pictureBoxCaller - // - this.pictureBoxCaller.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.pictureBoxCaller.Location = new System.Drawing.Point(417, 38); - this.pictureBoxCaller.Name = "pictureBoxCaller"; - this.pictureBoxCaller.Size = new System.Drawing.Size(100, 122); - this.pictureBoxCaller.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; - this.pictureBoxCaller.TabIndex = 13; - this.pictureBoxCaller.TabStop = false; - // // buttonCallerChange // this.buttonCallerChange.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); @@ -610,8 +595,60 @@ this.buttonCancel.UseVisualStyleBackColor = true; this.buttonCancel.Click += new System.EventHandler(this.buttonCancel_Click); // - // Form1 + // pictureBox1 // + this.pictureBox1.Image = global::FritzBox.Properties.Resources.FritzBox; + this.pictureBox1.Location = new System.Drawing.Point(6, 20); + this.pictureBox1.Name = "pictureBox1"; + this.pictureBox1.Size = new System.Drawing.Size(97, 99); + this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom; + this.pictureBox1.TabIndex = 2; + this.pictureBox1.TabStop = false; + // + // pictureBoxCaller + // + this.pictureBoxCaller.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.pictureBoxCaller.Location = new System.Drawing.Point(417, 38); + this.pictureBoxCaller.Name = "pictureBoxCaller"; + this.pictureBoxCaller.Size = new System.Drawing.Size(100, 122); + this.pictureBoxCaller.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.pictureBoxCaller.TabIndex = 13; + this.pictureBoxCaller.TabStop = false; + // + // upDownMaxNotifies + // + this.upDownMaxNotifies.Location = new System.Drawing.Point(465, 20); + this.upDownMaxNotifies.Maximum = new decimal(new int[] { + 20, + 0, + 0, + 0}); + this.upDownMaxNotifies.Minimum = new decimal(new int[] { + 1, + 0, + 0, + 0}); + this.upDownMaxNotifies.Name = "upDownMaxNotifies"; + this.upDownMaxNotifies.Size = new System.Drawing.Size(40, 21); + this.upDownMaxNotifies.TabIndex = 7; + this.upDownMaxNotifies.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; + this.upDownMaxNotifies.Value = new decimal(new int[] { + 20, + 0, + 0, + 0}); + // + // lblMaxNotifies + // + this.lblMaxNotifies.AutoSize = true; + this.lblMaxNotifies.Location = new System.Drawing.Point(365, 22); + this.lblMaxNotifies.Name = "lblMaxNotifies"; + this.lblMaxNotifies.Size = new System.Drawing.Size(94, 13); + this.lblMaxNotifies.TabIndex = 8; + this.lblMaxNotifies.Text = "maximum Notifies:"; + // + // FritzBoxSetupFrom + // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(552, 393); @@ -623,7 +660,7 @@ this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.MaximizeBox = false; this.MinimizeBox = false; - this.Name = "Form1"; + this.Name = "FritzBoxSetupFrom"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.Text = "FRITZ!Box configuration"; this.tabControlFritzBoxSettings.ResumeLayout(false); @@ -631,7 +668,6 @@ this.tabGeneral.PerformLayout(); this.mpGroupBox1.ResumeLayout(false); this.mpGroupBox1.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); this.tabIncoming.ResumeLayout(false); this.groupBoxPhonebook.ResumeLayout(false); this.groupBoxPhonebook.PerformLayout(); @@ -642,8 +678,10 @@ this.groupBoxMedia.PerformLayout(); this.tabPhonebook.ResumeLayout(false); this.tabPhonebook.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.dataGridView)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.pictureBoxCaller)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.dataGridView)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.upDownMaxNotifies)).EndInit(); this.ResumeLayout(false); } @@ -695,5 +733,7 @@ private MediaPortal.UserInterface.Controls.MPButton buttonSave; private MediaPortal.UserInterface.Controls.MPButton buttonCancel; private System.Windows.Forms.OpenFileDialog openFileDialog; + private MediaPortal.UserInterface.Controls.MPNumericUpDown upDownMaxNotifies; + private MediaPortal.UserInterface.Controls.MPLabel lblMaxNotifies; } } \ No newline at end of file Modified: trunk/plugins/FritzBox/FritzBox/FritzBoxSetupFrom.cs =================================================================== --- trunk/plugins/FritzBox/FritzBox/FritzBoxSetupFrom.cs 2007-06-22 21:34:44 UTC (rev 602) +++ trunk/plugins/FritzBox/FritzBox/FritzBoxSetupFrom.cs 2007-06-22 22:11:15 UTC (rev 603) @@ -42,6 +42,7 @@ textBoxPort.Text = xmlreader.GetValueAsString("fritzbox", "port", "1012"); // notify settings + upDownMaxNotifies.Value = xmlreader.GetValueAsInt("fritzbox", "maxNotifies", 20); checkBoxCloseOnTimout.Checked = xmlreader.GetValueAsBool("fritzbox", "closeOnTimeout", false); numericUpDownTimeout.Value = xmlreader.GetValueAsInt("fritzbox", "timeout", 10); @@ -88,6 +89,7 @@ xmlwriter.SetValue("fritzbox", "port", textBoxPort.Text); // notify settings + xmlwriter.SetValue("fritzbox", "maxNotifies", upDownMaxNotifies.Value); xmlwriter.SetValueAsBool("fritzbox", "closeOnTimeout", checkBoxCloseOnTimout.Checked); xmlwriter.SetValue("fritzbox", "timeout", numericUpDownTimeout.Value); Modified: trunk/plugins/FritzBox/FritzBox/FritzBoxWatch.cs =================================================================== --- trunk/plugins/FritzBox/FritzBox/FritzBoxWatch.cs 2007-06-22 21:34:44 UTC (rev 602) +++ trunk/plugins/FritzBox/FritzBox/FritzBoxWatch.cs 2007-06-22 22:11:15 UTC (rev 603) @@ -52,6 +52,9 @@ public static string fritzBoxAddress; // address for the connected fritzbox public static string fritzBoxPort; // port for the connected fritzbox + + public static int maxNotifies = 20; + public static int notifyCount = 0; public void Start() { @@ -95,7 +98,11 @@ } if (cChar == '\n') { - FritzBoxAction(strLine); + if (notifyCount < maxNotifies) + { + FritzBoxAction(strLine); + notifyCount++; + } strLine = ""; cChar = '\0'; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |