From: <hor...@us...> - 2012-03-05 20:45:14
|
Revision: 4464 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=4464&view=rev Author: horned-reaper Date: 2012-03-05 20:45:05 +0000 (Mon, 05 Mar 2012) Log Message: ----------- Modified Paths: -------------- trunk/plugins/FritzBox/Build/Build.log trunk/plugins/FritzBox/Docs/Changes.txt trunk/plugins/FritzBox/FritzBox/EditPhoneBook.Designer.cs trunk/plugins/FritzBox/FritzBox/EditPhoneBook.cs trunk/plugins/FritzBox/FritzBox/EditPhoneBook.resx trunk/plugins/FritzBox/FritzBox/FritzBox.cs trunk/plugins/FritzBox/FritzBox/FritzBox.csproj trunk/plugins/FritzBox/FritzBox/FritzBoxConfig.Designer.cs trunk/plugins/FritzBox/FritzBox/FritzBoxConfig.cs trunk/plugins/FritzBox/FritzBox/FritzCallMonitor/FritzBoxClient.cs trunk/plugins/FritzBox/FritzBox/FritzManager/PhoneBook.cs trunk/plugins/FritzBox/FritzBox/FritzManager/PhonebookItem.cs trunk/plugins/FritzBox/FritzBox/Properties/AssemblyInfo.cs trunk/plugins/FritzBox/FritzBox/Settings.cs trunk/plugins/FritzBox/FritzBox/bin/Release/FritzBox.dll trunk/plugins/FritzBox/FritzBox/bin/Release/FritzBox.pdb trunk/plugins/FritzBox/FritzBox/obj/Debug/FritzBox.csproj.FileListAbsolute.txt trunk/plugins/FritzBox/FritzBox/obj/Debug/FritzBox.dll trunk/plugins/FritzBox/FritzBox/obj/Debug/FritzBox.pdb trunk/plugins/FritzBox/FritzBox/obj/Debug/GenerateResource-ResGen.read.1.tlog trunk/plugins/FritzBox/FritzBox/obj/Release/FritzBox.dll trunk/plugins/FritzBox/FritzBox/obj/Release/FritzBox.pdb trunk/plugins/FritzBox/MpeRelease/FritzBox.xmp2 trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/FritzBoxConfigTester.csproj trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/FritzBoxConfigTester.csproj.user trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/Program.cs trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/Properties/AssemblyInfo.cs trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Debug/FritzBox.dll trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Debug/FritzBox.pdb trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Debug/FritzBoxConfigTester.exe trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Debug/FritzBoxConfigTester.pdb trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Release/FritzBox.dll trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Release/FritzBox.pdb trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Release/FritzBoxConfigTester.exe trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Release/FritzBoxConfigTester.pdb trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/obj/Debug/FritzBoxConfigTester.csproj.FileListAbsolute.txt trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/obj/Debug/FritzBoxConfigTester.exe trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/obj/Debug/FritzBoxConfigTester.pdb trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/obj/Debug/ResolveAssemblyReference.cache trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/obj/Release/DesignTimeResolveAssemblyReferencesInput.cache trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/obj/Release/FritzBoxConfigTester.exe trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/obj/Release/FritzBoxConfigTester.pdb trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/obj/Release/ResolveAssemblyReference.cache trunk/plugins/FritzBox/Tools/FritzBoxDebugger/FritzBoxDebugger.csproj trunk/plugins/FritzBox/Tools/FritzBoxDebugger/Properties/AssemblyInfo.cs trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Debug/FritzBox.dll trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Debug/FritzBox.pdb trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Debug/FritzBoxDebugger.exe trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Debug/FritzBoxDebugger.pdb trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Release/FritzBox.dll trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Release/FritzBox.pdb trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Release/FritzBoxDebugger.exe trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Release/FritzBoxDebugger.pdb trunk/plugins/FritzBox/Tools/FritzBoxDebugger/obj/Debug/FritzBoxDebugger.csproj.FileListAbsolute.txt trunk/plugins/FritzBox/Tools/FritzBoxDebugger/obj/Debug/FritzBoxDebugger.exe trunk/plugins/FritzBox/Tools/FritzBoxDebugger/obj/Debug/FritzBoxDebugger.pdb trunk/plugins/FritzBox/Tools/FritzBoxDebugger/obj/Debug/GenerateResource.read.1.tlog trunk/plugins/FritzBox/Tools/FritzBoxDebugger/obj/Debug/GenerateResource.write.1.tlog trunk/plugins/FritzBox/Tools/FritzBoxDebugger/obj/Release/FritzBoxDebugger.exe trunk/plugins/FritzBox/Tools/FritzBoxDebugger/obj/Release/FritzBoxDebugger.pdb trunk/plugins/FritzBox/releases/update.xml Added Paths: ----------- trunk/plugins/FritzBox/FritzBox/obj/Release/DesignTimeResolveAssemblyReferences.cache trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Debug/FritzBoxConfigTester/ trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Debug/FritzBoxConfigTester/FritzBoxConfigTester.vshost.exe.config trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Debug/FritzBoxConfigTester.vshost.exe.manifest trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Debug/FritzBoxDebugger/ trunk/plugins/FritzBox/Tools/FritzBoxDebugger/obj/Debug/GenerateResource-ResGen.read.1.tlog trunk/plugins/FritzBox/Tools/FritzBoxDebugger/obj/Debug/GenerateResource-ResGen.write.1.tlog trunk/plugins/FritzBox/releases/FritzBox_v1.0.0.4463.mpe1 Removed Paths: ------------- trunk/plugins/FritzBox/Docs/Ausstehend.txt Modified: trunk/plugins/FritzBox/Build/Build.log =================================================================== --- trunk/plugins/FritzBox/Build/Build.log 2012-03-04 18:33:38 UTC (rev 4463) +++ trunk/plugins/FritzBox/Build/Build.log 2012-03-05 20:45:05 UTC (rev 4464) @@ -1,6 +1,6 @@ Running : C:\Program Files\TortoiseSVN\bin\SubWCRev.exe -SVN Version: 4461 +SVN Version: 4463 Updating: D:\FritzBox\FritzBox\Properties\AssemblyInfo.cs Updating: D:\FritzBox\MP2version\Listeners\FritzBox\Properties\AssemblyInfo.cs Updating: D:\FritzBox\MP2version\Properties\AssemblyInfo.cs @@ -10,7 +10,7 @@ [Microsoft .NET Framework, Version 4.0.30319.239] Copyright (C) Microsoft Corporation 2007. All rights reserved. -Build started 26.02.2012 16:16:20. +Build started 05.03.2012 21:32:52. Project "D:\FritzBox\FritzBox.sln" on node 1 (Rebuild target(s)). ValidateSolutionConfiguration: Building solution configuration "Release|Mixed Platforms". @@ -68,9 +68,6 @@ Copying file from "obj\Release\FritzBox.dll" to "bin\Release\FritzBox.dll". FritzBox -> D:\FritzBox\FritzBox\bin\Release\FritzBox.dll Copying file from "obj\Release\FritzBox.pdb" to "bin\Release\FritzBox.pdb". -PostBuildEvent: - rem xcopy /y "D:\FritzBox\FritzBox\bin\Release\FritzBox.dll" "D:\FritzBox\\xbmc\bin\Release\plugins\windows" - rem xcopy /y "D:\FritzBox\FritzBox\bin\Release\FritzBox.dll" "D:\FritzBox\\Configuration\bin\Release\plugins\windows" Done Building Project "D:\FritzBox\FritzBox\FritzBox.csproj" (Rebuild target(s)). Project "D:\FritzBox\FritzBox.sln" (1) is building "D:\FritzBox\Tools\FritzBoxConfigTester\FritzBoxConfigTester.csproj" (3) on node 1 (Rebuild target(s)). CoreClean: @@ -156,6 +153,8 @@ Deleting file "D:\FritzBox\Tools\FritzBoxDebugger\obj\Release\FritzBoxDebugger.pdb". Deleting file "D:\FritzBox\Tools\FritzBoxDebugger\obj\Release\GenerateResource.read.6.tlog". Deleting file "D:\FritzBox\Tools\FritzBoxDebugger\obj\Release\GenerateResource.write.6.tlog". + Deleting file "D:\FritzBox\Tools\FritzBoxDebugger\obj\Release\GenerateResource-ResGen.read.1.tlog". + Deleting file "D:\FritzBox\Tools\FritzBoxDebugger\obj\Release\GenerateResource-ResGen.write.1.tlog". CoreResGen: "C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin\NETFX 4.0 Tools\resgen.exe" /useSourcePath /r:"C:\Program Files\Team MediaPortal\MediaPortal\Core.dll" /r:D:\FritzBox\FritzBox\bin\Release\FritzBox.dll /r:"C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\mscorlib.dll" /r:"C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Core.dll" /r:"C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Data.dll" /r:"C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.dll" /r:"C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Drawing.dll" /r:"C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Windows.Forms.dll" /r:"C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Xml.dll" /compile DebugForm.resx,obj\Release\FritzBoxDebugger.DebugForm.resources Processing resource file "DebugForm.resx" into "obj\Release\FritzBoxDebugger.DebugForm.resources". @@ -195,7 +194,7 @@ 0 Warning(s) 0 Error(s) -Time Elapsed 00:00:01.89 +Time Elapsed 00:00:03.53 Reverting to build 0 Updating: D:\FritzBox\FritzBox\Properties\AssemblyInfo.cs Updating: D:\FritzBox\MP2version\Listeners\FritzBox\Properties\AssemblyInfo.cs @@ -298,7 +297,7 @@ ..\FritzBox\Languages\Unsupported\strings_zh-CN.xml 36 File(s) copied MpeMaker version: 1.2.1.0 -Build started at 16:16:25 +Build started at 21:32:59 Building "D:\FritzBox\MpeRelease\FritzBox.xmp2" Output: "..\MpeRelease\FritzBox.mpe1" Writing UpdateXML to "update.xml" Deleted: trunk/plugins/FritzBox/Docs/Ausstehend.txt =================================================================== --- trunk/plugins/FritzBox/Docs/Ausstehend.txt 2012-03-04 18:33:38 UTC (rev 4463) +++ trunk/plugins/FritzBox/Docs/Ausstehend.txt 2012-03-05 20:45:05 UTC (rev 4464) @@ -1,65 +0,0 @@ -Neue Funktionen/Erweiterungen: -- Telefonbuch editierbar machen (f\xFCr FRITZ!Box-Versionen ohne Telefonbuch) -- Bei Anrufbenachrichtigungen: Auflistung von Kontaktnamen, wenn eine Rufnummer mehrmals im Telefonbuch vorkommt -- Nachrichtenl\xE4nge zur Anzeige hinzuf\xFCgen -- "Nachricht l\xF6schen"-Funktion -- "Nachricht als geh\xF6rt markieren"-Funktion -- R\xFCckw\xE4rtssuche wieder integrieren -- Wiki-Eintrag -- Skin-Erweiterungen - - Anzahl der neuen Anrufe -- geplante \xC4nderungen ver\xF6ffentlichen -- Klingelton solange wiederholen bis H\xF6rer abgenommen wird - - -Anwenderw\xFCnsche ---------------- -Scrounger, 05.12.2011: -Was ich wirklich verdammt gerne noch h\xE4tte, w\xE4re die M\xF6glichkeit, sich auf dem Basic Home Screen die verpassten anrufe anzeigen zu lassen oder die letzten 3 Anrufe. K\xF6nntet ihr das evtl. in eine kommende Version integrieren? -Was ich damit meine ist, dass du evtl. 3 globale Variablen (AnruferName bzw. Nr. und Bild) zur Verf\xFCgung stellen k\xF6nntest, die dann jeder Skindesigner in seinem BasicHome integrieren k\xF6nnte. Z.B. wie das beim DriveFreeSpace Plugin geht oder bei den Plugins von Micropolis. - -joit, 06.12.2011: -was ich noch super f\xE4nd w\xE4re eine sch\xF6ne Mustayaluca-Integration! - -tor2010, 06.12.2011: -Skinanpassung f\xFCr AVALON - -rogerleifert, 08.12.2008: -F\xFCr den PurevisionHD-Skin gibt es m.W. auch noch keine Anpassung. -Die Notifications bei eingehenden/ausgehenden Rufen funktionieren mit dem Skin problemlos. -Wenn man allerdings in den Plugins-Bereichs geht, um z.B. die Anrufliste anzuzeigen, passiert erst mal gar nichts und dann kommt so ein ewig durchlaufender Fortschrittsbalken ohne da\xDF etwas passiert. - -Stefan Rinke: -Abspielen von Sprachnachrichten nach dem Anklicken im Home-Screen: -add onAction handler to catch custom action from home screen button -damit k\xF6nnten man ein Control auf dem HomeScreen erscheinen lassen -welches beim einem neuen Anruf direkt auf abspielen geht. - -Burkh2407, 30.12.2011: -ich benutze Stremed MP... mich st\xF6rt das ich zum Umschalten zwischen den einzelnen Listen seitlich ins Untermen\xFC wechseln -mu\xDF warum gibt es kein Buttons wo ich die Listen direKt anw\xE4hlen kann oder \xFCbersehe ich da was. -Gru\xDF Burkh2407 - -creativ, 10.01.2012, 19:53: -Was nur noch eingebaut werden sollte, das im Telefonbuch Kontakte abgew\xE4hlt werden k\xF6nnen die im MP dann nicht angezeigt werden! Ich habe n\xE4mlich das Fritz!Fon MT-F und dort sind Kontakte im internen Speicher die nicht gel\xF6scht werden k\xF6nnen, z.b. (wie klingt HD-Telefonie und daf\xFCr gibt es eine Telefonnumer die hinterlegt ist). - -IchBinsShort, 11.01.2012, 00:28: -L\xF6schen von Anruflisten \xFCber die GUI - -IchBinsShort, 17.01.2012, 15:05: -Ich h\xE4tte noch Idee, wei\xDF nicht ob dies M\xF6glich ist. Aber sch\xF6n w\xE4re es wenn Mediaportal aus dem Standby oder Hibernate erwacht anzeigen w\xFCrde wenn es verpasste Anrufe gibt. Also das vlt. ein Popup Fenster sich \xF6ffnet und anzeigt das es verpasste Anrufe gibt... Ist dies wohl M\xF6glich ? - -IchBinsShort, 17.01.2012, 15:23: -Eventuell w\xE4re es dann auch noch gut wenn neue Anrufe in der Anrufliste als Neu markiert werden k\xF6nnen. Also so was wie ein "gelesen Status" woraus ersichtlich welche der Anrufe seit dem letztem Aufruf der Anrufliste neu hinzugekommen sind :-) - -IchBinsShort, 20.01.2012, 12:38: -Nebenstelle in der Anrufliste anzeigen - -D3ltoroxp, 04.02.2012, 18:50 Uhr: -Und noch ein Feature Request, w\xFCrde es gehen, das der Klingelton aufh\xF6rt zu spielen wenn man abnimmt ? Denn wenn ich abnehme und er ist etwas l\xE4nger l\xE4uft er komplett durch, das bisschen bl\xF6d. - -Vasilich, 11.02.2012, 01:24 Uhr: -MSN in Nachrichtenansicht abschaltbar machen - -AlfredENeuma, 11.02.2012, 17:36 Uhr: -MSN in Anrufliste anzeigen und abschaltbar machen \ No newline at end of file Modified: trunk/plugins/FritzBox/Docs/Changes.txt =================================================================== --- trunk/plugins/FritzBox/Docs/Changes.txt 2012-03-04 18:33:38 UTC (rev 4463) +++ trunk/plugins/FritzBox/Docs/Changes.txt 2012-03-05 20:45:05 UTC (rev 4464) @@ -1,16 +1,8 @@ -New release 0.4.1.4461: +New release 1.0.0.44xx: New feature: -- call extension filter -- option for manual contact image path entry (for FRITZ!Boxes with contact image setting) -Optimizations: -- some language file adjustments -- enhanced connection test in MediaPortal Configuration -- settings XML file: - - consolidated section "FRITZ!Box Manager" - - clear entry names -- call monitor stability improvements +Optimization: + + Fixed bug: -- problem on task queuing -- notification window is not closed on quick sequent call actions (e. g. incoming FAX messages) \ No newline at end of file Modified: trunk/plugins/FritzBox/FritzBox/EditPhoneBook.Designer.cs =================================================================== --- trunk/plugins/FritzBox/FritzBox/EditPhoneBook.Designer.cs 2012-03-04 18:33:38 UTC (rev 4463) +++ trunk/plugins/FritzBox/FritzBox/EditPhoneBook.Designer.cs 2012-03-05 20:45:05 UTC (rev 4464) @@ -29,20 +29,27 @@ private void InitializeComponent() { System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle(); this.dataGridView = new System.Windows.Forms.DataGridView(); this.columnContactID = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.columnName = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.columnPhoneType = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.columnPhoneNumber = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.columnShowCallNotification = new System.Windows.Forms.DataGridViewCheckBoxColumn(); this.columnRingTonePath = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.ColumnContactImage = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.label1 = new System.Windows.Forms.Label(); this.pictureBoxCaller = new System.Windows.Forms.PictureBox(); - this.label1 = new System.Windows.Forms.Label(); + this.textBoxPhoneNumber1 = new System.Windows.Forms.TextBox(); + this.comboBoxPhoneNumber1 = new System.Windows.Forms.ComboBox(); + this.comboBoxPhoneNumber2 = new System.Windows.Forms.ComboBox(); + this.textBoxPhoneNumber2 = new System.Windows.Forms.TextBox(); + this.comboBoxPhoneNumber3 = new System.Windows.Forms.ComboBox(); + this.textBoxPhoneNumber3 = new System.Windows.Forms.TextBox(); + this.label2 = new System.Windows.Forms.Label(); + this.buttonDeleteSelectedContact = new System.Windows.Forms.Button(); ((System.ComponentModel.ISupportInitialize)(this.dataGridView)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.pictureBoxCaller)).BeginInit(); this.SuspendLayout(); @@ -68,40 +75,41 @@ this.dataGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.columnContactID, this.columnName, - this.columnPhoneType, - this.columnPhoneNumber, this.columnShowCallNotification, this.columnRingTonePath, this.ColumnContactImage}); - dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; - dataGridViewCellStyle4.BackColor = System.Drawing.SystemColors.Window; - dataGridViewCellStyle4.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - dataGridViewCellStyle4.ForeColor = System.Drawing.SystemColors.ControlText; - dataGridViewCellStyle4.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle4.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle4.WrapMode = System.Windows.Forms.DataGridViewTriState.False; - this.dataGridView.DefaultCellStyle = dataGridViewCellStyle4; - this.dataGridView.EditMode = System.Windows.Forms.DataGridViewEditMode.EditOnEnter; - this.dataGridView.Location = new System.Drawing.Point(31, 29); - this.dataGridView.MultiSelect = false; - this.dataGridView.Name = "dataGridView"; dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; - dataGridViewCellStyle5.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle5.BackColor = System.Drawing.SystemColors.Window; dataGridViewCellStyle5.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - dataGridViewCellStyle5.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle5.ForeColor = System.Drawing.SystemColors.ControlText; dataGridViewCellStyle5.SelectionBackColor = System.Drawing.SystemColors.Highlight; dataGridViewCellStyle5.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle5.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.dataGridView.RowHeadersDefaultCellStyle = dataGridViewCellStyle5; + dataGridViewCellStyle5.WrapMode = System.Windows.Forms.DataGridViewTriState.False; + this.dataGridView.DefaultCellStyle = dataGridViewCellStyle5; + this.dataGridView.EditMode = System.Windows.Forms.DataGridViewEditMode.EditOnEnter; + this.dataGridView.Location = new System.Drawing.Point(28, 29); + this.dataGridView.MultiSelect = false; + this.dataGridView.Name = "dataGridView"; + dataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle6.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle6.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + dataGridViewCellStyle6.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle6.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle6.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle6.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.dataGridView.RowHeadersDefaultCellStyle = dataGridViewCellStyle6; this.dataGridView.RowHeadersVisible = false; this.dataGridView.RowTemplate.Height = 23; this.dataGridView.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.CellSelect; - this.dataGridView.Size = new System.Drawing.Size(729, 582); + this.dataGridView.Size = new System.Drawing.Size(580, 582); this.dataGridView.TabIndex = 19; + this.dataGridView.RowsAdded += new System.Windows.Forms.DataGridViewRowsAddedEventHandler(this.dataGridView_RowsAdded); + this.dataGridView.RowsRemoved += new System.Windows.Forms.DataGridViewRowsRemovedEventHandler(this.dataGridView_RowsRemoved); // // columnContactID // dataGridViewCellStyle2.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + dataGridViewCellStyle2.NullValue = "null"; this.columnContactID.DefaultCellStyle = dataGridViewCellStyle2; this.columnContactID.HeaderText = "Contact ID"; this.columnContactID.Name = "columnContactID"; @@ -119,30 +127,14 @@ this.columnName.ReadOnly = true; this.columnName.Width = 220; // - // columnPhoneType - // - this.columnPhoneType.HeaderText = "Phone type"; - this.columnPhoneType.MinimumWidth = 70; - this.columnPhoneType.Name = "columnPhoneType"; - this.columnPhoneType.ReadOnly = true; - this.columnPhoneType.Width = 70; - // - // columnPhoneNumber - // - this.columnPhoneNumber.FillWeight = 31.88914F; - this.columnPhoneNumber.HeaderText = "Phone number"; - this.columnPhoneNumber.MinimumWidth = 100; - this.columnPhoneNumber.Name = "columnPhoneNumber"; - this.columnPhoneNumber.ReadOnly = true; - this.columnPhoneNumber.Width = 120; - // // columnShowCallNotification // + dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle4.NullValue = true; + this.columnShowCallNotification.DefaultCellStyle = dataGridViewCellStyle4; this.columnShowCallNotification.HeaderText = "Show call notification"; this.columnShowCallNotification.MinimumWidth = 73; this.columnShowCallNotification.Name = "columnShowCallNotification"; - this.columnShowCallNotification.Resizable = System.Windows.Forms.DataGridViewTriState.True; - this.columnShowCallNotification.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic; this.columnShowCallNotification.Width = 73; // // columnRingTonePath @@ -161,30 +153,124 @@ this.ColumnContactImage.Visible = false; this.ColumnContactImage.Width = 225; // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(826, 598); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(57, 13); + this.label1.TabIndex = 24; + this.label1.Text = "0 contacts"; + // // pictureBoxCaller // this.pictureBoxCaller.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.pictureBoxCaller.Location = new System.Drawing.Point(785, 29); + this.pictureBoxCaller.Location = new System.Drawing.Point(715, 29); this.pictureBoxCaller.Name = "pictureBoxCaller"; this.pictureBoxCaller.Size = new System.Drawing.Size(122, 122); this.pictureBoxCaller.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom; this.pictureBoxCaller.TabIndex = 23; this.pictureBoxCaller.TabStop = false; // - // label1 + // textBoxPhoneNumber1 // - this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(782, 598); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(89, 13); - this.label1.TabIndex = 24; - this.label1.Text = "0 phone numbers"; + this.textBoxPhoneNumber1.Location = new System.Drawing.Point(759, 208); + this.textBoxPhoneNumber1.Name = "textBoxPhoneNumber1"; + this.textBoxPhoneNumber1.ReadOnly = true; + this.textBoxPhoneNumber1.Size = new System.Drawing.Size(150, 20); + this.textBoxPhoneNumber1.TabIndex = 25; // + // comboBoxPhoneNumber1 + // + this.comboBoxPhoneNumber1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.comboBoxPhoneNumber1.FormattingEnabled = true; + this.comboBoxPhoneNumber1.Items.AddRange(new object[] { + "Private", + "Mobile", + "Business"}); + this.comboBoxPhoneNumber1.Location = new System.Drawing.Point(632, 208); + this.comboBoxPhoneNumber1.MaxDropDownItems = 3; + this.comboBoxPhoneNumber1.Name = "comboBoxPhoneNumber1"; + this.comboBoxPhoneNumber1.Size = new System.Drawing.Size(112, 21); + this.comboBoxPhoneNumber1.TabIndex = 26; + // + // comboBoxPhoneNumber2 + // + this.comboBoxPhoneNumber2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.comboBoxPhoneNumber2.FormattingEnabled = true; + this.comboBoxPhoneNumber2.Items.AddRange(new object[] { + "Private", + "Mobile", + "Business"}); + this.comboBoxPhoneNumber2.Location = new System.Drawing.Point(632, 246); + this.comboBoxPhoneNumber2.MaxDropDownItems = 3; + this.comboBoxPhoneNumber2.Name = "comboBoxPhoneNumber2"; + this.comboBoxPhoneNumber2.Size = new System.Drawing.Size(112, 21); + this.comboBoxPhoneNumber2.TabIndex = 28; + // + // textBoxPhoneNumber2 + // + this.textBoxPhoneNumber2.Location = new System.Drawing.Point(759, 246); + this.textBoxPhoneNumber2.Name = "textBoxPhoneNumber2"; + this.textBoxPhoneNumber2.ReadOnly = true; + this.textBoxPhoneNumber2.Size = new System.Drawing.Size(150, 20); + this.textBoxPhoneNumber2.TabIndex = 27; + // + // comboBoxPhoneNumber3 + // + this.comboBoxPhoneNumber3.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.comboBoxPhoneNumber3.FormattingEnabled = true; + this.comboBoxPhoneNumber3.Items.AddRange(new object[] { + "Private", + "Mobile", + "Business"}); + this.comboBoxPhoneNumber3.Location = new System.Drawing.Point(632, 285); + this.comboBoxPhoneNumber3.MaxDropDownItems = 3; + this.comboBoxPhoneNumber3.Name = "comboBoxPhoneNumber3"; + this.comboBoxPhoneNumber3.Size = new System.Drawing.Size(112, 21); + this.comboBoxPhoneNumber3.TabIndex = 30; + // + // textBoxPhoneNumber3 + // + this.textBoxPhoneNumber3.Location = new System.Drawing.Point(759, 285); + this.textBoxPhoneNumber3.Name = "textBoxPhoneNumber3"; + this.textBoxPhoneNumber3.ReadOnly = true; + this.textBoxPhoneNumber3.Size = new System.Drawing.Size(150, 20); + this.textBoxPhoneNumber3.TabIndex = 29; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label2.Location = new System.Drawing.Point(629, 188); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(94, 13); + this.label2.TabIndex = 31; + this.label2.Text = "Phone numbers"; + // + // buttonDeleteSelectedContact + // + this.buttonDeleteSelectedContact.Location = new System.Drawing.Point(717, 348); + this.buttonDeleteSelectedContact.Name = "buttonDeleteSelectedContact"; + this.buttonDeleteSelectedContact.Size = new System.Drawing.Size(109, 51); + this.buttonDeleteSelectedContact.TabIndex = 32; + this.buttonDeleteSelectedContact.Text = "Delete selected contact"; + this.buttonDeleteSelectedContact.UseVisualStyleBackColor = true; + this.buttonDeleteSelectedContact.Click += new System.EventHandler(this.buttonDeleteContact_Click); + // // EditPhoneBook // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(933, 639); + this.Controls.Add(this.buttonDeleteSelectedContact); + this.Controls.Add(this.label2); + this.Controls.Add(this.comboBoxPhoneNumber3); + this.Controls.Add(this.textBoxPhoneNumber3); + this.Controls.Add(this.comboBoxPhoneNumber2); + this.Controls.Add(this.textBoxPhoneNumber2); + this.Controls.Add(this.comboBoxPhoneNumber1); + this.Controls.Add(this.textBoxPhoneNumber1); this.Controls.Add(this.label1); this.Controls.Add(this.pictureBoxCaller); this.Controls.Add(this.dataGridView); @@ -204,12 +290,18 @@ private System.Windows.Forms.PictureBox pictureBoxCaller; private System.Windows.Forms.DataGridView dataGridView; private System.Windows.Forms.Label label1; + private System.Windows.Forms.TextBox textBoxPhoneNumber1; + private System.Windows.Forms.ComboBox comboBoxPhoneNumber1; + private System.Windows.Forms.ComboBox comboBoxPhoneNumber2; + private System.Windows.Forms.TextBox textBoxPhoneNumber2; + private System.Windows.Forms.ComboBox comboBoxPhoneNumber3; + private System.Windows.Forms.TextBox textBoxPhoneNumber3; private System.Windows.Forms.DataGridViewTextBoxColumn columnContactID; private System.Windows.Forms.DataGridViewTextBoxColumn columnName; - private System.Windows.Forms.DataGridViewTextBoxColumn columnPhoneType; - private System.Windows.Forms.DataGridViewTextBoxColumn columnPhoneNumber; private System.Windows.Forms.DataGridViewCheckBoxColumn columnShowCallNotification; private System.Windows.Forms.DataGridViewTextBoxColumn columnRingTonePath; private System.Windows.Forms.DataGridViewTextBoxColumn ColumnContactImage; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.Button buttonDeleteSelectedContact; } } \ No newline at end of file Modified: trunk/plugins/FritzBox/FritzBox/EditPhoneBook.cs =================================================================== --- trunk/plugins/FritzBox/FritzBox/EditPhoneBook.cs 2012-03-04 18:33:38 UTC (rev 4463) +++ trunk/plugins/FritzBox/FritzBox/EditPhoneBook.cs 2012-03-05 20:45:05 UTC (rev 4464) @@ -10,9 +10,16 @@ namespace FritzBox { + public enum PhoneTypeFormat + { + Display, + XML + } + public partial class EditPhoneBook : Form { private PhoneBook phoneBook = new PhoneBook(); + private bool phoneNumberChanges; public EditPhoneBook() { @@ -21,7 +28,7 @@ private void fillTable() { - string uniqueID, name, type = String.Empty, number = String.Empty, ringTonePath, imageURL; + string uniqueID, name, ringTonePath, imageURL; bool showCallNotification; phoneBook.LoadPhoneBookFromXMLFile(); @@ -34,108 +41,422 @@ ringTonePath = phoneBookItem.RingTonePath; imageURL = phoneBookItem.ImageURL; - foreach (PhoneNumber phoneNumber in phoneBookItem.PhoneNumbers) + dataGridView.Rows.Add(uniqueID, name, showCallNotification, ringTonePath, imageURL); + } + } + + private int getPhoneNumberType(string phoneNumberType) + { + switch (phoneNumberType.ToLower()) + { + case "home": + return 0; + case "work": + return 1; + case "business": + return 1; + case "mobile": + return 2; + default: + return -1; + } + } + + private string getPhoneNumberType(int phoneNumberType, PhoneTypeFormat phoneTypeFormat) + { + switch (phoneNumberType) + { + case 0: + if (phoneTypeFormat == PhoneTypeFormat.Display) return "Home"; + else return "home"; + case 1: + if (phoneTypeFormat == PhoneTypeFormat.Display) return "Business"; + else return "work"; + case 2: + if (phoneTypeFormat == PhoneTypeFormat.Display) return "Mobile"; + else return "mobile"; + default: + return String.Empty; + } + } + + private void updatePhoneNumbersInContactItem() + { + if (dataGridView.CurrentRow.Index != dataGridView.NewRowIndex) + { + string contactID = dataGridView.CurrentRow.Cells[0].Value.ToString(); + PhoneBookItem contact = phoneBook.Items[contactID]; + + contact.PhoneNumbers = new PhoneNumber[3]; + PhoneNumber[] phoneNumbers = { new PhoneNumber(), new PhoneNumber(), new PhoneNumber() }; + contact.PhoneNumbers = phoneNumbers; + + PhoneNumber phoneNumber; + + if (textBoxPhoneNumber1.Text != string.Empty) { + if (comboBoxPhoneNumber1.SelectedIndex != -1) + { + phoneNumber = new PhoneNumber(); + phoneNumber.type = getPhoneNumberType(comboBoxPhoneNumber1.SelectedIndex, PhoneTypeFormat.XML); + phoneNumber.Value = textBoxPhoneNumber1.Text; + + contact.PhoneNumbers[0] = phoneNumber; + } + else return; + } + + if (textBoxPhoneNumber2.Text != string.Empty) + { + if (comboBoxPhoneNumber2.SelectedIndex != -1) + { + phoneNumber = new PhoneNumber(); + phoneNumber.type = getPhoneNumberType(comboBoxPhoneNumber2.SelectedIndex, PhoneTypeFormat.XML); + phoneNumber.Value = textBoxPhoneNumber2.Text; + + contact.PhoneNumbers[1] = phoneNumber; + } + else return; + } + + if (textBoxPhoneNumber3.Text != string.Empty) + { + if (comboBoxPhoneNumber3.SelectedIndex != -1) + { + phoneNumber = new PhoneNumber(); + phoneNumber.type = getPhoneNumberType(comboBoxPhoneNumber3.SelectedIndex, PhoneTypeFormat.XML); + phoneNumber.Value = textBoxPhoneNumber3.Text; + + contact.PhoneNumbers[2] = phoneNumber; + } + else return; + } + + // transfer changed contact to phone book + phoneBook.EditItem(contact); + + phoneNumberChanges = false; + } + } + + private void updatePhoneNumbersInGUI(PhoneBookItem contact) + { + // load phone numbers + int numberPosition = 0; + + // unregister change events during automatic data load + unregisterPhoneNumberFieldChanges(); + + clearPhoneNumberFields(); + + if (contact.PhoneNumbers != null) + { + foreach (PhoneNumber phoneNumber in contact.PhoneNumbers) + { if (!String.IsNullOrEmpty(phoneNumber.Value)) { - type = phoneNumber.type; - number = phoneNumber.Value; + // fill in phone types and numbers + switch (numberPosition) + { + case 0: + if (Settings.SynchronizePhoneBook) + { + comboBoxPhoneNumber1.Items.Clear(); - dataGridView.Rows.Add(uniqueID, name, type, number, showCallNotification, ringTonePath, imageURL); + comboBoxPhoneNumber1.Items.Add(getPhoneNumberType(getPhoneNumberType(phoneNumber.type), PhoneTypeFormat.Display)); + comboBoxPhoneNumber1.SelectedIndex = 0; + } + else comboBoxPhoneNumber1.SelectedIndex = getPhoneNumberType(phoneNumber.type); + + textBoxPhoneNumber1.Text = phoneNumber.Value; + break; + + case 1: + if (Settings.SynchronizePhoneBook) + { + comboBoxPhoneNumber2.Items.Clear(); + + comboBoxPhoneNumber2.Items.Add(getPhoneNumberType(getPhoneNumberType(phoneNumber.type), PhoneTypeFormat.Display)); + comboBoxPhoneNumber2.SelectedIndex = 0; + } + else comboBoxPhoneNumber2.SelectedIndex = getPhoneNumberType(phoneNumber.type); + + textBoxPhoneNumber2.Text = phoneNumber.Value; + break; + + case 2: + if (Settings.SynchronizePhoneBook) + { + comboBoxPhoneNumber3.Items.Clear(); + + comboBoxPhoneNumber3.Items.Add(getPhoneNumberType(getPhoneNumberType(phoneNumber.type), PhoneTypeFormat.Display)); + comboBoxPhoneNumber3.SelectedIndex = 0; + } + else comboBoxPhoneNumber3.SelectedIndex = getPhoneNumberType(phoneNumber.type); + + textBoxPhoneNumber3.Text = phoneNumber.Value; + break; + } } + else if (Settings.SynchronizePhoneBook) + { + switch (numberPosition) + { + case 0: + comboBoxPhoneNumber1.Items.Clear(); + break; + case 1: + comboBoxPhoneNumber2.Items.Clear(); + break; + case 2: + comboBoxPhoneNumber3.Items.Clear(); + break; + } + } + + numberPosition++; } } - label1.Text = dataGridView.Rows.Count + " phone numbers"; + // register events after row adding + registerPhoneNumberFieldChanges(); } - private void EditPhoneBook_Load(object sender, EventArgs e) + private void clearPhoneNumberFields() { - dataGridView.Columns[6].Visible = Settings.ManualContactImagePathEntry; + // clear phone type and number fields + comboBoxPhoneNumber1.SelectedIndex = -1; + textBoxPhoneNumber1.ResetText(); + comboBoxPhoneNumber2.SelectedIndex = -1; + textBoxPhoneNumber2.ResetText(); + comboBoxPhoneNumber3.SelectedIndex = -1; + textBoxPhoneNumber3.ResetText(); + } - fillTable(); + private void registerPhoneNumberFieldChanges() + { + if (!Settings.SynchronizePhoneBook) + { + comboBoxPhoneNumber1.SelectedIndexChanged += comboBoxPhoneNumbers_SelectedIndexChanged; + comboBoxPhoneNumber2.SelectedIndexChanged += comboBoxPhoneNumbers_SelectedIndexChanged; + comboBoxPhoneNumber3.SelectedIndexChanged += comboBoxPhoneNumbers_SelectedIndexChanged; - if (dataGridView.Rows.Count > 0) + textBoxPhoneNumber1.TextChanged += textBoxPhoneNumbers_TextChanged; + textBoxPhoneNumber2.TextChanged += textBoxPhoneNumbers_TextChanged; + textBoxPhoneNumber3.TextChanged += textBoxPhoneNumbers_TextChanged; + + textBoxPhoneNumber1.Enter += textBoxPhoneNumber1_Enter; + textBoxPhoneNumber2.Enter += textBoxPhoneNumber2_Enter; + textBoxPhoneNumber3.Enter += textBoxPhoneNumber3_Enter; + } + } + + private void unregisterPhoneNumberFieldChanges() + { + if (!Settings.SynchronizePhoneBook) { - // show picture of first contact - dataGridView_SelectionChanged(null, null); + comboBoxPhoneNumber1.SelectedIndexChanged -= comboBoxPhoneNumbers_SelectedIndexChanged; + comboBoxPhoneNumber2.SelectedIndexChanged -= comboBoxPhoneNumbers_SelectedIndexChanged; + comboBoxPhoneNumber3.SelectedIndexChanged -= comboBoxPhoneNumbers_SelectedIndexChanged; - // monitor table changes - dataGridView.SelectionChanged += new EventHandler(dataGridView_SelectionChanged); - dataGridView.CellValueChanged += new DataGridViewCellEventHandler(dataGridView_CellValueChanged); + textBoxPhoneNumber1.TextChanged -= textBoxPhoneNumbers_TextChanged; + textBoxPhoneNumber2.TextChanged -= textBoxPhoneNumbers_TextChanged; + textBoxPhoneNumber3.TextChanged -= textBoxPhoneNumbers_TextChanged; + + textBoxPhoneNumber1.Enter -= textBoxPhoneNumber1_Enter; + textBoxPhoneNumber2.Enter -= textBoxPhoneNumber2_Enter; + textBoxPhoneNumber3.Enter -= textBoxPhoneNumber3_Enter; } - else + } + + private void updateContactCount() + { + if (phoneBook.Count > 1) label1.Text = phoneBook.Count + " contacts"; + else if (phoneBook.Count == 1) label1.Text = phoneBook.Count + " contacts"; + else if (phoneBook.Count == 0) label1.Text = "No contacts"; + } + + private void EditPhoneBook_Load(object sender, EventArgs e) + { + dataGridView.Columns[4].Visible = Settings.ManualContactImagePathEntry || !Settings.SynchronizePhoneBook; + + dataGridView.Columns[1].ReadOnly = Settings.SynchronizePhoneBook; + + dataGridView.AllowUserToAddRows = !Settings.SynchronizePhoneBook; + dataGridView.AllowUserToDeleteRows = !Settings.SynchronizePhoneBook; + + buttonDeleteSelectedContact.Visible = !Settings.SynchronizePhoneBook; + + textBoxPhoneNumber1.ReadOnly = Settings.SynchronizePhoneBook; + textBoxPhoneNumber2.ReadOnly = Settings.SynchronizePhoneBook; + textBoxPhoneNumber3.ReadOnly = Settings.SynchronizePhoneBook; + + // monitor changes + dataGridView.SelectionChanged += new EventHandler(dataGridView_SelectionChanged); + dataGridView.CellValueChanged += new DataGridViewCellEventHandler(dataGridView_CellValueChanged); + + if (!Settings.SynchronizePhoneBook) { + dataGridView.RowValidating += dataGridView_RowValidating; + dataGridView.UserAddedRow += dataGridView_UserAddedRow; + } + + registerPhoneNumberFieldChanges(); + + fillTable(); + + if (dataGridView.Rows.Count == 0 && Settings.SynchronizePhoneBook) + { MessageBox.Show("No phone book entries yet!" + Environment.NewLine + "Add a phone book in the FRITZ!Box settings and start MediaPortal to synchronize contacts!", "Edit phone book", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); this.Close(); } } - + private void dataGridView_SelectionChanged(object sender, EventArgs e) { - // get picture path for selected contact - string contactID = dataGridView.Rows[dataGridView.SelectedCells[0].RowIndex].Cells[0].Value.ToString(); - PhoneBookItem contact = phoneBook.Items[contactID]; - string contactPicturePath = phoneBook.GetContactImagePath(contact); + if (dataGridView.SelectedCells[0].RowIndex != dataGridView.NewRowIndex) + { + // get picture path for selected contact + string contactID = dataGridView.CurrentRow.Cells[0].Value.ToString(); + PhoneBookItem contact = phoneBook.Items[contactID]; + string contactPicturePath = phoneBook.GetContactImagePath(contact); - // show picture - pictureBoxCaller.ImageLocation = contactPicturePath; + // show picture + pictureBoxCaller.ImageLocation = contactPicturePath; + + updatePhoneNumbersInGUI(contact); + } + else clearPhoneNumberFields(); } private void dataGridView_CellValueChanged(object sender, DataGridViewCellEventArgs e) { - string contactID = dataGridView.Rows[e.RowIndex].Cells[0].Value.ToString(); - PhoneBookItem contact = phoneBook.Items[contactID]; - object newValue = dataGridView.Rows[e.RowIndex].Cells[e.ColumnIndex].Value; - - // update contact - switch (e.ColumnIndex) + if (e.ColumnIndex != 0) // not contact ID field { - case 4: - contact.ShowCallNotification = (bool)newValue; + string contactID = dataGridView.Rows[e.RowIndex].Cells[0].Value.ToString(); + PhoneBookItem contact = phoneBook.Items[contactID]; + object newValue = dataGridView.Rows[e.RowIndex].Cells[e.ColumnIndex].Value; - // update "Show call notification" field in all rows - for (int i = 0; i < dataGridView.Rows.Count; i++) - { - dataGridView.Rows[i].Cells[4].Value = phoneBook.Items[dataGridView.Rows[i].Cells[0].Value.ToString()].ShowCallNotification; - } + // update contact + switch (e.ColumnIndex) + { + case 1: + contact.Name = (string)newValue; + phoneBook.SortPhoneBook(); + break; - break; - case 5: - contact.RingTonePath = (string)newValue; + case 2: + contact.ShowCallNotification = (bool)newValue; + break; - // update "Ring tone path" field in all rows - for (int i = 0; i < dataGridView.Rows.Count; i++) - { - dataGridView.Rows[i].Cells[5].Value = phoneBook.Items[dataGridView.Rows[i].Cells[0].Value.ToString()].RingTonePath; - } + case 3: + contact.RingTonePath = (string)newValue; + break; - break; - case 6: - contact.ImageURL = (string)newValue; + case 4: + contact.ImageURL = (string)newValue; + break; + } - // update "Image URL" field in all rows - for (int i = 0; i < dataGridView.Rows.Count; i++) - { - dataGridView.Rows[i].Cells[6].Value = phoneBook.Items[dataGridView.Rows[i].Cells[0].Value.ToString()].ImageURL; - } - - break; + // transfer changed contact to phone book + phoneBook.EditItem(contact); } - - // transfer changed contact to phone book - phoneBook.EditItem(contact); } private void EditPhoneBook_FormClosing(object sender, FormClosingEventArgs e) { - dataGridView.EndEdit(); // confirm open table changes + // confirm unsaved changes + dataGridView.EndEdit(); // open table changes + if (phoneNumberChanges) updatePhoneNumbersInContactItem(); phoneBook.SavePhoneBookToXMLFile(); // unregister event monitors dataGridView.SelectionChanged -= new EventHandler(dataGridView_SelectionChanged); dataGridView.CellValueChanged -= new DataGridViewCellEventHandler(dataGridView_CellValueChanged); + + if (!Settings.SynchronizePhoneBook) + { + dataGridView.RowValidating -= dataGridView_RowValidating; + dataGridView.UserAddedRow -= dataGridView_UserAddedRow; + } + + unregisterPhoneNumberFieldChanges(); } + + private void comboBoxPhoneNumbers_SelectedIndexChanged(object sender, EventArgs e) + { + phoneNumberChanges = true; + } + + private void textBoxPhoneNumbers_TextChanged(object sender, EventArgs e) + { + phoneNumberChanges = true; + } + + private void textBoxPhoneNumber1_Enter(object sender, EventArgs e) + { + if (comboBoxPhoneNumber1.SelectedIndex == -1) + { + MessageBox.Show("Please select a phone number type for the first number field!", "Missing phone number type", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); + comboBoxPhoneNumber1.Focus(); + } + } + + private void textBoxPhoneNumber2_Enter(object sender, EventArgs e) + { + if (comboBoxPhoneNumber2.SelectedIndex == -1) + { + MessageBox.Show("Please select a phone number type for the second number field!", "Missing phone number type", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); + comboBoxPhoneNumber2.Focus(); + } + } + + private void textBoxPhoneNumber3_Enter(object sender, EventArgs e) + { + if (comboBoxPhoneNumber3.SelectedIndex == -1) + { + MessageBox.Show("Please select a phone number type for the third number field!", "Missing phone number type", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); + comboBoxPhoneNumber3.Focus(); + } + } + + private void dataGridView_UserAddedRow(object sender, DataGridViewRowEventArgs e) + { + string contactID = DateTime.Now.ToBinary().ToString(); + + dataGridView.CurrentRow.Cells[0].Value = contactID; + + PhoneBookItem contact = new PhoneBookItem(); + contact.UniqueID = contactID; + + phoneBook.AddItem(contact); + } + + private void buttonDeleteContact_Click(object sender, EventArgs e) + { + if (dataGridView.SelectedCells.Count > 0 && dataGridView.CurrentRow.Index != dataGridView.NewRowIndex) + { + string contactID = dataGridView.Rows[dataGridView.SelectedCells[0].RowIndex].Cells[0].Value.ToString(); + phoneBook.DeleteItem(contactID); + + dataGridView.Rows.RemoveAt(dataGridView.SelectedCells[0].RowIndex); + } + } + + private void dataGridView_RowValidating(object sender, DataGridViewCellCancelEventArgs e) + { + if (phoneNumberChanges) updatePhoneNumbersInContactItem(); + } + + private void dataGridView_RowsAdded(object sender, DataGridViewRowsAddedEventArgs e) + { + updateContactCount(); + } + + private void dataGridView_RowsRemoved(object sender, DataGridViewRowsRemovedEventArgs e) + { + updateContactCount(); + } } } Modified: trunk/plugins/FritzBox/FritzBox/EditPhoneBook.resx =================================================================== --- trunk/plugins/FritzBox/FritzBox/EditPhoneBook.resx 2012-03-04 18:33:38 UTC (rev 4463) +++ trunk/plugins/FritzBox/FritzBox/EditPhoneBook.resx 2012-03-05 20:45:05 UTC (rev 4464) @@ -123,12 +123,6 @@ <metadata name="columnName.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>True</value> </metadata> - <metadata name="columnPhoneType.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>True</value> - </metadata> - <metadata name="columnPhoneNumber.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>True</value> - </metadata> <metadata name="columnShowCallNotification.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>True</value> </metadata> Modified: trunk/plugins/FritzBox/FritzBox/FritzBox.cs =================================================================== --- trunk/plugins/FritzBox/FritzBox/FritzBox.cs 2012-03-04 18:33:38 UTC (rev 4463) +++ trunk/plugins/FritzBox/FritzBox/FritzBox.cs 2012-03-05 20:45:05 UTC (rev 4464) @@ -775,8 +775,8 @@ worker.EnqueueTask(new Task(Task.TaskAction.LoadCallListItems, null)); if (!String.IsNullOrEmpty(Settings.VBPath)) worker.EnqueueTask(new Task(Task.TaskAction.LoadVoiceBoxItems, null)); - worker.EnqueueTask(new Task(Task.TaskAction.SynchronizePhoneBook, null)); - if (!String.IsNullOrEmpty(Settings.NASShareName)) worker.EnqueueTask(new Task(Task.TaskAction.SynchronizeContactImages, null)); + if (Settings.SynchronizePhoneBook) worker.EnqueueTask(new Task(Task.TaskAction.SynchronizePhoneBook, null)); + if (!Settings.ManualContactImagePathEntry && !String.IsNullOrEmpty(Settings.NASShareName)) worker.EnqueueTask(new Task(Task.TaskAction.SynchronizeContactImages, null)); worker.EnqueueTask(new Task(Task.TaskAction.UpdateGUIProperties, null)); // reset update timer to get the countdown timer reset Modified: trunk/plugins/FritzBox/FritzBox/FritzBox.csproj =================================================================== --- trunk/plugins/FritzBox/FritzBox/FritzBox.csproj 2012-03-04 18:33:38 UTC (rev 4463) +++ trunk/plugins/FritzBox/FritzBox/FritzBox.csproj 2012-03-05 20:45:05 UTC (rev 4464) @@ -204,7 +204,7 @@ </Target> --> <PropertyGroup> - <PostBuildEvent>rem xcopy /y "$(TargetPath)" "$(SolutionDir)\xbmc\bin\$(ConfigurationName)\plugins\windows" -rem xcopy /y "$(TargetPath)" "$(SolutionDir)\Configuration\bin\$(ConfigurationName)\plugins\windows"</PostBuildEvent> + <PostBuildEvent> + </PostBuildEvent> </PropertyGroup> </Project> \ No newline at end of file Modified: trunk/plugins/FritzBox/FritzBox/FritzBoxConfig.Designer.cs =================================================================== --- trunk/plugins/FritzBox/FritzBox/FritzBoxConfig.Designer.cs 2012-03-04 18:33:38 UTC (rev 4463) +++ trunk/plugins/FritzBox/FritzBox/FritzBoxConfig.Designer.cs 2012-03-05 20:45:05 UTC (rev 4464) @@ -37,6 +37,8 @@ this.buttonConnectionTest = new MediaPortal.UserInterface.Controls.MPButton(); this.labelHelp = new System.Windows.Forms.TextBox(); this.tabPagePhoneBook = new System.Windows.Forms.TabPage(); + this.checkBoxSynchronizePhoneBook = new System.Windows.Forms.CheckBox(); + this.checkBoxManualContactImagePathEntry = new System.Windows.Forms.CheckBox(); this.buttonEditPhoneBook = new System.Windows.Forms.Button(); this.tabPageCallNotification = new System.Windows.Forms.TabPage(); this.groupBoxNotification = new MediaPortal.UserInterface.Controls.MPGroupBox(); @@ -85,7 +87,6 @@ this.updateInterval = new MediaPortal.UserInterface.Controls.MPNumericUpDown(); this.checkBoxExtensiveLogging = new MediaPortal.UserInterface.Controls.MPCheckBox(); this.label4 = new System.Windows.Forms.Label(); - this.checkBoxManualContactImagePathEntry = new System.Windows.Forms.CheckBox(); this.tabPageDiagnostics.SuspendLayout(); this.tabPagePhoneBook.SuspendLayout(); this.tabPageCallNotification.SuspendLayout(); @@ -183,6 +184,7 @@ // // tabPagePhoneBook // + this.tabPagePhoneBook.Controls.Add(this.checkBoxSynchronizePhoneBook); this.tabPagePhoneBook.Controls.Add(this.checkBoxManualContactImagePathEntry); this.tabPagePhoneBook.Controls.Add(this.buttonEditPhoneBook); this.tabPagePhoneBook.Location = new System.Drawing.Point(4, 22); @@ -193,9 +195,31 @@ this.tabPagePhoneBook.Text = "Phone book"; this.tabPagePhoneBook.UseVisualStyleBackColor = true; // + // checkBoxSynchronizePhoneBook + // + this.checkBoxSynchronizePhoneBook.AutoSize = true; + this.checkBoxSynchronizePhoneBook.Location = new System.Drawing.Point(34, 33); + this.checkBoxSynchronizePhoneBook.Name = "checkBoxSynchronizePhoneBook"; + this.checkBoxSynchronizePhoneBook.Size = new System.Drawing.Size(221, 17); + this.checkBoxSynchronizePhoneBook.TabIndex = 27; + this.checkBoxSynchronizePhoneBook.Text = "Synchronize phone book with FRITZ!Box"; + this.checkBoxSynchronizePhoneBook.UseVisualStyleBackColor = true; + this.checkBoxSynchronizePhoneBook.CheckedChanged += new System.EventHandler(this.checkBoxSynchronizePhoneBook_CheckedChanged); + // ... [truncated message content] |