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. |