From: <che...@us...> - 2007-02-06 02:47:14
|
Revision: 94 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=94&view=rev Author: chef_koch Date: 2007-02-05 18:46:58 -0800 (Mon, 05 Feb 2007) Log Message: ----------- added: when renaming a caller, who already has a thumbnail, the thumbnail will be renamed, too -> no manual work anymore added: some checks when adding caller cleaned up the setupform (typos, nice icon ...) Modified Paths: -------------- trunk/plugins/FritzBox/FritzBox.cs trunk/plugins/FritzBox/FritzBox.csproj trunk/plugins/FritzBox/FritzBoxSetupFrom.cs trunk/plugins/FritzBox/Properties/Resources.Designer.cs trunk/plugins/FritzBox/Properties/Resources.resx Modified: trunk/plugins/FritzBox/FritzBox.cs =================================================================== --- trunk/plugins/FritzBox/FritzBox.cs 2007-02-05 12:45:13 UTC (rev 93) +++ trunk/plugins/FritzBox/FritzBox.cs 2007-02-06 02:46:58 UTC (rev 94) @@ -104,7 +104,7 @@ char[] charSeparators = new char[] { ';' }; if (_extensiveLogging) - Log.Info("FritzBox: LoadSettings"); + Log.Info("FRITZ!Box: LoadSettings"); using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) { @@ -125,7 +125,7 @@ _msn = strMSN.Split(charSeparators, StringSplitOptions.RemoveEmptyEntries); if (_extensiveLogging) - Log.Debug("FritzBox: MSNs loaded: {0}", strMSN); + Log.Debug("FRITZ!Box: MSNs loaded: {0}", strMSN); _showMsnOnHeading = xmlreader.GetValueAsBool("fritzbox", "showMsnOnHeading", false); @@ -140,16 +140,16 @@ if (_extensiveLogging) { - Log.Info("FritzBox: closeOnTimeout = {0}", _closeOnTimeout.ToString()); - Log.Info("FritzBox: timeout = {0}", _timeout.ToString()); - Log.Info("FritzBox: showMsnOnHeading = {0}", _showMsnOnHeading.ToString()); + 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("FritzBox: stopMedia = {0}", _stopMedia.ToString()); - Log.Info("FritzBox: resumeMedia = {0}", _resumeMedia.ToString()); + Log.Info("FRITZ!Box: stopMedia = {0}", _stopMedia.ToString()); + Log.Info("FRITZ!Box: resumeMedia = {0}", _resumeMedia.ToString()); - Log.Info("FritzBox: usePhonebook = {0}", _usePhonebook.ToString()); - Log.Info("FritzBox: showUnknownCaller = {0}", _showUnknownCaller.ToString()); - Log.Info("FritzBox: saveUnknownCaller = {0}", _saveUnknownCaller.ToString()); + Log.Info("FRITZ!Box: usePhonebook = {0}", _usePhonebook.ToString()); + Log.Info("FRITZ!Box: showUnknownCaller = {0}", _showUnknownCaller.ToString()); + Log.Info("FRITZ!Box: saveUnknownCaller = {0}", _saveUnknownCaller.ToString()); } if (_usePhonebook) @@ -164,12 +164,12 @@ phonebook.Add(caller); if (_extensiveLogging) - Log.Debug("FritzBox: caller loaded: {0} {1} {2}", caller.callerId, caller.name, caller.show); + Log.Debug("FRITZ!Box: caller loaded: {0} {1} {2}", caller.callerId, caller.name, caller.show); } } if (_extensiveLogging) - Log.Debug("FritzBox: imported {0} callers", phonebook.Count.ToString()); + Log.Debug("FRITZ!Box: imported {0} callers", phonebook.Count.ToString()); } } @@ -177,7 +177,7 @@ private void SaveSettings() { if (_extensiveLogging) - Log.Info("FritzBox: SaveSettings"); + Log.Info("FRITZ!Box: SaveSettings"); using (MediaPortal.Profile.Settings xmlwriter = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) { @@ -482,7 +482,7 @@ /// </summary> public void Start() { - Log.Info("FritzBox Plugin {0} starting.", _version); + Log.Info("FRITZ!Box Plugin {0} starting.", _version); FritzBoxWatch = new FritzBoxWatch(); LoadSettings(); @@ -513,7 +513,7 @@ public string Description() { - return "Displays FritzBox calling information."; + return "Displays FRITZ!Box calling information."; } public bool DefaultEnabled() @@ -542,7 +542,7 @@ public string PluginName() { - return "FritzBox CallMonitor"; + return "FRITZ!Box CallMonitor"; } public bool HasSetup() Modified: trunk/plugins/FritzBox/FritzBox.csproj =================================================================== --- trunk/plugins/FritzBox/FritzBox.csproj 2007-02-05 12:45:13 UTC (rev 93) +++ trunk/plugins/FritzBox/FritzBox.csproj 2007-02-06 02:46:58 UTC (rev 94) @@ -94,6 +94,9 @@ <EmbeddedResource Include="FritzBoxDisabled.png" /> <EmbeddedResource Include="FritzBox.png" /> </ItemGroup> + <ItemGroup> + <None Include="gfx\FritzBoxIconTransparent.png" /> + </ItemGroup> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> <!-- To modify your build process, add your task inside one of the targets below and uncomment it. Other similar extension points exist, see Microsoft.Common.targets. Modified: trunk/plugins/FritzBox/FritzBoxSetupFrom.cs =================================================================== --- trunk/plugins/FritzBox/FritzBoxSetupFrom.cs 2007-02-05 12:45:13 UTC (rev 93) +++ trunk/plugins/FritzBox/FritzBoxSetupFrom.cs 2007-02-06 02:46:58 UTC (rev 94) @@ -58,13 +58,13 @@ private MediaPortal.UserInterface.Controls.MPCheckBox checkBoxSaveUnknownCaller; private MediaPortal.UserInterface.Controls.MPCheckBox checkBoxShowUnknownCaller; private MediaPortal.UserInterface.Controls.MPCheckBox checkBoxUsePhonebook; - private MediaPortal.UserInterface.Controls.MPCheckBox checkBoxNewShow; - private MediaPortal.UserInterface.Controls.MPTextBox textBoxNewName; - private MediaPortal.UserInterface.Controls.MPTextBox textBoxNewCallerId; - private MediaPortal.UserInterface.Controls.MPButton buttonRemove; - private MediaPortal.UserInterface.Controls.MPLabel labelNewCallerId; - private MediaPortal.UserInterface.Controls.MPLabel labelNewName; - private MediaPortal.UserInterface.Controls.MPButton buttonAdd; + private MediaPortal.UserInterface.Controls.MPCheckBox checkBoxCallerShow; + private MediaPortal.UserInterface.Controls.MPTextBox textBoxCallerName; + private MediaPortal.UserInterface.Controls.MPTextBox textBoxCallerId; + private MediaPortal.UserInterface.Controls.MPButton buttonCallerRemove; + private MediaPortal.UserInterface.Controls.MPLabel labelCallerId; + private MediaPortal.UserInterface.Controls.MPLabel labelCallerName; + private MediaPortal.UserInterface.Controls.MPButton buttonCallerChange; private MediaPortal.UserInterface.Controls.MPButton buttonCancel; private MediaPortal.UserInterface.Controls.MPButton buttonSave; private MediaPortal.UserInterface.Controls.MPNumericUpDown numericUpDownTimeout; @@ -81,10 +81,11 @@ private MediaPortal.UserInterface.Controls.MPLabel labelHelp; private MediaPortal.UserInterface.Controls.MPButton buttonMSNsRemove; private MediaPortal.UserInterface.Controls.MPButton buttonMSNsAdd; - private PictureBox pictureBox; + private PictureBox pictureBoxCaller; private MediaPortal.UserInterface.Controls.MPCheckBox checkBoxFilterMSNs; private MediaPortal.UserInterface.Controls.MPComboBox comboBoxMSNs; private MediaPortal.UserInterface.Controls.MPCheckBox checkBoxShowMsnOnHeading; + private PictureBox pictureBox1; /// <summary> /// Erforderliche Designervariable. @@ -155,21 +156,22 @@ this.checkBoxResumeMedia = new MediaPortal.UserInterface.Controls.MPCheckBox(); this.checkBoxStopMedia = new MediaPortal.UserInterface.Controls.MPCheckBox(); this.tabPhonebook = new System.Windows.Forms.TabPage(); - this.pictureBox = new System.Windows.Forms.PictureBox(); - this.buttonAdd = new MediaPortal.UserInterface.Controls.MPButton(); - this.checkBoxNewShow = new MediaPortal.UserInterface.Controls.MPCheckBox(); - this.textBoxNewName = new MediaPortal.UserInterface.Controls.MPTextBox(); - this.textBoxNewCallerId = new MediaPortal.UserInterface.Controls.MPTextBox(); - this.buttonRemove = new MediaPortal.UserInterface.Controls.MPButton(); + 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(); + this.textBoxCallerId = new MediaPortal.UserInterface.Controls.MPTextBox(); + this.buttonCallerRemove = new MediaPortal.UserInterface.Controls.MPButton(); this.dataGridView = new System.Windows.Forms.DataGridView(); this.colCallerId = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.colName = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.colShow = new System.Windows.Forms.DataGridViewCheckBoxColumn(); - this.labelNewCallerId = new MediaPortal.UserInterface.Controls.MPLabel(); - this.labelNewName = new MediaPortal.UserInterface.Controls.MPLabel(); + this.labelCallerId = new MediaPortal.UserInterface.Controls.MPLabel(); + this.labelCallerName = new MediaPortal.UserInterface.Controls.MPLabel(); this.buttonCancel = new MediaPortal.UserInterface.Controls.MPButton(); this.buttonSave = new MediaPortal.UserInterface.Controls.MPButton(); this.labelVersion = new MediaPortal.UserInterface.Controls.MPLabel(); + this.pictureBox1 = new System.Windows.Forms.PictureBox(); this.tabControlFritzBoxSettings.SuspendLayout(); this.tabGeneral.SuspendLayout(); this.mpGroupBox1.SuspendLayout(); @@ -179,8 +181,9 @@ ((System.ComponentModel.ISupportInitialize)(this.numericUpDownTimeout)).BeginInit(); this.groupBoxMedia.SuspendLayout(); this.tabPhonebook.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.pictureBox)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBoxCaller)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.dataGridView)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); this.SuspendLayout(); // // tabControlFritzBoxSettings @@ -224,6 +227,7 @@ // this.mpGroupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); + this.mpGroupBox1.Controls.Add(this.pictureBox1); this.mpGroupBox1.Controls.Add(this.buttonTest); this.mpGroupBox1.Controls.Add(this.textBoxPort); this.mpGroupBox1.Controls.Add(this.textBoxAddress); @@ -241,9 +245,9 @@ // buttonTest // this.buttonTest.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.buttonTest.Location = new System.Drawing.Point(430, 18); + this.buttonTest.Location = new System.Drawing.Point(430, 20); this.buttonTest.Name = "buttonTest"; - this.buttonTest.Size = new System.Drawing.Size(75, 25); + this.buttonTest.Size = new System.Drawing.Size(75, 21); this.buttonTest.TabIndex = 2; this.buttonTest.Text = "Test"; this.buttonTest.UseVisualStyleBackColor = true; @@ -254,9 +258,9 @@ this.textBoxPort.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.textBoxPort.BorderColor = System.Drawing.Color.Empty; - this.textBoxPort.Location = new System.Drawing.Point(60, 48); + this.textBoxPort.Location = new System.Drawing.Point(165, 47); this.textBoxPort.Name = "textBoxPort"; - this.textBoxPort.Size = new System.Drawing.Size(364, 21); + this.textBoxPort.Size = new System.Drawing.Size(259, 21); this.textBoxPort.TabIndex = 1; // // textBoxAddress @@ -264,15 +268,15 @@ this.textBoxAddress.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.textBoxAddress.BorderColor = System.Drawing.Color.Empty; - this.textBoxAddress.Location = new System.Drawing.Point(60, 20); + this.textBoxAddress.Location = new System.Drawing.Point(165, 20); this.textBoxAddress.Name = "textBoxAddress"; - this.textBoxAddress.Size = new System.Drawing.Size(364, 21); + this.textBoxAddress.Size = new System.Drawing.Size(259, 21); this.textBoxAddress.TabIndex = 0; // // labelPort // this.labelPort.AutoSize = true; - this.labelPort.Location = new System.Drawing.Point(25, 52); + this.labelPort.Location = new System.Drawing.Point(128, 50); this.labelPort.Name = "labelPort"; this.labelPort.Size = new System.Drawing.Size(31, 13); this.labelPort.TabIndex = 8; @@ -281,7 +285,7 @@ // labelAddress // this.labelAddress.AutoSize = true; - this.labelAddress.Location = new System.Drawing.Point(6, 24); + this.labelAddress.Location = new System.Drawing.Point(109, 24); this.labelAddress.Name = "labelAddress"; this.labelAddress.Size = new System.Drawing.Size(50, 13); this.labelAddress.TabIndex = 7; @@ -292,9 +296,9 @@ this.labelHelp.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.labelHelp.Location = new System.Drawing.Point(6, 73); + this.labelHelp.Location = new System.Drawing.Point(165, 73); this.labelHelp.Name = "labelHelp"; - this.labelHelp.Size = new System.Drawing.Size(499, 49); + this.labelHelp.Size = new System.Drawing.Size(340, 49); this.labelHelp.TabIndex = 6; // // tabIncoming @@ -329,7 +333,7 @@ // this.checkBoxSaveUnknownCaller.AutoSize = true; this.checkBoxSaveUnknownCaller.FlatStyle = System.Windows.Forms.FlatStyle.Popup; - this.checkBoxSaveUnknownCaller.Location = new System.Drawing.Point(24, 70); + this.checkBoxSaveUnknownCaller.Location = new System.Drawing.Point(24, 68); this.checkBoxSaveUnknownCaller.Name = "checkBoxSaveUnknownCaller"; this.checkBoxSaveUnknownCaller.Size = new System.Drawing.Size(121, 17); this.checkBoxSaveUnknownCaller.TabIndex = 2; @@ -398,7 +402,7 @@ this.buttonMSNsRemove.TabIndex = 5; this.buttonMSNsRemove.Text = "Remove"; this.buttonMSNsRemove.UseVisualStyleBackColor = true; - this.buttonMSNsRemove.Click += new System.EventHandler(this.buttonMsnRemove_Click); + this.buttonMSNsRemove.Click += new System.EventHandler(this.buttonMSNsRemove_Click); // // checkBoxFilterMSNs // @@ -421,7 +425,7 @@ this.buttonMSNsAdd.TabIndex = 4; this.buttonMSNsAdd.Text = "Add"; this.buttonMSNsAdd.UseVisualStyleBackColor = true; - this.buttonMSNsAdd.Click += new System.EventHandler(this.buttonMsnAdd_Click); + this.buttonMSNsAdd.Click += new System.EventHandler(this.buttonMSNsAdd_Click); // // comboBoxMSNs // @@ -505,15 +509,15 @@ // // tabPhonebook // - this.tabPhonebook.Controls.Add(this.pictureBox); - this.tabPhonebook.Controls.Add(this.buttonAdd); - this.tabPhonebook.Controls.Add(this.checkBoxNewShow); - this.tabPhonebook.Controls.Add(this.textBoxNewName); - this.tabPhonebook.Controls.Add(this.textBoxNewCallerId); - this.tabPhonebook.Controls.Add(this.buttonRemove); + this.tabPhonebook.Controls.Add(this.pictureBoxCaller); + this.tabPhonebook.Controls.Add(this.buttonCallerChange); + this.tabPhonebook.Controls.Add(this.checkBoxCallerShow); + this.tabPhonebook.Controls.Add(this.textBoxCallerName); + this.tabPhonebook.Controls.Add(this.textBoxCallerId); + this.tabPhonebook.Controls.Add(this.buttonCallerRemove); this.tabPhonebook.Controls.Add(this.dataGridView); - this.tabPhonebook.Controls.Add(this.labelNewCallerId); - this.tabPhonebook.Controls.Add(this.labelNewName); + this.tabPhonebook.Controls.Add(this.labelCallerId); + this.tabPhonebook.Controls.Add(this.labelCallerName); this.tabPhonebook.Location = new System.Drawing.Point(4, 22); this.tabPhonebook.Name = "tabPhonebook"; this.tabPhonebook.Padding = new System.Windows.Forms.Padding(3); @@ -522,72 +526,70 @@ this.tabPhonebook.Text = "Phonebook"; this.tabPhonebook.UseVisualStyleBackColor = true; // - // pictureBox + // pictureBoxCaller // - this.pictureBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Right))); - this.pictureBox.Location = new System.Drawing.Point(417, 38); - this.pictureBox.Name = "pictureBox"; - this.pictureBox.Size = new System.Drawing.Size(100, 122); - this.pictureBox.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; - this.pictureBox.TabIndex = 13; - this.pictureBox.TabStop = false; + 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; // - // buttonAdd + // buttonCallerChange // - this.buttonAdd.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.buttonAdd.Location = new System.Drawing.Point(417, 278); - this.buttonAdd.Name = "buttonAdd"; - this.buttonAdd.Size = new System.Drawing.Size(100, 25); - this.buttonAdd.TabIndex = 3; - this.buttonAdd.Text = "Add"; - this.buttonAdd.UseVisualStyleBackColor = true; - this.buttonAdd.Click += new System.EventHandler(this.buttonAdd_Click); + this.buttonCallerChange.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.buttonCallerChange.Location = new System.Drawing.Point(417, 278); + this.buttonCallerChange.Name = "buttonCallerChange"; + this.buttonCallerChange.Size = new System.Drawing.Size(100, 25); + this.buttonCallerChange.TabIndex = 3; + this.buttonCallerChange.Text = "Change"; + this.buttonCallerChange.UseVisualStyleBackColor = true; + this.buttonCallerChange.Click += new System.EventHandler(this.buttonCallerChange_Click); // - // checkBoxNewShow + // checkBoxCallerShow // - this.checkBoxNewShow.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.checkBoxNewShow.AutoSize = true; - this.checkBoxNewShow.FlatStyle = System.Windows.Forms.FlatStyle.Popup; - this.checkBoxNewShow.Location = new System.Drawing.Point(437, 254); - this.checkBoxNewShow.Name = "checkBoxNewShow"; - this.checkBoxNewShow.Size = new System.Drawing.Size(80, 17); - this.checkBoxNewShow.TabIndex = 2; - this.checkBoxNewShow.Text = "show notify"; - this.checkBoxNewShow.UseVisualStyleBackColor = true; + this.checkBoxCallerShow.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.checkBoxCallerShow.AutoSize = true; + this.checkBoxCallerShow.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.checkBoxCallerShow.Location = new System.Drawing.Point(437, 254); + this.checkBoxCallerShow.Name = "checkBoxCallerShow"; + this.checkBoxCallerShow.Size = new System.Drawing.Size(80, 17); + this.checkBoxCallerShow.TabIndex = 2; + this.checkBoxCallerShow.Text = "show notify"; + this.checkBoxCallerShow.UseVisualStyleBackColor = true; // - // textBoxNewName + // textBoxCallerName // - this.textBoxNewName.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.textBoxNewName.BorderColor = System.Drawing.Color.Empty; - this.textBoxNewName.Location = new System.Drawing.Point(417, 222); - this.textBoxNewName.Name = "textBoxNewName"; - this.textBoxNewName.Size = new System.Drawing.Size(100, 21); - this.textBoxNewName.TabIndex = 1; + this.textBoxCallerName.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.textBoxCallerName.BorderColor = System.Drawing.Color.Empty; + this.textBoxCallerName.Location = new System.Drawing.Point(417, 222); + this.textBoxCallerName.Name = "textBoxCallerName"; + this.textBoxCallerName.Size = new System.Drawing.Size(100, 21); + this.textBoxCallerName.TabIndex = 1; // - // textBoxNewCallerId + // textBoxCallerId // - this.textBoxNewCallerId.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.textBoxNewCallerId.BorderColor = System.Drawing.Color.Empty; - this.textBoxNewCallerId.Location = new System.Drawing.Point(417, 180); - this.textBoxNewCallerId.Name = "textBoxNewCallerId"; - this.textBoxNewCallerId.Size = new System.Drawing.Size(100, 21); - this.textBoxNewCallerId.TabIndex = 0; + this.textBoxCallerId.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.textBoxCallerId.BorderColor = System.Drawing.Color.Empty; + this.textBoxCallerId.Location = new System.Drawing.Point(417, 180); + this.textBoxCallerId.Name = "textBoxCallerId"; + this.textBoxCallerId.Size = new System.Drawing.Size(100, 21); + this.textBoxCallerId.TabIndex = 0; // - // buttonRemove + // buttonCallerRemove // - this.buttonRemove.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.buttonRemove.Location = new System.Drawing.Point(417, 6); - this.buttonRemove.Name = "buttonRemove"; - this.buttonRemove.Size = new System.Drawing.Size(100, 25); - this.buttonRemove.TabIndex = 6; - this.buttonRemove.Text = "Remove"; - this.buttonRemove.UseVisualStyleBackColor = true; - this.buttonRemove.Click += new System.EventHandler(this.buttonRemove_Click); + this.buttonCallerRemove.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.buttonCallerRemove.Location = new System.Drawing.Point(417, 6); + this.buttonCallerRemove.Name = "buttonCallerRemove"; + this.buttonCallerRemove.Size = new System.Drawing.Size(100, 25); + this.buttonCallerRemove.TabIndex = 6; + this.buttonCallerRemove.Text = "Remove"; + this.buttonCallerRemove.UseVisualStyleBackColor = true; + this.buttonCallerRemove.Click += new System.EventHandler(this.buttonCallerRemove_Click); // // dataGridView // - this.dataGridView.AllowUserToAddRows = false; this.dataGridView.AllowUserToDeleteRows = false; this.dataGridView.AllowUserToResizeRows = false; this.dataGridView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) @@ -632,25 +634,25 @@ this.colShow.Name = "colShow"; this.colShow.ReadOnly = true; // - // labelNewCallerId + // labelCallerId // - this.labelNewCallerId.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.labelNewCallerId.AutoSize = true; - this.labelNewCallerId.Location = new System.Drawing.Point(423, 163); - this.labelNewCallerId.Name = "labelNewCallerId"; - this.labelNewCallerId.Size = new System.Drawing.Size(44, 13); - this.labelNewCallerId.TabIndex = 12; - this.labelNewCallerId.Text = "CallerId"; + this.labelCallerId.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.labelCallerId.AutoSize = true; + this.labelCallerId.Location = new System.Drawing.Point(423, 163); + this.labelCallerId.Name = "labelCallerId"; + this.labelCallerId.Size = new System.Drawing.Size(44, 13); + this.labelCallerId.TabIndex = 12; + this.labelCallerId.Text = "CallerId"; // - // labelNewName + // labelCallerName // - this.labelNewName.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.labelNewName.AutoSize = true; - this.labelNewName.Location = new System.Drawing.Point(423, 205); - this.labelNewName.Name = "labelNewName"; - this.labelNewName.Size = new System.Drawing.Size(34, 13); - this.labelNewName.TabIndex = 11; - this.labelNewName.Text = "Name"; + this.labelCallerName.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.labelCallerName.AutoSize = true; + this.labelCallerName.Location = new System.Drawing.Point(423, 205); + this.labelCallerName.Name = "labelCallerName"; + this.labelCallerName.Size = new System.Drawing.Size(34, 13); + this.labelCallerName.TabIndex = 11; + this.labelCallerName.Text = "Name"; // // buttonCancel // @@ -683,6 +685,16 @@ this.labelVersion.TabIndex = 13; this.labelVersion.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // + // pictureBox1 + // + this.pictureBox1.Image = global::FritzBox.Properties.Resources.FritzBoxIconTransparent; + 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; + // // FritzBoxSetupForm // this.AutoScaleBaseSize = new System.Drawing.Size(5, 14); @@ -697,7 +709,7 @@ this.MinimizeBox = false; this.Name = "FritzBoxSetupForm"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - this.Text = "FritzBox configuration"; + this.Text = "FRITZ!Box configuration"; this.tabControlFritzBoxSettings.ResumeLayout(false); this.tabGeneral.ResumeLayout(false); this.tabGeneral.PerformLayout(); @@ -713,8 +725,9 @@ this.groupBoxMedia.PerformLayout(); this.tabPhonebook.ResumeLayout(false); this.tabPhonebook.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.pictureBox)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBoxCaller)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.dataGridView)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); this.ResumeLayout(false); } @@ -723,7 +736,7 @@ private void LoadSettings() { - Log.Info("FritzBox: LoadSettings"); + Log.Info("FRITZ!Box: LoadSettings"); labelVersion.Text = "v" + FritzBox._version; @@ -784,7 +797,7 @@ { try { - Log.Info("FritzBox: SaveSettings"); + Log.Info("FRITZ!Box: SaveSettings"); using (MediaPortal.Profile.Settings xmlwriter = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) { @@ -886,47 +899,6 @@ myClient.Close(); } - - private void buttonAdd_Click(object sender, EventArgs e) - { - if ( (textBoxNewCallerId.Text.Length > 0) && (!textBoxNewCallerId.Text.Contains(";")) ) - { - if ( (textBoxNewName.Text.Length > 0) && (!textBoxNewName.Text.Contains(";")) ) - { - dataGridView.Rows.Add(textBoxNewCallerId.Text, textBoxNewName.Text, checkBoxNewShow.Checked); - - textBoxNewCallerId.Text = ""; - textBoxNewName.Text = ""; - checkBoxNewShow.Checked = false; - - textBoxNewCallerId.Focus(); - } - else - { - textBoxNewName.Focus(); - MessageBox.Show("Name must contain any characters.\nA ';' ist not allowed."); - } - } - else - { - textBoxNewCallerId.Focus(); - MessageBox.Show("CallerID must contain any characters.\nA ';' ist not allowed."); - } - } - - private void buttonRemove_Click(object sender, EventArgs e) - { - if ((dataGridView.SelectedRows.Count > 0) && (dataGridView.Rows.Count > 0)) - { - textBoxNewCallerId.Text = dataGridView.Rows[dataGridView.CurrentCell.RowIndex].Cells[0].Value.ToString(); - textBoxNewName.Text = dataGridView.Rows[dataGridView.CurrentCell.RowIndex].Cells[1].Value.ToString(); - checkBoxNewShow.Checked = bool.Parse(dataGridView.Rows[dataGridView.CurrentCell.RowIndex].Cells[2].Value.ToString()); - - dataGridView.Rows.RemoveAt(dataGridView.CurrentCell.RowIndex); - } - } - - private void checkBoxCloseOnTimout_CheckedChanged(object sender, EventArgs e) { numericUpDownTimeout.Enabled = checkBoxCloseOnTimout.Checked; @@ -943,12 +915,22 @@ checkBoxSaveUnknownCaller.Enabled = checkBoxUsePhonebook.Checked; } - private void buttonMsnAdd_Click(object sender, EventArgs e) + private void buttonMSNsAdd_Click(object sender, EventArgs e) { if (isMSNvalid(comboBoxMSNs.Text) == true) comboBoxMSNs.Items.Add(comboBoxMSNs.Text); } + private void buttonMSNsRemove_Click(object sender, EventArgs e) + { + if (comboBoxMSNs.SelectedIndex != -1) + { + comboBoxMSNs.Text = comboBoxMSNs.SelectedItem.ToString(); + + comboBoxMSNs.Items.RemoveAt(comboBoxMSNs.SelectedIndex); + } + } + private bool isMSNvalid(string msn) { string msg = ""; @@ -967,32 +949,116 @@ } } - private void buttonMsnRemove_Click(object sender, EventArgs e) + private void checkBoxFilterMSNs_CheckedChanged(object sender, EventArgs e) { - if (comboBoxMSNs.SelectedIndex != -1) + comboBoxMSNs.Enabled = checkBoxFilterMSNs.Checked; + buttonMSNsAdd.Enabled = checkBoxFilterMSNs.Checked; + buttonMSNsRemove.Enabled = checkBoxFilterMSNs.Checked; + } + + private void checkBoxCloseOnTimout_CheckedChanged_1(object sender, EventArgs e) + { + numericUpDownTimeout.Enabled = checkBoxCloseOnTimout.Checked; + } + + private void buttonCallerChange_Click(object sender, EventArgs e) + { + if (CheckCallerId() && CheckCallerName()) + if (dataGridView.Rows[dataGridView.NewRowIndex].Selected) + { + dataGridView.Rows.Add(textBoxCallerId.Text, textBoxCallerName.Text, checkBoxCallerShow.Checked); + } + else + { + string oldfile = MediaPortal.Util.Utils.GetCoverArt(Thumbs.Yac, + dataGridView.Rows[dataGridView.CurrentCell.RowIndex].Cells[1].Value.ToString()); + + string newfile = String.Format(@"{0}\{1}{2}", Thumbs.Yac, Utils.MakeFileName(textBoxCallerName.Text), Utils.GetThumbExtension()); + + if (File.Exists(oldfile)) + File.Move(oldfile, newfile); + + dataGridView.Rows[dataGridView.CurrentCell.RowIndex].Cells[0].Value = textBoxCallerId.Text; + dataGridView.Rows[dataGridView.CurrentCell.RowIndex].Cells[1].Value = textBoxCallerName.Text; + dataGridView.Rows[dataGridView.CurrentCell.RowIndex].Cells[2].Value = checkBoxCallerShow.Checked; + + pictureBoxCaller.ImageLocation = MediaPortal.Util.Utils.GetCoverArt(Thumbs.Yac, textBoxCallerName.Text); + } + } + + private bool CheckCallerId() + { + if (textBoxCallerId.Text.Length == 0) { - comboBoxMSNs.Text = comboBoxMSNs.SelectedItem.ToString(); + textBoxCallerId.Focus(); + MessageBox.Show("CallerID is empty. Please type in the correct CallerID."); + return false; + } - comboBoxMSNs.Items.RemoveAt(comboBoxMSNs.SelectedIndex); + if (textBoxCallerId.Text.Contains(";")) + { + textBoxCallerId.Focus(); + MessageBox.Show("CallerID: A ';' ist not allowed."); + return false; } + + if (dataGridView.Rows[dataGridView.NewRowIndex].Selected) + for (int i = 0; i < dataGridView.Rows.Count - 1; i++) + if (textBoxCallerId.Text == dataGridView.Rows[i].Cells[0].Value.ToString()) + { + textBoxCallerId.Focus(); + MessageBox.Show("CallerID already exists in phonebook. Please check and change the id."); + return false; + } + + return true; } - private void dataGridView_SelectionChanged(object sender, EventArgs e) + private bool CheckCallerName() { - string strCallerId = dataGridView.Rows[dataGridView.CurrentCell.RowIndex].Cells[1].Value.ToString(); - pictureBox.ImageLocation = MediaPortal.Util.Utils.GetCoverArt(Thumbs.Yac, strCallerId); + if (textBoxCallerName.Text.Length == 0) + { + textBoxCallerName.Focus(); + MessageBox.Show("Name is empty. Please type the name to display for this CallerID."); + return false; + } + + if (textBoxCallerName.Text.Contains(";")) + { + textBoxCallerName.Focus(); + MessageBox.Show("Name: A ';' ist not allowed."); + return false; + } + + return true; } - private void checkBoxFilterMSNs_CheckedChanged(object sender, EventArgs e) + private void buttonCallerRemove_Click(object sender, EventArgs e) { - comboBoxMSNs.Enabled = checkBoxFilterMSNs.Checked; - buttonMSNsAdd.Enabled = checkBoxFilterMSNs.Checked; - buttonMSNsRemove.Enabled = checkBoxFilterMSNs.Checked; + if ((!dataGridView.Rows[dataGridView.NewRowIndex].Selected) && (dataGridView.SelectedRows.Count > 0)) + { + dataGridView.Rows.RemoveAt(dataGridView.CurrentCell.RowIndex); + } } - private void checkBoxCloseOnTimout_CheckedChanged_1(object sender, EventArgs e) + private void dataGridView_SelectionChanged(object sender, EventArgs e) { - numericUpDownTimeout.Enabled = checkBoxCloseOnTimout.Checked; + if (dataGridView.Rows[dataGridView.NewRowIndex].Selected) + { + textBoxCallerId.Text = ""; + textBoxCallerName.Text = ""; + checkBoxCallerShow.Checked = false; + + pictureBoxCaller.ImageLocation = ""; + } + else + { + textBoxCallerId.Text = dataGridView.Rows[dataGridView.CurrentCell.RowIndex].Cells[0].Value.ToString(); + textBoxCallerName.Text = dataGridView.Rows[dataGridView.CurrentCell.RowIndex].Cells[1].Value.ToString(); + checkBoxCallerShow.Checked = bool.Parse(dataGridView.Rows[dataGridView.CurrentCell.RowIndex].Cells[2].Value.ToString()); + + pictureBoxCaller.ImageLocation = MediaPortal.Util.Utils.GetCoverArt(Thumbs.Yac, textBoxCallerName.Text); + } } } } \ No newline at end of file Modified: trunk/plugins/FritzBox/Properties/Resources.Designer.cs =================================================================== --- trunk/plugins/FritzBox/Properties/Resources.Designer.cs 2007-02-05 12:45:13 UTC (rev 93) +++ trunk/plugins/FritzBox/Properties/Resources.Designer.cs 2007-02-06 02:46:58 UTC (rev 94) @@ -59,5 +59,12 @@ resourceCulture = value; } } + + internal static System.Drawing.Bitmap FritzBoxIconTransparent { + get { + object obj = ResourceManager.GetObject("FritzBoxIconTransparent", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } } } Modified: trunk/plugins/FritzBox/Properties/Resources.resx =================================================================== --- trunk/plugins/FritzBox/Properties/Resources.resx 2007-02-05 12:45:13 UTC (rev 93) +++ trunk/plugins/FritzBox/Properties/Resources.resx 2007-02-06 02:46:58 UTC (rev 94) @@ -117,4 +117,8 @@ <resheader name="writer"> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> + <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> + <data name="FritzBoxIconTransparent" type="System.Resources.ResXFileRef, System.Windows.Forms"> + <value>..\gfx\FritzBoxIconTransparent.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> + </data> </root> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <che...@us...> - 2007-02-06 03:28:07
|
Revision: 95 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=95&view=rev Author: chef_koch Date: 2007-02-05 19:28:05 -0800 (Mon, 05 Feb 2007) Log Message: ----------- small change for logging Modified Paths: -------------- trunk/plugins/FritzBox/FritzBoxSetupFrom.cs trunk/plugins/FritzBox/FritzBoxWatch.cs Modified: trunk/plugins/FritzBox/FritzBoxSetupFrom.cs =================================================================== --- trunk/plugins/FritzBox/FritzBoxSetupFrom.cs 2007-02-06 02:46:58 UTC (rev 94) +++ trunk/plugins/FritzBox/FritzBoxSetupFrom.cs 2007-02-06 03:28:05 UTC (rev 95) @@ -795,63 +795,52 @@ private void SaveSettings() { - try + Log.Info("FRITZ!Box: SaveSettings"); + using (MediaPortal.Profile.Settings xmlwriter = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) { - Log.Info("FRITZ!Box: SaveSettings"); - - using (MediaPortal.Profile.Settings xmlwriter = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) - { - xmlwriter.SetValueAsBool("fritzbox", "extensiveLogging", checkBoxExtensiveLogging.Checked); + xmlwriter.SetValueAsBool("fritzbox", "extensiveLogging", checkBoxExtensiveLogging.Checked); - xmlwriter.SetValue("fritzbox", "address", textBoxAddress.Text); - xmlwriter.SetValue("fritzbox", "port", textBoxPort.Text); + xmlwriter.SetValue("fritzbox", "address", textBoxAddress.Text); + xmlwriter.SetValue("fritzbox", "port", textBoxPort.Text); - // notify settings - xmlwriter.SetValueAsBool("fritzbox", "closeOnTimeout", checkBoxCloseOnTimout.Checked); - xmlwriter.SetValue("fritzbox", "timeout", numericUpDownTimeout.Value); + // notify settings + xmlwriter.SetValueAsBool("fritzbox", "closeOnTimeout", checkBoxCloseOnTimout.Checked); + xmlwriter.SetValue("fritzbox", "timeout", numericUpDownTimeout.Value); - xmlwriter.SetValueAsBool("fritzbox", "filterMSNs", checkBoxFilterMSNs.Checked); - string strMSN = ""; - for (int i = 0; i < comboBoxMSNs.Items.Count; i++) - { - strMSN += comboBoxMSNs.Items[i].ToString() + ";"; - } - xmlwriter.SetValue("fritzbox", "MSN", strMSN); + xmlwriter.SetValueAsBool("fritzbox", "filterMSNs", checkBoxFilterMSNs.Checked); + string strMSN = ""; + for (int i = 0; i < comboBoxMSNs.Items.Count; i++) + { + strMSN += comboBoxMSNs.Items[i].ToString() + ";"; + } + xmlwriter.SetValue("fritzbox", "MSN", strMSN); - xmlwriter.SetValueAsBool("fritzbox", "showMsnOnHeading", checkBoxShowMsnOnHeading.Checked); + xmlwriter.SetValueAsBool("fritzbox", "showMsnOnHeading", checkBoxShowMsnOnHeading.Checked); - // media settings - xmlwriter.SetValueAsBool("fritzbox", "stopMedia", checkBoxStopMedia.Checked); - xmlwriter.SetValueAsBool("fritzbox", "resumeMedia", checkBoxResumeMedia.Checked); - - // phonebook settings - xmlwriter.SetValueAsBool("fritzbox", "usePhonebook", checkBoxUsePhonebook.Checked); - xmlwriter.SetValueAsBool("fritzbox", "showUnknownCaller", checkBoxShowUnknownCaller.Checked); - xmlwriter.SetValueAsBool("fritzbox", "saveUnknownCaller", checkBoxSaveUnknownCaller.Checked); + // media settings + xmlwriter.SetValueAsBool("fritzbox", "stopMedia", checkBoxStopMedia.Checked); + xmlwriter.SetValueAsBool("fritzbox", "resumeMedia", checkBoxResumeMedia.Checked); + // phonebook settings + xmlwriter.SetValueAsBool("fritzbox", "usePhonebook", checkBoxUsePhonebook.Checked); + xmlwriter.SetValueAsBool("fritzbox", "showUnknownCaller", checkBoxShowUnknownCaller.Checked); + xmlwriter.SetValueAsBool("fritzbox", "saveUnknownCaller", checkBoxSaveUnknownCaller.Checked); - string strCallerId = ""; - string strName = ""; - string strShow = ""; - for (int i = 0; i < dataGridView.RowCount; i++) - { - strCallerId += dataGridView.Rows[i].Cells[0].Value.ToString() + ";"; - strName += dataGridView.Rows[i].Cells[1].Value.ToString() + ";"; - strShow += dataGridView.Rows[i].Cells[2].Value.ToString() + ";"; - } + string strCallerId = ""; + string strName = ""; + string strShow = ""; - xmlwriter.SetValue("fritzbox", "phonebookCallerId", strCallerId); - xmlwriter.SetValue("fritzbox", "phonebookName", strName); - xmlwriter.SetValue("fritzbox", "phonebookShow", strShow); - - + for (int i = 0; i < dataGridView.RowCount - 1; i++) + { + strCallerId += dataGridView.Rows[i].Cells[0].Value.ToString() + ";"; + strName += dataGridView.Rows[i].Cells[1].Value.ToString() + ";"; + strShow += dataGridView.Rows[i].Cells[2].Value.ToString() + ";"; } - } - catch (Exception ex) - { - Log.Error("{0}", ex); + xmlwriter.SetValue("fritzbox", "phonebookCallerId", strCallerId); + xmlwriter.SetValue("fritzbox", "phonebookName", strName); + xmlwriter.SetValue("fritzbox", "phonebookShow", strShow); } } Modified: trunk/plugins/FritzBox/FritzBoxWatch.cs =================================================================== --- trunk/plugins/FritzBox/FritzBoxWatch.cs 2007-02-06 02:46:58 UTC (rev 94) +++ trunk/plugins/FritzBox/FritzBoxWatch.cs 2007-02-06 03:28:05 UTC (rev 95) @@ -57,7 +57,7 @@ { Thread watchThread = new Thread(new ThreadStart(WatchThread)); watchThread.Priority = ThreadPriority.BelowNormal; - watchThread.Name = "FritzBox Monitoring"; + watchThread.Name = "FRITZ!Box Monitoring"; watchThread.Start(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <che...@us...> - 2007-04-08 11:08:00
|
Revision: 296 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=296&view=rev Author: chef_koch Date: 2007-04-08 04:07:48 -0700 (Sun, 08 Apr 2007) Log Message: ----------- phonebook entries are now saved in own fritzbox.xml Modified Paths: -------------- trunk/plugins/FritzBox/FritzBox.cs trunk/plugins/FritzBox/FritzBoxSetupFrom.cs Modified: trunk/plugins/FritzBox/FritzBox.cs =================================================================== --- trunk/plugins/FritzBox/FritzBox.cs 2007-04-07 14:39:22 UTC (rev 295) +++ trunk/plugins/FritzBox/FritzBox.cs 2007-04-08 11:07:48 UTC (rev 296) @@ -74,8 +74,9 @@ #endregion #region public Variables - - public const string _version = "0.2f"; + + public const string _version = "0.2.2.0"; + public static int _lastVersion = 0; public static bool _extensiveLogging = false; // phonebook settings @@ -108,6 +109,8 @@ using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) { + _lastVersion = xmlreader.GetValueAsInt("fritzbox", "lastVersion", 0); + _extensiveLogging = xmlreader.GetValueAsBool("fritzbox", "extensiveLogging", false); FritzBoxWatch.fritzBoxAddress = xmlreader.GetValueAsString("fritzbox", "address", "fritz.box"); @@ -117,7 +120,7 @@ _closeOnTimeout = xmlreader.GetValueAsBool("fritzbox", "closeOnTimeout", false); _timeout = xmlreader.GetValueAsInt("fritzbox", "timeout", 10); - if ( (!_closeOnTimeout) || (_timeout == 0) ) + if ((!_closeOnTimeout) || (_timeout == 0)) _timeout = -1; _filterMSNs = xmlreader.GetValueAsBool("fritzbox", "filterMSNs", false); @@ -132,12 +135,12 @@ // media settings _stopMedia = xmlreader.GetValueAsBool("fritzbox", "stopMedia", true); _resumeMedia = xmlreader.GetValueAsBool("fritzbox", "resumeMedia", true); - + // phonebook settings _usePhonebook = xmlreader.GetValueAsBool("fritzbox", "usePhonebook", true); _showUnknownCaller = xmlreader.GetValueAsBool("fritzbox", "showUnknownCaller", true); _saveUnknownCaller = xmlreader.GetValueAsBool("fritzbox", "saveUnknownCaller", true); - + if (_extensiveLogging) { Log.Info("FRITZ!Box: closeOnTimeout = {0}", _closeOnTimeout.ToString()); @@ -151,26 +154,55 @@ Log.Info("FRITZ!Box: showUnknownCaller = {0}", _showUnknownCaller.ToString()); Log.Info("FRITZ!Box: saveUnknownCaller = {0}", _saveUnknownCaller.ToString()); } + } - if (_usePhonebook) + if ((_lastVersion < 0220) && (!File.Exists(Config.GetFile(Config.Dir.Config, "fritzbox.xml")))) + UpdateTo0220(); + else + using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "fritzbox.xml"))) { - string[] strLCallerId = xmlreader.GetValueAsString("fritzbox", "phonebookCallerId", "").Split(charSeparators, StringSplitOptions.RemoveEmptyEntries); - string[] strLName = xmlreader.GetValueAsString("fritzbox", "phonebookName", "").Split(charSeparators, StringSplitOptions.RemoveEmptyEntries); - string[] strLShow = xmlreader.GetValueAsString("fritzbox", "phonebookShow", "").Split(charSeparators, StringSplitOptions.RemoveEmptyEntries); + int countCaller = xmlreader.GetValueAsInt("phonebook", "count", 0); - for (int i = 0; i <= strLCallerId.GetUpperBound(0); i++) + for (int i = 0; i < countCaller; i++) { - Caller caller = new Caller(strLCallerId[i], strLName[i], bool.Parse(strLShow[i])); + string strCallerId = xmlreader.GetValueAsString("phonebook", string.Format("callerID{0}", i.ToString()), ""); + string strName = xmlreader.GetValueAsString("phonebook", string.Format("name{0}", i.ToString()), ""); + bool bShow = xmlreader.GetValueAsBool("phonebook", string.Format("show{0}", i.ToString()), false); + + if (strCallerId == "") continue; + if (strCallerId == null) continue; + if (strName == "") continue; + if (strName == null) continue; + + Caller caller = new Caller(strCallerId, strName, bShow); phonebook.Add(caller); if (_extensiveLogging) Log.Debug("FRITZ!Box: caller loaded: {0} {1} {2}", caller.callerId, caller.name, caller.show); } } + if (_extensiveLogging) + Log.Debug("FRITZ!Box: imported {0} callers", phonebook.Count.ToString()); + } - if (_extensiveLogging) - Log.Debug("FRITZ!Box: imported {0} callers", phonebook.Count.ToString()); + private void UpdateTo0220() + { + char[] charSeparators = new char[] { ';' }; + + using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) + { + string[] strLCallerId = xmlreader.GetValueAsString("fritzbox", "phonebookCallerId", "").Split(charSeparators, StringSplitOptions.RemoveEmptyEntries); + string[] strLName = xmlreader.GetValueAsString("fritzbox", "phonebookName", "").Split(charSeparators, StringSplitOptions.RemoveEmptyEntries); + string[] strLShow = xmlreader.GetValueAsString("fritzbox", "phonebookShow", "").Split(charSeparators, StringSplitOptions.RemoveEmptyEntries); + for (int i = 0; i <= strLCallerId.GetUpperBound(0); i++) + { + Caller caller = new Caller(strLCallerId[i], strLName[i], bool.Parse(strLShow[i])); + phonebook.Add(caller); + + if (_extensiveLogging) + Log.Debug("FRITZ!Box: caller loaded: {0} {1} {2}", caller.callerId, caller.name, caller.show); + } } } @@ -178,27 +210,23 @@ { if (_extensiveLogging) Log.Info("FRITZ!Box: SaveSettings"); - + using (MediaPortal.Profile.Settings xmlwriter = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) { - if (_usePhonebook) + xmlwriter.SetValue("fritzbox", "lastVersion", _version.Replace(".", string.Empty)); + } + + using (MediaPortal.Profile.Settings xmlwriter = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "fritzbox.xml"))) + { + xmlwriter.SetValue("phonebook", "count", phonebook.Count); + + for (int i = 0; i < phonebook.Count; i++) { - string strCallerId = ""; - string strName = ""; - string strShow = ""; - - for (int i = 0; i < phonebook.Count; i++) - { - Caller caller = phonebook[i]; + Caller caller = phonebook[i]; - strCallerId += caller.callerId + ";"; - strName += caller.name + ";"; - strShow += caller.show + ";"; - } - - xmlwriter.SetValue("fritzbox", "phonebookCallerId", strCallerId); - xmlwriter.SetValue("fritzbox", "phonebookName", strName); - xmlwriter.SetValue("fritzbox", "phonebookShow", strShow); + xmlwriter.SetValue("phonebook", string.Format("callerID{0}", i.ToString()), caller.callerId); + xmlwriter.SetValue("phonebook", string.Format("name{0}", i.ToString()), caller.name); + xmlwriter.SetValueAsBool("phonebook", string.Format("show{0}", i.ToString()), caller.show); } } } Modified: trunk/plugins/FritzBox/FritzBoxSetupFrom.cs =================================================================== --- trunk/plugins/FritzBox/FritzBoxSetupFrom.cs 2007-04-07 14:39:22 UTC (rev 295) +++ trunk/plugins/FritzBox/FritzBoxSetupFrom.cs 2007-04-08 11:07:48 UTC (rev 296) @@ -738,66 +738,97 @@ { Log.Info("FRITZ!Box: LoadSettings"); - labelVersion.Text = "v" + FritzBox._version; + labelVersion.Text = "v" + FritzBox._version; - using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) - { - checkBoxExtensiveLogging.Checked = xmlreader.GetValueAsBool("fritzbox", "extensiveLogging", false); + using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) + { + FritzBox._lastVersion = xmlreader.GetValueAsInt("fritzbox", "lastVersion", 0); - textBoxAddress.Text = xmlreader.GetValueAsString("fritzbox", "address", "fritz.box"); - textBoxPort.Text = xmlreader.GetValueAsString("fritzbox", "port", "1012"); + checkBoxExtensiveLogging.Checked = xmlreader.GetValueAsBool("fritzbox", "extensiveLogging", false); - // notify settings - checkBoxCloseOnTimout.Checked = xmlreader.GetValueAsBool("fritzbox", "closeOnTimeout", false); - numericUpDownTimeout.Value = xmlreader.GetValueAsInt("fritzbox", "timeout", 10); + textBoxAddress.Text = xmlreader.GetValueAsString("fritzbox", "address", "fritz.box"); + textBoxPort.Text = xmlreader.GetValueAsString("fritzbox", "port", "1012"); - numericUpDownTimeout.Enabled = checkBoxCloseOnTimout.Checked; + // notify settings + checkBoxCloseOnTimout.Checked = xmlreader.GetValueAsBool("fritzbox", "closeOnTimeout", false); + numericUpDownTimeout.Value = xmlreader.GetValueAsInt("fritzbox", "timeout", 10); - checkBoxFilterMSNs.Checked = xmlreader.GetValueAsBool("fritzbox", "filterMSNs", false); - comboBoxMSNs.Enabled = checkBoxFilterMSNs.Checked; - buttonMSNsAdd.Enabled = checkBoxFilterMSNs.Checked; - buttonMSNsRemove.Enabled = checkBoxFilterMSNs.Checked; - string strMSN = xmlreader.GetValueAsString("fritzbox", "MSN", ""); - char[] charSeparators = new char[] { ';' }; - if (strMSN != "") - comboBoxMSNs.Items.AddRange(strMSN.Split(charSeparators, StringSplitOptions.RemoveEmptyEntries)); + numericUpDownTimeout.Enabled = checkBoxCloseOnTimout.Checked; - checkBoxShowMsnOnHeading.Checked = xmlreader.GetValueAsBool("fritzbox", "showMsnOnHeading", false); + checkBoxFilterMSNs.Checked = xmlreader.GetValueAsBool("fritzbox", "filterMSNs", false); + comboBoxMSNs.Enabled = checkBoxFilterMSNs.Checked; + buttonMSNsAdd.Enabled = checkBoxFilterMSNs.Checked; + buttonMSNsRemove.Enabled = checkBoxFilterMSNs.Checked; + string strMSN = xmlreader.GetValueAsString("fritzbox", "MSN", ""); + char[] charSeparators = new char[] { ';' }; + if (strMSN != "") + comboBoxMSNs.Items.AddRange(strMSN.Split(charSeparators, StringSplitOptions.RemoveEmptyEntries)); - // media settings - checkBoxStopMedia.Checked = xmlreader.GetValueAsBool("fritzbox", "stopMedia", true); - checkBoxResumeMedia.Checked = xmlreader.GetValueAsBool("fritzbox", "resumeMedia", true); + checkBoxShowMsnOnHeading.Checked = xmlreader.GetValueAsBool("fritzbox", "showMsnOnHeading", false); - // phonebook settings - checkBoxUsePhonebook.Checked = xmlreader.GetValueAsBool("fritzbox", "usePhonebook", true); - checkBoxShowUnknownCaller.Checked = xmlreader.GetValueAsBool("fritzbox", "showUnknownCaller", true); - checkBoxSaveUnknownCaller.Checked = xmlreader.GetValueAsBool("fritzbox", "saveUnknownCaller", true); + // media settings + checkBoxStopMedia.Checked = xmlreader.GetValueAsBool("fritzbox", "stopMedia", true); + checkBoxResumeMedia.Checked = xmlreader.GetValueAsBool("fritzbox", "resumeMedia", true); - checkBoxShowUnknownCaller.Enabled = checkBoxUsePhonebook.Checked; - checkBoxSaveUnknownCaller.Enabled = checkBoxUsePhonebook.Checked; + // phonebook settings + checkBoxUsePhonebook.Checked = xmlreader.GetValueAsBool("fritzbox", "usePhonebook", true); + checkBoxShowUnknownCaller.Checked = xmlreader.GetValueAsBool("fritzbox", "showUnknownCaller", true); + checkBoxSaveUnknownCaller.Checked = xmlreader.GetValueAsBool("fritzbox", "saveUnknownCaller", true); + checkBoxShowUnknownCaller.Enabled = checkBoxUsePhonebook.Checked; + checkBoxSaveUnknownCaller.Enabled = checkBoxUsePhonebook.Checked; + } - string strCallerId = xmlreader.GetValueAsString("fritzbox", "phonebookCallerId", ""); - string strName = xmlreader.GetValueAsString("fritzbox", "phonebookName", ""); - string strShow = xmlreader.GetValueAsString("fritzbox", "phonebookShow", ""); + if ((FritzBox._lastVersion < 0220) && (!File.Exists(Config.GetFile(Config.Dir.Config, "fritzbox.xml")))) + UpdateTo0220(); + else + using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "fritzbox.xml"))) + { + int countCaller = xmlreader.GetValueAsInt("phonebook", "count", 0); - if (strCallerId != "") + for (int i = 0; i < countCaller; i++) { - string[] strListCallerId = strCallerId.Split(';'); - string[] strListName = strName.Split(';'); - string[] strListShow = strShow.Split(';'); + string strCallerId = xmlreader.GetValueAsString("phonebook", string.Format("callerID{0}", i.ToString()), ""); + string strName = xmlreader.GetValueAsString("phonebook", string.Format("name{0}", i.ToString()), ""); + bool bShow = xmlreader.GetValueAsBool("phonebook", string.Format("show{0}", i.ToString()), false); - for (int i = 0; i < strListCallerId.GetUpperBound(0); i++) - dataGridView.Rows.Add(strListCallerId[i], strListName[i], bool.Parse(strListShow[i])); + if (strCallerId == "") continue; + if (strCallerId == null) continue; + if (strName == "") continue; + if (strName == null) continue; + + dataGridView.Rows.Add(strCallerId, strName, bShow); } } } + private void UpdateTo0220() + { + using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) + { + string strCallerId = xmlreader.GetValueAsString("fritzbox", "phonebookCallerId", ""); + string strName = xmlreader.GetValueAsString("fritzbox", "phonebookName", ""); + string strShow = xmlreader.GetValueAsString("fritzbox", "phonebookShow", ""); + + if (strCallerId != "") + { + string[] strListCallerId = strCallerId.Split(';'); + string[] strListName = strName.Split(';'); + string[] strListShow = strShow.Split(';'); + + for (int i = 0; i < strListCallerId.GetUpperBound(0); i++) + dataGridView.Rows.Add(strListCallerId[i], strListName[i], bool.Parse(strListShow[i])); + } + } + } + private void SaveSettings() { Log.Info("FRITZ!Box: SaveSettings"); using (MediaPortal.Profile.Settings xmlwriter = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) { + xmlwriter.SetValue("fritzbox", "lastVersion", FritzBox._version.Replace(".", string.Empty)); + xmlwriter.SetValueAsBool("fritzbox", "extensiveLogging", checkBoxExtensiveLogging.Checked); xmlwriter.SetValue("fritzbox", "address", textBoxAddress.Text); @@ -825,22 +856,22 @@ xmlwriter.SetValueAsBool("fritzbox", "usePhonebook", checkBoxUsePhonebook.Checked); xmlwriter.SetValueAsBool("fritzbox", "showUnknownCaller", checkBoxShowUnknownCaller.Checked); xmlwriter.SetValueAsBool("fritzbox", "saveUnknownCaller", checkBoxSaveUnknownCaller.Checked); + } + using (MediaPortal.Profile.Settings xmlwriter = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "fritzbox.xml"))) + { + xmlwriter.SetValue("phonebook", "count", dataGridView.RowCount - 1); - string strCallerId = ""; - string strName = ""; - string strShow = ""; - for (int i = 0; i < dataGridView.RowCount - 1; i++) { - strCallerId += dataGridView.Rows[i].Cells[0].Value.ToString() + ";"; - strName += dataGridView.Rows[i].Cells[1].Value.ToString() + ";"; - strShow += dataGridView.Rows[i].Cells[2].Value.ToString() + ";"; + string strCallerId = dataGridView.Rows[i].Cells[0].Value.ToString(); + string strName = dataGridView.Rows[i].Cells[1].Value.ToString(); + bool strShow = bool.Parse(dataGridView.Rows[i].Cells[2].Value.ToString()); + + xmlwriter.SetValue("phonebook", string.Format("callerID{0}", i.ToString()), strCallerId); + xmlwriter.SetValue("phonebook", string.Format("name{0}", i.ToString()), strName); + xmlwriter.SetValueAsBool("phonebook", string.Format("show{0}", i.ToString()), strShow); } - - xmlwriter.SetValue("fritzbox", "phonebookCallerId", strCallerId); - xmlwriter.SetValue("fritzbox", "phonebookName", strName); - xmlwriter.SetValue("fritzbox", "phonebookShow", strShow); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <che...@us...> - 2007-04-08 17:34:46
|
Revision: 297 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=297&view=rev Author: chef_koch Date: 2007-04-08 10:34:44 -0700 (Sun, 08 Apr 2007) Log Message: ----------- import phonebook from FRITZ!Box Monitor is now possible Modified Paths: -------------- trunk/plugins/FritzBox/Caller.cs trunk/plugins/FritzBox/FritzBox.cs trunk/plugins/FritzBox/FritzBoxSetupFrom.cs trunk/plugins/FritzBox/FritzBoxSetupFrom.resx Modified: trunk/plugins/FritzBox/Caller.cs =================================================================== --- trunk/plugins/FritzBox/Caller.cs 2007-04-08 11:07:48 UTC (rev 296) +++ trunk/plugins/FritzBox/Caller.cs 2007-04-08 17:34:44 UTC (rev 297) @@ -31,17 +31,59 @@ { public class Caller { + string _id; + string _name; + bool _show; - public readonly string callerId; - public readonly string name; - public readonly bool show; - - public Caller(string CallerId, string Name, bool Show) + public Caller() { - this.callerId = CallerId; - this.name = Name; - this.show = Show; + this._id = ""; + this._name = ""; + this._show = false; } + public Caller(string id, string name, bool show) + { + this._id = id; + this._name = name; + this._show = show; + } + + public string ID + { + get + { + return _id; + } + set + { + _id = value; + } + } + + public string Name + { + get + { + return _name; + } + set + { + _name = value; + } + } + + public bool Show + { + get + { + return _show; + } + set + { + _show = value; + } + } + } } Modified: trunk/plugins/FritzBox/FritzBox.cs =================================================================== --- trunk/plugins/FritzBox/FritzBox.cs 2007-04-08 11:07:48 UTC (rev 296) +++ trunk/plugins/FritzBox/FritzBox.cs 2007-04-08 17:34:44 UTC (rev 297) @@ -56,8 +56,6 @@ private bool _fritzBoxDisabled = false; - public List<Caller> phonebook = new List<Caller>(); - // notify settings private int _timeout = -1; // autoclose the dialog after the timeout expired private bool _closeOnTimeout = false; @@ -84,6 +82,8 @@ public static bool _showUnknownCaller = true; public static bool _saveUnknownCaller = true; + public static List<Caller> phonebook = new List<Caller>(); + #endregion FritzBoxWatch FritzBoxWatch; @@ -155,38 +155,74 @@ Log.Info("FRITZ!Box: saveUnknownCaller = {0}", _saveUnknownCaller.ToString()); } } + + LoadPhonebook(); + } + private void SaveSettings() + { + if (_extensiveLogging) + Log.Info("FRITZ!Box: SaveSettings"); + + using (MediaPortal.Profile.Settings xmlwriter = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) + { + xmlwriter.SetValue("fritzbox", "lastVersion", _version.Replace(".", string.Empty)); + } + + SavePhonebook(); + } + #endregion + + #region Phonebook + public static void LoadPhonebook() + { if ((_lastVersion < 0220) && (!File.Exists(Config.GetFile(Config.Dir.Config, "fritzbox.xml")))) + { UpdateTo0220(); - else - using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "fritzbox.xml"))) + return; + } + + using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "fritzbox.xml"))) + { + int countCaller = xmlreader.GetValueAsInt("phonebook", "count", 0); + + for (int i = 0; i < countCaller; i++) { - int countCaller = xmlreader.GetValueAsInt("phonebook", "count", 0); + Caller caller = new Caller(); - for (int i = 0; i < countCaller; i++) - { - string strCallerId = xmlreader.GetValueAsString("phonebook", string.Format("callerID{0}", i.ToString()), ""); - string strName = xmlreader.GetValueAsString("phonebook", string.Format("name{0}", i.ToString()), ""); - bool bShow = xmlreader.GetValueAsBool("phonebook", string.Format("show{0}", i.ToString()), false); + caller.ID = xmlreader.GetValueAsString("phonebook", string.Format("callerID{0}", i.ToString()), ""); + caller.Name = xmlreader.GetValueAsString("phonebook", string.Format("name{0}", i.ToString()), ""); + caller.Show = xmlreader.GetValueAsBool("phonebook", string.Format("show{0}", i.ToString()), false); - if (strCallerId == "") continue; - if (strCallerId == null) continue; - if (strName == "") continue; - if (strName == null) continue; + phonebook.Add(caller); - Caller caller = new Caller(strCallerId, strName, bShow); - phonebook.Add(caller); - - if (_extensiveLogging) - Log.Debug("FRITZ!Box: caller loaded: {0} {1} {2}", caller.callerId, caller.name, caller.show); - } + if (_extensiveLogging) + Log.Debug("FRITZ!Box: caller loaded: {0} {1} {2}", caller.ID, caller.Name, caller.Show); } + } if (_extensiveLogging) Log.Debug("FRITZ!Box: imported {0} callers", phonebook.Count.ToString()); } - private void UpdateTo0220() + public static void SavePhonebook() { + using (MediaPortal.Profile.Settings xmlwriter = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "fritzbox.xml"))) + { + xmlwriter.SetValue("phonebook", "count", phonebook.Count); + + for (int i = 0; i < phonebook.Count; i++) + { + Caller caller = phonebook[i]; + + xmlwriter.SetValue("phonebook", string.Format("callerID{0}", i.ToString()), caller.ID); + xmlwriter.SetValue("phonebook", string.Format("name{0}", i.ToString()), caller.Name); + xmlwriter.SetValueAsBool("phonebook", string.Format("show{0}", i.ToString()), caller.Show); + } + } + } + + public static void UpdateTo0220() + { char[] charSeparators = new char[] { ';' }; using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) @@ -194,46 +230,62 @@ string[] strLCallerId = xmlreader.GetValueAsString("fritzbox", "phonebookCallerId", "").Split(charSeparators, StringSplitOptions.RemoveEmptyEntries); string[] strLName = xmlreader.GetValueAsString("fritzbox", "phonebookName", "").Split(charSeparators, StringSplitOptions.RemoveEmptyEntries); string[] strLShow = xmlreader.GetValueAsString("fritzbox", "phonebookShow", "").Split(charSeparators, StringSplitOptions.RemoveEmptyEntries); - + for (int i = 0; i <= strLCallerId.GetUpperBound(0); i++) { Caller caller = new Caller(strLCallerId[i], strLName[i], bool.Parse(strLShow[i])); phonebook.Add(caller); if (_extensiveLogging) - Log.Debug("FRITZ!Box: caller loaded: {0} {1} {2}", caller.callerId, caller.name, caller.show); + Log.Debug("FRITZ!Box: caller loaded: {0} {1} {2}", caller.ID, caller.Name, caller.Show); } } } - private void SaveSettings() + public static void ImportFritzBoxMonitor(string filepath) { - if (_extensiveLogging) - Log.Info("FRITZ!Box: SaveSettings"); - - using (MediaPortal.Profile.Settings xmlwriter = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) + try { - xmlwriter.SetValue("fritzbox", "lastVersion", _version.Replace(".", string.Empty)); - } + // Create an instance of StreamReader to read from a file. + // The using statement also closes the StreamReader. + using (StreamReader sr = new StreamReader(filepath)) + { + string line; + // Read and display lines from the file until the end of + // the file is reached. + while ((line = sr.ReadLine()) != null) + { + string[] ar = line.Split(char.Parse(";")); - using (MediaPortal.Profile.Settings xmlwriter = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "fritzbox.xml"))) - { - xmlwriter.SetValue("phonebook", "count", phonebook.Count); + Caller caller = new Caller(); - for (int i = 0; i < phonebook.Count; i++) - { - Caller caller = phonebook[i]; + caller.ID = ar[2]; + caller.Name = String.Format("{0} {1}", ar[0], ar[1]); + caller.Show = true; - xmlwriter.SetValue("phonebook", string.Format("callerID{0}", i.ToString()), caller.callerId); - xmlwriter.SetValue("phonebook", string.Format("name{0}", i.ToString()), caller.name); - xmlwriter.SetValueAsBool("phonebook", string.Format("show{0}", i.ToString()), caller.show); + if (!CallerExists(caller)) + phonebook.Add(caller); + } } } + catch (Exception e) + { + // Let the user know what went wrong. + Log.Error("The file could not be read: {0}", e.Message); + } } + + public static bool CallerExists(Caller caller) + { + for (int i = 0; i < phonebook.Count; i++) + { + if (phonebook[i].ID == caller.ID) + return true; + } + return false; + } #endregion - - public bool IsFritzBoxConnected(string fritzBoxAddress, string fritzBoxPort) { TcpClient TcpClient; @@ -334,16 +386,16 @@ { Caller caller = phonebook[i]; - if (caller.callerId.Equals(callerId)) + if (caller.ID.Equals(callerId)) { - Log.Info("Caller is identified by phonebook as {0}.", caller.name); + Log.Info("Caller is identified by phonebook as {0}.", caller.Name); foundCaller = true; - if (caller.show) + if (caller.Show) { Log.Info("Caller is accepted by phonebook and dialog will be shown."); - DialogOnIncomingCall(caller.name, msn); + DialogOnIncomingCall(caller.Name, msn); } else { Modified: trunk/plugins/FritzBox/FritzBoxSetupFrom.cs =================================================================== --- trunk/plugins/FritzBox/FritzBoxSetupFrom.cs 2007-04-08 11:07:48 UTC (rev 296) +++ trunk/plugins/FritzBox/FritzBoxSetupFrom.cs 2007-04-08 17:34:44 UTC (rev 297) @@ -86,6 +86,8 @@ private MediaPortal.UserInterface.Controls.MPComboBox comboBoxMSNs; private MediaPortal.UserInterface.Controls.MPCheckBox checkBoxShowMsnOnHeading; private PictureBox pictureBox1; + private MediaPortal.UserInterface.Controls.MPButton mpImportFBMonitor; + private OpenFileDialog openFileDialog; /// <summary> /// Erforderliche Designervariable. @@ -133,6 +135,7 @@ 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(); @@ -171,10 +174,12 @@ this.buttonCancel = new MediaPortal.UserInterface.Controls.MPButton(); this.buttonSave = new MediaPortal.UserInterface.Controls.MPButton(); this.labelVersion = new MediaPortal.UserInterface.Controls.MPLabel(); - this.pictureBox1 = new System.Windows.Forms.PictureBox(); + this.mpImportFBMonitor = new MediaPortal.UserInterface.Controls.MPButton(); + this.openFileDialog = new System.Windows.Forms.OpenFileDialog(); this.tabControlFritzBoxSettings.SuspendLayout(); this.tabGeneral.SuspendLayout(); this.mpGroupBox1.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); this.tabIncoming.SuspendLayout(); this.groupBoxPhonebook.SuspendLayout(); this.groupBoxNotify.SuspendLayout(); @@ -183,7 +188,6 @@ this.tabPhonebook.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.pictureBoxCaller)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.dataGridView)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); this.SuspendLayout(); // // tabControlFritzBoxSettings @@ -242,6 +246,16 @@ this.mpGroupBox1.TabStop = false; this.mpGroupBox1.Text = "connection"; // + // pictureBox1 + // + this.pictureBox1.Image = global::FritzBox.Properties.Resources.FritzBoxIconTransparent; + 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))); @@ -318,6 +332,7 @@ // this.groupBoxPhonebook.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); + this.groupBoxPhonebook.Controls.Add(this.mpImportFBMonitor); this.groupBoxPhonebook.Controls.Add(this.checkBoxSaveUnknownCaller); this.groupBoxPhonebook.Controls.Add(this.checkBoxShowUnknownCaller); this.groupBoxPhonebook.Controls.Add(this.checkBoxUsePhonebook); @@ -685,15 +700,16 @@ this.labelVersion.TabIndex = 13; this.labelVersion.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // - // pictureBox1 + // mpImportFBMonitor // - this.pictureBox1.Image = global::FritzBox.Properties.Resources.FritzBoxIconTransparent; - 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; + this.mpImportFBMonitor.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.mpImportFBMonitor.Location = new System.Drawing.Point(355, 20); + this.mpImportFBMonitor.Name = "mpImportFBMonitor"; + this.mpImportFBMonitor.Size = new System.Drawing.Size(150, 23); + this.mpImportFBMonitor.TabIndex = 3; + this.mpImportFBMonitor.Text = "Import FRITZ!Box Monitor"; + this.mpImportFBMonitor.UseVisualStyleBackColor = true; + this.mpImportFBMonitor.Click += new System.EventHandler(this.mpImportFBMonitor_Click); // // FritzBoxSetupForm // @@ -715,6 +731,7 @@ 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(); @@ -727,7 +744,6 @@ this.tabPhonebook.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.pictureBoxCaller)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.dataGridView)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); this.ResumeLayout(false); } @@ -778,50 +794,11 @@ checkBoxShowUnknownCaller.Enabled = checkBoxUsePhonebook.Checked; checkBoxSaveUnknownCaller.Enabled = checkBoxUsePhonebook.Checked; } - - if ((FritzBox._lastVersion < 0220) && (!File.Exists(Config.GetFile(Config.Dir.Config, "fritzbox.xml")))) - UpdateTo0220(); - else - using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "fritzbox.xml"))) - { - int countCaller = xmlreader.GetValueAsInt("phonebook", "count", 0); - - for (int i = 0; i < countCaller; i++) - { - string strCallerId = xmlreader.GetValueAsString("phonebook", string.Format("callerID{0}", i.ToString()), ""); - string strName = xmlreader.GetValueAsString("phonebook", string.Format("name{0}", i.ToString()), ""); - bool bShow = xmlreader.GetValueAsBool("phonebook", string.Format("show{0}", i.ToString()), false); - - if (strCallerId == "") continue; - if (strCallerId == null) continue; - if (strName == "") continue; - if (strName == null) continue; - - dataGridView.Rows.Add(strCallerId, strName, bShow); - } - } + + FritzBox.LoadPhonebook(); + RefreshDataGridView(); } - private void UpdateTo0220() - { - using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) - { - string strCallerId = xmlreader.GetValueAsString("fritzbox", "phonebookCallerId", ""); - string strName = xmlreader.GetValueAsString("fritzbox", "phonebookName", ""); - string strShow = xmlreader.GetValueAsString("fritzbox", "phonebookShow", ""); - - if (strCallerId != "") - { - string[] strListCallerId = strCallerId.Split(';'); - string[] strListName = strName.Split(';'); - string[] strListShow = strShow.Split(';'); - - for (int i = 0; i < strListCallerId.GetUpperBound(0); i++) - dataGridView.Rows.Add(strListCallerId[i], strListName[i], bool.Parse(strListShow[i])); - } - } - } - private void SaveSettings() { Log.Info("FRITZ!Box: SaveSettings"); @@ -858,21 +835,8 @@ xmlwriter.SetValueAsBool("fritzbox", "saveUnknownCaller", checkBoxSaveUnknownCaller.Checked); } - using (MediaPortal.Profile.Settings xmlwriter = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "fritzbox.xml"))) - { - xmlwriter.SetValue("phonebook", "count", dataGridView.RowCount - 1); - - for (int i = 0; i < dataGridView.RowCount - 1; i++) - { - string strCallerId = dataGridView.Rows[i].Cells[0].Value.ToString(); - string strName = dataGridView.Rows[i].Cells[1].Value.ToString(); - bool strShow = bool.Parse(dataGridView.Rows[i].Cells[2].Value.ToString()); - - xmlwriter.SetValue("phonebook", string.Format("callerID{0}", i.ToString()), strCallerId); - xmlwriter.SetValue("phonebook", string.Format("name{0}", i.ToString()), strName); - xmlwriter.SetValueAsBool("phonebook", string.Format("show{0}", i.ToString()), strShow); - } - } + SaveDataGridView(); + FritzBox.SavePhonebook(); } private void buttonSave_Click(object sender, EventArgs e) @@ -1020,13 +984,6 @@ MessageBox.Show("CallerID is empty. Please type in the correct CallerID."); return false; } - - if (textBoxCallerId.Text.Contains(";")) - { - textBoxCallerId.Focus(); - MessageBox.Show("CallerID: A ';' ist not allowed."); - return false; - } if (dataGridView.Rows[dataGridView.NewRowIndex].Selected) for (int i = 0; i < dataGridView.Rows.Count - 1; i++) @@ -1049,13 +1006,6 @@ return false; } - if (textBoxCallerName.Text.Contains(";")) - { - textBoxCallerName.Focus(); - MessageBox.Show("Name: A ';' ist not allowed."); - return false; - } - return true; } @@ -1086,5 +1036,40 @@ pictureBoxCaller.ImageLocation = MediaPortal.Util.Utils.GetCoverArt(Thumbs.Yac, textBoxCallerName.Text); } } + + private void mpImportFBMonitor_Click(object sender, EventArgs e) + { + if (openFileDialog.ShowDialog() == DialogResult.OK) + { + FritzBox.ImportFritzBoxMonitor(openFileDialog.FileName); + RefreshDataGridView(); + } + } + + private void RefreshDataGridView() + { + dataGridView.Rows.Clear(); + + for (int i = 0; i < FritzBox.phonebook.Count; i++) + { + dataGridView.Rows.Add(FritzBox.phonebook[i].ID, FritzBox.phonebook[i].Name, FritzBox.phonebook[i].Show); + } + } + + private void SaveDataGridView() + { + FritzBox.phonebook.Clear(); + + for (int i = 0; i < dataGridView.RowCount - 1; i++) + { + Caller caller = new Caller(); + + caller.ID = dataGridView.Rows[i].Cells[0].Value.ToString(); + caller.Name = dataGridView.Rows[i].Cells[1].Value.ToString(); + caller.Show = bool.Parse(dataGridView.Rows[i].Cells[2].Value.ToString()); + + FritzBox.phonebook.Add(caller); + } + } } } \ No newline at end of file Modified: trunk/plugins/FritzBox/FritzBoxSetupFrom.resx =================================================================== --- trunk/plugins/FritzBox/FritzBoxSetupFrom.resx 2007-04-08 11:07:48 UTC (rev 296) +++ trunk/plugins/FritzBox/FritzBoxSetupFrom.resx 2007-04-08 17:34:44 UTC (rev 297) @@ -126,6 +126,9 @@ <metadata name="colShow.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>True</value> </metadata> + <metadata name="openFileDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <value>17, 17</value> + </metadata> <assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> <data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <value> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <che...@us...> - 2007-04-09 03:04:27
|
Revision: 298 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=298&view=rev Author: chef_koch Date: 2007-04-08 20:03:35 -0700 (Sun, 08 Apr 2007) Log Message: ----------- fixed importing first line of FritzBoxMonitors export-file added message box with import result Modified Paths: -------------- trunk/plugins/FritzBox/FritzBox.cs trunk/plugins/FritzBox/FritzBoxSetupFrom.cs Modified: trunk/plugins/FritzBox/FritzBox.cs =================================================================== --- trunk/plugins/FritzBox/FritzBox.cs 2007-04-08 17:34:44 UTC (rev 297) +++ trunk/plugins/FritzBox/FritzBox.cs 2007-04-09 03:03:35 UTC (rev 298) @@ -242,10 +242,12 @@ } } - public static void ImportFritzBoxMonitor(string filepath) + public static int ImportFritzBoxMonitor(string filepath) { try { + int count = 0; + // Create an instance of StreamReader to read from a file. // The using statement also closes the StreamReader. using (StreamReader sr = new StreamReader(filepath)) @@ -260,18 +262,25 @@ Caller caller = new Caller(); caller.ID = ar[2]; - caller.Name = String.Format("{0} {1}", ar[0], ar[1]); + caller.Name = string.Format("{0} {1}", ar[0], ar[1]); + caller.Name = caller.Name.Trim(); caller.Show = true; - if (!CallerExists(caller)) - phonebook.Add(caller); + if (CallerExists(caller)) continue; + if (caller.ID == "Telefonnummer") continue; + + phonebook.Add(caller); + count++; } } + + return count; } catch (Exception e) { // Let the user know what went wrong. Log.Error("The file could not be read: {0}", e.Message); + return 0; } } Modified: trunk/plugins/FritzBox/FritzBoxSetupFrom.cs =================================================================== --- trunk/plugins/FritzBox/FritzBoxSetupFrom.cs 2007-04-08 17:34:44 UTC (rev 297) +++ trunk/plugins/FritzBox/FritzBoxSetupFrom.cs 2007-04-09 03:03:35 UTC (rev 298) @@ -144,6 +144,7 @@ this.labelHelp = new MediaPortal.UserInterface.Controls.MPLabel(); this.tabIncoming = new System.Windows.Forms.TabPage(); this.groupBoxPhonebook = new MediaPortal.UserInterface.Controls.MPGroupBox(); + this.mpImportFBMonitor = new MediaPortal.UserInterface.Controls.MPButton(); this.checkBoxSaveUnknownCaller = new MediaPortal.UserInterface.Controls.MPCheckBox(); this.checkBoxShowUnknownCaller = new MediaPortal.UserInterface.Controls.MPCheckBox(); this.checkBoxUsePhonebook = new MediaPortal.UserInterface.Controls.MPCheckBox(); @@ -174,7 +175,6 @@ this.buttonCancel = new MediaPortal.UserInterface.Controls.MPButton(); this.buttonSave = new MediaPortal.UserInterface.Controls.MPButton(); this.labelVersion = new MediaPortal.UserInterface.Controls.MPLabel(); - this.mpImportFBMonitor = new MediaPortal.UserInterface.Controls.MPButton(); this.openFileDialog = new System.Windows.Forms.OpenFileDialog(); this.tabControlFritzBoxSettings.SuspendLayout(); this.tabGeneral.SuspendLayout(); @@ -344,6 +344,17 @@ this.groupBoxPhonebook.TabStop = false; this.groupBoxPhonebook.Text = "phonebook settings"; // + // mpImportFBMonitor + // + this.mpImportFBMonitor.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.mpImportFBMonitor.Location = new System.Drawing.Point(355, 20); + this.mpImportFBMonitor.Name = "mpImportFBMonitor"; + this.mpImportFBMonitor.Size = new System.Drawing.Size(150, 23); + this.mpImportFBMonitor.TabIndex = 3; + this.mpImportFBMonitor.Text = "Import FRITZ!Box Monitor"; + this.mpImportFBMonitor.UseVisualStyleBackColor = true; + this.mpImportFBMonitor.Click += new System.EventHandler(this.mpImportFBMonitor_Click); + // // checkBoxSaveUnknownCaller // this.checkBoxSaveUnknownCaller.AutoSize = true; @@ -626,6 +637,7 @@ this.dataGridView.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; this.dataGridView.Size = new System.Drawing.Size(405, 297); this.dataGridView.TabIndex = 5; + this.dataGridView.Sorted += new System.EventHandler(this.dataGridView_Sorted); this.dataGridView.SelectionChanged += new System.EventHandler(this.dataGridView_SelectionChanged); // // colCallerId @@ -700,17 +712,6 @@ this.labelVersion.TabIndex = 13; this.labelVersion.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // - // mpImportFBMonitor - // - this.mpImportFBMonitor.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.mpImportFBMonitor.Location = new System.Drawing.Point(355, 20); - this.mpImportFBMonitor.Name = "mpImportFBMonitor"; - this.mpImportFBMonitor.Size = new System.Drawing.Size(150, 23); - this.mpImportFBMonitor.TabIndex = 3; - this.mpImportFBMonitor.Text = "Import FRITZ!Box Monitor"; - this.mpImportFBMonitor.UseVisualStyleBackColor = true; - this.mpImportFBMonitor.Click += new System.EventHandler(this.mpImportFBMonitor_Click); - // // FritzBoxSetupForm // this.AutoScaleBaseSize = new System.Drawing.Size(5, 14); @@ -947,33 +948,39 @@ private void buttonCallerChange_Click(object sender, EventArgs e) { - if (CheckCallerId() && CheckCallerName()) - if (dataGridView.Rows[dataGridView.NewRowIndex].Selected) - { - dataGridView.Rows.Add(textBoxCallerId.Text, textBoxCallerName.Text, checkBoxCallerShow.Checked); + if (!CheckCallerId()) return; + if (!CheckCallerName()) return; - textBoxCallerId.Text = ""; - textBoxCallerName.Text = ""; - checkBoxCallerShow.Checked = false; + if (dataGridView.Rows[dataGridView.NewRowIndex].Selected) + { + dataGridView.Rows.Add(textBoxCallerId.Text, textBoxCallerName.Text, checkBoxCallerShow.Checked); - textBoxCallerId.Focus(); - } - else - { - string oldfile = MediaPortal.Util.Utils.GetCoverArt(Thumbs.Yac, - dataGridView.Rows[dataGridView.CurrentCell.RowIndex].Cells[1].Value.ToString()); + textBoxCallerId.Text = ""; + textBoxCallerName.Text = ""; + checkBoxCallerShow.Checked = false; - string newfile = String.Format(@"{0}\{1}{2}", Thumbs.Yac, Utils.MakeFileName(textBoxCallerName.Text), Utils.GetThumbExtension()); + textBoxCallerId.Focus(); - if (File.Exists(oldfile)) - File.Move(oldfile, newfile); + SaveDataGridView(); + } + else + { + string oldfile = MediaPortal.Util.Utils.GetCoverArt(Thumbs.Yac, + dataGridView.Rows[dataGridView.CurrentCell.RowIndex].Cells[1].Value.ToString()); - dataGridView.Rows[dataGridView.CurrentCell.RowIndex].Cells[0].Value = textBoxCallerId.Text; - dataGridView.Rows[dataGridView.CurrentCell.RowIndex].Cells[1].Value = textBoxCallerName.Text; - dataGridView.Rows[dataGridView.CurrentCell.RowIndex].Cells[2].Value = checkBoxCallerShow.Checked; + string newfile = String.Format(@"{0}\{1}{2}", Thumbs.Yac, Utils.MakeFileName(textBoxCallerName.Text), Utils.GetThumbExtension()); - pictureBoxCaller.ImageLocation = MediaPortal.Util.Utils.GetCoverArt(Thumbs.Yac, textBoxCallerName.Text); - } + if (File.Exists(oldfile)) + File.Move(oldfile, newfile); + + dataGridView.Rows[dataGridView.CurrentCell.RowIndex].Cells[0].Value = textBoxCallerId.Text; + dataGridView.Rows[dataGridView.CurrentCell.RowIndex].Cells[1].Value = textBoxCallerName.Text; + dataGridView.Rows[dataGridView.CurrentCell.RowIndex].Cells[2].Value = checkBoxCallerShow.Checked; + + pictureBoxCaller.ImageLocation = MediaPortal.Util.Utils.GetCoverArt(Thumbs.Yac, textBoxCallerName.Text); + + SaveDataGridView(); + } } private bool CheckCallerId() @@ -1014,6 +1021,8 @@ if ((!dataGridView.Rows[dataGridView.NewRowIndex].Selected) && (dataGridView.SelectedRows.Count > 0)) { dataGridView.Rows.RemoveAt(dataGridView.CurrentCell.RowIndex); + + SaveDataGridView(); } } @@ -1041,8 +1050,10 @@ { if (openFileDialog.ShowDialog() == DialogResult.OK) { - FritzBox.ImportFritzBoxMonitor(openFileDialog.FileName); + int count = FritzBox.ImportFritzBoxMonitor(openFileDialog.FileName); RefreshDataGridView(); + + MessageBox.Show("Import done!\nAdded " + count.ToString() + " new CallerIDs to phonebook."); } } @@ -1071,5 +1082,10 @@ FritzBox.phonebook.Add(caller); } } + + private void dataGridView_Sorted(object sender, EventArgs e) + { + SaveDataGridView(); + } } } \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <che...@us...> - 2007-06-17 15:37:07
|
Revision: 565 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=565&view=rev Author: chef_koch Date: 2007-06-17 08:37:03 -0700 (Sun, 17 Jun 2007) Log Message: ----------- Added Paths: ----------- trunk/plugins/FritzBox/FritzBox/ trunk/plugins/FritzBox/FritzBox/Caller.cs trunk/plugins/FritzBox/FritzBox/FritzBox.cs trunk/plugins/FritzBox/FritzBox/FritzBox.csproj trunk/plugins/FritzBox/FritzBox/FritzBox.png trunk/plugins/FritzBox/FritzBox/FritzBoxDisabled.png trunk/plugins/FritzBox/FritzBox/FritzBoxSetupFrom.cs trunk/plugins/FritzBox/FritzBox/FritzBoxSetupFrom.resx trunk/plugins/FritzBox/FritzBox/FritzBoxWatch.cs trunk/plugins/FritzBox/FritzBox/Properties/ trunk/plugins/FritzBox/FritzBox/gfx/ Removed Paths: ------------- trunk/plugins/FritzBox/Caller.cs trunk/plugins/FritzBox/FritzBox.cs trunk/plugins/FritzBox/FritzBox.csproj trunk/plugins/FritzBox/FritzBox.png trunk/plugins/FritzBox/FritzBoxDisabled.png trunk/plugins/FritzBox/FritzBoxSetupFrom.cs trunk/plugins/FritzBox/FritzBoxSetupFrom.resx trunk/plugins/FritzBox/FritzBoxWatch.cs trunk/plugins/FritzBox/Properties/ trunk/plugins/FritzBox/gfx/ Deleted: trunk/plugins/FritzBox/Caller.cs =================================================================== --- trunk/plugins/FritzBox/Caller.cs 2007-06-17 11:03:06 UTC (rev 564) +++ trunk/plugins/FritzBox/Caller.cs 2007-06-17 15:37:03 UTC (rev 565) @@ -1,89 +0,0 @@ -#region Copyright (C) 2005-2007 Team MediaPortal - -/* - * Copyright (C) 2005-2007 Team MediaPortal - * http://www.team-mediaportal.com - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Make; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#endregion - -using System; -using System.Collections.Generic; -using System.Text; - -namespace FritzBox -{ - public class Caller - { - string _id; - string _name; - bool _show; - - public Caller() - { - this._id = ""; - this._name = ""; - this._show = false; - } - - public Caller(string id, string name, bool show) - { - this._id = id; - this._name = name; - this._show = show; - } - - public string ID - { - get - { - return _id; - } - set - { - _id = value; - } - } - - public string Name - { - get - { - return _name; - } - set - { - _name = value; - } - } - - public bool Show - { - get - { - return _show; - } - set - { - _show = value; - } - } - - } -} Copied: trunk/plugins/FritzBox/FritzBox/Caller.cs (from rev 554, trunk/plugins/FritzBox/Caller.cs) =================================================================== --- trunk/plugins/FritzBox/FritzBox/Caller.cs (rev 0) +++ trunk/plugins/FritzBox/FritzBox/Caller.cs 2007-06-17 15:37:03 UTC (rev 565) @@ -0,0 +1,89 @@ +#region Copyright (C) 2005-2007 Team MediaPortal + +/* + * Copyright (C) 2005-2007 Team MediaPortal + * http://www.team-mediaportal.com + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Make; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +#endregion + +using System; +using System.Collections.Generic; +using System.Text; + +namespace FritzBox +{ + public class Caller + { + string _id; + string _name; + bool _show; + + public Caller() + { + this._id = ""; + this._name = ""; + this._show = false; + } + + public Caller(string id, string name, bool show) + { + this._id = id; + this._name = name; + this._show = show; + } + + public string ID + { + get + { + return _id; + } + set + { + _id = value; + } + } + + public string Name + { + get + { + return _name; + } + set + { + _name = value; + } + } + + public bool Show + { + get + { + return _show; + } + set + { + _show = value; + } + } + + } +} Copied: trunk/plugins/FritzBox/FritzBox/FritzBox.cs (from rev 554, trunk/plugins/FritzBox/FritzBox.cs) =================================================================== --- trunk/plugins/FritzBox/FritzBox/FritzBox.cs (rev 0) +++ trunk/plugins/FritzBox/FritzBox/FritzBox.cs 2007-06-17 15:37:03 UTC (rev 565) @@ -0,0 +1,698 @@ +#region Copyright (C) 2005-2007 Team MediaPortal + +/* + * Copyright (C) 2005-2007 Team MediaPortal + * http://www.team-mediaportal.com + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Make; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +#endregion + +using System; +using System.Collections; +using System.Diagnostics; +using System.IO; +using System.Net.Sockets; +using System.Reflection; +using System.Runtime.InteropServices; +using System.Threading; +using System.Windows.Forms; +using System.Xml; + +using MediaPortal.Ripper; + +using MediaPortal.Util; +using MediaPortal.GUI.Library; +using MediaPortal.Configuration; +using MediaPortal.Dialogs; +using MediaPortal.Player; +using System.Collections.Generic; + + +namespace FritzBox +{ + /* + * Things to do: + * - add more comments to code + * - split code more in methods/classes + */ + + [PluginIcons("FritzBox.FritzBox.png", "FritzBox.FritzBoxDisabled.png")] + public class FritzBox : ISetupForm, IPlugin + { + #region Variables + #region Private Variables + + private bool _fritzBoxDisabled = false; + + // notify settings + private int _timeout = -1; // autoclose the dialog after the timeout expired + private bool _closeOnTimeout = false; + + public static bool _filterMSNs = false; + public static string[] _msn; + + public static bool _showMsnOnHeading = false; + + // media settings + private bool _stopMedia = true; // stop media when an event happend + private bool _resumeMedia = true; // resume media when notify is closed + + private bool _showNotify = true; + private List<string> notifyQueue = new List<string>(); + + #endregion + + #region public Variables + + public const string _version = "0.2.2.0"; + public static int _lastVersion = 0; + public static bool _extensiveLogging = false; + + // phonebook settings + public static bool _usePhonebook = true; + public static bool _showUnknownCaller = true; + public static bool _saveUnknownCaller = true; + + public static List<Caller> phonebook = new List<Caller>(); + + #endregion + + FritzBoxWatch FritzBoxWatch; + + // Protected Variables + #endregion + + #region Constructors/Destructors + public FritzBox() + { + } + #endregion + + #region Private Methods + + #region Settings + private void LoadSettings() + { + char[] charSeparators = new char[] { ';' }; + + if (_extensiveLogging) + Log.Info("FRITZ!Box: LoadSettings"); + + using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) + { + _lastVersion = xmlreader.GetValueAsInt("fritzbox", "lastVersion", 0); + + _extensiveLogging = xmlreader.GetValueAsBool("fritzbox", "extensiveLogging", false); + + FritzBoxWatch.fritzBoxAddress = xmlreader.GetValueAsString("fritzbox", "address", "fritz.box"); + FritzBoxWatch.fritzBoxPort = xmlreader.GetValueAsString("fritzbox", "port", "1012"); + + // notify settings + _closeOnTimeout = xmlreader.GetValueAsBool("fritzbox", "closeOnTimeout", false); + _timeout = xmlreader.GetValueAsInt("fritzbox", "timeout", 10); + + if ((!_closeOnTimeout) || (_timeout == 0)) + _timeout = -1; + + _filterMSNs = xmlreader.GetValueAsBool("fritzbox", "filterMSNs", false); + string strMSN = xmlreader.GetValueAsString("fritzbox", "MSN", ""); + _msn = strMSN.Split(charSeparators, StringSplitOptions.RemoveEmptyEntries); + + if (_extensiveLogging) + Log.Debug("FRITZ!Box: MSNs loaded: {0}", strMSN); + + _showMsnOnHeading = xmlreader.GetValueAsBool("fritzbox", "showMsnOnHeading", false); + + // media settings + _stopMedia = xmlreader.GetValueAsBool("fritzbox", "stopMedia", true); + _resumeMedia = xmlreader.GetValueAsBool("fritzbox", "resumeMedia", true); + + // phonebook settings + _usePhonebook = xmlreader.GetValueAsBool("fritzbox", "usePhonebook", true); + _showUnknownCaller = xmlreader.GetValueAsBool("fritzbox", "showUnknownCaller", true); + _saveUnknownCaller = xmlreader.GetValueAsBool("fritzbox", "saveUnknownCaller", true); + + if (_extensiveLogging) + { + 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: stopMedia = {0}", _stopMedia.ToString()); + Log.Info("FRITZ!Box: resumeMedia = {0}", _resumeMedia.ToString()); + + Log.Info("FRITZ!Box: usePhonebook = {0}", _usePhonebook.ToString()); + Log.Info("FRITZ!Box: showUnknownCaller = {0}", _showUnknownCaller.ToString()); + Log.Info("FRITZ!Box: saveUnknownCaller = {0}", _saveUnknownCaller.ToString()); + } + } + + LoadPhonebook(); + } + + private void SaveSettings() + { + if (_extensiveLogging) + Log.Info("FRITZ!Box: SaveSettings"); + + using (MediaPortal.Profile.Settings xmlwriter = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) + { + xmlwriter.SetValue("fritzbox", "lastVersion", _version.Replace(".", string.Empty)); + } + + SavePhonebook(); + } + #endregion + + #region Phonebook + public static void LoadPhonebook() + { + if ((_lastVersion < 0220) && (!File.Exists(Config.GetFile(Config.Dir.Config, "fritzbox.xml")))) + { + UpdateTo0220(); + return; + } + + using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "fritzbox.xml"))) + { + int countCaller = xmlreader.GetValueAsInt("phonebook", "count", 0); + + for (int i = 0; i < countCaller; i++) + { + Caller caller = new Caller(); + + caller.ID = xmlreader.GetValueAsString("phonebook", string.Format("callerID{0}", i.ToString()), ""); + caller.Name = xmlreader.GetValueAsString("phonebook", string.Format("name{0}", i.ToString()), ""); + caller.Show = xmlreader.GetValueAsBool("phonebook", string.Format("show{0}", i.ToString()), false); + + phonebook.Add(caller); + + if (_extensiveLogging) + Log.Debug("FRITZ!Box: caller loaded: {0} {1} {2}", caller.ID, caller.Name, caller.Show); + } + } + if (_extensiveLogging) + Log.Debug("FRITZ!Box: imported {0} callers", phonebook.Count.ToString()); + } + + public static void SavePhonebook() + { + using (MediaPortal.Profile.Settings xmlwriter = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "fritzbox.xml"))) + { + xmlwriter.SetValue("phonebook", "count", phonebook.Count); + + for (int i = 0; i < phonebook.Count; i++) + { + Caller caller = phonebook[i]; + + xmlwriter.SetValue("phonebook", string.Format("callerID{0}", i.ToString()), caller.ID); + xmlwriter.SetValue("phonebook", string.Format("name{0}", i.ToString()), caller.Name); + xmlwriter.SetValueAsBool("phonebook", string.Format("show{0}", i.ToString()), caller.Show); + } + } + } + + public static void UpdateTo0220() + { + char[] charSeparators = new char[] { ';' }; + + using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) + { + string[] strLCallerId = xmlreader.GetValueAsString("fritzbox", "phonebookCallerId", "").Split(charSeparators, StringSplitOptions.RemoveEmptyEntries); + string[] strLName = xmlreader.GetValueAsString("fritzbox", "phonebookName", "").Split(charSeparators, StringSplitOptions.RemoveEmptyEntries); + string[] strLShow = xmlreader.GetValueAsString("fritzbox", "phonebookShow", "").Split(charSeparators, StringSplitOptions.RemoveEmptyEntries); + + for (int i = 0; i <= strLCallerId.GetUpperBound(0); i++) + { + Caller caller = new Caller(strLCallerId[i], strLName[i], bool.Parse(strLShow[i])); + phonebook.Add(caller); + + if (_extensiveLogging) + Log.Debug("FRITZ!Box: caller loaded: {0} {1} {2}", caller.ID, caller.Name, caller.Show); + } + } + } + + public static int ImportFritzBoxMonitor(string filepath) + { + try + { + int count = 0; + + // Create an instance of StreamReader to read from a file. + // The using statement also closes the StreamReader. + using (StreamReader sr = new StreamReader(filepath)) + { + string line; + // Read and display lines from the file until the end of + // the file is reached. + while ((line = sr.ReadLine()) != null) + { + if ( (count == 0) && line.Contains("sep=;") ) + continue; + if ( (count == 0) && line.Contains("Telefonnummer")) + continue; + + string[] ar = line.Split(char.Parse(";")); + + ar[0] = ar[0].TrimStart('!'); + ar[1] = ar[1].TrimStart('!'); + + Caller caller = new Caller(); + + caller.ID = ar[2]; + caller.Name = string.Format("{0} {1}", ar[0], ar[1]); + caller.Name = caller.Name.Trim(); + caller.Show = true; + + if (CallerExists(caller)) continue; + + phonebook.Add(caller); + count++; + } + } + + return count; + } + catch (Exception e) + { + // Let the user know what went wrong. + Log.Error("The file could not be read: {0}", e.Message); + return 0; + } + } + + public static bool CallerExists(Caller caller) + { + for (int i = 0; i < phonebook.Count; i++) + { + if (phonebook[i].ID == caller.ID) + return true; + } + return false; + } + #endregion + + public bool IsFritzBoxConnected(string fritzBoxAddress, string fritzBoxPort) + { + TcpClient TcpClient; + + try + { + TcpClient = new TcpClient(fritzBoxAddress, Int32.Parse(fritzBoxPort)); + } + catch (Exception) + { + return false; + } + + TcpClient.Close(); + return true; + } + + #region FritzBoxActions + private void OnFritzBoxEvent(string dataStream) + { + if (!_showNotify) + { + Log.Info("External process is running. Notify is queued and will be shown later."); + notifyQueue.Add(dataStream); + return; + } + + string[] strList; // splitted data + + // data-stream can be in following format: + // incoming calls: DateTime;RING;ConnectionID;CallerID;MSN;??POTS??; + // outgoing calls: DateTime;CALL;ConnectionID;??Nebenstelle??;MSN;CallerID;??POTS??; + // connection started: DateTime;CONNECT;ConnectionID;??Nebenstelle??;CallerID; + // connection closed: DateTime;DISCONNECT;ConnectionID;ConnectedTime; + + // DateTime format: + // 12.12.06 12:12:12 + // dd.MM.yy hh:mm:ss + + dataStream = dataStream.Replace("\n", ""); + if (FritzBox._extensiveLogging) + Log.Info("received data: {0}", dataStream); + strList = dataStream.Split(';'); + + switch (strList[1]) + { + case "RING": + OnIncomingCall(strList[0], strList[3], strList[4]); + break; + + case "CALL": + OnOutgoingCall(strList[0], strList[3], strList[4], strList[5]); + break; + + case "CONNECT": + OnConnectionStarted(strList[0], strList[3], strList[4]); + break; + + case "DISCONNECT": + OnConnectionClosed(strList[0], int.Parse(strList[3])); + break; + } + } + + private void OnIncomingCall(string dateTime, string callerId, string msn) + { + Log.Info("incoming call:"); + Log.Info(" DateTime: {0}", dateTime); + if (FritzBox._extensiveLogging) + { + Log.Info(" Caller: {0}", callerId); + Log.Info(" MSN: {0}", msn); + } + + if (CheckMSN(msn) == true) + { + if (callerId == "") + { + Log.Info("Caller is not identified by CLIP."); + + if (FritzBox._showUnknownCaller) + DialogOnIncomingCall("", msn); + } + else + { + if (FritzBox._usePhonebook) + { + + + + + bool foundCaller = false; + + if (phonebook.Count == 0) + { + Log.Info("Phonebook is empty. Caller is added to the phonebook."); + Caller caller = new Caller(callerId, callerId, true); + phonebook.Add(caller); + } + else + { + int i = 0; + + do + { + Caller caller = phonebook[i]; + + if (caller.ID.Equals(callerId)) + { + Log.Info("Caller is identified by phonebook as {0}.", caller.Name); + foundCaller = true; + + if (caller.Show) + { + Log.Info("Caller is accepted by phonebook and dialog will be shown."); + + DialogOnIncomingCall(caller.Name, msn); + } + else + { + Log.Info("Caller is denied by phonebook and dialog won't be shown."); + } + } + i++; + } + while (!foundCaller && (i < phonebook.Count)); + + if (!foundCaller) + { + Log.Info("Caller is not identified by phonebook."); + + if (FritzBox._saveUnknownCaller) + { + Log.Info("saveUnknownCallers is ON - Caller is added to the phonebook."); + + Caller caller = new Caller(callerId, callerId, FritzBox._showUnknownCaller); + phonebook.Add(caller); + } + + if (FritzBox._showUnknownCaller) + { + Log.Info("showUnknownCallers is ON - Caller is shown."); + + DialogOnIncomingCall(callerId, msn); + } + } + + } + } + else + DialogOnIncomingCall(callerId, msn); + } + } + } + + private void OnOutgoingCall(string dateTime, string nebenstelle, string msn, string callerId) + { + Log.Info("outgoing call:"); + Log.Info(" DateTime: {0}", dateTime); + if (FritzBox._extensiveLogging) + { + Log.Info(" Nebenstelle: {0}", nebenstelle); + Log.Info(" MSN: {0}", msn); + Log.Info(" Caller: {0}", callerId); + } + } + + private void OnConnectionStarted(string dateTime, string nebenstelle, string callerId) + { + Log.Info("connection started:"); + Log.Info(" DateTime: {0}", dateTime); + if (FritzBox._extensiveLogging) + { + Log.Info(" Nebenstelle: {0}", nebenstelle); + Log.Info(" Caller: {0}", callerId); + } + } + + private void OnConnectionClosed(string dateTime, int connectedTime) + { + Log.Info("connection closed:"); + Log.Info(" DateTime: {0}", dateTime); + Log.Info(" conneted time (in s): {0}", connectedTime.ToString()); + } + #endregion + + void DialogOnIncomingCall(string strCallerId, string strMSN) + { + string strImage = null; + string strHeading = null; + + if (strCallerId == "") + { + strCallerId = GUILocalizeStrings.Get(2014); // 2014 = unknown + strImage = MediaPortal.Util.Utils.GetCoverArt(Thumbs.Yac, "_unknown"); + } + else + { + //search image for caller + if (_extensiveLogging) + Log.Info("searching image: " + MediaPortal.Util.Utils.GetCoverArtName(Thumbs.Yac, strCallerId)); + + if (File.Exists(MediaPortal.Util.Utils.GetCoverArt(Thumbs.Yac, strCallerId))) + { + if (_extensiveLogging) + Log.Info("found image for caller: " + MediaPortal.Util.Utils.GetCoverArt(Thumbs.Yac, strCallerId)); + else + Log.Info("found image for caller"); + + strImage = MediaPortal.Util.Utils.GetCoverArt(Thumbs.Yac, strCallerId); + } + else + { + Log.Info("found NO image for caller"); + strImage = MediaPortal.Util.Utils.GetCoverArt(Thumbs.Yac, "_noImage"); + } + } + + if (_showMsnOnHeading) + strHeading = GUILocalizeStrings.Get(1023) + " on " + strMSN; // ???? Incoming call on + else + strHeading = GUILocalizeStrings.Get(1023); // 1023 Incoming call + + //show dialog + if (g_Player.Playing && !g_Player.Paused && _stopMedia) + g_Player.Pause(); + + GUIDialogNotify dlgNotify = (GUIDialogNotify)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_NOTIFY); + if (dlgNotify == null) return; + + dlgNotify.Reset(); + dlgNotify.ClearAll(); + dlgNotify.SetHeading(strHeading); + dlgNotify.SetImage(strImage); + dlgNotify.SetText(strCallerId); + dlgNotify.TimeOut = _timeout; + + dlgNotify.DoModal(GUIWindowManager.ActiveWindow); + + if (g_Player.Playing && g_Player.Paused && _stopMedia && _resumeMedia) + g_Player.Pause(); + } + + private bool CheckMSN(string msn) + { + bool foundMSN = false; + + if (FritzBox._filterMSNs) + { + for (int i = 0; i <= FritzBox._msn.GetUpperBound(0); i++) + { + if (FritzBox._msn[i].ToString() == msn) + foundMSN = true; + } + if (foundMSN == true) + { + Log.Info("MSN is on list."); + return true; + } + else + { + Log.Info("MSN is not on list. Notify won't be shown."); + return false; + } + } + else + { + Log.Info("MSN filter is disabled."); + return true; + } + } + + + public void OnStartExternal(Process proc, bool waitForExit) + { + if (waitForExit) + { + _showNotify = false; + } + else + { + _showNotify = true; + } + } + public void OnStopExternal(Process proc, bool waitForExit) + { + _showNotify = true; + + //for (int i = 0; i < notifyQueue.Count; i++) + // OnFritzBoxEvent(notifyQueue[i]); + + notifyQueue.Clear(); + } + + #endregion + + #region <Interface> Implementations + + #region IPlugin Interface + + /// <summary> + /// This method will be called by mediaportal to start your process plugin + /// </summary> + public void Start() + { + Log.Info("FRITZ!Box Plugin {0} starting.", _version); + + FritzBoxWatch = new FritzBoxWatch(); + LoadSettings(); + FritzBoxWatch.Start(); + + FritzBoxWatch.FritzBoxAction += new FritzBoxWatch.EventHandler(OnFritzBoxEvent); + + Utils.OnStartExternal += new Utils.UtilEventHandler(OnStartExternal); + Utils.OnStopExternal += new Utils.UtilEventHandler(OnStopExternal); + } + + /// <summary> + /// This method will be called by mediaportal to stop your process plugin + /// </summary> + public void Stop() + { + if (!_fritzBoxDisabled) + FritzBoxWatch.Stop(); + + SaveSettings(); + } + + #endregion + + #region ISetupForm Interface + + public bool CanEnable() + { + return true; + } + + public string Description() + { + return "Displays FRITZ!Box calling information."; + } + + public bool DefaultEnabled() + { + return false; + } + + public int GetWindowId() + { + return -1; + } + + public bool GetHome(out string strButtonText, out string strButtonImage, out string strButtonImageFocus, out string strPictureImage) + { + strButtonText = null; + strButtonImage = null; + strButtonImageFocus = null; + strPictureImage = null; + return false; + } + + public string Author() + { + return "chefkoch"; + } + + public string PluginName() + { + return "FRITZ!Box CallMonitor"; + } + + public bool HasSetup() + { + return true; + } + + public void ShowPlugin() + { + Form setup = new FritzBoxSetupForm(); + setup.ShowDialog(); + } + + #endregion + + #endregion + } +} \ No newline at end of file Copied: trunk/plugins/FritzBox/FritzBox/FritzBox.csproj (from rev 554, trunk/plugins/FritzBox/FritzBox.csproj) =================================================================== --- trunk/plugins/FritzBox/FritzBox/FritzBox.csproj (rev 0) +++ trunk/plugins/FritzBox/FritzBox/FritzBox.csproj 2007-06-17 15:37:03 UTC (rev 565) @@ -0,0 +1,117 @@ +<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProductVersion>8.0.50727</ProductVersion> + <SchemaVersion>2.0</SchemaVersion> + <ProjectGuid>{7A458560-A537-429E-A016-1A4513CB586F}</ProjectGuid> + <OutputType>Library</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>FritzBox</RootNamespace> + <AssemblyName>FritzBox</AssemblyName> + <ApplicationIcon> + </ApplicationIcon> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>bin\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <DebugType>pdbonly</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\Release\</OutputPath> + <DefineConstants>TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> + <DebugSymbols>true</DebugSymbols> + <OutputPath>bin\x86\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <DebugType>full</DebugType> + <PlatformTarget>x86</PlatformTarget> + <ErrorReport>prompt</ErrorReport> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' "> + <OutputPath>bin\Release\</OutputPath> + <DefineConstants>TRACE</DefineConstants> + <Optimize>true</Optimize> + <DebugType>pdbonly</DebugType> + <PlatformTarget>x86</PlatformTarget> + <ErrorReport>prompt</ErrorReport> + </PropertyGroup> + <ItemGroup> + <Reference Include="System" /> + <Reference Include="System.Data" /> + <Reference Include="System.Drawing" /> + <Reference Include="System.Windows.Forms" /> + <Reference Include="System.Xml" /> + </ItemGroup> + <ItemGroup> + <Compile Include="Caller.cs" /> + <Compile Include="FritzBox.cs" /> + <Compile Include="FritzBoxSetupFrom.cs"> + <SubType>Form</SubType> + </Compile> + <Compile Include="FritzBoxWatch.cs" /> + <Compile Include="Properties\Resources.Designer.cs"> + <AutoGen>True</AutoGen> + <DesignTime>True</DesignTime> + <DependentUpon>Resources.resx</DependentUpon> + </Compile> + </ItemGroup> + <ItemGroup> + <ProjectReference Include="..\..\mediaportal\Core\Core.csproj"> + <Project>{02FFFC1F-2555-4B99-8B01-3432D0673855}</Project> + <Name>Core</Name> + </ProjectReference> + <ProjectReference Include="..\..\mediaportal\Dialogs\Dialogs.csproj"> + <Project>{396C5208-5D46-4A11-92C1-FD0F2F42D7DD}</Project> + <Name>Dialogs</Name> + </ProjectReference> + <ProjectReference Include="..\..\mediaportal\Utils\Utils.csproj"> + <Project>{6DA0E4DF-6230-4642-98B5-E690BB6942BB}</Project> + <Name>Utils</Name> + </ProjectReference> + <ProjectReference Include="..\..\mediaportal\WindowPlugins\WindowPlugins.csproj"> + <Project>{B282C55B-A37B-4CEC-A4FC-00791069BF00}</Project> + <Name>WindowPlugins</Name> + </ProjectReference> + </ItemGroup> + <ItemGroup> + <EmbeddedResource Include="FritzBoxSetupFrom.resx"> + <DependentUpon>FritzBoxSetupFrom.cs</DependentUpon> + <SubType>Designer</SubType> + </EmbeddedResource> + <EmbeddedResource Include="Properties\Resources.resx"> + <SubType>Designer</SubType> + <Generator>ResXFileCodeGenerator</Generator> + <LastGenOutput>Resources.Designer.cs</LastGenOutput> + </EmbeddedResource> + </ItemGroup> + <ItemGroup> + <EmbeddedResource Include="FritzBoxDisabled.png" /> + <EmbeddedResource Include="FritzBox.png" /> + </ItemGroup> + <ItemGroup> + <None Include="gfx\FritzBoxIconTransparent.png" /> + </ItemGroup> + <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> + <!-- To modify your build process, add your task inside one of the targets below and uncomment it. + Other similar extension points exist, see Microsoft.Common.targets. + <Target Name="BeforeBuild"> + </Target> + <Target Name="AfterBuild"> + </Target> + --> + <PropertyGroup> + <PostBuildEvent>copy "$(TargetPath)" "C:\Programme\Team MediaPortal\MediaPortal\Plugins\Process\$(TargetFileName)" +rem copy "$(TargetPath)" "$(ProjectDir)\..\FritzBox_release\MP_svn_release\Plugins\Process\$(TargetFileName)" +rem copy "$(ProjectDir)\*" "$(ProjectDir)\..\FritzBox_release\MP_svn_source\*"</PostBuildEvent> + </PropertyGroup> +</Project> \ No newline at end of file Copied: trunk/plugins/FritzBox/FritzBox/FritzBox.png (from rev 554, trunk/plugins/FritzBox/FritzBox.png) =================================================================== (Binary files differ) Copied: trunk/plugins/FritzBox/FritzBox/FritzBoxDisabled.png (from rev 554, trunk/plugins/FritzBox/FritzBoxDisabled.png) =================================================================== (Binary files differ) Copied: trunk/plugins/FritzBox/FritzBox/FritzBoxSetupFrom.cs (from rev 554, trunk/plugins/FritzBox/FritzBoxSetupFrom.cs) =================================================================== --- trunk/plugins/FritzBox/FritzBox/FritzBoxSetupFrom.cs (rev 0) +++ trunk/plugins/FritzBox/FritzBox/FritzBoxSetupFrom.cs 2007-06-17 15:37:03 UTC (rev 565) @@ -0,0 +1,1091 @@ +#region Copyright (C) 2005-2007 Team MediaPortal + +/* + * Copyright (C) 2005-2007 Team MediaPortal + * http://www.team-mediaportal.com + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Make; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +#endregion + +using System; +using System.Drawing; +using System.Collections; +using System.ComponentModel; +using System.Windows.Forms; +using System.Net.Sockets; +using System.IO; +using MediaPortal.Profile; + +using MediaPortal.Util; +using MediaPortal.GUI.Library; +using MediaPortal.Configuration; + +namespace FritzBox +{ + /// <summary> + /// Zusammenfassung f\xFCr CallSetupFrom. + /// </summary> + public class FritzBoxSetupForm : Form + { + private MediaPortal.UserInterface.Controls.MPTabControl tabControlFritzBoxSettings; + private TabPage tabGeneral; + private TabPage tabIncoming; + private MediaPortal.UserInterface.Controls.MPGroupBox groupBoxNotify; + private MediaPortal.UserInterface.Controls.MPGroupBox groupBoxMedia; + private MediaPortal.UserInterface.Controls.MPCheckBox checkBoxStopMedia; + private TabPage tabPhonebook; + private DataGridView dataGridView; + private DataGridViewTextBoxColumn colCallerId; + private DataGridViewTextBoxColumn colName; + private DataGridViewCheckBoxColumn colShow; + private MediaPortal.UserInterface.Controls.MPGroupBox groupBoxPhonebook; + private MediaPortal.UserInterface.Controls.MPCheckBox checkBoxSaveUnknownCaller; + private MediaPortal.UserInterface.Controls.MPCheckBox checkBoxShowUnknownCaller; + private MediaPortal.UserInterface.Controls.MPCheckBox checkBoxUsePhonebook; + private MediaPortal.UserInterface.Controls.MPCheckBox checkBoxCallerShow; + private MediaPortal.UserInterface.Controls.MPTextBox textBoxCallerName; + private MediaPortal.UserInterface.Controls.MPTextBox textBoxCallerId; + private MediaPortal.UserInterface.Controls.MPButton buttonCallerRemove; + private MediaPortal.UserInterface.Controls.MPLabel labelCallerId; + private MediaPortal.UserInterface.Controls.MPLabel labelCallerName; + private MediaPortal.UserInterface.Controls.MPButton buttonCallerChange; + private MediaPortal.UserInterface.Controls.MPButton buttonCancel; + private MediaPortal.UserInterface.Controls.MPButton buttonSave; + private MediaPortal.UserInterface.Controls.MPNumericUpDown numericUpDownTimeout; + private MediaPortal.UserInterface.Controls.MPCheckBox checkBoxCloseOnTimout; + private MediaPortal.UserInterface.Controls.MPCheckBox checkBoxResumeMedia; + private MediaPortal.UserInterface.Controls.MPLabel labelVersion; + private MediaPortal.UserInterface.Controls.MPGroupBox mpGroupBox1; + private MediaPortal.UserInterface.Controls.MPCheckBox checkBoxExtensiveLogging; + private MediaPortal.UserInterface.Controls.MPButton buttonTest; + private MediaPortal.UserInterface.Controls.MPTextBox textBoxPort; + private MediaPortal.UserInterface.Controls.MPTextBox textBoxAddress; + private MediaPortal.UserInterface.Controls.MPLabel labelPort; + private MediaPortal.UserInterface.Controls.MPLabel labelAddress; + private MediaPortal.UserInterface.Controls.MPLabel labelHelp; + private MediaPortal.UserInterface.Controls.MPButton buttonMSNsRemove; + private MediaPortal.UserInterface.Controls.MPButton buttonMSNsAdd; + private PictureBox pictureBoxCaller; + private MediaPortal.UserInterface.Controls.MPCheckBox checkBoxFilterMSNs; + private MediaPortal.UserInterface.Controls.MPComboBox comboBoxMSNs; + private MediaPortal.UserInterface.Controls.MPCheckBox checkBoxShowMsnOnHeading; + private PictureBox pictureBox1; + private MediaPortal.UserInterface.Controls.MPButton mpImportFBMonitor; + private OpenFileDialog openFileDialog; + + /// <summary> + /// Erforderliche Designervariable. + /// </summary> + private Container components = null; + + public FritzBoxSetupForm() + { + // + // Erforderlich f\xFCr die Windows Form-Designerunterst\xFCtzung + // + InitializeComponent(); + + LoadSettings(); + // + // TODO: F\xFCgen Sie den Konstruktorcode nach dem Aufruf von InitializeComponent hinzu + // + } + + /// <summary> + /// Die verwendeten Ressourcen bereinigen. + /// </summary> + protected override void Dispose(bool disposing) + { + if (disposing) + { + if (components != null) + { + components.Dispose(); + } + } + base.Dispose(disposing); + } + + #region Vom Windows Form-Designer generierter Code + + /// <summary> + /// Erforderliche Methode f\xFCr die Designerunterst\xFCtzung. + /// Der Inhalt der Methode darf nicht mit dem Code-Editor ge\xE4ndert werden. + /// </summary> + private void InitializeComponent() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FritzBoxSetupForm)); + this.tabControlFritzBoxSettings = new MediaPortal.UserInterface.Controls.MPTabControl(); + 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(); + this.labelPort = new MediaPortal.UserInterface.Controls.MPLabel(); + this.labelAddress = new MediaPortal.UserInterface.Controls.MPLabel(); + this.labelHelp = new MediaPortal.UserInterface.Controls.MPLabel(); + this.tabIncoming = new System.Windows.Forms.TabPage(); + this.groupBoxPhonebook = new MediaPortal.UserInterface.Controls.MPGroupBox(); + this.mpImportFBMonitor = new MediaPortal.UserInterface.Controls.MPButton(); + this.checkBoxSaveUnknownCaller = new MediaPortal.UserInterface.Controls.MPCheckBox(); + this.checkBoxShowUnknownCaller = new MediaPortal.UserInterface.Controls.MPCheckBox(); + this.checkBoxUsePhonebook = new MediaPortal.UserInterface.Controls.MPCheckBox(); + this.groupBoxNotify = new MediaPortal.UserInterface.Controls.MPGroupBox(); + this.checkBoxShowMsnOnHeading = new MediaPortal.UserInterface.Controls.MPCheckBox(); + this.buttonMSNsRemove = new MediaPortal.UserInterface.Controls.MPButton(); + this.checkBoxFilterMSNs = new MediaPortal.UserInterface.Controls.MPCheckBox(); + this.buttonMSNsAdd = new MediaPortal.UserInterface.Controls.MPButton(); + this.comboBoxMSNs = new MediaPortal.UserInterface.Controls.MPComboBox(); + this.numericUpDownTimeout = new MediaPortal.UserInterface.Controls.MPNumericUpDown(); + this.checkBoxCloseOnTimout = new MediaPortal.UserInterface.Controls.MPCheckBox(); + this.groupBoxMedia = new MediaPortal.UserInterface.Controls.MPGroupBox(); + 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(); + this.textBoxCallerId = new MediaPortal.UserInterface.Controls.MPTextBox(); + this.buttonCallerRemove = new MediaPortal.UserInterface.Controls.MPButton(); + this.dataGridView = new System.Windows.Forms.DataGridView(); + this.colCallerId = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.colName = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.colShow = new System.Windows.Forms.DataGridViewCheckBoxColumn(); + this.labelCallerId = new MediaPortal.UserInterface.Controls.MPLabel(); + this.labelCallerName = new MediaPortal.UserInterface.Controls.MPLabel(); + this.buttonCancel = new MediaPortal.UserInterface.Controls.MPButton(); + this.buttonSave = new MediaPortal.UserInterface.Controls.MPButton(); + this.labelVersion = new MediaPortal.UserInterface.Controls.MPLabel(); + this.openFileDialog = new System.Windows.Forms.OpenFileDialog(); + 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.pictureBoxCaller)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.dataGridView)).BeginInit(); + this.SuspendLayout(); + // + // tabControlFritzBoxSettings + // + this.tabControlFritzBoxSettings.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.tabControlFritzBoxSettings.Controls.Add(this.tabGeneral); + this.tabControlFritzBoxSettings.Controls.Add(this.tabIncoming); + this.tabControlFritzBoxSettings.Controls.Add(this.tabPhonebook); + this.tabControlFritzBoxSettings.Location = new System.Drawing.Point(12, 13); + this.tabControlFritzBoxSettings.Name = "tabControlFritzBoxSettings"; + this.tabControlFritzBoxSettings.SelectedIndex = 0; + this.tabControlFritzBoxSettings.Size = new System.Drawing.Size(531, 337); + this.tabControlFritzBoxSettings.TabIndex = 0; + // + // tabGeneral + // + this.tabGeneral.Controls.Add(this.checkBoxExtensiveLogging); + this.tabGeneral.Controls.Add(this.mpGroupBox1); + this.tabGeneral.Location = new System.Drawing.Point(4, 22); + this.tabGeneral.Name = "tabGeneral"; + this.tabGeneral.Padding = new System.Windows.Forms.Padding(3); + this.tabGeneral.Size = new System.Drawing.Size(523, 311); + this.tabGeneral.TabIndex = 0; + this.tabGeneral.Text = "General"; + this.tabGeneral.UseVisualStyleBackColor = true; + // + // checkBoxExtensiveLogging + // + this.checkBoxExtensiveLogging.AutoSize = true; + this.checkBoxExtensiveLogging.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.checkBoxExtensiveLogging.Location = new System.Drawing.Point(6, 138); + this.checkBoxExtensiveLogging.Name = "checkBoxExtensiveLogging"; + this.checkBoxExtensiveLogging.Size = new System.Drawing.Size(339, 17); + this.checkBoxExtensiveLogging.TabIndex = 1; + this.checkBoxExtensiveLogging.Text = "extensive logging (!!! phonenumbers are written to the logfile !!!)"; + this.checkBoxExtensiveLogging.UseVisualStyleBackColor = true; + // + // mpGroupBox1 + // + this.mpGroupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.mpGroupBox1.Controls.Add(this.pictureBox1); + this.mpGroupBox1.Controls.Add(this.buttonTest); + this.mpGroupBox1.Controls.Add(this.textBoxPort); + this.mpGroupBox1.Controls.Add(this.textBoxAddress); + this.mpGroupBox1.Controls.Add(this.labelPort); + this.mpGroupBox1.Controls.Add(this.labelAddress); + this.mpGroupBox1.Controls.Add(this.labelHelp); + this.mpGroupBox1.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.mpGroupBox1.Location = new System.Drawing.Point(6, 6); + this.mpGroupBox1.Name = "mpGroupBox1"; + this.mpGroupBox1.Size = new System.Drawing.Size(511, 125); + this.mpGroupBox1.TabIndex = 0; + this.mpGroupBox1.TabStop = false; + this.mpGroupBox1.Text = "connection"; + // + // pictureBox1 + // + this.pictureBox1.Image = global::FritzBox.Properties.Resources.FritzBoxIconTransparent; + 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))); + this.buttonTest.Location = new System.Drawing.Point(430, 20); + this.buttonTest.Name = "buttonTest"; + this.buttonTest.Size = new System.Drawing.Size(75, 21); + this.buttonTest.TabIndex = 2; + this.buttonTest.Text = "Test"; + this.buttonTest.UseVisualStyleBackColor = true; + this.buttonTest.Click += new System.EventHandler(this.buttonTest_Click); + // + // textBoxPort + // + this.textBoxPort.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.textBoxPort.BorderColor = System.Drawing.Color.Empty; + this.textBoxPort.Location = new System.Drawing.Point(165, 47); + this.textBoxPort.Name = "textBoxPort"; + this.textBoxPort.Size = new System.Drawing.Size(259, 21); + this.textBoxPort.TabIndex = 1; + // + // textBoxAddress + // + this.textBoxAddress.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.textBoxAddress.BorderColor = System.Drawing.Color.Empty; + this.textBoxAddress.Location = new System.Drawing.Point(165, 20); + this.textBoxAddress.Name = "textBoxAddress"; + this.textBoxAddress.Size = new System.Drawing.Size(259, 21); + this.textBoxAddress.TabIndex = 0; + // + // labelPort + // + this.labelPort.AutoSize = true; + this.labelPort.Location = new System.Drawing.Point(128, 50); + this.labelPort.Name = "labelPort"; + this.labelPort.Size = new System.Drawing.Size(31, 13); + this.labelPort.TabIndex = 8; + this.labelPort.Text = "Port:"; + // + // labelAddress + // + this.labelAddress.AutoSize = true; + this.labelAddress.Location = new System.Drawing.Point(109, 24); + this.labelAddress.Name = "labelAddress"; + this.labelAddress.Size = new System.Drawing.Size(50, 13); + this.labelAddress.TabIndex = 7; + this.labelAddress.Text = "Address:"; + // + // labelHelp + // + this.labelHelp.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.labelHelp.Location = new System.Drawing.Point(165, 73); + this.labelHelp.Name = "labelHelp"; + this.labelHelp.Size = new System.Drawing.Size(340, 49); + this.labelHelp.TabIndex = 6; + // + // tabIncoming + // + this.tabIncoming.Controls.Add(this.groupBoxPhonebook); + this.tabIncoming.Controls.Add(this.groupBoxNotify); + this.tabIncoming.Controls.Add(this.groupBoxMedia); + this.tabIncoming.Location = new System.Drawing.Point(4, 22); + this.tabIncoming.Name = "tabIncoming"; + this.tabIncoming.Padding = new System.Windows.Forms.Padding(3); + this.tabIncoming.Size = new System.Drawing.Size(523, 311); + this.tabIncoming.TabIndex = 1; + this.tabIncoming.Text = "Incoming Call"; + this.tabIncoming.UseVisualStyleBackColor = true; + // + // groupBoxPhonebook + // + this.groupBoxPhonebook.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.groupBoxPhonebook.Controls.Add(this.mpImportFBMonitor); + this.groupBoxPhonebook.Controls.Add(this.checkBoxSaveUnknownCaller); + this.groupBoxPhonebook.Controls.Add(this.checkBoxShowUnknownCaller); + this.groupBoxPhonebook.Controls.Add(this.checkBoxUsePhonebook); + this.groupBoxPhonebook.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.groupBoxPhonebook.Location = new System.Drawing.Point(6, 208); + this.groupBoxPhonebook.Name = "groupBoxPhonebook"; + this.groupBoxPhonebook.Size = new System.Drawing.Size(511, 95); + this.groupBoxPhonebook.TabIndex = 2; + this.groupBoxPhonebook.TabStop = false; + this.groupBoxPhonebook.Text = "phonebook settings"; + // + // mpImportFBMonitor + // + this.mpImportFBMonitor.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.mpImportFBMonitor.Location = new System.Drawing.Point(355, 20); + this.mpImportFBMonitor.Name = "mpImportFBMonitor"; + this.mpImportFBMonitor.Size = new System.Drawing.Size(150, 23); + this.mpImportFBMonitor.TabIndex = 3; + this.mpImportFBMonitor.Text = "Import FRITZ!Box Monitor"; + this.mpImportFBMonitor.UseVisualStyleBackColor = true; + this.mpImportFBMonitor.Click += new System.EventHandler(this.mpImportFBMonitor_Click); + // + // checkBoxSaveUnknownCaller + // + this.checkBoxSaveUnknownCaller.AutoSize = true; + this.checkBoxSaveUnknownCaller.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.checkBoxSaveUnknownCaller.Location = new System.Drawing.Point(24, 68); + this.checkBoxSaveUnknownCaller.Name = "checkBoxSaveUnknownCaller"; + this.checkBoxSaveUnknownCaller.Size = new System.Drawing.Size(121, 17); + this.checkBoxSaveUnknownCaller.TabIndex = 2; + this.checkBoxSaveUnknownCaller.Text = "save unknown caller"; + this.checkBoxSaveUnknownCaller.UseVisualStyleBackColor = true; + // + // checkBoxShowUnknownCaller + // + this.checkBoxShowUnknownCaller.AutoSize = true; + this.checkBoxShowUnknownCaller.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.checkBoxShowUnknownCaller.Location = new System.Drawing.Point(24, 45); + this.checkBoxShowUnknownCaller.Name = "checkBoxShowUnknownCaller"; + this.checkBoxShowUnknownCaller.Size = new System.Drawing.Size(123, 17); + this.checkBoxShowUnknownCaller.TabIndex = 1; + this.checkBoxShowUnknownCaller.Text = "show unknown caller"; + this.checkBoxShowUnknownCaller.UseVisualStyleBackColor = true; + // + // checkBoxUsePhonebook + // + this.checkBoxUsePhonebook.AutoSize = true; + this.checkBoxUsePhonebook.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.checkBoxUsePhonebook.Location = new System.Drawing.Point(6, 20); + this.checkBoxUsePhonebook.Name = "checkBoxUsePhonebook"; + this.checkBoxUsePhonebook.Size = new System.Drawing.Size(97, 17); + this.checkBoxUsePhonebook.TabIndex = 0; + this.checkBoxUsePhonebook.Text = "use phonebook"; + this.checkBoxUsePhonebook.UseVisualStyleBackColor = true; + this.checkBoxUsePhonebook.CheckedChanged += new System.EventHandler(this.checkBoxUsePhonebook_CheckedChanged); + // + // groupBoxNotify + // + 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.checkBoxShowMsnOnHeading); + this.groupBoxNotify.Controls.Add(this.buttonMSNsRemove); + this.groupBoxNotify.Controls.Add(this.checkBoxFilterMSNs); + this.groupBoxNotify.Controls.Add(this.buttonMSNsAdd); + this.groupBoxNotify.Controls.Add(this.comboBoxMSNs); + this.groupBoxNotify.Controls.Add(this.numericUpDownTimeout); + this.groupBoxNotify.Controls.Add(this.checkBoxCloseOnTimout); + this.groupBoxNotify.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.groupBoxNotify.Location = new System.Drawing.Point(6, 6); + this.groupBoxNotify.Name = "groupBoxNotify"; + this.groupBoxNotify.Size = new System.Drawing.Size(511, 122); + this.groupBoxNotify.TabIndex = 0; + this.groupBoxNotify.TabStop = false; + this.groupBoxNotify.Text = "notify settings"; + // + // checkBoxShowMsnOnHeading + // + this.checkBoxShowMsnOnHeading.AutoSize = true; + this.checkBoxShowMsnOnHeading.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.checkBoxShowMsnOnHeading.Location = new System.Drawing.Point(6, 99); + this.checkBoxShowMsnOnHeading.Name = "checkBoxShowMsnOnHeading"; + this.checkBoxShowMsnOnHeading.Size = new System.Drawing.Size(161, 17); + this.checkBoxShowMsnOnHeading.TabIndex = 6; + this.checkBoxShowMsnOnHeading.Text = "show MSN on notify-heading"; + this.checkBoxShowMsnOnHeading.UseVisualStyleBackColor = true; + // + // buttonMSNsRemove + // + this.buttonMSNsRemove.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.buttonMSNsRemove.Location = new System.Drawing.Point(275, 72); + this.buttonMSNsRemove.Name = "buttonMSNsRemove"; + this.buttonMSNsRemove.Size = new System.Drawing.Size(63, 21); + this.buttonMSNsRemove.TabIndex = 5; + this.buttonMSNsRemove.Text = "Remove"; + this.buttonMSNsRemove.UseVisualStyleBackColor = true; + this.buttonMSNsRemove.Click += new System.EventHandler(this.buttonMSNsRemove_Click); + // + // checkBoxFilterMSNs + // + this.checkBoxFilterMSNs.AutoSize = true; + this.checkBoxFilterMSNs.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.checkBoxFilterMSNs.Location = new System.Drawing.Point(6, 49); + this.checkBoxFilterMSNs.Name = "checkBoxFilterMSNs"; + this.checkBoxFilterMSNs.Size = new System.Drawing.Size(194, 17); + this.checkBoxFilterMSNs.TabIndex = 2; + this.checkBoxFilterMSNs.Text = "show notify only for following MSNs"; + this.checkBoxFilterMSNs.UseVisualStyleBackColor = true; + this.checkBoxFilterMSNs.CheckedChanged += new System.EventHandler(this.checkBoxFilterMSNs_CheckedChanged); + // + // buttonMSNsAdd + // + this.buttonMSNsAdd.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.buttonMSNsAdd.Location = new System.Drawing.Point(206, 72); + this.buttonMSNsAdd.Name = "buttonMSNsAdd"; + this.buttonMSNsAdd.Size = new System.Drawing.Size(63, 21); + this.buttonMSNsAdd.TabIndex = 4; + this.buttonMSNsAdd.Text = "Add"; + this.buttonMSNsAdd.UseVisualStyleBackColor = true; + this.buttonMSNsAdd.Click += new System.EventHandler(this.buttonMSNsAdd_Click); + // + // comboBoxMSNs + // + this.comboBoxMSNs.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.comboBoxMSNs.BorderColor = System.Drawing.Color.Empty; + this.comboBoxMSNs.FormattingEnabled = true; + this.comboBoxMSNs.Location = new System.Drawing.Point(24, 72); + this.comboBoxMSNs.Name = "comboBoxMSNs"; + this.comboBoxMSNs.Size = new System.Drawing.Size(176, 21); + this.comboBoxMSNs.Sorted = true; + this.comboBoxMSNs.TabIndex = 3; + // + // numericUpDownTimeout + // + this.numericUpDownTimeout.Enabled = false; + this.numericUpDownTimeout.Location = new System.Drawing.Point(206, 20); + this.numericUpDownTimeout.Minimum = new decimal(new int[] { + 1, + 0, + 0, + 0}); + this.numericUpDownTimeout.Name = "numericUpDownTimeout"; + this.numericUpDownTimeout.Size = new System.Drawing.Size(53, 21); + this.numericUpDownTimeout.TabIndex = 1; + this.numericUpDownTimeout.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; + this.numericUpDownTimeout.Value = new decimal(new int[] { + 1, + 0, + 0, + 0}); + // + // checkBoxCloseOnTimout + // + this.checkBoxCloseOnTimout.AutoSize = true; + this.checkBoxCloseOnTimout.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.checkBoxCloseOnTimout.Location = new System.Drawing.Point(6, 20); + this.checkBoxCloseOnTimout.Name = "checkBoxCloseOnTimout"; + this.checkBoxCloseOnTimout.Size = new System.Drawing.Size(179, 17); + this.checkBoxCloseOnTimout.TabIndex = 0; + this.checkBoxCloseOnTimout.Text = "auto-close after timeout expired"; + this.checkBoxCloseOnTimout.UseVisualStyleBackColor = true; + this.checkBoxCloseOnTimout.CheckedChanged += new System.EventHandler(this.checkBoxCloseOnTimout_CheckedChanged_1); + // + // groupBoxMedia + // + this.groupBoxMedia.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.groupBoxMedia.Controls.Add(this.checkBoxResumeMedia); + this.groupBoxMedia.Controls.Add(this.checkBoxStopMedia); + this.groupBoxMedia.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.groupBoxMedia.Location = new System.Drawing.Point(6, 134); + this.groupBoxMedia.Name = "groupBoxMedia"; + this.groupBoxMedia.Size = new System.Drawing.Size(511, 68); + this.groupBoxMedia.TabIndex = 1; + this.groupBoxMedia.TabStop = false; + this.groupBoxMedia.Text = "media settings"; + // + // checkBoxResumeMedia + // + this.checkBoxResumeMedia.AutoSize = true; + this.... [truncated message content] |
From: <che...@us...> - 2007-06-24 07:29:02
|
Revision: 612 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=612&view=rev Author: chef_koch Date: 2007-06-24 00:29:01 -0700 (Sun, 24 Jun 2007) Log Message: ----------- Property Changed: ---------------- trunk/plugins/FritzBox/ trunk/plugins/FritzBox/FritzBox/ trunk/plugins/FritzBox/FritzBox/Properties/ trunk/plugins/FritzBox/FritzBox/gfx/ trunk/plugins/FritzBox/FritzBox/gfx/Thumbs/ trunk/plugins/FritzBox/FritzBox/gfx/Thumbs/YAC/ Property changes on: trunk/plugins/FritzBox ___________________________________________________________________ Name: svn:ignore - *.suo *.user thumbs.db + bin obj *.suo *.user thumbs.db Property changes on: trunk/plugins/FritzBox/FritzBox ___________________________________________________________________ Name: svn:ignore + bin obj *.suo *.user thumbs.db Property changes on: trunk/plugins/FritzBox/FritzBox/Properties ___________________________________________________________________ Name: svn:ignore - *.suo *.user thumbs.db + bin obj *.suo *.user thumbs.db Property changes on: trunk/plugins/FritzBox/FritzBox/gfx ___________________________________________________________________ Name: svn:ignore - *.suo *.user thumbs.db + bin obj *.suo *.user thumbs.db Property changes on: trunk/plugins/FritzBox/FritzBox/gfx/Thumbs ___________________________________________________________________ Name: svn:ignore - *.suo *.user thumbs.db + bin obj *.suo *.user thumbs.db Property changes on: trunk/plugins/FritzBox/FritzBox/gfx/Thumbs/YAC ___________________________________________________________________ Name: svn:ignore - *.suo *.user thumbs.db + bin obj *.suo *.user thumbs.db This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <che...@us...> - 2008-02-16 15:47:12
|
Revision: 1372 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1372&view=rev Author: chef_koch Date: 2008-02-16 07:46:56 -0800 (Sat, 16 Feb 2008) Log Message: ----------- added MP2version Added Paths: ----------- trunk/plugins/FritzBox/MP2version/ trunk/plugins/FritzBox/MP2version/CallMonitor.cs trunk/plugins/FritzBox/MP2version/CallMonitor.csproj trunk/plugins/FritzBox/MP2version/CallMonitor.plugin trunk/plugins/FritzBox/MP2version/HelperClasses/ trunk/plugins/FritzBox/MP2version/HelperClasses/CallAction.cs trunk/plugins/FritzBox/MP2version/HelperClasses/Caller.cs trunk/plugins/FritzBox/MP2version/HelperClasses/ICallMonitor.cs trunk/plugins/FritzBox/MP2version/HelperClasses/IListener.cs trunk/plugins/FritzBox/MP2version/ListenerBuilder.cs trunk/plugins/FritzBox/MP2version/Listeners/ trunk/plugins/FritzBox/MP2version/Listeners/BlueTooth_USB/ trunk/plugins/FritzBox/MP2version/Listeners/BlueTooth_USB/BlueTooth_USB.cs trunk/plugins/FritzBox/MP2version/Listeners/BlueTooth_USB/BlueTooth_USB.csproj trunk/plugins/FritzBox/MP2version/Listeners/BlueTooth_USB/BlueTooth_USB.plugin trunk/plugins/FritzBox/MP2version/Listeners/BlueTooth_USB/Helper/ trunk/plugins/FritzBox/MP2version/Listeners/BlueTooth_USB/Helper/ATcommand.cs trunk/plugins/FritzBox/MP2version/Listeners/FritzBox/ trunk/plugins/FritzBox/MP2version/Listeners/FritzBox/FritzBox.cs trunk/plugins/FritzBox/MP2version/Listeners/FritzBox/FritzBox.csproj trunk/plugins/FritzBox/MP2version/Listeners/FritzBox/FritzBox.plugin trunk/plugins/FritzBox/MP2version/Listeners/FritzBox/Properties/ trunk/plugins/FritzBox/MP2version/Listeners/FritzBox/Properties/AssemblyInfo.cs trunk/plugins/FritzBox/MP2version/Properties/ trunk/plugins/FritzBox/MP2version/Properties/AssemblyInfo.cs Added: trunk/plugins/FritzBox/MP2version/CallMonitor.cs =================================================================== --- trunk/plugins/FritzBox/MP2version/CallMonitor.cs (rev 0) +++ trunk/plugins/FritzBox/MP2version/CallMonitor.cs 2008-02-16 15:46:56 UTC (rev 1372) @@ -0,0 +1,278 @@ +using System; +using System.Collections.Generic; +using System.Text; +using MediaPortal.Core.PluginManager; +using MediaPortal.Core; +using MediaPortal.Core.Logging; +using MediaPortal.Core.Database.Interfaces; +using MediaPortal.Core.MediaManager.Views; + +namespace CallMonitor +{ + public class CallMonitor : IPlugin, IAutoStart, ICallMonitor + { + ILogger Logger; + + + IDatabase _callDatabase; + List<ListenerBuilder> _listeners; + + /// <summary> + /// Initializes a new instance of the <see cref="CallMonitor"/> class. + /// </summary> + public CallMonitor() + { + Logger = ServiceScope.Get<ILogger>(); + } + + #region IPlugin Members + public void Initialize(string id) + { + // Get all Importer plugins + try + { + _listeners = ServiceScope.Get<IPluginManager>().GetAllPluginItems<ListenerBuilder>("/CallMonitor/Listeners"); + } + catch (Exception ex) + { + Logger.Error("FritzBox: CallMonitor: {0}", ex, "FEHLER"); + } + } + + public void Dispose() + { + } + #endregion + + #region IImporterManager Members + + /// <summary> + /// Registers the specified listener. + /// </summary> + /// <param name="listener">The listener.</param> + public void Register(IListener listener) + { + // Use plugin space + //if (!_listeners.Contains(listener)) + //{ + // _listeners.Add(listener); + //} + } + + /// <summary> + /// Unregisters the listener + /// </summary> + /// <param name="listener">The listener.</param> + public void UnRegister(IListener listener) + { + //if (_listeners.Contains(listener)) + //{ + // _listeners.Remove(listener); + //} + } + + /// <summary> + /// Gets the registered listeners. + /// </summary> + /// <value>The registered listeners.</value> + public List<IListener> Listeners + { + get + { + List<IListener> listeners = new List<IListener>(); + foreach (ListenerBuilder listenerBuilder in _listeners) + { + listeners.Add(listenerBuilder.Listener); + } + return listeners; + } + } + + /// <summary> + /// Gets the listener for the specific name + /// </summary> + /// <param name="name">The name.</param> + /// <returns></returns> + public IListener GetListenerByName(string name) + { + foreach (ListenerBuilder listenerBuilder in _listeners) + { + if (String.Compare(listenerBuilder.Name, name, true) == 0) + return listenerBuilder.Listener; + } + return null; + } + #endregion + + + /// <summary> + /// Initializes this instance. + /// </summary> + private void Initialize() { } + + /// <summary> + /// Startups this instance. + /// </summary> + public void Startup() + { + ServiceScope.Add<ICallMonitor>(this); + + try + { + foreach (IListener listener in Listeners) + { + listener.Start(); + } + } + catch (Exception ex) + { + Logger.Error("FritzBox: CallMonitor: {0}", ex, "FEHLER"); + } + + Initialize(); + } + + + + + + + + /// <summary> + /// Creates the picture database. + /// </summary> + void CreateCallsDatabase() + { + try + { + IDatabaseBuilderFactory builderFactory = ServiceScope.Get<IDatabaseBuilderFactory>(); + IDatabaseFactory factory = builderFactory.CreateFromId("Calls"); + + _callDatabase = factory.Open("Calls"); + + _callDatabase.Add("Date", typeof(DateTime), 1024); + _callDatabase.Add("CallerId", typeof(string), 1024); + //_callDatabase.Add("CameraModel", typeof(string), 40); + //_callDatabase.Add("EquipmentMake", typeof(string), 40); + //_callDatabase.Add("ExposureCompensation", typeof(string), 1024); + //_callDatabase.Add("ExposureTime", typeof(string), 1024); + //_callDatabase.Add("Flash", typeof(string), 40); + //_callDatabase.Add("Fstop", typeof(string), 40); + //_callDatabase.Add("ImgDimensions", typeof(string), 40); + //_callDatabase.Add("title", typeof(string), 60); + //_callDatabase.Add("MeteringMod", typeof(string), 1024); + //_callDatabase.Add("Resolutions", typeof(string), 1024); + //_callDatabase.Add("ShutterSpeed", typeof(string), 1024); + //_callDatabase.Add("ViewComment", typeof(string), 1024); + //_callDatabase.Add("ISOSpeed", typeof(string), 1024); + //_callDatabase.Add("Orientation", typeof(int)); + //_callDatabase.Add("PictureTags", typeof(List<string>), 1024); + //_callDatabase.Add("contentURI", typeof(string), 1024); + //_callDatabase.Add("CoverArt", typeof(string), 1024); + //_callDatabase.Add("Updated", typeof(string), 1); + //_callDatabase.Add("path", typeof(string), 1024); + //_callDatabase.Add("dateAdded", typeof(DateTime)); + + //get date/time of last import done.... + //Query lastDateQuery = new Query(); + //lastDateQuery.Sort = SortOrder.Descending; + //lastDateQuery.SortFields.Add("dateAdded"); + //lastDateQuery.Limit = 1; + //List<IDbItem> lastItems = _callDatabase.Query(lastDateQuery); + //if (lastItems.Count == 0) + // _lastImport = DateTime.MinValue; + //else + // _lastImport = (DateTime)lastItems[0]["dateAdded"]; + } + catch (Exception ex) + { + ServiceScope.Get<ILogger>().Info("callmonitor:error CreatePictureDatabase"); + ServiceScope.Get<ILogger>().Error(ex); + } + } + } +} + + + + + + + + + //public void Startup() + //{ + // try + // { + // IPluginManager pluginManager = ServiceScope.Get<IPluginManager>(); + + + + // foreach (IListener plugin in pluginManager.GetAllPluginItems<IListener>("/CallMonitor/Listeners")) + // { + // //plugin.Startup(); + // } + + // ServiceScope.Add<ICallMonitor>(this); + + // List<string> strL = new List<string>(); + // strL.Add("/AutoStart"); + // strL.Add("/Media/Providers"); + // strL.Add("/CallMonitor/Listeners"); + + + // foreach (string str in strL) + // { + // string count = ServiceScope.Get<IPluginManager>().GetAllPluginItems<IPlugin>(str).Count.ToString(); + // ServiceScope.Get<ILogger>().Info("FritzBox: CallMonitor: {0} count: {1}", str, count); + // } + + + // foreach (IListener listener in ServiceScope.Get<IPluginManager>().GetAllPluginItems<IListener>("/")) + // { + // ServiceScope.Get<ILogger>().Info("FritzBox: CallMonitor: register {0}", listener.ToString()); + // ServiceScope.Get<ICallMonitor>().Register(listener); + // } + + + // foreach (IPlugin listener in ServiceScope.Get<IPluginManager>().GetAllPluginItems<IPlugin>("/AutoStart")) + // { + // ServiceScope.Get<ILogger>().Info("FritzBox: CallMonitor: register {0}", listener.ToString()); + // } + // ServiceScope.Get<ILogger>().Info("FritzBox: IPluginInfo: AutoStart DONE "); + // foreach (IPlugin listener in ServiceScope.Get<IPluginManager>().GetAllPluginItems<IPlugin>("/Media/Providers")) + // { + // ServiceScope.Get<ILogger>().Info("FritzBox: CallMonitor: register {0}", listener.ToString()); + // } + // ServiceScope.Get<ILogger>().Info("FritzBox: IPluginInfo: Media/Providers DONE "); + // foreach (IPlugin listener in ServiceScope.Get<IPluginManager>().GetAllPluginItems<IPlugin>("/Media/Providers")) + // { + // ServiceScope.Get<ILogger>().Info("FritzBox: CallMonitor: register {0}", listener.ToString()); + // } + // ServiceScope.Get<ILogger>().Info("FritzBox: IPluginInfo: Media/Providers DONE "); + // foreach (IPlugin listener in ServiceScope.Get<IPluginManager>().GetAllPluginItems<IPlugin>("//")) + // { + // ServiceScope.Get<ILogger>().Info("FritzBox: CallMonitor: register {0}", listener.ToString()); + // } + // ServiceScope.Get<ILogger>().Info("FritzBox: IPluginInfo: Listeners DONE "); + + + + // ServiceScope.Get<ILogger>().Info("FritzBox: CallMonitor: foreach (IListener listener in ServiceScope.Get<IPluginManager>().GetAllPluginItems<IListener>()"); + + + + + + // foreach (IListener listener in ServiceScope.Get<IPluginManager>().GetAllPluginItems<IListener>("/Media/Providers")) + // { + // ServiceScope.Get<ILogger>().Info("FritzBox: CallMonitor: register {0}", listener.Title); + // ServiceScope.Get<ICallMonitor>().Register(listener); + // } + // //ServiceScope.Get<ILogger>().Info("FritzBox: CallMonitor: Startup() finished {0} eintr\xE4ge", _listeners.Count.ToString()); + // } + // catch (Exception ex) + // { + // ServiceScope.Get<ILogger>().Error("FritzBox: CallMonitor: {0}", ex, "kneuk"); + // } + //} \ No newline at end of file Added: trunk/plugins/FritzBox/MP2version/CallMonitor.csproj =================================================================== --- trunk/plugins/FritzBox/MP2version/CallMonitor.csproj (rev 0) +++ trunk/plugins/FritzBox/MP2version/CallMonitor.csproj 2008-02-16 15:46:56 UTC (rev 1372) @@ -0,0 +1,71 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProductVersion>8.0.50727</ProductVersion> + <SchemaVersion>2.0</SchemaVersion> + <ProjectGuid>{131A0BFD-AF34-4AEB-8A10-7330FE83811E}</ProjectGuid> + <OutputType>Library</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>CallMonitor</RootNamespace> + <AssemblyName>CallMonitor</AssemblyName> + <StartupObject> + </StartupObject> + <SignAssembly>false</SignAssembly> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>bin\x86\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + <PlatformTarget>x86</PlatformTarget> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <DebugType>pdbonly</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\x86\Release\</OutputPath> + <DefineConstants>TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + <PlatformTarget>x86</PlatformTarget> + </PropertyGroup> + <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> + <!-- To modify your build process, add your task inside one of the targets below and uncomment it. + Other similar extension points exist, see Microsoft.Common.targets. + <Target Name="BeforeBuild"> + </Target> + <Target Name="AfterBuild"> + </Target> + --> + <ItemGroup> + <Compile Include="ListenerBuilder.cs" /> + <Compile Include="HelperClasses\ICallMonitor.cs" /> + <Compile Include="HelperClasses\IListener.cs" /> + <Compile Include="Properties\AssemblyInfo.cs" /> + <Compile Include="CallMonitor.cs" /> + <Compile Include="HelperClasses\Caller.cs" /> + <Compile Include="HelperClasses\CallAction.cs" /> + </ItemGroup> + <ItemGroup> + <Reference Include="System" /> + <Reference Include="System.Data" /> + <Reference Include="System.Xml" /> + </ItemGroup> + <ItemGroup> + <None Include="CallMonitor.plugin" /> + </ItemGroup> + <PropertyGroup> + <PostBuildEvent>xcopy /Y "$(ProjectDir)$(ProjectName).plugin" "$(SolutionDir)$(SolutionName)\$(OutDir)Plugins\$(ProjectName)\" +xcopy /Y "$(TargetDir)CallMonitor.dll" "$(SolutionDir)$(SolutionName)\$(OutDir)Plugins\$(ProjectName)\"</PostBuildEvent> + </PropertyGroup> + <ItemGroup> + <ProjectReference Include="..\MediaPortal.Core\MediaPortal.Core.csproj"> + <Project>{52E587D0-A274-44DA-8846-8EEAF5414923}</Project> + <Name>MediaPortal.Core</Name> + </ProjectReference> + </ItemGroup> +</Project> \ No newline at end of file Added: trunk/plugins/FritzBox/MP2version/CallMonitor.plugin =================================================================== --- trunk/plugins/FritzBox/MP2version/CallMonitor.plugin (rev 0) +++ trunk/plugins/FritzBox/MP2version/CallMonitor.plugin 2008-02-16 15:46:56 UTC (rev 1372) @@ -0,0 +1,22 @@ +<Plugin name = "CallMonitor" + author = "Frodo" + copyright = "GPL" + description = "CallMonitor"> + + <Manifest> + <Identity name = "CallMonitor.CallMonitor"/> + </Manifest> + + <Runtime> + <Import assembly = "CallMonitor.dll"> + <Builder name = 'Listener' class = 'CallMonitor.ListenerBuilder'/> + </Import> + </Runtime> + + <Register location = "/AutoStart"> + <Class id = "CallMonitor" class = "CallMonitor.CallMonitor" insertbefore = "DirectxGui"/> + </Register> + <Register location = "/Services"> + <Class id = "ICallMonitor" class = "CallMonitor.CallMonitor"/> + </Register> +</Plugin> \ No newline at end of file Added: trunk/plugins/FritzBox/MP2version/HelperClasses/CallAction.cs =================================================================== --- trunk/plugins/FritzBox/MP2version/HelperClasses/CallAction.cs (rev 0) +++ trunk/plugins/FritzBox/MP2version/HelperClasses/CallAction.cs 2008-02-16 15:46:56 UTC (rev 1372) @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Text; +using MediaPortal.Core.Logging; + +namespace CallMonitor +{ + public class CallAction + { + public enum CallType + { + Incoming, + Outgoing, + ConnectionStarted, + ConnectionClosed, + } + + public CallType type; + public DateTime time = DateTime.MinValue; + public Caller caller = new Caller(); + public string msn = string.Empty; + + public void WriteToLog() + { + ILogger log = MediaPortal.Core.ServiceScope.Get<ILogger>(); + + log.Info("CallAction Info:"); + log.Info(" CallType: {0}", this.type.ToString()); + log.Info(" Date: {0}", this.time.ToShortDateString()); + log.Info(" Time: {0}", this.time.ToShortTimeString()); + log.Info(" Caller: {0}", this.caller.ID); + log.Info(" MSN: {0}", this.msn); + } + } +} \ No newline at end of file Added: trunk/plugins/FritzBox/MP2version/HelperClasses/Caller.cs =================================================================== --- trunk/plugins/FritzBox/MP2version/HelperClasses/Caller.cs (rev 0) +++ trunk/plugins/FritzBox/MP2version/HelperClasses/Caller.cs 2008-02-16 15:46:56 UTC (rev 1372) @@ -0,0 +1,89 @@ +#region Copyright (C) 2005-2007 Team MediaPortal + +/* + * Copyright (C) 2005-2007 Team MediaPortal + * http://www.team-mediaportal.com + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Make; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +#endregion + +using System; +using System.Collections.Generic; +using System.Text; + +namespace CallMonitor +{ + public class Caller + { + string _id; + string _name; + bool _show; + + public Caller() + { + this._id = ""; + this._name = ""; + this._show = true; + } + + public Caller(string id, string name, bool show) + { + this._id = id; + this._name = name; + this._show = show; + } + + public string ID + { + get + { + return _id; + } + set + { + _id = value; + } + } + + public string Name + { + get + { + return _name; + } + set + { + _name = value; + } + } + + public bool Show + { + get + { + return _show; + } + set + { + _show = value; + } + } + + } +} Added: trunk/plugins/FritzBox/MP2version/HelperClasses/ICallMonitor.cs =================================================================== --- trunk/plugins/FritzBox/MP2version/HelperClasses/ICallMonitor.cs (rev 0) +++ trunk/plugins/FritzBox/MP2version/HelperClasses/ICallMonitor.cs 2008-02-16 15:46:56 UTC (rev 1372) @@ -0,0 +1,36 @@ + +using System; +using System.Collections.Generic; + +namespace CallMonitor +{ + public interface ICallMonitor + { + /// <summary> + /// Registers a new listener with the listener manager + /// </summary> + /// <param name="listener">The Listener.</param> + [Obsolete("Listeners should be registered via the Plugin space /CallMonitor/Listeners")] + void Register(IListener listener); + + /// <summary> + /// Unregisters an listener with the listener manager + /// </summary> + /// <param name="listener">The Listener.</param> + [Obsolete("Listeners should be registered via the Plugin space /CallMonitor/Listeners")] + void UnRegister(IListener listener); + + /// <summary> + /// Gets a list of all registered listeners. + /// </summary> + /// <value>The registered listeners.</value> + List<IListener> Listeners { get;} + + /// <summary> + /// Gets the listener for the specific name + /// </summary> + /// <param name="name">The name.</param> + /// <returns></returns> + IListener GetListenerByName(string name); + } +} Added: trunk/plugins/FritzBox/MP2version/HelperClasses/IListener.cs =================================================================== --- trunk/plugins/FritzBox/MP2version/HelperClasses/IListener.cs (rev 0) +++ trunk/plugins/FritzBox/MP2version/HelperClasses/IListener.cs 2008-02-16 15:46:56 UTC (rev 1372) @@ -0,0 +1,19 @@ + +namespace CallMonitor +{ + /// <summary> + /// interface for a listener + /// </summary> + public interface IListener + { + ///// <summary> + ///// Gets the listener name. + ///// </summary> + ///// <value>The listener name.</value> + //string Name { get;} + + void Start(); + void Stop(); + bool IsActive(); + } +} Added: trunk/plugins/FritzBox/MP2version/ListenerBuilder.cs =================================================================== --- trunk/plugins/FritzBox/MP2version/ListenerBuilder.cs (rev 0) +++ trunk/plugins/FritzBox/MP2version/ListenerBuilder.cs 2008-02-16 15:46:56 UTC (rev 1372) @@ -0,0 +1,134 @@ + +using System; +using System.IO; +using System.Collections; +using System.Collections.Generic; +using System.Text; +using MediaPortal.Core; +using MediaPortal.Core.Logging; +using MediaPortal.Core.PluginManager; +using MediaPortal.Core.Importers; +using MediaPortal.Core.MediaManager; + +namespace CallMonitor +{ + class ListenerBuilder : IPluginBuilder + { + #region variables + INodeItem _item; + IListener _listenerInstance; + #endregion + + #region IPluginBuilder methods + public object BuildItem(object caller, INodeItem item, ArrayList subItems) + { + ListenerBuilder builder = new ListenerBuilder(); + builder._item = item; + + return builder; + } + #endregion + + #region IListenerBuilder + /// <summary> + /// Gets the importer name. + /// </summary> + /// <value>The importer name.</value> + public string Name + { + get { return _item.Id; } + } + + /// <summary> + /// Gets the Listener + /// </summary> + /// <value>The Listener instance.</value> + public IListener Listener + { + get + { + Build(); + return _listenerInstance; + } + } + + /// <summary> + /// Called by the importer manager when a full-import needs to be done from the folder + /// </summary> + /// <param name="folder">The folder.</param> + //public void ImportFolder(string folder, DateTime since) + //{ + // List<string> availableFiles = new List<string>(); + // Import(folder, ref availableFiles, since); + + // if (availableFiles.Count > 0) + // { + // Build(); + // foreach (string filename in availableFiles) + // { + // _importerInstance.FileImport(filename); + // } + // } + //} + + /// <summary> + /// Called by the importer manager after it detected that a file was deleted + /// This gives the importer a change to update the database + /// </summary> + /// <param name="file">The filename of the deleted file.</param> + //public void FileDeleted(string filename) + //{ + // if (_extensions.Contains(Path.GetExtension(filename).ToLower())) + // { + // Build(); + // _importerInstance.FileDeleted(filename); + // } + //} + + /// <summary> + /// Called by the importer manager after it detected that a file was created + /// This gives the importer a change to update the database + /// </summary> + /// <param name="file">The filename of the new file.</param> + //public void FileCreated(string filename) + //{ + // if (_extensions.Contains(Path.GetExtension(filename).ToLower())) + // { + // Build(); + // _importerInstance.FileCreated(filename); + // } + //} + + /// <summary> + /// Called by the importer manager after it detected that a file was changed + /// This gives the importer a change to update the database + /// </summary> + /// <param name="file">The filename of the changed file.</param> + //public void FileChanged(string filename) + //{ + // if (_extensions.Contains(Path.GetExtension(filename).ToLower())) + // { + // Build(); + // _importerInstance.FileChanged(filename); + // } + //} + #endregion + + #region Private + private void Build() + { + if (_listenerInstance == null) + { + try + { + _listenerInstance = (IListener)_item.CreateObject(_item["class"]); + } + catch (Exception e) + { + ServiceScope.Get<ILogger>().Error(e.ToString() + "Can't create importer : " + _item.Id); + } + } + } + #endregion + } +} Added: trunk/plugins/FritzBox/MP2version/Listeners/BlueTooth_USB/BlueTooth_USB.cs =================================================================== --- trunk/plugins/FritzBox/MP2version/Listeners/BlueTooth_USB/BlueTooth_USB.cs (rev 0) +++ trunk/plugins/FritzBox/MP2version/Listeners/BlueTooth_USB/BlueTooth_USB.cs 2008-02-16 15:46:56 UTC (rev 1372) @@ -0,0 +1,1225 @@ +using System.IO; +using MediaPortal.Core; +using MediaPortal.Core.Threading; + +using MediaPortal.Core.PluginManager; + +using CallMonitor; +using System; +using MediaPortal.Core.Logging; + + + + + +using System; +using System.Collections.Generic; +using System.ComponentModel; +//using System.Data; +//using System.Drawing; +using System.Text; +//using System.Windows.Forms; +using System.IO.Ports; + +using C4F.DevKit.Bluetooth.SerialPortProfile; +using System.Net.Sockets; +using System.Threading; + + +namespace CallMonitor.Listeners +{ + public class BlueTooth_USB : IPlugin, IListener + { + #region variables + + BluetoothSPPManager spp; + + public event phoneMessageHandler message; + public delegate void phoneMessageHandler(string message); + + public delegate void signalStrengthHandler(string message); + public delegate void callerIdHandler(string message); + public delegate void modeHandler(string message); + public delegate void batteryStatusHandler(string message); + public delegate void volumeHandler(string message); + + + #region Public Events and Delegates + + /// <summary> + /// This represents the method that will be raised when data is detected + /// on the port. + /// </summary> + /// <param name="sender">The sender of this event.</param> + /// <param name="e">EventArgs object containing information about the + /// event.</param> + public delegate void DataDetectedOnSerialPortEventHandler( + object sender, EventArgs e); + + /// <summary> + /// This represents the method that will be raised when data is detected + /// on the NetworkStream. + /// </summary> + /// <param name="sender">The sender of this event.</param> + /// <param name="e">EventArgs object containing information about the + /// event.</param> + public delegate void DataDetectedFromRemoteDeviceEventHandler( + object sender, EventArgs e); + + /// <summary> + /// This event will be raised when incoming data is detected on the port + /// (to be sent to the NetworkStream). + /// </summary> + public event DataDetectedOnSerialPortEventHandler + DataDetectedOnSerialPort; + + /// <summary> + /// This event will be raised when incoming data is detected on the + /// NetworkStream (to be sent to the port). + /// </summary> + public event DataDetectedFromRemoteDeviceEventHandler + DataDetectedFromRemoteDevice; + + #endregion + + ILogger Logger; + + + + + List<string> _ports = new List<string>(); + + + + + + + int _selectedPort = -1; + int _signalStrength = int.MinValue; + string _PhoneNumber = string.Empty; + string _name = string.Empty; + int _volumeLevel = -1; + int _powerLevel = -1; + + + + int _mode = -1; + + + int maxNotifies = 20; + int notifyCount = 0; + + bool stopThread = false; + + + #endregion + + #region Private Fields + /// <summary> + /// Name of the port which will be used for communication. + /// </summary> + private string portName; + + /// <summary> + /// SerialPort object representing the port which will be used for + /// communication. + /// </summary> + private SerialPort serialPort; + + /// <summary> + /// NetworkStream which will be used for communication. + /// </summary> + private NetworkStream networkStream; + + /// <summary> + /// Thread which will listen for DataDetectedFromRemoteDevice event. + /// </summary> + private Thread serialCommEventThread; + + + + + #region Serial Port Settings + + /// <summary> + /// Serial baud rate. + /// </summary> + private int baudRate = DEFAULT_BAUD_RATE; + + /// <summary> + /// Standard length of data bits per byte. + /// </summary> + private int dataBits = DEFAULT_DATA_BITS; + + /// <summary> + /// Parity-checking protocol. + /// </summary> + private Parity parity = DEFAULT_PARITY; + + /// <summary> + /// A byte that replaces invalid bytes in a data stream when a parity + /// error occurs. + /// </summary> + private byte parityReplace = DEFAULT_PARITY_REPLACE; + + /// <summary> + /// The standard number of stopbits per byte. + /// </summary> + private StopBits stopBits = DEFAULT_STOP_BITS; + + /// <summary> + /// The size of the SerialPort input buffer. + /// </summary> + private int readBufferSize = DEFAULT_READBUFFER_SIZE; + + /// <summary> + /// The number of milliseconds before a time-out occurs when a read + /// operation does not finish. + /// </summary> + private int readTimeout = DEFAULT_READ_TIMEOUT; + + /// <summary> + /// The size of the SerialPort output buffer. + /// </summary> + private int writeBufferSize = DEFAULT_WRITEBUFFER_SIZE; + + /// <summary> + /// The number of milliseconds before a time-out occurs when a write + /// operation does not finish. + /// </summary> + private int writeTimeout = DEFAULT_WRITE_TIMEOUT; + + /// <summary> + /// The byte encoding for pre- and post-transmission conversion of text. + /// </summary> + private Encoding encoding = ASCIIEncoding.ASCII; + + #endregion + + #endregion + + #region Private Constants + + /// <summary> + /// The maximum length of data bits per byte. + /// </summary> + private const int MAX_DATA_BITS = 8; + + /// <summary> + /// The minimum length of data bits per byte. + /// </summary> + private const int MIN_DATA_BITS = 5; + + #endregion + + #region Public Constants + + //Default values. + + /// <summary> + /// The default value for serial baud rate is 9600 bits per second (bps). + /// </summary> + public const int DEFAULT_BAUD_RATE = 0x2580; + + /// <summary> + /// The default value for standard length of data bits per byte is 8. + /// </summary> + public const int DEFAULT_DATA_BITS = 8; + + /// <summary> + /// The default value for Parity-checking protocol is None. + /// </summary> + public const Parity DEFAULT_PARITY = Parity.None; + + /// <summary> + /// The default value for the byte that replaces invalid bytes in a + /// data stream when a parity error occurs is 0x3f. + /// </summary> + public const byte DEFAULT_PARITY_REPLACE = 0x3f; + + /// <summary> + /// The default value for the standard number of stopbits per byte is 1. + /// </summary> + public const StopBits DEFAULT_STOP_BITS = StopBits.One; + + /// <summary> + /// The default value for the size of the SerialPort input buffer is + /// 4096. + /// </summary> + public const int DEFAULT_READBUFFER_SIZE = 0x1000; + + /// <summary> + /// The default value for the number of milliseconds before a time-out + /// occurs when a read operation does not finish is InfiniteTimeout. + /// </summary> + public const int DEFAULT_READ_TIMEOUT = -1; + + /// <summary> + /// The default value for the size of the SerialPort output buffer is + /// 2048. + /// </summary> + public const int DEFAULT_WRITEBUFFER_SIZE = 0x800; + + /// <summary> + /// The default value for the number of milliseconds before a time-out + /// occurs when a write operation does not finish is InfiniteTimeout. + /// </summary> + public const int DEFAULT_WRITE_TIMEOUT = -1; + + /// <summary> + /// The value for InfiniteTimeout. + /// </summary> + public const int INFINITE_TIMEOUT = -1; + + #endregion + + #region Public Properties + + /// <summary> + /// Gets or sets the name of the port. + /// </summary> + //[Category(SPPConstants.Category_SerialPortSettings)] + //[Description(SPPConstants.Desc_PortName)] + public string PortName + { + get { return this.portName; } + set + { + if (this.serialPort != null) + throw new InvalidOperationException("SPPResources.Error_SP_PortSet"); + else { this.portName = value; } + } + } + + /// <summary> + /// Gets the status of the port (Opened/Closed). + /// </summary> + [Browsable(false)] + public bool IsPortOpen + { + get + { + if (this.serialPort == null) + return false; + else return this.serialPort.IsOpen; + } + } + + /// <summary> + /// Gets or sets the NetworkStream used for communicating with a remote device. + /// </summary> + [Browsable(false)] + public NetworkStream NetworkStream + { + get + { return this.networkStream; } + set + { + this.networkStream = value; + if (this.networkStream != null) + { + this.networkStream.WriteTimeout = this.readTimeout; + this.networkStream.ReadTimeout = this.writeTimeout; + } + } + } + + #region Serial Port Settings + + /// <summary> + /// Gets or sets the serial baud rate. The default value is 9600 bits + /// per second (bps). + /// </summary> + [Category("SPPConstants.Category_SerialPortSettings")] + [Description("SPPConstants.Desc_BaudRate")] + public int BaudRate + { + get + { return this.baudRate; } + set + { + if (value <= 0) + throw new ArgumentOutOfRangeException("BaudRate", + "SPPResources.Error_SP_InvalidBaudRate"); + + this.baudRate = value; + if (this.serialPort != null) + this.serialPort.BaudRate = value; + } + } + + /// <summary> + /// Gets or sets the standard length of data bits per byte. + /// The range of values for this field is from 5 through 8. + /// The default value is 8. + /// </summary> + [Category("SPPConstants.Category_SerialPortSettings")] + [Description("SPPConstants.Desc_DataBits")] + public int DataBits + { + get + { return this.dataBits; } + set + { + if ((value < MIN_DATA_BITS) || (value > MAX_DATA_BITS)) + throw new ArgumentOutOfRangeException("DataBits", + "SPPResources.Error_SP_DataBitsRange"); + + this.dataBits = value; + if (this.serialPort != null) + this.serialPort.DataBits = value; + } + } + + /// <summary> + /// Gets or sets the byte encoding for pre- and post-transmission + /// conversion of text. + /// The default is ASCIIEncoding. + /// </summary> + [Browsable(false)] + public Encoding Encoding + { + get + { return this.encoding; } + set + { + if (value == null) + this.encoding = ASCIIEncoding.ASCII; + else + { + if (((!(value is ASCIIEncoding) && + !(value is UTF8Encoding)) && + (!(value is UnicodeEncoding) && + !(value is UTF32Encoding))) && + (((value.CodePage >= 0xc350) + && (value.CodePage != 0xd698)) + || (value.GetType().Assembly != + typeof(string).Assembly))) + throw new ArgumentException( + "SPPResources.Error_SP_EncodingNotSupported", "Encoding"); + + this.encoding = value; + if (this.serialPort != null) + this.serialPort.Encoding = value; + } + } + } + + /// <summary> + /// Gets or sets the Parity-checking protocol. The default value is + /// None. + /// </summary> + //[Category(SPPConstants.Category_SerialPortSettings)] + //[Description(SPPConstants.Desc_Parity)] + public Parity Parity + { + get + { return this.parity; } + set + { + if (!Enum.IsDefined(typeof(Parity), value)) + throw new ArgumentOutOfRangeException("Parity"); + + this.parity = value; + if (this.serialPort != null) + this.serialPort.Parity = value; + } + } + + /// <summary> + /// Gets or sets the byte that replaces invalid bytes in a data stream + /// when a parity error occurs. + /// The default value is 0x3f. + /// </summary> + //[Category(SPPConstants.Category_SerialPortSettings)] + //[Description(SPPConstants.Desc_ParityReplace)] + public byte ParityReplace + { + get + { return this.parityReplace; } + set + { + this.parityReplace = value; + if (this.serialPort != null) + this.serialPort.ParityReplace = value; + } + } + + /// <summary> + /// Gets or sets the size of the SerialPort input buffer. The default + /// value is 4096. If the port is open, ReadBufferSize will not be set. + /// </summary> + //[Category(SPPConstants.Category_SerialPortSettings)] + //[Description(SPPConstants.Desc_ReadBufferSize)] + public int ReadBufferSize + { + get + { return this.readBufferSize; } + set + { + if (value <= 0) + throw new ArgumentOutOfRangeException("ReadBufferSize"); + + if (this.serialPort != null) + if (IsPortOpen) + // If the port is open, ReadBufferSize cannot be set. + // So set the portsetting values to the current port settings. + this.readBufferSize = this.serialPort.ReadBufferSize; + else + { // If the port is closed, ReadBufferSize can be set. + this.readBufferSize = value; + this.serialPort.ReadBufferSize = this.readBufferSize; + } + else this.readBufferSize = value; + } + } + + /// <summary> + /// Gets or sets the number of milliseconds before a time-out occurs + /// when a read operation does not finish. + /// InfiniteTimeout is the default value. + /// </summary> + //[Category(SPPConstants.Category_SerialPortSettings)] + //[Description(SPPConstants.Desc_ReadTimeout)] + public int ReadTimeout + { + get + { return this.readTimeout; } + set + { + if ((value < 0) && (value != -1)) + throw new ArgumentOutOfRangeException("ReadTimeout"); + + this.readTimeout = value; + if (this.serialPort != null) + this.serialPort.ReadTimeout = value; + if (networkStream != null) + networkStream.WriteTimeout = this.readTimeout; + } + } + + /// <summary> + /// Gets or sets the standard number of stopbits per byte. The default + /// value is 1. + /// </summary> + //[Category(SPPConstants.Category_SerialPortSettings)] + //[Description(SPPConstants.Desc_StopBits)] + public StopBits StopBits + { + get + { return this.stopBits; } + set + { + if (!Enum.IsDefined(typeof(StopBits), value)) + throw new ArgumentOutOfRangeException("StopBits"); + + this.stopBits = value; + if (this.serialPort != null) + this.serialPort.StopBits = value; + } + } + + /// <summary> + /// Gets or sets the size of the SerialPort output buffer. The default + /// value is 2048. If the port is open, WriteBufferSize will not be set. + /// </summary> + //[Category(SPPConstants.Category_SerialPortSettings)] + //[Description(SPPConstants.Desc_WriteBufferSize)] + public int WriteBufferSize + { + get + { return this.writeBufferSize; } + set + { + if (value <= 0) + throw new ArgumentOutOfRangeException("WriteBufferSize"); + + if (this.serialPort != null) + if (IsPortOpen) + // If the port is open, WriteBufferSize cannot be set. + // So set the portsetting values to the current port settings. + this.writeBufferSize = this.serialPort.WriteBufferSize; + else + { // If the port is closed, WriteBufferSize can be set. + this.writeBufferSize = value; + this.serialPort.WriteBufferSize = this.writeBufferSize; + } + else this.writeBufferSize = value; + } + } + + /// <summary> + /// Gets or sets the number of milliseconds before a time-out occurs + /// when a write operation does not finish. + /// InfiniteTimeout is the default value. + /// </summary> + //[Category(SPPConstants.Category_SerialPortSettings)] + //[Description(SPPConstants.Desc_WriteTimeout)] + public int WriteTimeout + { + get + { return this.writeTimeout; } + set + { + if ((value <= 0) && (value != -1)) + throw new ArgumentOutOfRangeException("WriteTimeout"); + + this.writeTimeout = value; + if (this.serialPort != null) + this.serialPort.WriteTimeout = value; + if (networkStream != null) + networkStream.ReadTimeout = this.writeTimeout; + } + } + + #endregion + + #endregion + + + public void Initialize(string id) { } + + public void Dispose() + { + //timer1.Enabled = false; + serialPort.Close(); + message("Closed connection"); + //btnConnect.Enabled = true; + //cbPorts.Enabled = true; + } + + + public BlueTooth_USB() + { + Logger = ServiceScope.Get<ILogger>(); + } + + #region IListener Member + + public void Start() + { + spp = new BluetoothSPPManager(); + spp.PortName = "COM 3"; + + spp.OpenPort(); + return; + + //GetPorts(); + + //event to handle messages recieved from the phone + //message += new phoneMessageHandler(ParseMessage); + + portName = "COM 3"; + + OpenPort(); + + + //_selectedPort = 2; + //ServiceScope.Get<IThreadPool>().Add(new DoWorkHandler(connect)); + } + + #endregion + + + + + + + + + void OpenPort() + { + if (string.IsNullOrEmpty(this.portName) || string.IsNullOrEmpty(this.portName.Trim())) + throw new InvalidOperationException("portname not set"); + + // Set up the port. + this.serialPort = new SerialPort(this.portName); + this.serialPort.DataReceived += + new SerialDataReceivedEventHandler(serialPort_DataReceived); + this.serialPort.ErrorReceived += + new SerialErrorReceivedEventHandler(serialPort_ErrorReceived); + } + + + + + + + + + + + + + + + void GetPorts() + { + //add the list of port names to select from + _ports.AddRange(SerialPort.GetPortNames()); + Logger.Debug("BlueTooth_USB: found {0} serial ports", _ports.Count); + + foreach (string port in _ports) + { + Logger.Debug("BlueTooth_USB: found serial port: {0}", port); + TestPort(port); + } + } + + + bool TestPort(string portname) + { + try + { + Logger.Debug("Bluetooth_USB: Starting TestPort for {0}.", portname); + + serialPort = new SerialPort(portname); + serialPort.Open(); + + + + Logger.Error("Bluetooth_USB: TestPort for {0} succeeded.", portname); + return true; + } + catch (Exception ex) + { + Logger.Error("Bluetooth_USB: TestPort for {0} failed.", portname); + Logger.Error(ex); + return false; + } + finally + { + serialPort.Close(); + } + } + + + + + + + void Form1_volume(string message) + { + //decode caller id + string[] sep = { "," }; + string[] volume = message.Remove(0, 6).Split(sep, StringSplitOptions.None); + + //if it is the ringer + if (volume[0].Trim() == "1") + _volumeLevel = int.Parse(volume[1]); + } + + void Form1_battery(string message) + { + //decode caller id + string[] sep = { "," }; + string[] battery = message.Remove(0, 5).Split(sep, StringSplitOptions.None); + //txtPhoneNumber.Text = caller[0]; + _powerLevel = int.Parse(battery[1]); + } + + void ParseMode(string message) + { + switch (message) + { + case "+MODE: 0": + Logger.Info("Bluetooth_USB: Using mode 0"); + _mode = 0; + break; + case "+MODE: 2": + Logger.Info("Bluetooth_USB: Using mode 2"); + _mode = 2; + break; + default: + Logger.Error("Bluetooth_USB: Unknown Mode"); + _mode = -1; + break; + } + } + + void decode_caller_id(string message) + { + + + + //decode caller id + string[] sep = { "," }; + string[] caller = message.Remove(0, 6).Split(sep, StringSplitOptions.None); + _PhoneNumber = caller[0].Remove(0, 1); + if (caller.Length > 4) + _name = caller[4]; + + + //CallAction callAction = ParseAction(strLine); + //Logger.Info(strLine); + //callAction.WriteToLog(); + + + + } + + void decode_signal_strength(string message) + { + //decode_signal_strength + switch (message) + { + case "+MSSI: 0": + + _signalStrength = 0; + Logger.Error("Bluetooth_USB: No signal found"); + break; + case "+MSSI: 1": + _signalStrength = 1; + break; + case "+MSSI: 25": + _signalStrength = 2; + break; + case "+MSSI: 56": + _signalStrength = 3; + break; + case "+MSSI: 75": + _signalStrength = 4; + break; + case "+MSSI: 90": + _signalStrength = 5; + break; + default: + Logger.Error("Bluetooth_USB: Signal strenght not recognized: " + message); + break; + } + } + + + + + private void connect() + { + SendData(ATcommand.GetManufacturer); + SendData(ATcommand.GetModel); + + + System.Threading.Thread.Sleep(5000); + + + + setMode(2); + + //get the signal strength + SendData("AT+MSSI?"); + System.Threading.Thread.Sleep(1000); + + //get the battery level + SendData("AT+CBC"); + System.Threading.Thread.Sleep(1000); + + //get the ring volumne level + SendData("AT+MAVL?"); + System.Threading.Thread.Sleep(1000); + + //set the calling line identification to enabled + SendData("AT+CLIP=1"); + System.Threading.Thread.Sleep(1000); + } + + + + + + + void port_ErrorReceived(object sender, SerialErrorReceivedEventArgs e) + { + //error = _currentPort.ReadExisting(); + //this.Invoke(new EventHandler(SetErrorText)); + } + + + + + + + + void port_DataReceived(object sender, SerialDataReceivedEventArgs e) + { + //displayString = _currentPort.ReadExisting(); + //this.Invoke(new EventHandler(DisplayReceiveData)); + Logger.Debug("Bluetooth_USB: ATcommand: {0}", serialPort.ReadExisting()); + + return; + + string buffer = ReadBuffer(); + + switch (buffer) + { + case ATcommand.GetManufacturer: + { + Logger.Debug("Bluetooth_USB: mobile phone manufacturer: {0}", ReadBuffer()); + Logger.Debug("Bluetooth_USB: mobile phone result: {0}", ReadBuffer()); + break; + } + case ATcommand.GetModel: + { + Logger.Debug("Bluetooth_USB: mobile phone model: {0}", ReadBuffer()); + Logger.Debug("Bluetooth_USB: mobile phone result: {0}", ReadBuffer()); + break; + } + default: + Logger.Debug("Bluetooth_USB: Unknown ATcommand: {0}", buffer); + break; + } + + + + + } + + + + + + void ParseMessage(string message) + { + if (message.Length < 1) return; + Logger.Debug("Bluetooth_USB: received DATA: {0}", message); + + //signal strength + if (message.StartsWith("+MSSI")) + { + signalStrengthHandler s = new signalStrengthHandler(decode_signal_strength); + //this.Invoke(s, new object[] { message }); + return; + } + + //Caller ID + if (message.StartsWith("+CLIP")) + { + callerIdHandler c = new callerIdHandler(decode_caller_id); + //this.Invoke(c, new object[] { message }); + return; + } + + //mode + if (message.StartsWith("+MODE")) + { + modeHandler m = new modeHandler(ParseMode); + //this.Invoke(m, new object[] { message }); + return; + } + + //battery status + if (message.StartsWith("+CBC")) + { + batteryStatusHandler b = new batteryStatusHandler(Form1_battery); + //this.Invoke(b, new object[] { message }); + return; + } + + //volume level + if (message.StartsWith("+MAVL")) + { + volumeHandler v = new volumeHandler(Form1_volume); + //this.Invoke(v, new object[] { message }); + //return; + } + } + + + + + + + + string ReadBuffer() + { + Logger.Debug("ReadBuffer"); + //Logger.Debug(strBuffer); + + + ////this does not work, because i am not able to remove the \n at the end + //string strBuffer = _currentPort.ReadLine(); + //if (cToRem == char.MinValue) + // cToRem = strBuffer[strBuffer.Length - 1]; + //strBuffer.Trim(cToRem); + //Logger.Debug(strBuffer); + //return strBuffer; + + + int buffersize = serialPort.BytesToRead; + StringBuilder line = new StringBuilder(); + int Bval; + for (int i = 0; i < buffersize; i++) + { + //data is received read the message + Bval = serialPort.ReadByte(); + switch (Bval) + { + case 10: //new line + return line.ToString(); + break; + case 13: //carriage return - ignore + break; + default: //build string message + line.Append(char.ConvertFromUtf32(Bval)); + break; + } + } + return line.ToString(); + + + //Logger.Debug(strBuffer); + + //int buffersize = _currentPort.BytesToRead; + //StringBuilder line = new StringBuilder(); + //int Bval; + //for (int i = 0; i < buffersize; i++) + //{ + // //data is received read the message + // Bval = _currentPort.ReadByte(); + // Logger.Debug("alter string '{0}' ::: neues byte '{1}' zeichen '{2}'", line.ToString(), Bval, char.ConvertFromUtf32(Bval)); + // switch (Bval) + // { + // case 10: //new line + // message(line.ToString()); + // line = new StringBuilder(); + // break; + // case 13: //carriage return - ignore + // break; + // default: //build string message + // line.Append(char.ConvertFromUtf32(Bval)); + // break; + // } + //} + ////send string message for processing. + //message(line.ToString()); + } + + void SendData(string value) + { + Logger.Debug("Bluetooth_USB: Data SEND: {0}", value); + + //convert the string data to + //byte values to send to the phone + StringBuilder sb = new StringBuilder(value); + int size = sb.Length; + byte[] data = new byte[size + 1]; + for (int i = 0; i < sb.Length; i++) + { + data[i] = (byte)sb[i]; + } + data[size] = (byte)Convert.ToChar(13); + + //send the data + if (serialPort.IsOpen) + serialPort.Write(data, 0, size + 1); + else + { + //timer1.Enabled = false; + Logger.Error("Bluetooth port not opend"); + message("Port not opened"); + } + System.Threading.Thread.Sleep(1000); + } + + + + + private void timer1_Tick(object sender, EventArgs e) + { + //request cellular signal strength + SendData("AT+MSSI?"); + } + + private void checkSignal() + { + //enable the timer which checks + //the signal strength every two minutes. + //timer1.Enabled = true; + + //set the mode to 2 + setMode(2); + + //get the signal strength + SendData("AT+MSSI?"); + System.Threading.Thread.Sleep(1000); + + //get the battery level + SendData("AT+CBC"); + System.Threading.Thread.Sleep(1000); + + //get the ring volumne level + SendData("AT+MAVL?"); + } + + private void volumeLevel_Scroll(object sender, EventArgs e) + { + setMode(2); + SendData("AT+MAVL=1," + _volumeLevel.ToString()); + } + + + + + #region Private Functions/Methods + + /// <summary> + /// Sets up the serial port. + /// </summary> + /// <exception cref="InvalidOperationException">PortName is not set.</exception> + private void SetupSerialPort() + { + if (string.IsNullOrEmpty(this.portName) || string.IsNullOrEmpty(this.portName.Trim())) + throw new InvalidOperationException("portname not set"); + + // Set up the port. + this.serialPort = new SerialPort(this.portName); + this.serialPort.DataReceived += + new SerialDataReceivedEventHandler(serialPort_DataReceived); + this.serialPort.ErrorReceived += + new SerialErrorReceivedEventHandler(serialPort_ErrorReceived); + + // Configure the port. + ConfigurePort(); + } + + /// <summary> + /// Configures the serial port settings. + /// Note that ReadBufferSize and WriteBufferSize will not be set if the + /// port is open. + /// </summary> + /// <exception cref="ArgumentNullException">PortSettings property has + /// not been set.</exception> + private void ConfigurePort() + { + serialPort.BaudRate = this.baudRate; + serialPort.DataBits = this.dataBits; + if (this.encoding != null) + serialPort.Encoding = this.encoding; + serialPort.Parity = this.parity; + serialPort.ParityReplace = this.parityReplace; + serialPort.StopBits = this.stopBits; + serialPort.ReadTimeout = this.readTimeout; + if (networkStream != null) + { + networkStream.WriteTimeout = this.readTimeout; + networkStream.ReadTimeout = this.writeTimeout; + } + serialPort.WriteTimeout = this.writeTimeout; + + if (IsPortOpen) + { + // If the port is open, ReadBufferSize and WriteBufferSize + // cannot be set. So set the portsetting values to the + // current port settings. + this.readBufferSize = serialPort.ReadBufferSize; + this.writeBufferSize = serialPort.WriteBufferSize; + } + else + { + // If the port is closed, ReadBufferSize and WriteBufferSize + // can be set. + serialPort.ReadBufferSize = this.readBufferSize; + serialPort.WriteBufferSize = this.writeBufferSize; + } + } + + /// <summary> + /// Helps the serialCommEventThread to listen to the NetworkStream. + /// If data is available, it raises a DataDetectedFromRemoteDevice + /// event. + /// </summary> + private void ReceiveThread() + { + while (this.IsPortOpen) + { + Thread.Sleep(100); + // Raise an event that data is detected on the Network stream. + if (this.networkStream.DataAvailable) + if (DataDetectedFromRemoteDevice != null) + DataDetectedFromRemoteDevice(this, new EventArgs()); + } + } + + /// <summary> + /// This is the handler method for the serial port when an error is + /// received on the port. It raises an ErrorReceived event. + /// </summary> + /// <param name="sender">The sender of the event.</param> + /// <param name="e">Provides data for the serial port's ErrorReceived + /// event.</param> + private void serialPort_ErrorReceived( + object sender, SerialErrorReceivedEventArgs e) + { + string errorMessage = string.Empty; + switch (e.EventType) + { + case SerialError.Frame: + errorMessage = "SPPResources.Error_SP_Frame"; + break; + + case SerialError.Overrun: + errorMessage = "SPPResources.Error_SP_Overrun"; + break; + + case SerialError.RXOver: + errorMessage = "SPPResources.Error_SP_RXOver"; + break; + + case SerialError.RXParity: + errorMessage = "SPPResources.Error_SP_RXParity"; + break; + + case SerialError.TXFull: + errorMessage = "SPPResources.Error_SP_TXFull"; + break; + } + throw new SPPException( + SerialCommErrorType.SerialPortError, errorMessage); + } + + /// <summary> + /// This is the handler method for the serial port when data is received + /// on the port. It raises a DataDetectedOnSerialPort event. + /// </summary> + /// <param name="sender">The sender of the event.</param> + /// <param name="e">Provides data for the serial port's DataReceived + /// event.</param> + private void serialPort_DataReceived( + object sender, SerialDataReceivedEventArgs e) + { + // Since data is detected on the serial port, raise an event. + if (DataDetectedOnSerialPort != null) + DataDetectedOnSerialPort(sender, new EventArgs()); + } + + #endregion + + + #region Commands + + + private void setMode(int val) + { + if (_mode == val) + return; + switch (val) + { + case 0: + //set the mode to 0 + SendData("AT+MODE=0"); + break; + + case 2: + //set the mode to 2 + SendData("AT+MODE=2"); + break; + default: + Logger.Error("Mode: " + val.ToString() + " not recognized."); + break; + } + System.Threading.Thread.Sleep(1000); + SendData("AT+MODE?"); + } + + #endregion + + } +} Added: trunk/plugins/FritzBox/MP2version/Listeners/BlueTooth_USB/BlueTooth_USB.csproj =================================================================== --- trunk/plugins/FritzBox/MP2version/Listeners/BlueTooth_USB/BlueTooth_USB.csproj (rev 0) +++ trunk/plugins/FritzBox/MP2version/Listeners/BlueTooth_USB/BlueTooth_USB.csproj 2008-02-16 15:46:56 UTC (rev 1372) @@ -0,0 +1,74 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProductVersion>8.0.50727</ProductVersion> + <SchemaVersion>2.0</SchemaVersion> + <ProjectGuid>{501A8A8C-E843-44C8-B680-656E06F99F17}</ProjectGuid> + <OutputType>Library</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>CallMonitor.Listeners</RootNamespace> + <AssemblyName>BlueTooth_USB</AssemblyName> + <StartupObject> + </StartupObject> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>bin\x86\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + <PlatformTarget>x86</PlatformTarget> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <DebugType>pdbonly</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\x86\Release\</OutputPath> + <DefineConstants>TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + <PlatformTarget>x86</PlatformTarget> + </Prop... [truncated message content] |
From: <che...@us...> - 2008-04-27 02:05:04
|
Revision: 1728 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1728&view=rev Author: chef_koch Date: 2008-04-26 19:04:58 -0700 (Sat, 26 Apr 2008) Log Message: ----------- added AssemblyInfo.cs minor improvements Modified Paths: -------------- trunk/plugins/FritzBox/FritzBox/FritzBox.cs trunk/plugins/FritzBox/FritzBox/FritzBox.csproj trunk/plugins/FritzBox/FritzBox.xmp Added Paths: ----------- trunk/plugins/FritzBox/FritzBox/Properties/AssemblyInfo.cs Modified: trunk/plugins/FritzBox/FritzBox/FritzBox.cs =================================================================== --- trunk/plugins/FritzBox/FritzBox/FritzBox.cs 2008-04-26 20:05:15 UTC (rev 1727) +++ trunk/plugins/FritzBox/FritzBox/FritzBox.cs 2008-04-27 02:04:58 UTC (rev 1728) @@ -70,7 +70,7 @@ #region Variables - public const string _version = "0.2.2.9"; + public const string _version = "0.3.0.0"; public static int _lastVersion = 0; static bool _extensiveLogging = false; Modified: trunk/plugins/FritzBox/FritzBox/FritzBox.csproj =================================================================== --- trunk/plugins/FritzBox/FritzBox/FritzBox.csproj 2008-04-26 20:05:15 UTC (rev 1727) +++ trunk/plugins/FritzBox/FritzBox/FritzBox.csproj 2008-04-27 02:04:58 UTC (rev 1728) @@ -53,6 +53,7 @@ <Reference Include="System.Xml" /> </ItemGroup> <ItemGroup> + <Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Caller.cs" /> <Compile Include="CallAction.cs" /> <Compile Include="FritzBoxSetupFrom.cs"> @@ -118,8 +119,7 @@ </Target> --> <PropertyGroup> - <PostBuildEvent>copy "$(TargetPath)" "C:\Programme\Team MediaPortal\MediaPortal\Plugins\Process\$(TargetFileName)" -rem copy "$(TargetPath)" "$(ProjectDir)\..\FritzBox_release\MP_svn_release\Plugins\Process\$(TargetFileName)" -rem copy "$(ProjectDir)\*" "$(ProjectDir)\..\FritzBox_release\MP_svn_source\*"</PostBuildEvent> + <PostBuildEvent> + </PostBuildEvent> </PropertyGroup> </Project> \ No newline at end of file Added: trunk/plugins/FritzBox/FritzBox/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/FritzBox/FritzBox/Properties/AssemblyInfo.cs (rev 0) +++ trunk/plugins/FritzBox/FritzBox/Properties/AssemblyInfo.cs 2008-04-27 02:04:58 UTC (rev 1728) @@ -0,0 +1,33 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// Allgemeine Informationen über eine Assembly werden über die folgenden +// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern, +// die mit einer Assembly verknüpft sind. +[assembly: AssemblyTitle("FRITZ!Box CallMonitor")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("chefkoch @ Team MediaPortal")] +[assembly: AssemblyProduct("FRITZ!Box CallMonitor")] +[assembly: AssemblyCopyright("Copyright © chefkoch @ Team MediaPortal 2008")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Durch Festlegen von ComVisible auf "false" werden die Typen in dieser Assembly unsichtbar +// für COM-Komponenten. Wenn Sie auf einen Typ in dieser Assembly von +// COM zugreifen müssen, legen Sie das ComVisible-Attribut für diesen Typ auf "true" fest. +[assembly: ComVisible(false)] + +// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird +[assembly: Guid("2fed1c7a-a6ad-4bec-b6a5-f6390c705e93")] + +// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten: +// +// Hauptversion +// Nebenversion +// Buildnummer +// Revision +// +[assembly: AssemblyVersion("0.3.0.0")] +[assembly: AssemblyFileVersion("0.3.0.0")] Modified: trunk/plugins/FritzBox/FritzBox.xmp =================================================================== --- trunk/plugins/FritzBox/FritzBox.xmp 2008-04-26 20:05:15 UTC (rev 1727) +++ trunk/plugins/FritzBox/FritzBox.xmp 2008-04-27 02:04:58 UTC (rev 1728) @@ -8,7 +8,7 @@ <Source>FritzBox\gfx\Thumbs\YAC\_noImage.png</Source> <Id>04010</Id> <Option>OutputFileName=|DefaultFile=False|</Option> - <Guid>5129c19a-5cf0-4978-9090-fa45f9ed4a3d</Guid> + <Guid>8e6b98ca-9280-4453-850e-2352bde99717</Guid> </File> <File> <FileName>_unknown.png</FileName> @@ -17,7 +17,7 @@ <Source>FritzBox\gfx\Thumbs\YAC\_unknown.png</Source> <Id>04010</Id> <Option /> - <Guid>4fff10ca-4951-4090-a0a7-a207472eea9e</Guid> + <Guid>3fc4269c-bd6d-4315-8c64-f8e8e55ee622</Guid> </File> <File> <FileName>FritzBox.dll</FileName> @@ -26,7 +26,7 @@ <Source>FritzBox\bin\Release\FritzBox.dll</Source> <Id>01020</Id> <Option /> - <Guid>7646bae7-5c25-4488-8093-e76590422bc9</Guid> + <Guid>188bfd8b-7a6c-40e5-8719-8962af8c841a</Guid> </File> </FileList> <StringList /> @@ -36,13 +36,13 @@ <SetupGroups /> <SetupGroupMappings /> <Option> - <BuildFileName>E:\mediaportal\mediaportal_plugins\FritzBox\FritzBox.mpi</BuildFileName> + <BuildFileName>E:\mediaportal\mediaportal_plugins\FritzBox\FritzBox_v0.3.0.mpi</BuildFileName> <ProiectFileName>E:\mediaportal\mediaportal_plugins\FritzBox\FritzBox.xmp</ProiectFileName> <ProiectName>FritzBox CallMonitor</ProiectName> - <Author>chefkoch</Author> + <Author>chefkoch @ Team MediaPortal</Author> <UpdateURL>http://mpi.team-mediaportal.com/downloads</UpdateURL> - <Version>0.2.2.9</Version> - <Description>The FRITZ!Box plugin is a process plugin, which is able to notify you on incoming calls on your FRITZ!Box. + <Version>0.3.0.0</Version> + <Description>The FRITZ!Box plugin is a process plugin, which is able to notify you within MediaPortal on an incomming call on your FRITZ!Box. All strings are multi language. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <che...@us...> - 2008-07-16 01:03:09
|
Revision: 1920 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1920&view=rev Author: chef_koch Date: 2008-07-15 18:03:01 -0700 (Tue, 15 Jul 2008) Log Message: ----------- v0.3.1.0 # support for new export format of Fritz!Box Monitor v01.02.00 # added option to set suffixes for home, work and mobile phone numbers # added option to clear all entries in phone book Modified Paths: -------------- trunk/plugins/FritzBox/FritzBox/FritzBox.cs trunk/plugins/FritzBox/FritzBox/FritzBox.csproj trunk/plugins/FritzBox/FritzBox/FritzBoxSetupFrom.Designer.cs trunk/plugins/FritzBox/FritzBox/FritzBoxSetupFrom.cs trunk/plugins/FritzBox/FritzBox/PhoneBook.cs trunk/plugins/FritzBox/FritzBox/Properties/AssemblyInfo.cs trunk/plugins/FritzBox/FritzBox.xmp trunk/plugins/FritzBox/MP2version/CallMonitor.cs trunk/plugins/FritzBox/MP2version/CallMonitor.csproj trunk/plugins/FritzBox/MP2version/Listeners/FritzBox/FritzBox.cs trunk/plugins/FritzBox/MP2version/Listeners/FritzBox/FritzBox.csproj Modified: trunk/plugins/FritzBox/FritzBox/FritzBox.cs =================================================================== --- trunk/plugins/FritzBox/FritzBox/FritzBox.cs 2008-07-14 18:57:36 UTC (rev 1919) +++ trunk/plugins/FritzBox/FritzBox/FritzBox.cs 2008-07-16 01:03:01 UTC (rev 1920) @@ -70,7 +70,7 @@ #region Variables - public const string _version = "0.3.0.0"; + public const string _version = "0.3.1.0"; public static int _lastVersion = 0; static bool _extensiveLogging = false; Modified: trunk/plugins/FritzBox/FritzBox/FritzBox.csproj =================================================================== --- trunk/plugins/FritzBox/FritzBox/FritzBox.csproj 2008-07-14 18:57:36 UTC (rev 1919) +++ trunk/plugins/FritzBox/FritzBox/FritzBox.csproj 2008-07-16 01:03:01 UTC (rev 1920) @@ -74,6 +74,7 @@ <EmbeddedResource Include="Properties\Resources.resx"> <Generator>ResXFileCodeGenerator</Generator> <LastGenOutput>Resources.Designer.cs</LastGenOutput> + <SubType>Designer</SubType> </EmbeddedResource> </ItemGroup> <ItemGroup> Modified: trunk/plugins/FritzBox/FritzBox/FritzBoxSetupFrom.Designer.cs =================================================================== --- trunk/plugins/FritzBox/FritzBox/FritzBoxSetupFrom.Designer.cs 2008-07-14 18:57:36 UTC (rev 1919) +++ trunk/plugins/FritzBox/FritzBox/FritzBoxSetupFrom.Designer.cs 2008-07-16 01:03:01 UTC (rev 1920) @@ -42,7 +42,6 @@ this.labelHelp = new MediaPortal.UserInterface.Controls.MPLabel(); this.tabIncoming = new System.Windows.Forms.TabPage(); this.groupBoxPhonebook = new MediaPortal.UserInterface.Controls.MPGroupBox(); - this.mpImportFBMonitor = new MediaPortal.UserInterface.Controls.MPButton(); this.checkBoxSaveUnknownCaller = new MediaPortal.UserInterface.Controls.MPCheckBox(); this.checkBoxShowUnknownCaller = new MediaPortal.UserInterface.Controls.MPCheckBox(); this.checkBoxUsePhonebook = new MediaPortal.UserInterface.Controls.MPCheckBox(); @@ -77,6 +76,15 @@ this.buttonSave = new MediaPortal.UserInterface.Controls.MPButton(); this.buttonCancel = new MediaPortal.UserInterface.Controls.MPButton(); this.openFileDialog = new System.Windows.Forms.OpenFileDialog(); + this.buttonClearAll = new MediaPortal.UserInterface.Controls.MPButton(); + this.mpImportFBMonitor = new MediaPortal.UserInterface.Controls.MPButton(); + this.textBoxSuffixWork = new MediaPortal.UserInterface.Controls.MPTextBox(); + this.textBoxSuffixHome = new MediaPortal.UserInterface.Controls.MPTextBox(); + this.textBoxSuffixMobile = new MediaPortal.UserInterface.Controls.MPTextBox(); + this.groupBoxImport = new MediaPortal.UserInterface.Controls.MPGroupBox(); + this.labelSuffixHome = new MediaPortal.UserInterface.Controls.MPLabel(); + this.mpLabel2 = new MediaPortal.UserInterface.Controls.MPLabel(); + this.mpLabel3 = new MediaPortal.UserInterface.Controls.MPLabel(); this.tabControlFritzBoxSettings.SuspendLayout(); this.tabGeneral.SuspendLayout(); this.mpGroupBox1.SuspendLayout(); @@ -91,6 +99,7 @@ this.tabPhonebook.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.pictureBoxCaller)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.dataGridView)).BeginInit(); + this.groupBoxImport.SuspendLayout(); this.SuspendLayout(); // // tabControlFritzBoxSettings @@ -125,7 +134,7 @@ this.checkBoxExtensiveLogging.FlatStyle = System.Windows.Forms.FlatStyle.Popup; this.checkBoxExtensiveLogging.Location = new System.Drawing.Point(6, 138); this.checkBoxExtensiveLogging.Name = "checkBoxExtensiveLogging"; - this.checkBoxExtensiveLogging.Size = new System.Drawing.Size(339, 17); + this.checkBoxExtensiveLogging.Size = new System.Drawing.Size(321, 17); this.checkBoxExtensiveLogging.TabIndex = 1; this.checkBoxExtensiveLogging.Text = "extensive logging (!!! phonenumbers are written to the logfile !!!)"; this.checkBoxExtensiveLogging.UseVisualStyleBackColor = true; @@ -158,7 +167,7 @@ 0, 0}); this.numericUpDownPort.Name = "numericUpDownPort"; - this.numericUpDownPort.Size = new System.Drawing.Size(116, 21); + this.numericUpDownPort.Size = new System.Drawing.Size(116, 20); this.numericUpDownPort.TabIndex = 9; this.numericUpDownPort.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; this.numericUpDownPort.Value = new decimal(new int[] { @@ -195,7 +204,7 @@ this.textBoxAddress.BorderColor = System.Drawing.Color.Empty; this.textBoxAddress.Location = new System.Drawing.Point(165, 20); this.textBoxAddress.Name = "textBoxAddress"; - this.textBoxAddress.Size = new System.Drawing.Size(309, 21); + this.textBoxAddress.Size = new System.Drawing.Size(309, 20); this.textBoxAddress.TabIndex = 0; // // labelPort @@ -203,7 +212,7 @@ this.labelPort.AutoSize = true; this.labelPort.Location = new System.Drawing.Point(128, 50); this.labelPort.Name = "labelPort"; - this.labelPort.Size = new System.Drawing.Size(31, 13); + this.labelPort.Size = new System.Drawing.Size(29, 13); this.labelPort.TabIndex = 8; this.labelPort.Text = "Port:"; // @@ -212,7 +221,7 @@ this.labelAddress.AutoSize = true; this.labelAddress.Location = new System.Drawing.Point(109, 24); this.labelAddress.Name = "labelAddress"; - this.labelAddress.Size = new System.Drawing.Size(50, 13); + this.labelAddress.Size = new System.Drawing.Size(48, 13); this.labelAddress.TabIndex = 7; this.labelAddress.Text = "Address:"; // @@ -228,6 +237,7 @@ // // tabIncoming // + this.tabIncoming.Controls.Add(this.groupBoxImport); this.tabIncoming.Controls.Add(this.groupBoxPhonebook); this.tabIncoming.Controls.Add(this.groupBoxNotify); this.tabIncoming.Controls.Add(this.groupBoxMedia); @@ -241,38 +251,24 @@ // // groupBoxPhonebook // - this.groupBoxPhonebook.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.groupBoxPhonebook.Controls.Add(this.mpImportFBMonitor); this.groupBoxPhonebook.Controls.Add(this.checkBoxSaveUnknownCaller); this.groupBoxPhonebook.Controls.Add(this.checkBoxShowUnknownCaller); this.groupBoxPhonebook.Controls.Add(this.checkBoxUsePhonebook); this.groupBoxPhonebook.FlatStyle = System.Windows.Forms.FlatStyle.Popup; this.groupBoxPhonebook.Location = new System.Drawing.Point(6, 208); this.groupBoxPhonebook.Name = "groupBoxPhonebook"; - this.groupBoxPhonebook.Size = new System.Drawing.Size(561, 95); + this.groupBoxPhonebook.Size = new System.Drawing.Size(177, 95); this.groupBoxPhonebook.TabIndex = 2; this.groupBoxPhonebook.TabStop = false; this.groupBoxPhonebook.Text = "phonebook settings"; // - // mpImportFBMonitor - // - this.mpImportFBMonitor.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.mpImportFBMonitor.Location = new System.Drawing.Point(405, 20); - this.mpImportFBMonitor.Name = "mpImportFBMonitor"; - this.mpImportFBMonitor.Size = new System.Drawing.Size(150, 23); - this.mpImportFBMonitor.TabIndex = 3; - this.mpImportFBMonitor.Text = "Import FRITZ!Box Monitor"; - this.mpImportFBMonitor.UseVisualStyleBackColor = true; - this.mpImportFBMonitor.Click += new System.EventHandler(this.mpImportFBMonitor_Click); - // // checkBoxSaveUnknownCaller // this.checkBoxSaveUnknownCaller.AutoSize = true; this.checkBoxSaveUnknownCaller.FlatStyle = System.Windows.Forms.FlatStyle.Popup; this.checkBoxSaveUnknownCaller.Location = new System.Drawing.Point(24, 68); this.checkBoxSaveUnknownCaller.Name = "checkBoxSaveUnknownCaller"; - this.checkBoxSaveUnknownCaller.Size = new System.Drawing.Size(121, 17); + this.checkBoxSaveUnknownCaller.Size = new System.Drawing.Size(122, 17); this.checkBoxSaveUnknownCaller.TabIndex = 2; this.checkBoxSaveUnknownCaller.Text = "save unknown caller"; this.checkBoxSaveUnknownCaller.UseVisualStyleBackColor = true; @@ -283,7 +279,7 @@ this.checkBoxShowUnknownCaller.FlatStyle = System.Windows.Forms.FlatStyle.Popup; this.checkBoxShowUnknownCaller.Location = new System.Drawing.Point(24, 45); this.checkBoxShowUnknownCaller.Name = "checkBoxShowUnknownCaller"; - this.checkBoxShowUnknownCaller.Size = new System.Drawing.Size(123, 17); + this.checkBoxShowUnknownCaller.Size = new System.Drawing.Size(124, 17); this.checkBoxShowUnknownCaller.TabIndex = 1; this.checkBoxShowUnknownCaller.Text = "show unknown caller"; this.checkBoxShowUnknownCaller.UseVisualStyleBackColor = true; @@ -294,7 +290,7 @@ this.checkBoxUsePhonebook.FlatStyle = System.Windows.Forms.FlatStyle.Popup; this.checkBoxUsePhonebook.Location = new System.Drawing.Point(6, 20); this.checkBoxUsePhonebook.Name = "checkBoxUsePhonebook"; - this.checkBoxUsePhonebook.Size = new System.Drawing.Size(97, 17); + this.checkBoxUsePhonebook.Size = new System.Drawing.Size(98, 17); this.checkBoxUsePhonebook.TabIndex = 0; this.checkBoxUsePhonebook.Text = "use phonebook"; this.checkBoxUsePhonebook.UseVisualStyleBackColor = true; @@ -328,7 +324,7 @@ this.checkBoxCloseOnConnectionClosed.FlatStyle = System.Windows.Forms.FlatStyle.Popup; this.checkBoxCloseOnConnectionClosed.Location = new System.Drawing.Point(6, 43); this.checkBoxCloseOnConnectionClosed.Name = "checkBoxCloseOnConnectionClosed"; - this.checkBoxCloseOnConnectionClosed.Size = new System.Drawing.Size(199, 17); + this.checkBoxCloseOnConnectionClosed.Size = new System.Drawing.Size(197, 17); this.checkBoxCloseOnConnectionClosed.TabIndex = 9; this.checkBoxCloseOnConnectionClosed.Text = "auto-close after connection is closed"; this.checkBoxCloseOnConnectionClosed.UseVisualStyleBackColor = true; @@ -339,7 +335,7 @@ this.lblMaxNotifies.AutoSize = true; this.lblMaxNotifies.Location = new System.Drawing.Point(21, 68); this.lblMaxNotifies.Name = "lblMaxNotifies"; - this.lblMaxNotifies.Size = new System.Drawing.Size(94, 13); + this.lblMaxNotifies.Size = new System.Drawing.Size(91, 13); this.lblMaxNotifies.TabIndex = 8; this.lblMaxNotifies.Text = "maximum Notifies:"; // @@ -357,7 +353,7 @@ 0, 0}); this.numericUpDownMaxNotifies.Name = "numericUpDownMaxNotifies"; - this.numericUpDownMaxNotifies.Size = new System.Drawing.Size(53, 21); + this.numericUpDownMaxNotifies.Size = new System.Drawing.Size(53, 20); this.numericUpDownMaxNotifies.TabIndex = 7; this.numericUpDownMaxNotifies.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; this.numericUpDownMaxNotifies.Value = new decimal(new int[] { @@ -372,7 +368,7 @@ this.checkBoxShowMsnOnHeading.FlatStyle = System.Windows.Forms.FlatStyle.Popup; this.checkBoxShowMsnOnHeading.Location = new System.Drawing.Point(6, 93); this.checkBoxShowMsnOnHeading.Name = "checkBoxShowMsnOnHeading"; - this.checkBoxShowMsnOnHeading.Size = new System.Drawing.Size(161, 17); + this.checkBoxShowMsnOnHeading.Size = new System.Drawing.Size(160, 17); this.checkBoxShowMsnOnHeading.TabIndex = 6; this.checkBoxShowMsnOnHeading.Text = "show MSN on notify-heading"; this.checkBoxShowMsnOnHeading.UseVisualStyleBackColor = true; @@ -394,7 +390,7 @@ this.checkBoxFilterMSNs.FlatStyle = System.Windows.Forms.FlatStyle.Popup; this.checkBoxFilterMSNs.Location = new System.Drawing.Point(361, 43); this.checkBoxFilterMSNs.Name = "checkBoxFilterMSNs"; - this.checkBoxFilterMSNs.Size = new System.Drawing.Size(194, 17); + this.checkBoxFilterMSNs.Size = new System.Drawing.Size(190, 17); this.checkBoxFilterMSNs.TabIndex = 2; this.checkBoxFilterMSNs.Text = "show notify only for following MSNs"; this.checkBoxFilterMSNs.UseVisualStyleBackColor = true; @@ -433,7 +429,7 @@ 0, 0}); this.numericUpDownTimeout.Name = "numericUpDownTimeout"; - this.numericUpDownTimeout.Size = new System.Drawing.Size(53, 21); + this.numericUpDownTimeout.Size = new System.Drawing.Size(53, 20); this.numericUpDownTimeout.TabIndex = 1; this.numericUpDownTimeout.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; this.numericUpDownTimeout.Value = new decimal(new int[] { @@ -448,7 +444,7 @@ this.checkBoxCloseOnTimout.FlatStyle = System.Windows.Forms.FlatStyle.Popup; this.checkBoxCloseOnTimout.Location = new System.Drawing.Point(6, 20); this.checkBoxCloseOnTimout.Name = "checkBoxCloseOnTimout"; - this.checkBoxCloseOnTimout.Size = new System.Drawing.Size(179, 17); + this.checkBoxCloseOnTimout.Size = new System.Drawing.Size(171, 17); this.checkBoxCloseOnTimout.TabIndex = 0; this.checkBoxCloseOnTimout.Text = "auto-close after timeout expired"; this.checkBoxCloseOnTimout.UseVisualStyleBackColor = true; @@ -474,7 +470,7 @@ this.checkBoxResumeMedia.FlatStyle = System.Windows.Forms.FlatStyle.Popup; this.checkBoxResumeMedia.Location = new System.Drawing.Point(24, 45); this.checkBoxResumeMedia.Name = "checkBoxResumeMedia"; - this.checkBoxResumeMedia.Size = new System.Drawing.Size(166, 17); + this.checkBoxResumeMedia.Size = new System.Drawing.Size(161, 17); this.checkBoxResumeMedia.TabIndex = 1; this.checkBoxResumeMedia.Text = "auto-resume on closing notify"; this.checkBoxResumeMedia.UseVisualStyleBackColor = true; @@ -485,7 +481,7 @@ this.checkBoxStopMedia.FlatStyle = System.Windows.Forms.FlatStyle.Popup; this.checkBoxStopMedia.Location = new System.Drawing.Point(6, 20); this.checkBoxStopMedia.Name = "checkBoxStopMedia"; - this.checkBoxStopMedia.Size = new System.Drawing.Size(122, 17); + this.checkBoxStopMedia.Size = new System.Drawing.Size(123, 17); this.checkBoxStopMedia.TabIndex = 0; this.checkBoxStopMedia.Text = "stop on incoming call"; this.checkBoxStopMedia.UseVisualStyleBackColor = true; @@ -493,6 +489,7 @@ // // tabPhonebook // + this.tabPhonebook.Controls.Add(this.buttonClearAll); this.tabPhonebook.Controls.Add(this.pictureBoxCaller); this.tabPhonebook.Controls.Add(this.buttonCallerChange); this.tabPhonebook.Controls.Add(this.checkBoxCallerShow); @@ -513,7 +510,7 @@ // 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.Location = new System.Drawing.Point(467, 86); this.pictureBoxCaller.Name = "pictureBoxCaller"; this.pictureBoxCaller.Size = new System.Drawing.Size(100, 122); this.pictureBoxCaller.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; @@ -523,7 +520,7 @@ // buttonCallerChange // this.buttonCallerChange.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.buttonCallerChange.Location = new System.Drawing.Point(417, 278); + this.buttonCallerChange.Location = new System.Drawing.Point(467, 326); this.buttonCallerChange.Name = "buttonCallerChange"; this.buttonCallerChange.Size = new System.Drawing.Size(100, 25); this.buttonCallerChange.TabIndex = 3; @@ -536,9 +533,9 @@ this.checkBoxCallerShow.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.checkBoxCallerShow.AutoSize = true; this.checkBoxCallerShow.FlatStyle = System.Windows.Forms.FlatStyle.Popup; - this.checkBoxCallerShow.Location = new System.Drawing.Point(437, 254); + this.checkBoxCallerShow.Location = new System.Drawing.Point(490, 302); this.checkBoxCallerShow.Name = "checkBoxCallerShow"; - this.checkBoxCallerShow.Size = new System.Drawing.Size(80, 17); + this.checkBoxCallerShow.Size = new System.Drawing.Size(77, 17); this.checkBoxCallerShow.TabIndex = 2; this.checkBoxCallerShow.Text = "show notify"; this.checkBoxCallerShow.UseVisualStyleBackColor = true; @@ -547,24 +544,24 @@ // this.textBoxCallerName.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.textBoxCallerName.BorderColor = System.Drawing.Color.Empty; - this.textBoxCallerName.Location = new System.Drawing.Point(417, 222); + this.textBoxCallerName.Location = new System.Drawing.Point(467, 270); this.textBoxCallerName.Name = "textBoxCallerName"; - this.textBoxCallerName.Size = new System.Drawing.Size(100, 21); + this.textBoxCallerName.Size = new System.Drawing.Size(100, 20); this.textBoxCallerName.TabIndex = 1; // // textBoxCallerId // this.textBoxCallerId.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.textBoxCallerId.BorderColor = System.Drawing.Color.Empty; - this.textBoxCallerId.Location = new System.Drawing.Point(417, 180); + this.textBoxCallerId.Location = new System.Drawing.Point(467, 228); this.textBoxCallerId.Name = "textBoxCallerId"; - this.textBoxCallerId.Size = new System.Drawing.Size(100, 21); + this.textBoxCallerId.Size = new System.Drawing.Size(100, 20); this.textBoxCallerId.TabIndex = 0; // // buttonCallerRemove // this.buttonCallerRemove.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.buttonCallerRemove.Location = new System.Drawing.Point(417, 6); + this.buttonCallerRemove.Location = new System.Drawing.Point(467, 6); this.buttonCallerRemove.Name = "buttonCallerRemove"; this.buttonCallerRemove.Size = new System.Drawing.Size(100, 25); this.buttonCallerRemove.TabIndex = 6; @@ -593,7 +590,7 @@ this.dataGridView.RowTemplate.Height = 23; this.dataGridView.RowTemplate.ReadOnly = true; this.dataGridView.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; - this.dataGridView.Size = new System.Drawing.Size(405, 297); + this.dataGridView.Size = new System.Drawing.Size(455, 345); this.dataGridView.TabIndex = 5; this.dataGridView.Sorted += new System.EventHandler(this.dataGridView_Sorted); this.dataGridView.SelectionChanged += new System.EventHandler(this.dataGridView_SelectionChanged); @@ -623,9 +620,9 @@ // this.labelCallerId.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.labelCallerId.AutoSize = true; - this.labelCallerId.Location = new System.Drawing.Point(423, 163); + this.labelCallerId.Location = new System.Drawing.Point(473, 211); this.labelCallerId.Name = "labelCallerId"; - this.labelCallerId.Size = new System.Drawing.Size(44, 13); + this.labelCallerId.Size = new System.Drawing.Size(42, 13); this.labelCallerId.TabIndex = 12; this.labelCallerId.Text = "CallerId"; // @@ -633,9 +630,9 @@ // this.labelCallerName.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.labelCallerName.AutoSize = true; - this.labelCallerName.Location = new System.Drawing.Point(423, 205); + this.labelCallerName.Location = new System.Drawing.Point(473, 253); this.labelCallerName.Name = "labelCallerName"; - this.labelCallerName.Size = new System.Drawing.Size(34, 13); + this.labelCallerName.Size = new System.Drawing.Size(35, 13); this.labelCallerName.TabIndex = 11; this.labelCallerName.Text = "Name"; // @@ -670,6 +667,104 @@ this.buttonCancel.UseVisualStyleBackColor = true; this.buttonCancel.Click += new System.EventHandler(this.buttonCancel_Click); // + // buttonClearAll + // + this.buttonClearAll.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.buttonClearAll.Location = new System.Drawing.Point(467, 37); + this.buttonClearAll.Name = "buttonClearAll"; + this.buttonClearAll.Size = new System.Drawing.Size(100, 25); + this.buttonClearAll.TabIndex = 14; + this.buttonClearAll.Text = "Clear All"; + this.buttonClearAll.UseVisualStyleBackColor = true; + this.buttonClearAll.Click += new System.EventHandler(this.buttonClearAll_Click); + // + // mpImportFBMonitor + // + this.mpImportFBMonitor.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.mpImportFBMonitor.Location = new System.Drawing.Point(279, 66); + this.mpImportFBMonitor.Name = "mpImportFBMonitor"; + this.mpImportFBMonitor.Size = new System.Drawing.Size(93, 23); + this.mpImportFBMonitor.TabIndex = 3; + this.mpImportFBMonitor.Text = "Import"; + this.mpImportFBMonitor.UseVisualStyleBackColor = true; + this.mpImportFBMonitor.Click += new System.EventHandler(this.mpImportFBMonitor_Click); + // + // textBoxSuffixWork + // + this.textBoxSuffixWork.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.textBoxSuffixWork.BorderColor = System.Drawing.Color.Empty; + this.textBoxSuffixWork.Location = new System.Drawing.Point(85, 45); + this.textBoxSuffixWork.Name = "textBoxSuffixWork"; + this.textBoxSuffixWork.Size = new System.Drawing.Size(141, 20); + this.textBoxSuffixWork.TabIndex = 4; + // + // textBoxSuffixHome + // + this.textBoxSuffixHome.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.textBoxSuffixHome.BorderColor = System.Drawing.Color.Empty; + this.textBoxSuffixHome.Location = new System.Drawing.Point(85, 19); + this.textBoxSuffixHome.Name = "textBoxSuffixHome"; + this.textBoxSuffixHome.Size = new System.Drawing.Size(141, 20); + this.textBoxSuffixHome.TabIndex = 5; + // + // textBoxSuffixMobile + // + this.textBoxSuffixMobile.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.textBoxSuffixMobile.BorderColor = System.Drawing.Color.Empty; + this.textBoxSuffixMobile.Location = new System.Drawing.Point(85, 71); + this.textBoxSuffixMobile.Name = "textBoxSuffixMobile"; + this.textBoxSuffixMobile.Size = new System.Drawing.Size(141, 20); + this.textBoxSuffixMobile.TabIndex = 6; + // + // groupBoxImport + // + this.groupBoxImport.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.groupBoxImport.Controls.Add(this.mpLabel3); + this.groupBoxImport.Controls.Add(this.mpLabel2); + this.groupBoxImport.Controls.Add(this.labelSuffixHome); + this.groupBoxImport.Controls.Add(this.textBoxSuffixMobile); + this.groupBoxImport.Controls.Add(this.textBoxSuffixHome); + this.groupBoxImport.Controls.Add(this.mpImportFBMonitor); + this.groupBoxImport.Controls.Add(this.textBoxSuffixWork); + this.groupBoxImport.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.groupBoxImport.Location = new System.Drawing.Point(189, 208); + this.groupBoxImport.Name = "groupBoxImport"; + this.groupBoxImport.Size = new System.Drawing.Size(378, 95); + this.groupBoxImport.TabIndex = 3; + this.groupBoxImport.TabStop = false; + this.groupBoxImport.Text = "Fritz!Box CallMonitor import"; + // + // labelSuffixHome + // + this.labelSuffixHome.AutoSize = true; + this.labelSuffixHome.Location = new System.Drawing.Point(6, 22); + this.labelSuffixHome.Name = "labelSuffixHome"; + this.labelSuffixHome.Size = new System.Drawing.Size(65, 13); + this.labelSuffixHome.TabIndex = 7; + this.labelSuffixHome.Text = "Suffix home:"; + // + // mpLabel2 + // + this.mpLabel2.AutoSize = true; + this.mpLabel2.Location = new System.Drawing.Point(6, 48); + this.mpLabel2.Name = "mpLabel2"; + this.mpLabel2.Size = new System.Drawing.Size(62, 13); + this.mpLabel2.TabIndex = 8; + this.mpLabel2.Text = "Suffix work:"; + // + // mpLabel3 + // + this.mpLabel3.AutoSize = true; + this.mpLabel3.Location = new System.Drawing.Point(6, 74); + this.mpLabel3.Name = "mpLabel3"; + this.mpLabel3.Size = new System.Drawing.Size(69, 13); + this.mpLabel3.TabIndex = 9; + this.mpLabel3.Text = "Suffix mobile:"; + // // FritzBoxSetupFrom // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -706,6 +801,8 @@ this.tabPhonebook.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.pictureBoxCaller)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.dataGridView)).EndInit(); + this.groupBoxImport.ResumeLayout(false); + this.groupBoxImport.PerformLayout(); this.ResumeLayout(false); } @@ -724,7 +821,6 @@ private MediaPortal.UserInterface.Controls.MPLabel labelHelp; private System.Windows.Forms.TabPage tabIncoming; private MediaPortal.UserInterface.Controls.MPGroupBox groupBoxPhonebook; - private MediaPortal.UserInterface.Controls.MPButton mpImportFBMonitor; private MediaPortal.UserInterface.Controls.MPCheckBox checkBoxSaveUnknownCaller; private MediaPortal.UserInterface.Controls.MPCheckBox checkBoxShowUnknownCaller; private MediaPortal.UserInterface.Controls.MPCheckBox checkBoxUsePhonebook; @@ -760,5 +856,14 @@ private MediaPortal.UserInterface.Controls.MPLabel lblMaxNotifies; private System.Windows.Forms.NumericUpDown numericUpDownPort; private MediaPortal.UserInterface.Controls.MPCheckBox checkBoxCloseOnConnectionClosed; + private MediaPortal.UserInterface.Controls.MPButton buttonClearAll; + private MediaPortal.UserInterface.Controls.MPGroupBox groupBoxImport; + private MediaPortal.UserInterface.Controls.MPTextBox textBoxSuffixMobile; + private MediaPortal.UserInterface.Controls.MPTextBox textBoxSuffixHome; + private MediaPortal.UserInterface.Controls.MPButton mpImportFBMonitor; + private MediaPortal.UserInterface.Controls.MPTextBox textBoxSuffixWork; + private MediaPortal.UserInterface.Controls.MPLabel mpLabel3; + private MediaPortal.UserInterface.Controls.MPLabel mpLabel2; + private MediaPortal.UserInterface.Controls.MPLabel labelSuffixHome; } } \ No newline at end of file Modified: trunk/plugins/FritzBox/FritzBox/FritzBoxSetupFrom.cs =================================================================== --- trunk/plugins/FritzBox/FritzBox/FritzBoxSetupFrom.cs 2008-07-14 18:57:36 UTC (rev 1919) +++ trunk/plugins/FritzBox/FritzBox/FritzBoxSetupFrom.cs 2008-07-16 01:03:01 UTC (rev 1920) @@ -75,6 +75,10 @@ checkBoxSaveUnknownCaller.Checked = phoneBook.SaveUnknownCaller; checkBoxShowUnknownCaller.Enabled = checkBoxUsePhonebook.Checked; checkBoxSaveUnknownCaller.Enabled = checkBoxUsePhonebook.Checked; + + textBoxSuffixHome.Text = phoneBook.SuffixHome; + textBoxSuffixWork.Text = phoneBook.SuffixWork; + textBoxSuffixMobile.Text = phoneBook.SuffixMobile; } RefreshDataGridView(); @@ -116,6 +120,9 @@ xmlwriter.SetValueAsBool("fritzbox", "usePhonebook", checkBoxUsePhonebook.Checked); phoneBook.ShowUnknownCaller = checkBoxShowUnknownCaller.Checked; phoneBook.SaveUnknownCaller = checkBoxSaveUnknownCaller.Checked; + phoneBook.SuffixHome = textBoxSuffixHome.Text; + phoneBook.SuffixWork = textBoxSuffixWork.Text; + phoneBook.SuffixMobile = textBoxSuffixMobile.Text; } SaveDataGridView(); @@ -372,5 +379,14 @@ { numericUpDownMaxNotifies.Enabled = !checkBoxCloseOnConnectionClosed.Checked; } + + private void buttonClearAll_Click(object sender, EventArgs e) + { + if (MessageBox.Show("Attention! Do you really want to clear the phone book? This will delete all your entries!", "", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes) + { + phoneBook.Contacts.Clear(); + dataGridView.Rows.Clear(); + } + } } } \ No newline at end of file Modified: trunk/plugins/FritzBox/FritzBox/PhoneBook.cs =================================================================== --- trunk/plugins/FritzBox/FritzBox/PhoneBook.cs 2008-07-14 18:57:36 UTC (rev 1919) +++ trunk/plugins/FritzBox/FritzBox/PhoneBook.cs 2008-07-16 01:03:01 UTC (rev 1920) @@ -43,6 +43,10 @@ bool _showUnknownCaller; bool _saveUnknownCaller; + string _suffixHome; + string _suffixWork; + string _suffixMobile; + bool _extensiveLogging; #endregion @@ -61,6 +65,22 @@ set { _saveUnknownCaller = value; } } + public string SuffixHome + { + get { return _suffixHome; } + set { _suffixHome = value; } + } + public string SuffixWork + { + get { return _suffixWork; } + set { _suffixWork = value; } + } + public string SuffixMobile + { + get { return _suffixMobile; } + set { _suffixMobile = value; } + } + public List<Caller> Contacts { get { return _contacts; } @@ -104,6 +124,10 @@ _showUnknownCaller = xmlreader.GetValueAsBool("fritzbox", "showUnknownCaller", true); _saveUnknownCaller = xmlreader.GetValueAsBool("fritzbox", "saveUnknownCaller", true); + + _suffixHome = xmlreader.GetValueAsString("fritzbox", "suffixHome", ""); + _suffixWork = xmlreader.GetValueAsString("fritzbox", "suffixWork", " @ work"); + _suffixMobile = xmlreader.GetValueAsString("fritzbox", "suffixMobile", " (mobile)"); } @@ -143,6 +167,10 @@ { xmlreader.SetValueAsBool("fritzbox", "showUnknownCaller", _showUnknownCaller); xmlreader.SetValueAsBool("fritzbox", "saveUnknownCaller", _saveUnknownCaller); + + xmlreader.SetValue("fritzbox", "suffixHome", _suffixHome); + xmlreader.SetValue("fritzbox", "suffixWork", _suffixWork); + xmlreader.SetValue("fritzbox", "suffixMobile", _suffixMobile); } using (MediaPortal.Profile.Settings xmlwriter = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "fritzbox.xml"))) @@ -169,34 +197,56 @@ // Create an instance of StreamReader to read from a file. // The using statement also closes the StreamReader. - using (StreamReader sr = new StreamReader(filepath)) + using (StreamReader sr = new StreamReader(filepath, Encoding.Default)) { string line; + line = sr.ReadLine(); // sep=; + line = sr.ReadLine(); // Name;TelNumHome;VanityHome;KurzWahlHome;TelNumWork;VanityWork;KurzWahlWork;TelNumMobile;VanityMobile;KurzWahlMobile;Kommentar;Firma;Bild;Kategorie;ImageUrl;Prio;Email;RingTone;RingVol + // Read and display lines from the file until the end of // the file is reached. while ((line = sr.ReadLine()) != null) { - if ((count == 0) && line.Contains("sep=;")) - continue; - if ((count == 0) && line.Contains("Telefonnummer")) - continue; - string[] ar = line.Split(char.Parse(";")); - ar[0] = ar[0].TrimStart('!'); - ar[1] = ar[1].TrimStart('!'); + // add TelNumHome , ar[1] + if (ar[1] != string.Empty) + if (!CallerExists(ar[1])) + { + Caller caller = new Caller(); + caller.Name = ar[0] + SuffixHome; + caller.ID = ar[1]; + caller.Show = true; + + _contacts.Add(caller); + count++; + } - Caller caller = new Caller(); + // add TelNumWork , ar[4] + if (ar[4] != string.Empty) + if (!CallerExists(ar[4])) + { + Caller caller = new Caller(); + caller.Name = ar[0] + SuffixWork; + caller.ID = ar[4]; + caller.Show = true; + + _contacts.Add(caller); + count++; + } - caller.ID = ar[2]; - caller.Name = string.Format("{0} {1}", ar[0], ar[1]); - caller.Name = caller.Name.Trim(); - caller.Show = true; + // add TelNumMobile , ar[7] + if (ar[7] != string.Empty) + if (!CallerExists(ar[7])) + { + Caller caller = new Caller(); + caller.Name = ar[0] + SuffixMobile; + caller.ID = ar[7]; + caller.Show = true; - if (CallerExists(caller)) continue; - - _contacts.Add(caller); - count++; + _contacts.Add(caller); + count++; + } } } @@ -210,13 +260,11 @@ } } - public bool CallerExists(Caller caller) + public bool CallerExists(string callerId) { - for (int i = 0; i < _contacts.Count; i++) - { - if (_contacts[i].ID == caller.ID) - return true; - } + foreach (Caller caller in _contacts) + if (caller.ID.Equals(callerId)) return true; + return false; } Modified: trunk/plugins/FritzBox/FritzBox/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/FritzBox/FritzBox/Properties/AssemblyInfo.cs 2008-07-14 18:57:36 UTC (rev 1919) +++ trunk/plugins/FritzBox/FritzBox/Properties/AssemblyInfo.cs 2008-07-16 01:03:01 UTC (rev 1920) @@ -29,5 +29,5 @@ // Buildnummer // Revision // -[assembly: AssemblyVersion("0.3.0.0")] -[assembly: AssemblyFileVersion("0.3.0.0")] +[assembly: AssemblyVersion("0.3.1.0")] +[assembly: AssemblyFileVersion("0.3.1.0")] Modified: trunk/plugins/FritzBox/FritzBox.xmp =================================================================== --- trunk/plugins/FritzBox/FritzBox.xmp 2008-07-14 18:57:36 UTC (rev 1919) +++ trunk/plugins/FritzBox/FritzBox.xmp 2008-07-16 01:03:01 UTC (rev 1920) @@ -8,7 +8,7 @@ <Source>FritzBox\gfx\Thumbs\YAC\_noImage.png</Source> <Id>04010</Id> <Option>OutputFileName=|DefaultFile=False|</Option> - <Guid>580ec1c2-280e-4687-8717-f0539dd6aade</Guid> + <Guid>3ffa94ec-3feb-4a17-a810-172c92c8327d</Guid> </File> <File> <FileName>_unknown.png</FileName> @@ -17,7 +17,7 @@ <Source>FritzBox\gfx\Thumbs\YAC\_unknown.png</Source> <Id>04010</Id> <Option /> - <Guid>a54daff6-0969-4190-b5b7-6476b68d1d10</Guid> + <Guid>eff8eaba-dd4a-41a5-b5b6-8d2a7f883ce4</Guid> </File> <File> <FileName>FritzBox.dll</FileName> @@ -26,7 +26,7 @@ <Source>FritzBox\bin\Release\FritzBox.dll</Source> <Id>01020</Id> <Option /> - <Guid>9c4a9bbd-f5b4-43a5-a625-6426e9581989</Guid> + <Guid>9e67d038-ac40-4084-9d43-51a541f5c092</Guid> </File> </FileList> <StringList /> @@ -36,12 +36,12 @@ <SetupGroups /> <SetupGroupMappings /> <Option> - <BuildFileName>D:\mediaportal\mediaportal_plugins\FritzBox\FritzBox_v0.3.0.1.mpi</BuildFileName> + <BuildFileName>D:\mediaportal\mediaportal_plugins\FritzBox\FritzBox_v0.3.1.0.mpi</BuildFileName> <ProiectFileName>D:\mediaportal\mediaportal_plugins\FritzBox\FritzBox.xmp</ProiectFileName> <ProiectName>FritzBox CallMonitor</ProiectName> <Author>chefkoch @ Team MediaPortal</Author> <UpdateURL>http://mpi.team-mediaportal.com/downloads</UpdateURL> - <Version>0.3.0.1</Version> + <Version>0.3.1.0</Version> <Description>The FRITZ!Box plugin is a process plugin, which is able to notify you within MediaPortal on an incomming call on your FRITZ!Box. All strings are multi language. Modified: trunk/plugins/FritzBox/MP2version/CallMonitor.cs =================================================================== --- trunk/plugins/FritzBox/MP2version/CallMonitor.cs 2008-07-14 18:57:36 UTC (rev 1919) +++ trunk/plugins/FritzBox/MP2version/CallMonitor.cs 2008-07-16 01:03:01 UTC (rev 1920) @@ -1,10 +1,11 @@ using System; using System.Collections.Generic; using System.Text; -using MediaPortal.Core.PluginManager; + using MediaPortal.Core; using MediaPortal.Core.Logging; using MediaPortal.Core.Messaging; +using MediaPortal.Core.PluginManager; namespace CallMonitor { @@ -21,7 +22,6 @@ public CallMonitor() { Logger = ServiceScope.Get<ILogger>(); - } #region IPlugin Members @@ -150,6 +150,7 @@ void ShowNotify(CallAction action) { + /* // MediaPortal.Utilities.Screens.InfoScreen info = new MediaPortal.Utilities.Screens.InfoScreen(action.type.ToString(), "INCOMING CALL"); MediaPortal.Utilities.Screens.InfoScreen info = new MediaPortal.Utilities.Screens.InfoScreen(action.type.ToString(), "INCOMING CALL", action.caller.ID, MediaPortal.Utilities.Screens.BaseScreen.Image.info); @@ -160,6 +161,7 @@ info.pbIcon.ImageLocation = @"G:\chefkoch.png"; info.Show(); + */ } Modified: trunk/plugins/FritzBox/MP2version/CallMonitor.csproj =================================================================== --- trunk/plugins/FritzBox/MP2version/CallMonitor.csproj 2008-07-14 18:57:36 UTC (rev 1919) +++ trunk/plugins/FritzBox/MP2version/CallMonitor.csproj 2008-07-16 01:03:01 UTC (rev 1920) @@ -42,12 +42,6 @@ </Target> --> <ItemGroup> - <Compile Include="HelperClasses\CallInfoScreen.cs"> - <SubType>Form</SubType> - </Compile> - <Compile Include="HelperClasses\CallInfoScreen.Designer.cs"> - <DependentUpon>CallInfoScreen.cs</DependentUpon> - </Compile> <Compile Include="ListenerBuilder.cs" /> <Compile Include="HelperClasses\ICallMonitor.cs" /> <Compile Include="HelperClasses\IListener.cs" /> @@ -68,14 +62,14 @@ </ItemGroup> <PropertyGroup> <PostBuildEvent>xcopy /Y "$(ProjectDir)$(ProjectName).plugin" "$(SolutionDir)$(SolutionName)\$(OutDir)Plugins\$(ProjectName)\" -xcopy /Y "$(TargetDir)CallMonitor.dll" "$(SolutionDir)$(SolutionName)\$(OutDir)Plugins\$(ProjectName)\"</PostBuildEvent> +xcopy /Y "$(TargetDir)$(ProjectName).dll" "$(SolutionDir)$(SolutionName)\$(OutDir)Plugins\$(ProjectName)\"</PostBuildEvent> </PropertyGroup> <ItemGroup> - <ProjectReference Include="..\..\MediaPortal.Core\MediaPortal.Core.csproj"> + <ProjectReference Include="..\..\..\MP-II\MediaPortal.Interfaces\MediaPortal.Interfaces.csproj"> <Project>{52E587D0-A274-44DA-8846-8EEAF5414923}</Project> - <Name>MediaPortal.Core</Name> + <Name>MediaPortal.Interfaces</Name> </ProjectReference> - <ProjectReference Include="..\..\MediaPortal.Utilities\MediaPortal.Utilities.csproj"> + <ProjectReference Include="..\..\..\MP-II\MediaPortal.Utilities\MediaPortal.Utilities.csproj"> <Project>{4FE7B8AE-1330-424A-91A1-C68D7ABF9CB8}</Project> <Name>MediaPortal.Utilities</Name> </ProjectReference> Modified: trunk/plugins/FritzBox/MP2version/Listeners/FritzBox/FritzBox.cs =================================================================== --- trunk/plugins/FritzBox/MP2version/Listeners/FritzBox/FritzBox.cs 2008-07-14 18:57:36 UTC (rev 1919) +++ trunk/plugins/FritzBox/MP2version/Listeners/FritzBox/FritzBox.cs 2008-07-16 01:03:01 UTC (rev 1920) @@ -1,18 +1,17 @@ +using System; using System.IO; -using MediaPortal.Core; -using MediaPortal.Core.Threading; - +using System.IO.Ports; using System.Net.Sockets; -using MediaPortal.Core.PluginManager; +using System.Text; -using CallMonitor; -using System; +using MediaPortal.Core; using MediaPortal.Core.Logging; -using System.IO.Ports; -using System.Text; -using MediaPortal.Core.PluginManager; using MediaPortal.Core.Messaging; +using MediaPortal.Core.PluginManager; +using MediaPortal.Core.Threading; +using CallMonitor; + namespace CallMonitor.Listeners { public class FritzBox : IPlugin, IListener Modified: trunk/plugins/FritzBox/MP2version/Listeners/FritzBox/FritzBox.csproj =================================================================== --- trunk/plugins/FritzBox/MP2version/Listeners/FritzBox/FritzBox.csproj 2008-07-14 18:57:36 UTC (rev 1919) +++ trunk/plugins/FritzBox/MP2version/Listeners/FritzBox/FritzBox.csproj 2008-07-16 01:03:01 UTC (rev 1920) @@ -52,16 +52,16 @@ xcopy /Y "$(TargetDir)$(ProjectName).dll" "$(SolutionDir)$(SolutionName)\$(OutDir)Plugins\CallMonitor.Listeners.$(ProjectName)\"</PostBuildEvent> </PropertyGroup> <ItemGroup> + <Reference Include="System" /> + </ItemGroup> + <ItemGroup> + <ProjectReference Include="..\..\..\..\..\MP-II\MediaPortal.Interfaces\MediaPortal.Interfaces.csproj"> + <Project>{EE12C52A-B610-4B8B-95CE-76AE73F8990E}</Project> + <Name>MediaPortal.Interfaces</Name> + </ProjectReference> <ProjectReference Include="..\..\CallMonitor.csproj"> <Project>{131A0BFD-AF34-4AEB-8A10-7330FE83811E}</Project> - <Name>CallMonitor %28CallMonitor\CallMonitor%29</Name> + <Name>CallMonitor %28Plugins\CallMonitor\CallMonitor%29</Name> </ProjectReference> - <ProjectReference Include="..\..\..\..\MediaPortal.Core\MediaPortal.Core.csproj"> - <Project>{52E587D0-A274-44DA-8846-8EEAF5414923}</Project> - <Name>MediaPortal.Core</Name> - </ProjectReference> </ItemGroup> - <ItemGroup> - <Reference Include="System" /> - </ItemGroup> </Project> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <che...@us...> - 2007-02-07 11:28:55
|
Revision: 99 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=99&view=rev Author: chef_koch Date: 2007-02-07 03:28:52 -0800 (Wed, 07 Feb 2007) Log Message: ----------- increased version number to 0.2e improved behavior when adding new caller to phone book Modified Paths: -------------- trunk/plugins/FritzBox/FritzBox.cs trunk/plugins/FritzBox/FritzBoxSetupFrom.cs Modified: trunk/plugins/FritzBox/FritzBox.cs =================================================================== --- trunk/plugins/FritzBox/FritzBox.cs 2007-02-06 21:49:35 UTC (rev 98) +++ trunk/plugins/FritzBox/FritzBox.cs 2007-02-07 11:28:52 UTC (rev 99) @@ -75,7 +75,7 @@ #region public Variables - public const string _version = "0.2e"; + public const string _version = "0.2f"; public static bool _extensiveLogging = false; // phonebook settings Modified: trunk/plugins/FritzBox/FritzBoxSetupFrom.cs =================================================================== --- trunk/plugins/FritzBox/FritzBoxSetupFrom.cs 2007-02-06 21:49:35 UTC (rev 98) +++ trunk/plugins/FritzBox/FritzBoxSetupFrom.cs 2007-02-07 11:28:52 UTC (rev 99) @@ -956,6 +956,12 @@ if (dataGridView.Rows[dataGridView.NewRowIndex].Selected) { dataGridView.Rows.Add(textBoxCallerId.Text, textBoxCallerName.Text, checkBoxCallerShow.Checked); + + textBoxCallerId.Text = ""; + textBoxCallerName.Text = ""; + checkBoxCallerShow.Checked = false; + + textBoxCallerId.Focus(); } else { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <che...@us...> - 2008-05-23 07:53:07
|
Revision: 1804 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1804&view=rev Author: chef_koch Date: 2008-05-23 00:53:02 -0700 (Fri, 23 May 2008) Log Message: ----------- fixed parsing the dateTime, see http://forum.team-mediaportal.com/plugins-47/fritz-box-callmonitor-v0-2e-2007-02-06-a-5165/index6.html#post264627 and following for further infos Modified Paths: -------------- trunk/plugins/FritzBox/FritzBox/FritzBox.cs trunk/plugins/FritzBox/FritzBox.xmp Modified: trunk/plugins/FritzBox/FritzBox/FritzBox.cs =================================================================== --- trunk/plugins/FritzBox/FritzBox/FritzBox.cs 2008-05-22 17:09:10 UTC (rev 1803) +++ trunk/plugins/FritzBox/FritzBox/FritzBox.cs 2008-05-23 07:53:02 UTC (rev 1804) @@ -366,7 +366,7 @@ CallAction callAction = new CallAction(); // time when action happens - callAction.time = DateTime.Parse(strList[0]); + callAction.time = DateTime.Parse(strList[0], new System.Globalization.CultureInfo("de-DE", false)); // set the type of the callAction switch (strList[1]) Modified: trunk/plugins/FritzBox/FritzBox.xmp =================================================================== --- trunk/plugins/FritzBox/FritzBox.xmp 2008-05-22 17:09:10 UTC (rev 1803) +++ trunk/plugins/FritzBox/FritzBox.xmp 2008-05-23 07:53:02 UTC (rev 1804) @@ -8,7 +8,7 @@ <Source>FritzBox\gfx\Thumbs\YAC\_noImage.png</Source> <Id>04010</Id> <Option>OutputFileName=|DefaultFile=False|</Option> - <Guid>8e6b98ca-9280-4453-850e-2352bde99717</Guid> + <Guid>580ec1c2-280e-4687-8717-f0539dd6aade</Guid> </File> <File> <FileName>_unknown.png</FileName> @@ -17,7 +17,7 @@ <Source>FritzBox\gfx\Thumbs\YAC\_unknown.png</Source> <Id>04010</Id> <Option /> - <Guid>3fc4269c-bd6d-4315-8c64-f8e8e55ee622</Guid> + <Guid>a54daff6-0969-4190-b5b7-6476b68d1d10</Guid> </File> <File> <FileName>FritzBox.dll</FileName> @@ -26,7 +26,7 @@ <Source>FritzBox\bin\Release\FritzBox.dll</Source> <Id>01020</Id> <Option /> - <Guid>188bfd8b-7a6c-40e5-8719-8962af8c841a</Guid> + <Guid>9c4a9bbd-f5b4-43a5-a625-6426e9581989</Guid> </File> </FileList> <StringList /> @@ -36,12 +36,12 @@ <SetupGroups /> <SetupGroupMappings /> <Option> - <BuildFileName>E:\mediaportal\mediaportal_plugins\FritzBox\FritzBox_v0.3.0.mpi</BuildFileName> - <ProiectFileName>E:\mediaportal\mediaportal_plugins\FritzBox\FritzBox.xmp</ProiectFileName> + <BuildFileName>D:\mediaportal\mediaportal_plugins\FritzBox\FritzBox_v0.3.0.1.mpi</BuildFileName> + <ProiectFileName>D:\mediaportal\mediaportal_plugins\FritzBox\FritzBox.xmp</ProiectFileName> <ProiectName>FritzBox CallMonitor</ProiectName> <Author>chefkoch @ Team MediaPortal</Author> <UpdateURL>http://mpi.team-mediaportal.com/downloads</UpdateURL> - <Version>0.3.0.0</Version> + <Version>0.3.0.1</Version> <Description>The FRITZ!Box plugin is a process plugin, which is able to notify you within MediaPortal on an incomming call on your FRITZ!Box. All strings are multi language. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |