You can subscribe to this list here.
2007 |
Jan
(36) |
Feb
(79) |
Mar
(123) |
Apr
(95) |
May
(119) |
Jun
(172) |
Jul
(124) |
Aug
(100) |
Sep
(83) |
Oct
(52) |
Nov
(97) |
Dec
(87) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
(131) |
Feb
(80) |
Mar
(163) |
Apr
(178) |
May
(73) |
Jun
(54) |
Jul
(106) |
Aug
(118) |
Sep
(50) |
Oct
(125) |
Nov
(100) |
Dec
(99) |
2009 |
Jan
(104) |
Feb
(99) |
Mar
(68) |
Apr
(81) |
May
(52) |
Jun
(87) |
Jul
(67) |
Aug
(33) |
Sep
(27) |
Oct
(37) |
Nov
(60) |
Dec
(116) |
2010 |
Jan
(82) |
Feb
(79) |
Mar
(38) |
Apr
(50) |
May
(45) |
Jun
(53) |
Jul
(23) |
Aug
(86) |
Sep
(22) |
Oct
(96) |
Nov
(97) |
Dec
(73) |
2011 |
Jan
(24) |
Feb
(45) |
Mar
(28) |
Apr
(31) |
May
(42) |
Jun
(25) |
Jul
|
Aug
(12) |
Sep
(28) |
Oct
(13) |
Nov
(43) |
Dec
(13) |
2012 |
Jan
(62) |
Feb
(28) |
Mar
(6) |
Apr
(16) |
May
(7) |
Jun
|
Jul
(16) |
Aug
(2) |
Sep
(1) |
Oct
(4) |
Nov
(1) |
Dec
(3) |
2013 |
Jan
(5) |
Feb
|
Mar
(34) |
Apr
(9) |
May
(6) |
Jun
(10) |
Jul
(32) |
Aug
(8) |
Sep
(11) |
Oct
(35) |
Nov
(24) |
Dec
(22) |
2014 |
Jan
(44) |
Feb
(9) |
Mar
(9) |
Apr
(15) |
May
(25) |
Jun
(34) |
Jul
(16) |
Aug
(11) |
Sep
(7) |
Oct
(6) |
Nov
(1) |
Dec
(12) |
2015 |
Jan
(33) |
Feb
(19) |
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2019 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2023 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
(5) |
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] |
From: <mca...@us...> - 2012-03-04 18:33:44
|
Revision: 4463 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=4463&view=rev Author: mcarter2006 Date: 2012-03-04 18:33:38 +0000 (Sun, 04 Mar 2012) Log Message: ----------- Modified Paths: -------------- trunk/plugins/UKTVThumb/Normal/package/UK_Logos.mpe1 trunk/plugins/UKTVThumb/Normal/update.xml Modified: trunk/plugins/UKTVThumb/Normal/package/UK_Logos.mpe1 =================================================================== (Binary files differ) Modified: trunk/plugins/UKTVThumb/Normal/update.xml =================================================================== --- trunk/plugins/UKTVThumb/Normal/update.xml 2012-02-26 15:26:52 UTC (rev 4462) +++ trunk/plugins/UKTVThumb/Normal/update.xml 2012-03-04 18:33:38 UTC (rev 4463) @@ -82,7 +82,7 @@ <Major>4</Major> <Minor>0</Minor> <Build>0</Build> - <Revision>7</Revision> + <Revision>8</Revision> </Version> <ExtensionDescription>In this pack you find a large selection of UK TV and Radio channel logos. If the logo you require isn't in this pack, let me know or create your own. Please if you do make your own logos for a channel remember to share them with the rest of the community on this thread. @@ -96,7 +96,7 @@ <VersionDescription>TV and Radio logos for UK Freeview & Freesat.</VersionDescription> <DevelopmentStatus>Stable</DevelopmentStatus> <OnlineLocation>https://mp-plugins.svn.sourceforge.net/svnroot/mp-plugins/trunk/plugins/UKTVThumb/Normal/package/UK_Logos.mpe1</OnlineLocation> - <ReleaseDate>2012-01-08T21:46:40</ReleaseDate> + <ReleaseDate>2012-03-04T21:46:40</ReleaseDate> <Tags>logos, thumbs, tv, radio</Tags> <Location>C:\Users\Matthew\Documents\TV Logos\Logos\mp-plugins\UKTVThumb\Normal\package\UK_Logos.mpe1</Location> <Params> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hor...@us...> - 2012-02-26 15:27:03
|
Revision: 4462 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=4462&view=rev Author: horned-reaper Date: 2012-02-26 15:26:52 +0000 (Sun, 26 Feb 2012) Log Message: ----------- Modified Paths: -------------- trunk/plugins/FritzBox/Build/Build.log trunk/plugins/FritzBox/Docs/Ausstehend.txt 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/FritzBox.csproj.user trunk/plugins/FritzBox/FritzBox/FritzBoxConfig.Designer.cs trunk/plugins/FritzBox/FritzBox/FritzBoxConfig.cs trunk/plugins/FritzBox/FritzBox/FritzCallMonitor/CallAction.cs trunk/plugins/FritzBox/FritzBox/FritzCallMonitor/FritzBoxClient.cs trunk/plugins/FritzBox/FritzBox/FritzManager/BackGroundWorker.cs trunk/plugins/FritzBox/FritzBox/FritzManager/Fritz.cs trunk/plugins/FritzBox/FritzBox/FritzManager/PhoneBook.cs trunk/plugins/FritzBox/FritzBox/Languages/strings_de.xml trunk/plugins/FritzBox/FritzBox/Languages/strings_el.xml trunk/plugins/FritzBox/FritzBox/Languages/strings_en-US.xml trunk/plugins/FritzBox/FritzBox/Languages/strings_en.xml trunk/plugins/FritzBox/FritzBox/Languages/strings_es.xml trunk/plugins/FritzBox/FritzBox/Languages/strings_fr.xml trunk/plugins/FritzBox/FritzBox/Languages/strings_it.xml trunk/plugins/FritzBox/FritzBox/Languages/strings_nl.xml trunk/plugins/FritzBox/FritzBox/Languages/strings_ru.xml 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/DesignTimeResolveAssemblyReferences.cache 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/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.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/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/DebugForm.Designer.cs trunk/plugins/FritzBox/Tools/FritzBoxDebugger/DebugForm.cs trunk/plugins/FritzBox/Tools/FritzBoxDebugger/DebugForm.resx trunk/plugins/FritzBox/Tools/FritzBoxDebugger/FritzBoxDebugger.csproj 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.exe trunk/plugins/FritzBox/Tools/FritzBoxDebugger/obj/Debug/FritzBoxDebugger.pdb 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/bin/Debug Configuration/ trunk/plugins/FritzBox/FritzBox/bin/Debug Configuration/AxInterop.WMPLib.dll trunk/plugins/FritzBox/FritzBox/bin/Debug Configuration/Bass.Net.dll trunk/plugins/FritzBox/FritzBox/bin/Debug Configuration/BassRegistration.dll trunk/plugins/FritzBox/FritzBox/bin/Debug Configuration/BassVisAPI.Net.dll trunk/plugins/FritzBox/FritzBox/bin/Debug Configuration/Common.Utils.dll trunk/plugins/FritzBox/FritzBox/bin/Debug Configuration/Core.dll trunk/plugins/FritzBox/FritzBox/bin/Debug Configuration/Dialogs.dll trunk/plugins/FritzBox/FritzBox/bin/Debug Configuration/DirectShowLib.dll trunk/plugins/FritzBox/FritzBox/bin/Debug Configuration/FritzBox.dll trunk/plugins/FritzBox/FritzBox/bin/Debug Configuration/FritzBox.pdb trunk/plugins/FritzBox/FritzBox/bin/Debug Configuration/Interop.SHDocVw.dll trunk/plugins/FritzBox/FritzBox/bin/Debug Configuration/Interop.WMPLib.dll trunk/plugins/FritzBox/FritzBox/bin/Debug Configuration/Ionic.Zip.dll trunk/plugins/FritzBox/FritzBox/bin/Debug Configuration/MediaPortal.Support.dll trunk/plugins/FritzBox/FritzBox/bin/Debug Configuration/Utils.dll trunk/plugins/FritzBox/FritzBox/bin/Debug Configuration/edtftpnet-1.2.2.dll trunk/plugins/FritzBox/FritzBox/bin/Debug Configuration/log4net.dll trunk/plugins/FritzBox/FritzBox/bin/Debug Configuration/taglib-sharp.dll trunk/plugins/FritzBox/FritzBox/obj/Debug Configuration/ trunk/plugins/FritzBox/FritzBox/obj/Debug Configuration/DesignTimeResolveAssemblyReferencesInput.cache trunk/plugins/FritzBox/FritzBox/obj/Debug Configuration/FritzBox.EditPhoneBook.resources trunk/plugins/FritzBox/FritzBox/obj/Debug Configuration/FritzBox.FritzBoxConfig.resources trunk/plugins/FritzBox/FritzBox/obj/Debug Configuration/FritzBox.Properties.Resources.resources trunk/plugins/FritzBox/FritzBox/obj/Debug Configuration/FritzBox.csproj.FileListAbsolute.txt trunk/plugins/FritzBox/FritzBox/obj/Debug Configuration/FritzBox.dll trunk/plugins/FritzBox/FritzBox/obj/Debug Configuration/FritzBox.pdb trunk/plugins/FritzBox/FritzBox/obj/Debug Configuration/GenerateResource-ResGen.read.1.tlog trunk/plugins/FritzBox/FritzBox/obj/Debug Configuration/GenerateResource-ResGen.read.4.tlog trunk/plugins/FritzBox/FritzBox/obj/Debug Configuration/GenerateResource-ResGen.write.1.tlog trunk/plugins/FritzBox/FritzBox/obj/Debug Configuration/TempPE/ trunk/plugins/FritzBox/FritzBox/obj/Debug Configuration/TempPE/Properties.Resources.Designer.cs.dll trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Debug/FritzBoxConfigTester.vshost.exe trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Debug/FritzBoxConfigTester.vshost.exe.config trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Debug Configuration/ trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Debug Configuration/AxInterop.WMPLib.dll trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Debug Configuration/Bass.Net.dll trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Debug Configuration/BassRegistration.dll trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Debug Configuration/BassVisAPI.Net.dll trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Debug Configuration/Common.Utils.dll trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Debug Configuration/Core.dll trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Debug Configuration/Dialogs.dll trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Debug Configuration/DirectShowLib.dll trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Debug Configuration/FritzBox.dll trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Debug Configuration/FritzBox.pdb trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Debug Configuration/FritzBoxConfigTester.exe trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Debug Configuration/FritzBoxConfigTester.exe.config trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Debug Configuration/FritzBoxConfigTester.pdb trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Debug Configuration/FritzBoxConfigTester.vshost.exe trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Debug Configuration/FritzBoxConfigTester.vshost.exe.config trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Debug Configuration/FritzBoxConfigTester.vshost.exe.manifest trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Debug Configuration/Interop.SHDocVw.dll trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Debug Configuration/Interop.WMPLib.dll trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Debug Configuration/Ionic.Zip.dll trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Debug Configuration/MediaPortal.Support.dll trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Debug Configuration/Utils.dll trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Debug Configuration/edtftpnet-1.2.2.dll trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Debug Configuration/log4net.dll trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Debug Configuration/taglib-sharp.dll trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Release/FritzBoxConfigTester.vshost.exe trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Release/FritzBoxConfigTester.vshost.exe.config trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Release/FritzBoxConfigTester.vshost.exe.manifest trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/obj/Debug Configuration/ trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/obj/Debug Configuration/DesignTimeResolveAssemblyReferencesInput.cache trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/obj/Debug Configuration/FritzBoxConfigTester.csproj.FileListAbsolute.txt trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/obj/Debug Configuration/FritzBoxConfigTester.exe trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/obj/Debug Configuration/FritzBoxConfigTester.pdb trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/obj/Debug Configuration/ResolveAssemblyReference.cache trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/obj/Debug Configuration/TempPE/ trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Debug/FritzBoxDebugger.vshost.exe trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Debug/FritzBoxDebugger.vshost.exe.config trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Debug Configuration/ trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Debug Configuration/AxInterop.WMPLib.dll trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Debug Configuration/Bass.Net.dll trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Debug Configuration/BassRegistration.dll trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Debug Configuration/BassVisAPI.Net.dll trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Debug Configuration/Common.Utils.dll trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Debug Configuration/Core.dll trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Debug Configuration/Dialogs.dll trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Debug Configuration/DirectShowLib.dll trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Debug Configuration/FritzBox.dll trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Debug Configuration/FritzBox.pdb trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Debug Configuration/FritzBoxDebugger.exe trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Debug Configuration/FritzBoxDebugger.exe.config trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Debug Configuration/FritzBoxDebugger.pdb trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Debug Configuration/Interop.SHDocVw.dll trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Debug Configuration/Interop.WMPLib.dll trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Debug Configuration/Ionic.Zip.dll trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Debug Configuration/MediaPortal.Support.dll trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Debug Configuration/Utils.dll trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Debug Configuration/edtftpnet-1.2.2.dll trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Debug Configuration/log4net.dll trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Debug Configuration/taglib-sharp.dll trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Release/FritzBoxDebugger.vshost.exe trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Release/FritzBoxDebugger.vshost.exe.config trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Release/FritzBoxDebugger.vshost.exe.manifest trunk/plugins/FritzBox/Tools/FritzBoxDebugger/obj/Debug Configuration/ trunk/plugins/FritzBox/Tools/FritzBoxDebugger/obj/Debug Configuration/DesignTimeResolveAssemblyReferencesInput.cache trunk/plugins/FritzBox/Tools/FritzBoxDebugger/obj/Debug Configuration/FritzBoxDebugger.DebugForm.resources trunk/plugins/FritzBox/Tools/FritzBoxDebugger/obj/Debug Configuration/FritzBoxDebugger.csproj.FileListAbsolute.txt trunk/plugins/FritzBox/Tools/FritzBoxDebugger/obj/Debug Configuration/FritzBoxDebugger.exe trunk/plugins/FritzBox/Tools/FritzBoxDebugger/obj/Debug Configuration/FritzBoxDebugger.pdb trunk/plugins/FritzBox/Tools/FritzBoxDebugger/obj/Debug Configuration/GenerateResource.read.1.tlog trunk/plugins/FritzBox/Tools/FritzBoxDebugger/obj/Debug Configuration/GenerateResource.write.1.tlog trunk/plugins/FritzBox/Tools/FritzBoxDebugger/obj/Debug Configuration/TempPE/ trunk/plugins/FritzBox/releases/FritzBox_v0.4.1.4461.mpe1 Modified: trunk/plugins/FritzBox/Build/Build.log =================================================================== --- trunk/plugins/FritzBox/Build/Build.log 2012-02-19 22:31:59 UTC (rev 4461) +++ trunk/plugins/FritzBox/Build/Build.log 2012-02-26 15:26:52 UTC (rev 4462) @@ -1,6 +1,6 @@ Running : C:\Program Files\TortoiseSVN\bin\SubWCRev.exe -SVN Version: 4449 +SVN Version: 4461 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 11.02.2012 00:03:28. +Build started 26.02.2012 16:16:20. Project "D:\FritzBox\FritzBox.sln" on node 1 (Rebuild target(s)). ValidateSolutionConfiguration: Building solution configuration "Release|Mixed Platforms". @@ -106,8 +106,8 @@ Copying file from "C:\Program Files\Team MediaPortal\MediaPortal\Core.dll" to ".\bin\Release\Core.dll". Copying file from "D:\FritzBox\FritzBox\bin\Release\FritzBox.dll" to ".\bin\Release\FritzBox.dll". Copying file from "D:\FritzBox\FritzBox\bin\Release\Utils.dll" to ".\bin\Release\Utils.dll". - Copying file from "D:\FritzBox\FritzBox\bin\Release\Common.Utils.dll" to ".\bin\Release\Common.Utils.dll". Copying file from "D:\FritzBox\FritzBox\bin\Release\Dialogs.dll" to ".\bin\Release\Dialogs.dll". + Copying file from "D:\FritzBox\FritzBox\bin\Release\Common.Utils.dll" to ".\bin\Release\Common.Utils.dll". Copying file from "C:\Program Files\Team MediaPortal\MediaPortal\Bass.Net.dll" to ".\bin\Release\Bass.Net.dll". Copying file from "C:\Program Files\Team MediaPortal\MediaPortal\DirectShowLib.dll" to ".\bin\Release\DirectShowLib.dll". Copying file from "C:\Program Files\Team MediaPortal\MediaPortal\BassVisAPI.Net.dll" to ".\bin\Release\BassVisAPI.Net.dll". @@ -156,8 +156,6 @@ 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.read.7.tlog". - Deleting file "D:\FritzBox\Tools\FritzBoxDebugger\obj\Release\GenerateResource.write.7.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". @@ -169,8 +167,8 @@ Copying file from "C:\Program Files\Team MediaPortal\MediaPortal\Core.dll" to ".\bin\Release\Core.dll". Copying file from "D:\FritzBox\FritzBox\bin\Release\FritzBox.dll" to ".\bin\Release\FritzBox.dll". Copying file from "D:\FritzBox\FritzBox\bin\Release\Utils.dll" to ".\bin\Release\Utils.dll". - Copying file from "D:\FritzBox\FritzBox\bin\Release\Common.Utils.dll" to ".\bin\Release\Common.Utils.dll". Copying file from "D:\FritzBox\FritzBox\bin\Release\Dialogs.dll" to ".\bin\Release\Dialogs.dll". + Copying file from "D:\FritzBox\FritzBox\bin\Release\Common.Utils.dll" to ".\bin\Release\Common.Utils.dll". Copying file from "C:\Program Files\Team MediaPortal\MediaPortal\Bass.Net.dll" to ".\bin\Release\Bass.Net.dll". Copying file from "C:\Program Files\Team MediaPortal\MediaPortal\DirectShowLib.dll" to ".\bin\Release\DirectShowLib.dll". Copying file from "C:\Program Files\Team MediaPortal\MediaPortal\BassVisAPI.Net.dll" to ".\bin\Release\BassVisAPI.Net.dll". @@ -197,7 +195,7 @@ 0 Warning(s) 0 Error(s) -Time Elapsed 00:00:02.04 +Time Elapsed 00:00:01.89 Reverting to build 0 Updating: D:\FritzBox\FritzBox\Properties\AssemblyInfo.cs Updating: D:\FritzBox\MP2version\Listeners\FritzBox\Properties\AssemblyInfo.cs @@ -300,7 +298,7 @@ ..\FritzBox\Languages\Unsupported\strings_zh-CN.xml 36 File(s) copied MpeMaker version: 1.2.1.0 -Build started at 00:03:32 +Build started at 16:16:25 Building "D:\FritzBox\MpeRelease\FritzBox.xmp2" Output: "..\MpeRelease\FritzBox.mpe1" Writing UpdateXML to "update.xml" Modified: trunk/plugins/FritzBox/Docs/Ausstehend.txt =================================================================== --- trunk/plugins/FritzBox/Docs/Ausstehend.txt 2012-02-19 22:31:59 UTC (rev 4461) +++ trunk/plugins/FritzBox/Docs/Ausstehend.txt 2012-02-26 15:26:52 UTC (rev 4462) @@ -1,24 +1,14 @@ -Fehler beheben: -- Problem bei schnell aufeinander folgenden Anrufen - -Optimierungen: -- Einstellungen-Eintr\xE4ge in XML-Datei in Kategorie "FRITZ!Box Manager" zusammenfassen - Neue Funktionen/Erweiterungen: -- Tastenk\xFCrzel-Unterst\xFCtzung f\xFCr Telefonbuch -- Telefonbuch editierbar machen (f\xFCr FRITZ!Box-Versionen ohne Telefonbuch), ImageURL-Feld hinzuf\xFCgen und nur synchronisieren, wenn im FRITZ!Box-Telefonbuch vorhanden +- 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 -- "Anrufen"-Funktion zur Anrufliste hinzuf\xFCgen - R\xFCckw\xE4rtssuche wieder integrieren - Wiki-Eintrag - Skin-Erweiterungen - Anzahl der neuen Anrufe - geplante \xC4nderungen ver\xF6ffentlichen -- wenn m\xF6glich GUI-Telefonbuch (und edit Phonebook) nach Kontakt gruppieren -- Bei Anrufbenachrichtigungen: Auflistung von Kontaktnamen wenn eine Rufnummer mehrmals im Telefonbuch vorkommt -- Verbindungstest um Login, Anruflisten- und Telefonbuch-Download erweitern - Klingelton solange wiederholen bis H\xF6rer abgenommen wird @@ -40,7 +30,7 @@ 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: +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. @@ -66,4 +56,10 @@ 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. \ No newline at end of file +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-02-19 22:31:59 UTC (rev 4461) +++ trunk/plugins/FritzBox/Docs/Changes.txt 2012-02-26 15:26:52 UTC (rev 4462) @@ -1,5 +1,16 @@ -New release 0.4.1.44x: -Optimization: +New release 0.4.1.4461: +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 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-02-19 22:31:59 UTC (rev 4461) +++ trunk/plugins/FritzBox/FritzBox/EditPhoneBook.Designer.cs 2012-02-26 15:26:52 UTC (rev 4462) @@ -40,6 +40,7 @@ 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.pictureBoxCaller = new System.Windows.Forms.PictureBox(); this.label1 = new System.Windows.Forms.Label(); ((System.ComponentModel.ISupportInitialize)(this.dataGridView)).BeginInit(); @@ -70,7 +71,8 @@ this.columnPhoneType, this.columnPhoneNumber, this.columnShowCallNotification, - this.columnRingTonePath}); + 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))); @@ -151,6 +153,14 @@ this.columnRingTonePath.Name = "columnRingTonePath"; this.columnRingTonePath.Width = 225; // + // ColumnContactImage + // + this.ColumnContactImage.HeaderText = "Contact image path"; + this.ColumnContactImage.MinimumWidth = 150; + this.ColumnContactImage.Name = "ColumnContactImage"; + this.ColumnContactImage.Visible = false; + this.ColumnContactImage.Width = 225; + // // pictureBoxCaller // this.pictureBoxCaller.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); @@ -193,12 +203,13 @@ private System.Windows.Forms.PictureBox pictureBoxCaller; private System.Windows.Forms.DataGridView dataGridView; + private System.Windows.Forms.Label label1; 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.Label label1; + private System.Windows.Forms.DataGridViewTextBoxColumn ColumnContactImage; } } \ No newline at end of file Modified: trunk/plugins/FritzBox/FritzBox/EditPhoneBook.cs =================================================================== --- trunk/plugins/FritzBox/FritzBox/EditPhoneBook.cs 2012-02-19 22:31:59 UTC (rev 4461) +++ trunk/plugins/FritzBox/FritzBox/EditPhoneBook.cs 2012-02-26 15:26:52 UTC (rev 4462) @@ -21,7 +21,7 @@ private void fillTable() { - string uniqueID, name, type = String.Empty, number = String.Empty, ringTonePath; + string uniqueID, name, type = String.Empty, number = String.Empty, ringTonePath, imageURL; bool showCallNotification; phoneBook.LoadPhoneBookFromXMLFile(); @@ -32,6 +32,7 @@ name = phoneBookItem.Name; showCallNotification = phoneBookItem.ShowCallNotification; ringTonePath = phoneBookItem.RingTonePath; + imageURL = phoneBookItem.ImageURL; foreach (PhoneNumber phoneNumber in phoneBookItem.PhoneNumbers) { @@ -40,7 +41,7 @@ type = phoneNumber.type; number = phoneNumber.Value; - dataGridView.Rows.Add(uniqueID, name, type, number, showCallNotification, ringTonePath); + dataGridView.Rows.Add(uniqueID, name, type, number, showCallNotification, ringTonePath, imageURL); } } } @@ -50,6 +51,8 @@ private void EditPhoneBook_Load(object sender, EventArgs e) { + dataGridView.Columns[6].Visible = Settings.ManualContactImagePathEntry; + fillTable(); if (dataGridView.Rows.Count > 0) @@ -58,7 +61,7 @@ dataGridView_SelectionChanged(null, null); // monitor table changes - this.dataGridView.SelectionChanged += new System.EventHandler(this.dataGridView_SelectionChanged); + dataGridView.SelectionChanged += new EventHandler(dataGridView_SelectionChanged); dataGridView.CellValueChanged += new DataGridViewCellEventHandler(dataGridView_CellValueChanged); } else @@ -76,7 +79,7 @@ string contactPicturePath = phoneBook.GetContactImagePath(contact); // show picture - if (contactPicturePath != String.Empty) pictureBoxCaller.ImageLocation = contactPicturePath; + pictureBoxCaller.ImageLocation = contactPicturePath; } private void dataGridView_CellValueChanged(object sender, DataGridViewCellEventArgs e) @@ -108,6 +111,16 @@ } break; + case 6: + contact.ImageURL = (string)newValue; + + // 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 @@ -121,7 +134,7 @@ phoneBook.SavePhoneBookToXMLFile(); // unregister event monitors - this.dataGridView.SelectionChanged -= new System.EventHandler(this.dataGridView_SelectionChanged); + dataGridView.SelectionChanged -= new EventHandler(dataGridView_SelectionChanged); dataGridView.CellValueChanged -= new DataGridViewCellEventHandler(dataGridView_CellValueChanged); } } Modified: trunk/plugins/FritzBox/FritzBox/EditPhoneBook.resx =================================================================== --- trunk/plugins/FritzBox/FritzBox/EditPhoneBook.resx 2012-02-19 22:31:59 UTC (rev 4461) +++ trunk/plugins/FritzBox/FritzBox/EditPhoneBook.resx 2012-02-26 15:26:52 UTC (rev 4462) @@ -135,4 +135,7 @@ <metadata name="columnRingTonePath.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>True</value> </metadata> + <metadata name="ColumnContactImage.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>True</value> + </metadata> </root> \ No newline at end of file Modified: trunk/plugins/FritzBox/FritzBox/FritzBox.cs =================================================================== --- trunk/plugins/FritzBox/FritzBox/FritzBox.cs 2012-02-19 22:31:59 UTC (rev 4461) +++ trunk/plugins/FritzBox/FritzBox/FritzBox.cs 2012-02-26 15:26:52 UTC (rev 4462) @@ -65,8 +65,9 @@ private readonly List<CallAction> _actionList = new List<CallAction>(); private readonly List<CallAction> _notificationQueue = new List<CallAction>(); private bool _showNotification = true; - private object _tempNotification; + private GUIDialogNotify _tempNotification; private int notificationCount = 0; + private CallAction.CallType lastCallActionType; // necessary to avoid that notification window isn't closed on quick sequent call actions #endregion Variables @@ -81,14 +82,15 @@ private void OnStopExternal(Process proc, bool waitForExit) { _showNotification = true; - _notificationQueue.Clear(); } private void OnCallAction(CallAction callAction) { + lastCallActionType = callAction.Type; + Log.Debug("OnCallAction()"); - + callAction.WriteToLog(); if (!_showNotification) @@ -107,22 +109,21 @@ OnCall(callAction); break; case CallAction.CallType.ConnectionStarted: + if (!isExtensionEnabled(callAction.Extension)) + { + Log.Info("Extension isn't enabled for notification. If notification window is opened it will be closed"); + closeNotificationWindow(); + } break; case CallAction.CallType.ConnectionClosed: if (Settings.CloseNotificationOnConnectionClosed) { - Log.Info("\"Auto-close after connection is closed\" setting is enabled. Trying to close active notification"); - - if (_tempNotification != null) - { - MediaPortal.GUI.Library.Action act = new MediaPortal.GUI.Library.Action(); - act.wID = MediaPortal.GUI.Library.Action.ActionType.ACTION_CLOSE_DIALOG; - GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_NOTIFY).OnAction(act); - } + Log.Info("\"Auto-close after connection is closed\" setting is enabled"); + closeNotificationWindow(); } break; default: - Log.Error("Incorrect CallAction type"); + Log.Error("Incorrect call type"); break; } } @@ -198,10 +199,10 @@ switch (callAction.Type) { case CallAction.CallType.Incoming: - showNotification = Settings.ShowNotficationOnIncomingCall; + showNotification = Settings.ShowNotificationOnIncomingCall; break; case CallAction.CallType.Outgoing: - showNotification = Settings.ShowNotficationOnOutgoingCall; + showNotification = Settings.ShowNotificationOnOutgoingCall && isExtensionEnabled(callAction.Extension); break; } @@ -263,11 +264,6 @@ showNotificationWindow(callAction.Type, strHeading, strImage, strText); } } - - // update call list and voice box items and refresh GUI - worker.EnqueueTask(new Task(Task.TaskAction.LoadCallListItems, null)); - worker.EnqueueTask(new Task(Task.TaskAction.LoadVoiceBoxItems, null)); - worker.EnqueueTask(new Task(Task.TaskAction.RefreshView, null)); } } @@ -277,7 +273,7 @@ private bool isMSNEnabled(string mSN) { - if (!Settings.FilterMSN) + if (!Settings.FilterMSNs) { Log.Info("MSN filter is disabled"); return true; @@ -305,6 +301,36 @@ } } + private bool isExtensionEnabled(string extension) + { + if (!Settings.FilterExtensions) + { + Log.Info("Extension filter is disabled"); + return true; + } + else + { + if (extension != String.Empty) + { + if (Settings.ExtensionList.Contains(extension)) + { + Log.Info("Extension is on the filter list"); + return true; + } + else + { + Log.Info("Extension is not on the list. Notification will be automatically closed"); + return false; + } + } + else + { + Log.Info("Missing extension. Filtering is disabled"); + return true; + } + } + } + private void showNotificationWindow(CallAction.CallType callType, string strHeading, string strImage, string strText) { bool resumePlayer = false; @@ -348,8 +374,13 @@ else dlgNotification.TimeOut = -1; _tempNotification = dlgNotification; - dlgNotification.DoModal(GUIWindowManager.ActiveWindow); + if (lastCallActionType != CallAction.CallType.ConnectionClosed) // this check avoids that the notification window isn't closed on quick sequent call actions (e. g. incoming FAX messages) + { + Log.Debug("Showing notification window"); + dlgNotification.DoModal(GUIWindowManager.ActiveWindow); + } + // resume player if (resumePlayer && g_Player.Playing && g_Player.Paused) { @@ -378,7 +409,7 @@ private bool isMovingPicturesOrMPTVSeriesDialogOpened() { - if (GUIWindowManager.IsRouted) // check if dialog window is opened + if (GUIWindowManager.IsRouted) { if (GUIWindowManager.ActiveWindow == 96742 || GUIWindowManager.ActiveWindow == 9811) // 96742 = window ID of "Moving Pictures", 9811 = window ID of "MP-TV Series" { @@ -389,6 +420,42 @@ return false; } + private bool isNotificationWindowOpened() + { + if (GUIWindowManager.IsRouted) + { + if (GUIWindowManager.ActiveWindowEx == (int)GUIWindow.Window.WINDOW_DIALOG_NOTIFY) return true; + } + + return false; + } + + private void closeNotificationWindow() + { + if (_tempNotification != null && isNotificationWindowOpened()) + { + Log.Debug("Closing notification window"); + + MediaPortal.GUI.Library.Action act = new MediaPortal.GUI.Library.Action(); + act.wID = MediaPortal.GUI.Library.Action.ActionType.ACTION_CLOSE_DIALOG; + + _tempNotification.OnAction(act); + + if (!isNotificationWindowOpened()) Log.Debug("Notification window has been closed"); + else + { + Log.Debug("Notification couldn't be closed yet. Trying to close it again in one second"); + + // set session timer interval and start the timer + notificationWindowCloseTimer.Interval = 1000; + notificationWindowCloseTimer.AutoReset = false; + notificationWindowCloseTimer.Elapsed += OnCloseNotificationWindowTimerEvent; + notificationWindowCloseTimer.Start(); + } + } + else Log.Debug("Notification window wasn't opened"); + } + #endregion Helper Methods #endregion CallMonitor @@ -403,7 +470,7 @@ public void Start() { Log.Info("FRITZ!Box Manager {0} plugin is starting", Assembly.GetExecutingAssembly().GetName().Version); - + thePlugin = this; LocalizeStrings.LoadLocalization(); @@ -439,7 +506,7 @@ if (updateInterval != 0) { - updateTimer.Interval = updateInterval * 1000; // interval is in sec + updateTimer.Interval = updateInterval * 1000; // interval is in seconds updateTimer.Elapsed += OnUpdateTimerEvent; updateTimer.Start(); } @@ -460,7 +527,7 @@ FritzBoxClient.CallEvent -= OnCallAction; FritzBoxClient.LogEvent -= OnLogAction; - FritzBoxClient.ConnectedEvent += OnConnectedAction; + FritzBoxClient.ConnectedEvent -= OnConnectedAction; Utils.OnStartExternal -= OnStartExternal; Utils.OnStopExternal -= OnStopExternal; @@ -588,6 +655,8 @@ private static System.Timers.Timer updateTimer = new System.Timers.Timer(); // session timer for login thread private static System.Timers.Timer sessionTimer = new System.Timers.Timer(); + // timer to close remaining notification windows + private static System.Timers.Timer notificationWindowCloseTimer = new System.Timers.Timer(); // list of call items (callers) private List<CallItem> callItemList; // state of facade view @@ -732,6 +801,11 @@ loadDataInBackground(); } + private static void OnCloseNotificationWindowTimerEvent(object source, System.Timers.ElapsedEventArgs e) + { + thePlugin.closeNotificationWindow(); + } + protected override void OnPageDestroy(int new_windowId) { CleanupTempFiles(); @@ -797,7 +871,7 @@ worker.EnqueueTask(new Task(Task.TaskAction.RefreshView, null)); } } - else Log.Debug("No voice box items on the FRITZ!Box"); + else Log.Debug("No voice box item list changes"); } } else Log.Debug("No connection to FRITZ!Box. Voice box items couldn't be loaded"); @@ -896,7 +970,7 @@ worker.EnqueueTask(new Task(Task.TaskAction.RefreshView, null)); } } - else Log.Debug("No voice box items on the FRITZ!Box"); + else Log.Debug("No call list changes"); } } @@ -1034,7 +1108,7 @@ } } - public void updateGUIProperties() + public void UpdateGUIProperties() { Caller caller = new Caller(); string lastNewCallerName = String.Empty; @@ -1154,7 +1228,7 @@ facadeView.Add(elem); } } - else Log.Debug("call item list is not initialized"); + else Log.Debug("Call item list is not initialized"); } private void showThumbPanel() Modified: trunk/plugins/FritzBox/FritzBox/FritzBox.csproj =================================================================== --- trunk/plugins/FritzBox/FritzBox/FritzBox.csproj 2012-02-19 22:31:59 UTC (rev 4461) +++ trunk/plugins/FritzBox/FritzBox/FritzBox.csproj 2012-02-26 15:26:52 UTC (rev 4462) @@ -69,6 +69,17 @@ <PlatformTarget>AnyCPU</PlatformTarget> <FileAlignment>4096</FileAlignment> </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug Configuration|AnyCPU'"> + <DebugSymbols>true</DebugSymbols> + <OutputPath>C:\Program Files\Team MediaPortal\MediaPortal\plugins\Windows\</OutputPath> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <FileAlignment>4096</FileAlignment> + <DebugType>Full</DebugType> + <PlatformTarget>AnyCPU</PlatformTarget> + <ErrorReport>prompt</ErrorReport> + <CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules> + <CodeAnalysisFailOnMissingRules>false</CodeAnalysisFailOnMissingRules> + </PropertyGroup> <ItemGroup> <Reference Include="Common.Utils"> <HintPath>C:\Program Files\Team MediaPortal\MediaPortal\Common.Utils.dll</HintPath> Modified: trunk/plugins/FritzBox/FritzBox/FritzBox.csproj.user =================================================================== --- trunk/plugins/FritzBox/FritzBox/FritzBox.csproj.user 2012-02-19 22:31:59 UTC (rev 4461) +++ trunk/plugins/FritzBox/FritzBox/FritzBox.csproj.user 2012-02-26 15:26:52 UTC (rev 4462) @@ -14,4 +14,12 @@ <StartProgram>C:\Program Files\Team MediaPortal\MediaPortal\MediaPortal.exe</StartProgram> <EnableUnmanagedDebugging>false</EnableUnmanagedDebugging> </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug Configuration|AnyCPU'"> + <StartProgram>C:\Program Files\Team MediaPortal\MediaPortal\Configuration.exe</StartProgram> + <StartAction>Project</StartAction> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'"> + <StartAction>Program</StartAction> + <StartProgram>C:\Program Files\Team MediaPortal\MediaPortal\MediaPortal.exe</StartProgram> + </PropertyGroup> </Project> \ No newline at end of file Modified: trunk/plugins/FritzBox/FritzBox/FritzBoxConfig.Designer.cs =================================================================== --- trunk/plugins/FritzBox/FritzBox/FritzBoxConfig.Designer.cs 2012-02-19 22:31:59 UTC (rev 4461) +++ trunk/plugins/FritzBox/FritzBox/FritzBoxConfig.Designer.cs 2012-02-26 15:26:52 UTC (rev 4462) @@ -40,6 +40,14 @@ this.buttonEditPhoneBook = new System.Windows.Forms.Button(); this.tabPageCallNotification = new System.Windows.Forms.TabPage(); this.groupBoxNotification = new MediaPortal.UserInterface.Controls.MPGroupBox(); + this.buttonExtensionsRemove = new MediaPortal.UserInterface.Controls.MPButton(); + this.checkBoxFilterExtensions = new MediaPortal.UserInterface.Controls.MPCheckBox(); + this.buttonExtensionsAdd = new MediaPortal.UserInterface.Controls.MPButton(); + this.comboBoxExtensions = new MediaPortal.UserInterface.Controls.MPComboBox(); + this.checkBoxShowPhoneTypeOnNotification = new MediaPortal.UserInterface.Controls.MPCheckBox(); + this.checkBoxShowUnknownCaller = new MediaPortal.UserInterface.Controls.MPCheckBox(); + this.checkBoxUsePhonebook = new MediaPortal.UserInterface.Controls.MPCheckBox(); + this.checkBoxShowPhoneNumberOnNotification = new MediaPortal.UserInterface.Controls.MPCheckBox(); this.checkBoxShowNotificationOnOutgoingCall = new MediaPortal.UserInterface.Controls.MPCheckBox(); this.checkBoxCloseOnConnectionClosed = new MediaPortal.UserInterface.Controls.MPCheckBox(); this.checkBoxShowNotificationOnIncomingCall = new MediaPortal.UserInterface.Controls.MPCheckBox(); @@ -77,10 +85,7 @@ this.updateInterval = new MediaPortal.UserInterface.Controls.MPNumericUpDown(); this.checkBoxExtensiveLogging = new MediaPortal.UserInterface.Controls.MPCheckBox(); this.label4 = new System.Windows.Forms.Label(); - this.checkBoxShowPhoneTypeOnNotification = new MediaPortal.UserInterface.Controls.MPCheckBox(); - this.checkBoxShowUnknownCaller = new MediaPortal.UserInterface.Controls.MPCheckBox(); - this.checkBoxUsePhonebook = new MediaPortal.UserInterface.Controls.MPCheckBox(); - this.checkBoxShowPhoneNumberOnNotification = new MediaPortal.UserInterface.Controls.MPCheckBox(); + this.checkBoxManualContactImagePathEntry = new System.Windows.Forms.CheckBox(); this.tabPageDiagnostics.SuspendLayout(); this.tabPagePhoneBook.SuspendLayout(); this.tabPageCallNotification.SuspendLayout(); @@ -178,6 +183,7 @@ // // tabPagePhoneBook // + this.tabPagePhoneBook.Controls.Add(this.checkBoxManualContactImagePathEntry); this.tabPagePhoneBook.Controls.Add(this.buttonEditPhoneBook); this.tabPagePhoneBook.Location = new System.Drawing.Point(4, 22); this.tabPagePhoneBook.Name = "tabPagePhoneBook"; @@ -189,7 +195,7 @@ // // buttonEditPhoneBook // - this.buttonEditPhoneBook.Location = new System.Drawing.Point(228, 64); + this.buttonEditPhoneBook.Location = new System.Drawing.Point(221, 83); this.buttonEditPhoneBook.Name = "buttonEditPhoneBook"; this.buttonEditPhoneBook.Size = new System.Drawing.Size(117, 46); this.buttonEditPhoneBook.TabIndex = 0; @@ -213,6 +219,10 @@ // this.groupBoxNotification.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); + this.groupBoxNotification.Controls.Add(this.buttonExtensionsRemove); + this.groupBoxNotification.Controls.Add(this.checkBoxFilterExtensions); + this.groupBoxNotification.Controls.Add(this.buttonExtensionsAdd); + this.groupBoxNotification.Controls.Add(this.comboBoxExtensions); this.groupBoxNotification.Controls.Add(this.checkBoxShowPhoneTypeOnNotification); this.groupBoxNotification.Controls.Add(this.checkBoxShowUnknownCaller); this.groupBoxNotification.Controls.Add(this.checkBoxUsePhonebook); @@ -231,27 +241,119 @@ this.groupBoxNotification.FlatStyle = System.Windows.Forms.FlatStyle.Popup; this.groupBoxNotification.Location = new System.Drawing.Point(6, 6); this.groupBoxNotification.Name = "groupBoxNotification"; - this.groupBoxNotification.Size = new System.Drawing.Size(561, 159); + this.groupBoxNotification.Size = new System.Drawing.Size(559, 242); this.groupBoxNotification.TabIndex = 0; this.groupBoxNotification.TabStop = false; this.groupBoxNotification.Text = "Notification settings"; // + // buttonExtensionsRemove + // + this.buttonExtensionsRemove.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.buttonExtensionsRemove.Location = new System.Drawing.Point(335, 209); + this.buttonExtensionsRemove.Name = "buttonExtensionsRemove"; + this.buttonExtensionsRemove.Size = new System.Drawing.Size(63, 21); + this.buttonExtensionsRemove.TabIndex = 22; + this.buttonExtensionsRemove.Text = "Remove"; + this.buttonExtensionsRemove.UseVisualStyleBackColor = true; + this.buttonExtensionsRemove.Click += new System.EventHandler(this.buttonExtensionsRemove_Click); + // + // checkBoxFilterExtensions + // + this.checkBoxFilterExtensions.AutoSize = true; + this.checkBoxFilterExtensions.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.checkBoxFilterExtensions.Location = new System.Drawing.Point(253, 161); + this.checkBoxFilterExtensions.Name = "checkBoxFilterExtensions"; + this.checkBoxFilterExtensions.Size = new System.Drawing.Size(305, 17); + this.checkBoxFilterExtensions.TabIndex = 19; + this.checkBoxFilterExtensions.Text = "Show outgoing call notification only for following extensions:"; + this.checkBoxFilterExtensions.UseVisualStyleBackColor = true; + this.checkBoxFilterExtensions.CheckedChanged += new System.EventHandler(this.checkBoxFilterExtensions_CheckedChanged); + // + // buttonExtensionsAdd + // + this.buttonExtensionsAdd.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.buttonExtensionsAdd.Location = new System.Drawing.Point(251, 209); + this.buttonExtensionsAdd.Name = "buttonExtensionsAdd"; + this.buttonExtensionsAdd.Size = new System.Drawing.Size(63, 21); + this.buttonExtensionsAdd.TabIndex = 21; + this.buttonExtensionsAdd.Text = "Add"; + this.buttonExtensionsAdd.UseVisualStyleBackColor = true; + this.buttonExtensionsAdd.Click += new System.EventHandler(this.buttonExtensionsAdd_Click); + // + // comboBoxExtensions + // + this.comboBoxExtensions.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.comboBoxExtensions.BorderColor = System.Drawing.Color.Empty; + this.comboBoxExtensions.FormattingEnabled = true; + this.comboBoxExtensions.Location = new System.Drawing.Point(253, 180); + this.comboBoxExtensions.MaxLength = 2; + this.comboBoxExtensions.Name = "comboBoxExtensions"; + this.comboBoxExtensions.Size = new System.Drawing.Size(51, 21); + this.comboBoxExtensions.Sorted = true; + this.comboBoxExtensions.TabIndex = 20; + // + // checkBoxShowPhoneTypeOnNotification + // + this.checkBoxShowPhoneTypeOnNotification.AutoSize = true; + this.checkBoxShowPhoneTypeOnNotification.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.checkBoxShowPhoneTypeOnNotification.Location = new System.Drawing.Point(215, 136); + this.checkBoxShowPhoneTypeOnNotification.Name = "checkBoxShowPhoneTypeOnNotification"; + this.checkBoxShowPhoneTypeOnNotification.Size = new System.Drawing.Size(107, 17); + this.checkBoxShowPhoneTypeOnNotification.TabIndex = 18; + this.checkBoxShowPhoneTypeOnNotification.Text = "Show phone type"; + this.checkBoxShowPhoneTypeOnNotification.UseVisualStyleBackColor = true; + // + // checkBoxShowUnknownCaller + // + this.checkBoxShowUnknownCaller.AutoSize = true; + this.checkBoxShowUnknownCaller.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.checkBoxShowUnknownCaller.Location = new System.Drawing.Point(32, 136); + this.checkBoxShowUnknownCaller.Name = "checkBoxShowUnknownCaller"; + this.checkBoxShowUnknownCaller.Size = new System.Drawing.Size(126, 17); + this.checkBoxShowUnknownCaller.TabIndex = 16; + 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(15, 115); + this.checkBoxUsePhonebook.Name = "checkBoxUsePhonebook"; + this.checkBoxUsePhonebook.Size = new System.Drawing.Size(103, 17); + this.checkBoxUsePhonebook.TabIndex = 15; + this.checkBoxUsePhonebook.Text = "Use phone book"; + this.checkBoxUsePhonebook.UseVisualStyleBackColor = true; + this.checkBoxUsePhonebook.CheckedChanged += new System.EventHandler(this.checkBoxUsePhonebook_CheckedChanged); + // + // checkBoxShowPhoneNumberOnNotification + // + this.checkBoxShowPhoneNumberOnNotification.AutoSize = true; + this.checkBoxShowPhoneNumberOnNotification.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.checkBoxShowPhoneNumberOnNotification.Location = new System.Drawing.Point(368, 136); + this.checkBoxShowPhoneNumberOnNotification.Name = "checkBoxShowPhoneNumberOnNotification"; + this.checkBoxShowPhoneNumberOnNotification.Size = new System.Drawing.Size(122, 17); + this.checkBoxShowPhoneNumberOnNotification.TabIndex = 17; + this.checkBoxShowPhoneNumberOnNotification.Text = "Show phone number"; + this.checkBoxShowPhoneNumberOnNotification.UseVisualStyleBackColor = true; + // // checkBoxShowNotificationOnOutgoingCall // this.checkBoxShowNotificationOnOutgoingCall.AutoSize = true; this.checkBoxShowNotificationOnOutgoingCall.FlatStyle = System.Windows.Forms.FlatStyle.Popup; - this.checkBoxShowNotificationOnOutgoingCall.Location = new System.Drawing.Point(207, 20); + this.checkBoxShowNotificationOnOutgoingCall.Location = new System.Drawing.Point(215, 20); this.checkBoxShowNotificationOnOutgoingCall.Name = "checkBoxShowNotificationOnOutgoingCall"; - this.checkBoxShowNotificationOnOutgoingCall.Size = new System.Drawing.Size(183, 17); + this.checkBoxShowNotificationOnOutgoingCall.Size = new System.Drawing.Size(129, 17); this.checkBoxShowNotificationOnOutgoingCall.TabIndex = 13; - this.checkBoxShowNotificationOnOutgoingCall.Text = "Show notification on outgoing call"; + this.checkBoxShowNotificationOnOutgoingCall.Text = "Show on outgoing call"; this.checkBoxShowNotificationOnOutgoingCall.UseVisualStyleBackColor = true; // // checkBoxCloseOnConnectionClosed // this.checkBoxCloseOnConnectionClosed.AutoSize = true; this.checkBoxCloseOnConnectionClosed.FlatStyle = System.Windows.Forms.FlatStyle.Popup; - this.checkBoxCloseOnConnectionClosed.Location = new System.Drawing.Point(7, 70); + this.checkBoxCloseOnConnectionClosed.Location = new System.Drawing.Point(15, 70); this.checkBoxCloseOnConnectionClosed.Name = "checkBoxCloseOnConnectionClosed"; this.checkBoxCloseOnConnectionClosed.Size = new System.Drawing.Size(198, 17); this.checkBoxCloseOnConnectionClosed.TabIndex = 9; @@ -263,17 +365,17 @@ // this.checkBoxShowNotificationOnIncomingCall.AutoSize = true; this.checkBoxShowNotificationOnIncomingCall.FlatStyle = System.Windows.Forms.FlatStyle.Popup; - this.checkBoxShowNotificationOnIncomingCall.Location = new System.Drawing.Point(7, 20); + this.checkBoxShowNotificationOnIncomingCall.Location = new System.Drawing.Point(15, 20); this.checkBoxShowNotificationOnIncomingCall.Name = "checkBoxShowNotificationOnIncomingCall"; - this.checkBoxShowNotificationOnIncomingCall.Size = new System.Drawing.Size(184, 17); + this.checkBoxShowNotificationOnIncomingCall.Size = new System.Drawing.Size(130, 17); this.checkBoxShowNotificationOnIncomingCall.TabIndex = 12; - this.checkBoxShowNotificationOnIncomingCall.Text = "Show notification on incoming call"; + this.checkBoxShowNotificationOnIncomingCall.Text = "Show on incoming call"; this.checkBoxShowNotificationOnIncomingCall.UseVisualStyleBackColor = true; // // lblMaxNotifies // this.lblMaxNotifies.AutoSize = true; - this.lblMaxNotifies.Location = new System.Drawing.Point(22, 93); + this.lblMaxNotifies.Location = new System.Drawing.Point(30, 93); this.lblMaxNotifies.Name = "lblMaxNotifies"; this.lblMaxNotifies.Size = new System.Drawing.Size(90, 13); this.lblMaxNotifies.TabIndex = 8; @@ -281,7 +383,7 @@ // // numericUpDownMaxNotifies // - this.numericUpDownMaxNotifies.Location = new System.Drawing.Point(207, 89); + this.numericUpDownMaxNotifies.Location = new System.Drawing.Point(215, 89); this.numericUpDownMaxNotifies.Maximum = new decimal(new int[] { 20, 0, @@ -305,7 +407,7 @@ // 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(387, 91); + this.buttonMSNsRemove.Location = new System.Drawing.Point(97, 209); this.buttonMSNsRemove.Name = "buttonMSNsRemove"; this.buttonMSNsRemove.Size = new System.Drawing.Size(63, 21); this.buttonMSNsRemove.TabIndex = 5; @@ -317,18 +419,19 @@ // this.checkBoxFilterMSNs.AutoSize = true; this.checkBoxFilterMSNs.FlatStyle = System.Windows.Forms.FlatStyle.Popup; - this.checkBoxFilterMSNs.Location = new System.Drawing.Point(303, 43); + this.checkBoxFilterMSNs.... [truncated message content] |
From: <Ba...@us...> - 2012-02-19 22:32:06
|
Revision: 4461 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=4461&view=rev Author: BartEv Date: 2012-02-19 22:31:59 +0000 (Sun, 19 Feb 2012) Log Message: ----------- Modified Paths: -------------- trunk/plugins/VeraControl/releases/VeraControl.xmp2 Modified: trunk/plugins/VeraControl/releases/VeraControl.xmp2 =================================================================== --- trunk/plugins/VeraControl/releases/VeraControl.xmp2 2012-02-19 22:31:13 UTC (rev 4460) +++ trunk/plugins/VeraControl/releases/VeraControl.xmp2 2012-02-19 22:31:59 UTC (rev 4461) @@ -383,6 +383,62 @@ <ZipFileName>Installer{CopyFile}\{c37da331-8478-4be6-8eed-4fec1dea3fd8}-state_success.png</ZipFileName> <DestinationFilename>%Skin%\Default\media\Vera\state_success.png</DestinationFilename> </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\skin\Media\Vera\back.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{f79b3f6f-4c5a-4191-9bc7-4c1d9935e6cc}-back.png</ZipFileName> + <DestinationFilename>%Skin%\Default\media\Vera\back.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\skin\Media\Vera\Motion_Sensor_bypass.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{66a0c7b4-5521-4bed-af4c-faf90ca114f3}-Motion_Sensor_bypass.png</ZipFileName> + <DestinationFilename>%Skin%\Default\media\Vera\Motion_Sensor_bypass.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\skin\Media\Vera\room.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{ed4a1bf8-fc80-42c1-a2a0-f715278793e4}-room.png</ZipFileName> + <DestinationFilename>%Skin%\Default\media\Vera\room.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\skin\Media\Vera\Window_Covering_0.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{5f51e65a-0d4d-4139-bdc5-2d0e297bfe56}-Window_Covering_0.png</ZipFileName> + <DestinationFilename>%Skin%\Default\media\Vera\Window_Covering_0.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\skin\Media\Vera\Window_Covering_100.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{bf2c69e0-957d-4869-91b3-514ea6620153}-Window_Covering_100.png</ZipFileName> + <DestinationFilename>%Skin%\Default\media\Vera\Window_Covering_100.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\skin\Media\Vera\Window_Covering_25.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{9283be3f-62ae-42ae-b665-e6a506c2d0d6}-Window_Covering_25.png</ZipFileName> + <DestinationFilename>%Skin%\Default\media\Vera\Window_Covering_25.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\skin\Media\Vera\Window_Covering_50.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{ecef5e34-97c4-45c4-8026-3fab2413ae9b}-Window_Covering_50.png</ZipFileName> + <DestinationFilename>%Skin%\Default\media\Vera\Window_Covering_50.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\skin\Media\Vera\Window_Covering_75.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{f1ebac2f-1a07-4c79-9cba-0a5992f26af8}-Window_Covering_75.png</ZipFileName> + <DestinationFilename>%Skin%\Default\media\Vera\Window_Covering_75.png</DestinationFilename> + </FileItem> </Items> </Files> </GroupItem> @@ -693,6 +749,62 @@ <ZipFileName>Installer{CopyFile}\{c0a2ca25-4cb3-4bd9-9131-b8010f4cf64a}-state_success.png</ZipFileName> <DestinationFilename>%Skin%\DefaultWide\media\Vera\state_success.png</DestinationFilename> </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\skin\Media\Vera\back.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{4a54bf43-c3de-4025-8373-322282d6c185}-back.png</ZipFileName> + <DestinationFilename>%Skin%\DefaultWide\media\Vera\back.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\skin\Media\Vera\Motion_Sensor_bypass.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{61436e7e-33c7-43f5-aeab-cd4670566989}-Motion_Sensor_bypass.png</ZipFileName> + <DestinationFilename>%Skin%\DefaultWide\media\Vera\Motion_Sensor_bypass.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\skin\Media\Vera\room.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{1778af59-1402-4fdb-8728-b12ed4302e75}-room.png</ZipFileName> + <DestinationFilename>%Skin%\DefaultWide\media\Vera\room.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\skin\Media\Vera\Window_Covering_0.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{42428dee-0d2f-4b6e-a93b-86a14cf0fa7b}-Window_Covering_0.png</ZipFileName> + <DestinationFilename>%Skin%\DefaultWide\media\Vera\Window_Covering_0.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\skin\Media\Vera\Window_Covering_100.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{05ee0b05-dfc8-4f3b-9ac4-2f62680933f1}-Window_Covering_100.png</ZipFileName> + <DestinationFilename>%Skin%\DefaultWide\media\Vera\Window_Covering_100.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\skin\Media\Vera\Window_Covering_25.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{97f8c18c-2139-4910-b07a-12090b951d44}-Window_Covering_25.png</ZipFileName> + <DestinationFilename>%Skin%\DefaultWide\media\Vera\Window_Covering_25.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\skin\Media\Vera\Window_Covering_50.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{10df74bf-d706-43b1-bdf3-e2175f4bf5b1}-Window_Covering_50.png</ZipFileName> + <DestinationFilename>%Skin%\DefaultWide\media\Vera\Window_Covering_50.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\skin\Media\Vera\Window_Covering_75.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{bf7a8ca3-ee4b-4847-ac47-b6a1d1afe94d}-Window_Covering_75.png</ZipFileName> + <DestinationFilename>%Skin%\DefaultWide\media\Vera\Window_Covering_75.png</DestinationFilename> + </FileItem> </Items> </Files> </GroupItem> @@ -862,10 +974,10 @@ <ForumPage>http://forum.team-mediaportal.com/mediaportal-plugins-47/plugin-micasaverde-vera-controller-104337/</ForumPage> <UpdateUrl>https://mp-plugins.svn.sourceforge.net/svnroot/mp-plugins/trunk/plugins/VeraControl/releases/update.xml</UpdateUrl> <Version> - <Major>0</Major> - <Minor>9</Minor> - <Build>0</Build> - <Revision>3</Revision> + <Major>1</Major> + <Minor>0</Minor> + <Build>1</Build> + <Revision>0</Revision> </Version> <ExtensionDescription>Control your Vera controller from MediaPortal. @@ -879,15 +991,16 @@ - Vera 2 v1.1.1362 - Vera 2 v1.5.255 </ExtensionDescription> - <VersionDescription>- Added multi box support -- Added fallback to remote connectionType + <VersionDescription>- Added multi box support (parallel update/control) +- Added fallback to remote connection - Move scene trigger to side action menu - Added sort options - Added filter options -- Add vie by category option</VersionDescription> +- Added view by category option +- Added flow view</VersionDescription> <DevelopmentStatus>Stable</DevelopmentStatus> - <OnlineLocation>https://mp-plugins.svn.sourceforge.net/svnroot/mp-plugins/trunk/plugins/VeraControl/releases/VeraControl_v0.9.0.3.mpe1</OnlineLocation> - <ReleaseDate>2012-02-02T22:51:05</ReleaseDate> + <OnlineLocation>https://mp-plugins.svn.sourceforge.net/svnroot/mp-plugins/trunk/plugins/VeraControl/releases/VeraControl_v1.0.1.0.mpe1</OnlineLocation> + <ReleaseDate>2012-02-19T22:51:05</ReleaseDate> <Tags>home automation, z-wave, micasaverde, @@ -1277,6 +1390,62 @@ <ZipFileName>Installer{CopyFile}\{c37da331-8478-4be6-8eed-4fec1dea3fd8}-state_success.png</ZipFileName> <DestinationFilename>%Skin%\Default\media\Vera\state_success.png</DestinationFilename> </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\skin\Media\Vera\back.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{f79b3f6f-4c5a-4191-9bc7-4c1d9935e6cc}-back.png</ZipFileName> + <DestinationFilename>%Skin%\Default\media\Vera\back.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\skin\Media\Vera\Motion_Sensor_bypass.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{66a0c7b4-5521-4bed-af4c-faf90ca114f3}-Motion_Sensor_bypass.png</ZipFileName> + <DestinationFilename>%Skin%\Default\media\Vera\Motion_Sensor_bypass.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\skin\Media\Vera\room.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{ed4a1bf8-fc80-42c1-a2a0-f715278793e4}-room.png</ZipFileName> + <DestinationFilename>%Skin%\Default\media\Vera\room.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\skin\Media\Vera\Window_Covering_0.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{5f51e65a-0d4d-4139-bdc5-2d0e297bfe56}-Window_Covering_0.png</ZipFileName> + <DestinationFilename>%Skin%\Default\media\Vera\Window_Covering_0.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\skin\Media\Vera\Window_Covering_100.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{bf2c69e0-957d-4869-91b3-514ea6620153}-Window_Covering_100.png</ZipFileName> + <DestinationFilename>%Skin%\Default\media\Vera\Window_Covering_100.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\skin\Media\Vera\Window_Covering_25.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{9283be3f-62ae-42ae-b665-e6a506c2d0d6}-Window_Covering_25.png</ZipFileName> + <DestinationFilename>%Skin%\Default\media\Vera\Window_Covering_25.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\skin\Media\Vera\Window_Covering_50.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{ecef5e34-97c4-45c4-8026-3fab2413ae9b}-Window_Covering_50.png</ZipFileName> + <DestinationFilename>%Skin%\Default\media\Vera\Window_Covering_50.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\skin\Media\Vera\Window_Covering_75.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{f1ebac2f-1a07-4c79-9cba-0a5992f26af8}-Window_Covering_75.png</ZipFileName> + <DestinationFilename>%Skin%\Default\media\Vera\Window_Covering_75.png</DestinationFilename> + </FileItem> </Items> </UniqueFileList> <ProjectSettings> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Ba...@us...> - 2012-02-19 22:31:19
|
Revision: 4460 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=4460&view=rev Author: BartEv Date: 2012-02-19 22:31:13 +0000 (Sun, 19 Feb 2012) Log Message: ----------- Modified Paths: -------------- trunk/plugins/VeraControl/releases/VeraControl_v1.0.1.0.mpe1 Modified: trunk/plugins/VeraControl/releases/VeraControl_v1.0.1.0.mpe1 =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Ba...@us...> - 2012-02-19 22:30:27
|
Revision: 4459 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=4459&view=rev Author: BartEv Date: 2012-02-19 22:30:21 +0000 (Sun, 19 Feb 2012) Log Message: ----------- Modified Paths: -------------- trunk/plugins/VeraControl/releases/update.xml Modified: trunk/plugins/VeraControl/releases/update.xml =================================================================== --- trunk/plugins/VeraControl/releases/update.xml 2012-02-19 22:27:31 UTC (rev 4458) +++ trunk/plugins/VeraControl/releases/update.xml 2012-02-19 22:30:21 UTC (rev 4459) @@ -1266,6 +1266,153 @@ <Build>0</Build> <Revision>3</Revision> </Version> + <ExtensionDescription>Control your Vera controller from MediaPortal. + +Supports Scene triggers for starting, hibernating and exiting MediaPortal; Also starting, pausing and stopping media streams. So dim your lights and close the curtains automatically when MediaPortal starts a movie... + +Vera is a Z-wave home automation controller from MicasaVerde. + +This version is tested with: + - Vera 1 v1.1.1338 + - Vera 2 v1.1.1267 + - Vera 2 v1.1.1362 + - Vera 2 v1.5.255 +</ExtensionDescription> + <VersionDescription> - Show device status of selected item also on main screen, + - Added the ability to show devices automatically when selecting a new room (= extra config option) + - bug fix: wrong scene dialog was shown in DefautWide skin</VersionDescription> + <DevelopmentStatus>Stable</DevelopmentStatus> + <OnlineLocation>https://mp-plugins.svn.sourceforge.net/svnroot/mp-plugins/trunk/plugins/VeraControl/releases/VeraControl_v0.9.0.3.mpe1</OnlineLocation> + <ReleaseDate>2012-02-02T22:51:05</ReleaseDate> + <Tags>home automation, +z-wave, +micasaverde, +vera</Tags> + <Location>C:\Users\Bart\Documents\SharpDevelop Projects\VeraControl\releases\VeraControl_v0.9.0.3.mpe1</Location> + <Params> + <Items> + <SectionParam Name="Online Icon"> + <Value /> + <ValueType>String</ValueType> + <Description>The icon file of the package stored online (jpg,png,bmp)</Description> + </SectionParam> + <SectionParam Name="Configuration file"> + <Value /> + <ValueType>Template</ValueType> + <Description>The file used to configure the extension. + If have .exe extension the will be executed + If have .dll extension used like MP plugin configuration</Description> + </SectionParam> + <SectionParam Name="Online Screenshots"> + <Value /> + <ValueType>String</ValueType> + <Description>Online stored screenshot urls separated by ; </Description> + </SectionParam> + <SectionParam Name="Force to uninstall on update"> + <Value>yes</Value> + <ValueType>Bool</ValueType> + <Description>Show dialog and force to uninstall previous version when updating an extension. Should only be disabled if you are using an NSIS/MSI installer.</Description> + </SectionParam> + </Items> + </Params> + </GeneralInfo> + <UniqueFileList> + <Items /> + </UniqueFileList> + <ProjectSettings> + <FolderGroups /> + </ProjectSettings> + <IsSkin>false</IsSkin> + </PackageClass> + <PackageClass> + <Version>2.0</Version> + <Groups> + <Items> + <GroupItem Name="Default"> + <DisplayName>Default</DisplayName> + <DefaulChecked>true</DefaulChecked> + <Description>Default</Description> + <Files> + <Items /> + </Files> + </GroupItem> + <GroupItem Name="IconsDefault"> + <DisplayName>IconsDefault</DisplayName> + <DefaulChecked>true</DefaulChecked> + <Description>IconsDefault</Description> + <Files> + <Items /> + </Files> + </GroupItem> + <GroupItem Name="IconsDefaultWide"> + <DisplayName>IconsDefaultWide</DisplayName> + <DefaulChecked>true</DefaulChecked> + <Description>IconsDefaultWide</Description> + <Files> + <Items /> + </Files> + </GroupItem> + </Items> + </Groups> + <Sections> + <Items /> + </Sections> + <Dependencies> + <Items> + <DependencyItem> + <Type>MediaPortal</Type> + <Id /> + <MinVersion> + <Major>1</Major> + <Minor>1</Minor> + <Build>6</Build> + <Revision>27644</Revision> + </MinVersion> + <MaxVersion> + <Major>1</Major> + <Minor>1</Minor> + <Build>6</Build> + <Revision>27644</Revision> + </MaxVersion> + <WarnOnly>false</WarnOnly> + <Message>requires MediaPortal version 1.1.6.27644 to 1.1.6.27644</Message> + <Name>MediaPortal</Name> + </DependencyItem> + </Items> + </Dependencies> + <PluginDependencies> + <Items> + <PluginDependencyItem AssemblyName="VeraControl.dll"> + <CompatibleVersion> + <Items> + <CompatibleVersionItem> + <MinRequiredVersion>1.1.6.27644</MinRequiredVersion> + <DesignedForVersion>1.1.6.27644</DesignedForVersion> + </CompatibleVersionItem> + </Items> + </CompatibleVersion> + <SubSystemsUsed> + <Items> + <SubSystemItem Name="MP.SkinEngine" /> + <SubSystemItem Name="MP.Config" /> + </Items> + </SubSystemsUsed> + </PluginDependencyItem> + </Items> + </PluginDependencies> + <GeneralInfo> + <Name>Vera Controller</Name> + <Id>ebb6b1af-6fb9-44e5-a859-9d32ffe20a9e</Id> + <Author>Bart Eversdijk</Author> + <HomePage>http://www.team-mediaportal.com/extensions/micasaverde-vera-controller</HomePage> + <ForumPage>http://forum.team-mediaportal.com/mediaportal-plugins-47/plugin-micasaverde-vera-controller-104337/</ForumPage> + <UpdateUrl>https://mp-plugins.svn.sourceforge.net/svnroot/mp-plugins/trunk/plugins/VeraControl/releases/update.xml</UpdateUrl> + <Version> + <Major>1</Major> + <Minor>0</Minor> + <Build>1</Build> + <Revision>0</Revision> + </Version> <ExtensionDescription>Control your Vera controller from MediaPortal. Supports Scene triggers for starting, hibernating and exiting MediaPortal; Also starting, pausing and stopping media streams. So dim your lights and close the curtains automatically when MediaPortal starts a movie... @@ -1278,17 +1425,21 @@ - Vera 2 v1.1.1362 - Vera 2 v1.5.255 </ExtensionDescription> - <VersionDescription> - Show device status of selected item also on main screen, - - Added the ability to show devices automatically when selecting a new room (= extra config option) - - bug fix: wrong scene dialog was shown in DefautWide skin</VersionDescription> + <VersionDescription>- Added multi box support (parallel update/control) +- Added fallback to remote connection +- Move scene trigger to side action menu +- Added sort options +- Added filter options +- Added view by category option +- Added flow view</VersionDescription> <DevelopmentStatus>Stable</DevelopmentStatus> - <OnlineLocation>https://mp-plugins.svn.sourceforge.net/svnroot/mp-plugins/trunk/plugins/VeraControl/releases/VeraControl_v0.9.0.3.mpe1</OnlineLocation> - <ReleaseDate>2012-02-02T22:51:05</ReleaseDate> + <OnlineLocation>https://mp-plugins.svn.sourceforge.net/svnroot/mp-plugins/trunk/plugins/VeraControl/releases/VeraControl_v1.0.1.0.mpe1</OnlineLocation> + <ReleaseDate>2012-02-19T22:51:05</ReleaseDate> <Tags>home automation, z-wave, micasaverde, vera</Tags> - <Location>C:\Users\Bart\Documents\SharpDevelop Projects\VeraControl\releases\VeraControl_v0.9.0.3.mpe1</Location> + <Location>C:\Users\Bart\Documents\SharpDevelop Projects\VeraControl\releases\VeraControl_v1.0.1.0.mpe1</Location> <Params> <Items> <SectionParam Name="Online Icon"> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Ba...@us...> - 2012-02-19 22:27:37
|
Revision: 4458 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=4458&view=rev Author: BartEv Date: 2012-02-19 22:27:31 +0000 (Sun, 19 Feb 2012) Log Message: ----------- Added Paths: ----------- trunk/plugins/VeraControl/releases/VeraControl_v1.0.1.0.mpe1 Added: trunk/plugins/VeraControl/releases/VeraControl_v1.0.1.0.mpe1 =================================================================== (Binary files differ) Property changes on: trunk/plugins/VeraControl/releases/VeraControl_v1.0.1.0.mpe1 ___________________________________________________________________ Added: svn:mime-type + application/octet-stream This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Ba...@us...> - 2012-02-19 22:21:53
|
Revision: 4457 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=4457&view=rev Author: BartEv Date: 2012-02-19 22:21:45 +0000 (Sun, 19 Feb 2012) Log Message: ----------- Modified Paths: -------------- trunk/plugins/VeraControl/BaseDevice.cs trunk/plugins/VeraControl/DevCategories.cs trunk/plugins/VeraControl/DeviceDimmer.cs trunk/plugins/VeraControl/DeviceSecurity.cs trunk/plugins/VeraControl/DeviceThermostat.cs trunk/plugins/VeraControl/DeviceWindowCovering.cs trunk/plugins/VeraControl/Properties/AssemblyInfo.cs trunk/plugins/VeraControl/Room.cs trunk/plugins/VeraControl/Section.cs trunk/plugins/VeraControl/VeraCommunication.cs trunk/plugins/VeraControl/VeraControl.cs trunk/plugins/VeraControl/VeraSetupForm.Designer.cs trunk/plugins/VeraControl/VeraSetupForm.cs trunk/plugins/VeraControl/releases/VeraControl.xmp2 trunk/plugins/VeraControl/skin/Default/VeraControl.xml trunk/plugins/VeraControl/skin/DefaultWide/VeraControl.xml trunk/plugins/VeraControl/skin/Media/Vera/Window_Covering.png trunk/plugins/VeraControl/skin/Media/Vera/music_audio.png Added Paths: ----------- trunk/plugins/VeraControl/VeraBox.cs trunk/plugins/VeraControl/skin/Media/Vera/Motion_Sensor_bypass.png trunk/plugins/VeraControl/skin/Media/Vera/Window_Covering_0.png trunk/plugins/VeraControl/skin/Media/Vera/Window_Covering_100.png trunk/plugins/VeraControl/skin/Media/Vera/Window_Covering_25.png trunk/plugins/VeraControl/skin/Media/Vera/Window_Covering_50.png trunk/plugins/VeraControl/skin/Media/Vera/Window_Covering_75.png trunk/plugins/VeraControl/skin/Media/Vera/back.png trunk/plugins/VeraControl/skin/Media/Vera/room.png Modified: trunk/plugins/VeraControl/BaseDevice.cs =================================================================== --- trunk/plugins/VeraControl/BaseDevice.cs 2012-02-17 23:12:46 UTC (rev 4456) +++ trunk/plugins/VeraControl/BaseDevice.cs 2012-02-19 22:21:45 UTC (rev 4457) @@ -49,7 +49,7 @@ _name = _helper.GetAttrAsString(xn, "name", _name); _id = _helper.GetAttrAsInt (xn, "id", _id); _room = _helper.GetAttrAsInt (xn, "room", _room); - _comment = _helper.GetAttrAsString(xn, "comment", _comment ); + _comment = _helper.GetAttrAsString(xn, "comment", _comment ); _dsState = _helper.ToDevState (_helper.GetAttrAsInt(xn, "state", -1)); if (_id == 0) Modified: trunk/plugins/VeraControl/DevCategories.cs =================================================================== --- trunk/plugins/VeraControl/DevCategories.cs 2012-02-17 23:12:46 UTC (rev 4456) +++ trunk/plugins/VeraControl/DevCategories.cs 2012-02-19 22:21:45 UTC (rev 4457) @@ -37,7 +37,7 @@ _name = nm; } - private string _name = "unknown category"; + private string _name = "Generic"; private int _id = 0; public VeraHelper _helper = VeraHelper.Instance; @@ -74,8 +74,8 @@ case 3: // Switch return "Binary_Light_100"; - case 4: // Generic Sensor - return "generic_sensor"; + case 4: // Security Sensor + return "Motion_Sensor_100"; case 5: // Thermostat return "Thermostat"; @@ -93,8 +93,8 @@ case 10: // Ir TX return "IR_Transmitter"; - case 12: // Motion Sensor - return "Motion_Sensor_100"; + case 12: // Generic Sensor + return "generic_sensor"; case 11: // Generic IO case 13: // Serial port Modified: trunk/plugins/VeraControl/DeviceDimmer.cs =================================================================== --- trunk/plugins/VeraControl/DeviceDimmer.cs 2012-02-17 23:12:46 UTC (rev 4456) +++ trunk/plugins/VeraControl/DeviceDimmer.cs 2012-02-19 22:21:45 UTC (rev 4457) @@ -117,7 +117,7 @@ if (level > 0) { strmode = "25%"; } if (level > 25) { strmode = "50%"; } if (level > 50) { strmode = "75%"; } - if (level > 75) { strmode = "0n"; } + if (level > 75) { strmode = "On"; } return strmode; } set { Modified: trunk/plugins/VeraControl/DeviceSecurity.cs =================================================================== --- trunk/plugins/VeraControl/DeviceSecurity.cs 2012-02-17 23:12:46 UTC (rev 4456) +++ trunk/plugins/VeraControl/DeviceSecurity.cs 2012-02-19 22:21:45 UTC (rev 4457) @@ -81,7 +81,7 @@ public override string GetIconName() { - return "Motion_Sensor_" + (_isTripped ? "100" : "0"); + return "Motion_Sensor_" + (status ? (_isTripped ? "100" : "0") : "bypass"); } public override string GetStatusText() Modified: trunk/plugins/VeraControl/DeviceThermostat.cs =================================================================== --- trunk/plugins/VeraControl/DeviceThermostat.cs 2012-02-17 23:12:46 UTC (rev 4456) +++ trunk/plugins/VeraControl/DeviceThermostat.cs 2012-02-19 22:21:45 UTC (rev 4457) @@ -63,8 +63,7 @@ // Do something with vera string cmd = "?id=lu_action&DeviceNum=" + internalId.ToString( )+ "&serviceId=urn:upnp-org:serviceId:HVAC_UserOperatingMode1&action=SetModeTarget" + - "&NewModeTarget=" + (value == "Off" ? "Off" : (value == "Cool" ? "CoolOn" : (value == "Heat" ? "HeatOn" : "AutoChangeOver")) - ); + "&NewModeTarget=" + (value == "Off" ? "Off" : (value == "Cool" ? "CoolOn" : (value == "Heat" ? "HeatOn" : "AutoChangeOver"))); _myVeraBox.DoVeraCommandRequest(cmd, ReportRequestError); } } Modified: trunk/plugins/VeraControl/DeviceWindowCovering.cs =================================================================== --- trunk/plugins/VeraControl/DeviceWindowCovering.cs 2012-02-17 23:12:46 UTC (rev 4456) +++ trunk/plugins/VeraControl/DeviceWindowCovering.cs 2012-02-19 22:21:45 UTC (rev 4457) @@ -4,8 +4,8 @@ * Date: 24-12-2011 * Time: 23:56 * - * Copyright: 2012 GPL - Bart Eversdijk - * MediaPort plugin - MicasaVerde (TM) Vera Controller + * Copyright: 2012 GPL - Bart Eversdijk + * MediaPort plugin - MicasaVerde (TM) Vera Controller * E-mail: ba...@ev... */ using System; @@ -18,12 +18,65 @@ /// </summary> public class DeviceWindowCovering : DeviceDimmer { - public DeviceWindowCovering(XmlNode xn, int verabox) : base (xn, verabox) + public DeviceWindowCovering(XmlNode xn, int verabox) : base (xn, verabox) { if (xn != null) { Update(xn); } } + + public override string GetIconName() + { + string leveltxt = "0"; + if (level > 0) { leveltxt = "25"; } + if (level > 25) { leveltxt = "50"; } + if (level > 50) { leveltxt = "75"; } + if (level > 75) { leveltxt = "100"; } + + return "Window_Covering_" + leveltxt; + } + + public override string GetStatusText() + { + return (status ? (level == 100 ? "Closed" : level.ToString() + "%") : "Opened"); + } + + public override string mode + { + get { + string strmode = "Open"; + if (level > 0) { strmode = "25%"; } + if (level > 25) { strmode = "50%"; } + if (level > 50) { strmode = "75%"; } + if (level > 75) { strmode = "Close"; } + return strmode; + } + set { + switch (value) + { + case "Open": + level = 0; + break; + case "25%": + level = 25; + break; + case "50%": + level = 50; + break; + case "75%": + level = 75; + break; + case "Close": + level = 100; + break; + } + } + } + + public override string [] GetCommands() + { + return new string [] {"Open", "Close", "25%", "75%", "50%"}; + } } } Modified: trunk/plugins/VeraControl/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/VeraControl/Properties/AssemblyInfo.cs 2012-02-17 23:12:46 UTC (rev 4456) +++ trunk/plugins/VeraControl/Properties/AssemblyInfo.cs 2012-02-19 22:21:45 UTC (rev 4457) @@ -28,4 +28,4 @@ // // You can specify all the values or you can use the default the Revision and // Build Numbers by using the '*' as shown below: -[assembly: AssemblyVersion("0.5.1.0")] +[assembly: AssemblyVersion("1.0.1.0")] Modified: trunk/plugins/VeraControl/Room.cs =================================================================== --- trunk/plugins/VeraControl/Room.cs 2012-02-17 23:12:46 UTC (rev 4456) +++ trunk/plugins/VeraControl/Room.cs 2012-02-19 22:21:45 UTC (rev 4457) @@ -61,7 +61,8 @@ public int id { - get { + get + { if (_myVeraBox == null) { return 0; @@ -82,7 +83,8 @@ public int section { - get { + get + { if (_myVeraBox == null) { return 0; Modified: trunk/plugins/VeraControl/Section.cs =================================================================== --- trunk/plugins/VeraControl/Section.cs 2012-02-17 23:12:46 UTC (rev 4456) +++ trunk/plugins/VeraControl/Section.cs 2012-02-19 22:21:45 UTC (rev 4457) @@ -42,7 +42,8 @@ public int id { - get { + get + { if (_myVeraBox == null) { return 0; Added: trunk/plugins/VeraControl/VeraBox.cs =================================================================== --- trunk/plugins/VeraControl/VeraBox.cs (rev 0) +++ trunk/plugins/VeraControl/VeraBox.cs 2012-02-19 22:21:45 UTC (rev 4457) @@ -0,0 +1,728 @@ +/* + * Created by SharpDevelop. + * User: Bart + * Date: 10-2-2012 + * Time: 16:41 + * + * + * Copyright: 2012 GPL - Bart Eversdijk + * MediaPort plugin - MicasaVerde (TM) Vera Controller + * E-mail: ba...@ev... + */ +using System; +using System.Net; +using System.IO; +using System.Threading; +using System.Collections.Generic; +using System.Xml; + +namespace VeraControl.Properties +{ + public enum ConnectionType + { + RemoteOnly = -1, + Auto = 0, + LocalOnly = 1 + } + + public class VeraStatus + { + public DeviceSystem system = new DeviceSystem(); + public List<DeviceGeneric> devices = new List<DeviceGeneric>(); + public List<Scene> scenes = new List<Scene>(); + public List<Room> rooms = new List<Room>(); + public List<DevCategories> categories = new List<DevCategories>(); + public List<Section> sections = new List<Section>(); + + #region Vers get by id support functions + + public void ClearAllLists() + { + devices.Clear(); + scenes.Clear(); + rooms.Clear(); + categories.Clear(); + sections.Clear(); + } + public Room GetRoomById(int id) + { + foreach(Room room in rooms) + { + if (room.id == id) + { + return room; + } + } + return new Room(null, 0); + } + + public Section GetSectionById(int id) + { + foreach(Section section in sections) + { + if (section.id == id) + { + return section; + } + } + return new Section(null, 0); + } + + public DeviceGeneric GetDeviceById(int id) + { + foreach(DeviceGeneric dev in devices) + { + if (dev.id == id) + { + return dev; + } + } + return new DeviceGeneric(null, 0); + } + + public Scene GetSceneById(int id) + { + foreach(Scene scene in scenes) + { + if (scene.id == id) + { + return scene; + } + } + return new Scene(null, 0); + } + + public DevCategories GetCategoryById(int id) + { + foreach(DevCategories cat in categories) + { + if (cat.id == id) + { + return cat; + } + } + return new DevCategories(null); + } + + public bool IsSectionFound(int id) + { + foreach(Section section in sections) + { + if (section.id == id) + { + return true; + } + } + return false; + } + + public bool IsRoomFound(int id) + { + foreach(Room room in rooms) + { + if (room.id == id) + { + return true; + } + } + return false; + } + + public bool IsDeviceFound(int id) + { + foreach(DeviceGeneric dev in devices) + { + if (dev.id == id) + { + return true; + } + } + return false; + } + + public bool IsSceneFound(int id) + { + foreach(Scene scene in scenes) + { + if (scene.id == id) + { + return true; + } + } + return false; + } + + public bool IsCategoryFound(int id) + { + foreach(DevCategories cat in categories) + { + if (cat.id == id) + { + return true; + } + } + return false; + } + #endregion + } + + /// <summary> + /// Description of VeraBox. + /// </summary> + public class VeraBox + { + private VeraHelper _helper = VeraHelper.Instance; + + // Actual device information + private VeraStatus _status = new VeraStatus(); + + // Config data + public int _maxRefreshDelay; // Maximun delay between 2 status updates in seconds + public int _minRefreshDelay = 1000; // Minimun delay between 2 status updates in miliseconds + private int _myVeraId = 0; + public bool _oldStyleConfig = false; // Read config settings in 0.9.0.3 or previous style + + // Communication status/control + private long _lastUpdate = 0; + private bool _screenUpdateRequired = false; // Only true when a new update was received AND at least one device(staus) or scene was changed + private bool _lastUpdateFailed = false; + private string _lastUpdateErrorMessage = ""; + public WebClient _webUpdateClient = new WebClient(); + public WebClient _webCommandClient = new WebClient(); + private Action<string> _webCommandClientErrorReporter = null; + + // Connection information + private int _serial = -1; + private string _ip = ""; + private string _name = ""; + private string _realLocalVeraAddress = null; + private string _realRemoteVeraAddress = null; + private string _discreteVeraAddress = null; + private ConnectionType _connectionType = ConnectionType.Auto; + private bool _fallBackConnection = false; + + public VeraBox(int id, int maxRefresh, int minRefresh) + { + _myVeraId = id; + _maxRefreshDelay = maxRefresh; + _minRefreshDelay = minRefresh; + + using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.MPSettings()) + { + // Set DownloadStringCompleted handler + _webUpdateClient.DownloadStringCompleted += new DownloadStringCompletedEventHandler(OnCompletedUpdateStatusRequest); + _webCommandClient.DownloadStringCompleted += new DownloadStringCompletedEventHandler(OnCompletedCommandRequest); + } + } + + public void DoVeraCommandRequest(string param, Action<string> errorReporter) + { + // If a request was pending just cancel the previous request (user is informed about the progress) + string url = veraAddress + "/data_request" + param + "&time=" + DateTime.Now.Ticks; + + // Callback thus ASynchronised call (do NOT wait for response) + try { + _webCommandClientErrorReporter = errorReporter; + _webCommandClient.CancelAsync(); // Cancel any current pending Async calls... + _webCommandClient.DownloadStringAsync(new Uri(url)); + + } catch( Exception e ) + { + _webCommandClientErrorReporter = null; + status.system.ReportCommandError(e.Message); + setScreenUpdateRequired(); + } + } + + public void OnCompletedCommandRequest(object sender, DownloadStringCompletedEventArgs e) + { + if (e.Cancelled) + { + // Communication cancel for some reason, no valid data to be expected + if (_webCommandClientErrorReporter != null) + { + // Send error to dialog message handler + _webCommandClientErrorReporter("Request was canceled"); + } + else + { + // Show eror in MediaPortal Vera-main window + status.system.ReportCommandError("Request was canceled"); + } + setScreenUpdateRequired(); + } + else if (e.Error != null) + { + // Handle error here + if (_webCommandClientErrorReporter != null) + { + // Send error to dialog message handler + _webCommandClientErrorReporter(e.Error.Message); + } + else + { + // Show eror in MediaPortal Vera-main window + status.system.ReportCommandError(e.Error.Message); + } + setScreenUpdateRequired(); + } + else + { + // Communication succes full -> no parse Vera response... + if (!e.Result.ToUpper().Contains("<OK>OK</OK>") && !e.Result.ToUpper().Contains("<JOBID>")) + { + if (_webCommandClientErrorReporter != null) + { + // Send error to dialog message handler + _webCommandClientErrorReporter(e.Result); + } + else + { + // Show eror in MediaPortal Vera-main window + status.system.ReportCommandError(e.Result); + } + setScreenUpdateRequired(); + } + } + // Communication done clear error report handler + _webCommandClientErrorReporter = null; + } + + public void UpdateCurrentStatus() + { + /* Keep updating with webClient timeout 180 sec, even when last time did fail or connection was lost....*/ + if (!_webUpdateClient.IsBusy && (!_lastUpdateFailed || (_lastUpdate + 30 < _helper.GetSecondsSince1970()))) + { + string url = veraAddress + "/data_request" + + "?id=lu_sdata&loadtime=" + _status.system.loadtime + + "&dataversion=" + _status.system.dataversion + + "&minimumdelay=" + _minRefreshDelay + + "&timeout=" + _maxRefreshDelay + + "&output_format=xml" + + "&time=" + DateTime.Now.Ticks; + + // Callback thus ASynchronised call (do NOT wait for response) + try { + _webUpdateClient.CancelAsync(); // Cancel any current pending Async calls... + _webUpdateClient.DownloadStringAsync(new Uri(url)); + } catch( Exception e ) + { + _lastUpdateFailed = true; + _lastUpdateErrorMessage = e.Message; + } + _lastUpdate = _helper.GetSecondsSince1970(); + } + } + + public void OnCompletedUpdateStatusRequest(object sender, DownloadStringCompletedEventArgs e) + { + if (!e.Cancelled) + { + // Communication cancel for some reason, no valid data to be expected + if (e.Error != null) + { + // Handle error here + _lastUpdateFailed = true; + _lastUpdateErrorMessage = e.Error.Message; + setScreenUpdateRequired(); + } + else + { + ParseUpdateInfo(e.Result); + // WebClient wc = new WebClient(); + // if (_status.system.dataversion == "0") + // { + // ParseUpdateInfo( wc.DownloadString(@"C:\Users\Bart\Documents\SharpDevelop Projects\VeraControl\testdata\text.xml")); + // } + } + } + + // update timer again (took some time to get the data) + _lastUpdate = _helper.GetSecondsSince1970(); + } + + public void ParseUpdateInfo(string veraresponse) + { + var xmlDoc = new XmlDocument(); + try { + xmlDoc.LoadXml(veraresponse); + } catch (Exception) + { + // Parser failed so incorrect data received (could be an interrupted data transfer) + return; + } + // Parse header + XmlNode rootnode = xmlDoc.SelectSingleNode("/root"); + if (rootnode == null) + { + // Not a status update, just return + return; + } + + if (!_screenUpdateRequired) + { + // Clear flag, only when previous update was already handled (might be some new or remove devices/scenes to be displayed) + _status.system.ClearFullReloadFlag(); + } + if (_lastUpdateFailed) + { + _lastUpdateFailed = false; + setScreenUpdateRequired(); + _status.system.ClearConnectionError(); + } + // Process system status first + _status.system.update(rootnode); + if (_status.system.fullReload) + { + // We have a full refresh -> Clear all lists (to get clear of removed devices/scenes/catgories/rooms/etc...) + _status.ClearAllLists(); + + } + + // Process Sections + XmlNodeList xnList = xmlDoc.SelectNodes("/root/sections/section"); + foreach (XmlNode xn in xnList) + { + Section sc = _status.GetSectionById( makeId(xn.Attributes["id"].Value) ); + if (sc.id != 0) { + sc.Update(xn); + } else { + _status.sections.Add(new Section(xn, _myVeraId)); + } + } + + // Process Rooms + xnList = xmlDoc.SelectNodes("/root/rooms/room"); + foreach (XmlNode xn in xnList) + { + Room room = _status.GetRoomById( makeId(xn.Attributes["id"].Value) ); + if (room.id != 0) { + room.Update(xn); + } else { + _status.rooms.Add(new Room(xn, _myVeraId)); + } + } + + // Process Scenes + xnList = xmlDoc.SelectNodes("/root/scenes/scene"); + // State update of Scenes are not reported done, so they have to be cleaned manualy + // if a message is still valid and/or new message will be reported below + foreach (Scene scene in _status.scenes) + { + scene.ClearCommState(); + } + foreach (XmlNode xn in xnList) + { + Scene sc = _status.GetSceneById( makeId(xn.Attributes["id"].Value) ); + if (sc.id != 0) { + sc.Update(xn); + } else { + _status.scenes.Add(new Scene(xn, _myVeraId)); + } + } + + // Process Categories - categories are general not Box specific + xnList = xmlDoc.SelectNodes("/root/categories/categorie"); + foreach (XmlNode xn in xnList) + { + DevCategories cat = _status.GetCategoryById( int.Parse(xn.Attributes["id"].Value) ); + if (cat.id != 0) { + cat.Update(xn); + } else { + _status.categories.Add(new DevCategories(xn)); + } + } + + // Process Devices + xnList = xmlDoc.SelectNodes("/root/devices/device"); + foreach (XmlNode xn in xnList) + { + DeviceGeneric dev = _status.GetDeviceById( makeId(xn.Attributes["id"].Value) ); + if (dev.id != 0) { + // update existing device + dev.Update(xn); + } else { + _status.system.SetFullReloadFlag(); + + // catids: http://wiki.micasaverde.com/index.php/Luup_UPNP_Files + switch (xn.Attributes["category"].Value) + { + //case "1": // TODO: Implement interface device ? + // m_status.devices.Add(new DeviceInterface(xn)); + // break; + + case "2": + _status.devices.Add(new DeviceDimmer(xn, _myVeraId)); + break; + + case "3": + case "11": // Generic IO + _status.devices.Add(new DeviceSwitch(xn, _myVeraId)); + break; + + case "4": // Generic Sensor + case "12": // Motion Sensor + _status.devices.Add(new DeviceSecurity(xn, _myVeraId)); + break; + + case "5": + _status.devices.Add(new DeviceThermostat(xn, _myVeraId, _status.system.IsMetric())); + break; + + case "6": + _status.devices.Add(new DeviceCam(xn, _myVeraId)); + break; + + case "7": + _status.devices.Add(new DeviceDoorlock(xn, _myVeraId)); + break; + + case "8": + _status.devices.Add(new DeviceWindowCovering(xn, _myVeraId)); + break; + + //case "9": + // m_status.devices.Add(new DeviceRemoteControl(xn, veraId)); + // break; + + //case "10": + // m_status.devices.Add(new DeviceIrTx(xn, veraId)); + // break; + + //case "13": + // m_status.devices.Add(new DeviceSerialPort(xn, veraId)); + // break + + case "14": + _status.devices.Add(new DeviceSceneController(xn, _myVeraId)); + break; + + // case "15": + // m_status.devices.Add(new DeviceAV(xn, veraId)); + // break; + + case "16": + _status.devices.Add(new DeviceHumidity(xn, _myVeraId)); + break; + + case "17": + _status.devices.Add(new DeviceTemperature(xn, _myVeraId, _status.system.IsMetric())); + break; + + case "18": + _status.devices.Add(new DeviceLightSensor(xn, _myVeraId)); + break; + + //case "19": + // m_status.devices.Add(new DeviceZwaveInt(xn, veraId)); + // break + //case "20": + // m_status.devices.Add(new DeviceInsteonInt(xn, veraId)); + // break + + case "21": + _status.devices.Add(new DevicePowerMeter(xn, _myVeraId)); + break; + + case "0": + default: + // Check for Google Weather Device + if (xn.Attributes["WindCondition"] != null || xn.Attributes["windcondition"] != null) + { + _status.devices.Add(new DeviceGWeather(xn, _myVeraId)); + break; + } + // Check for Bart's sprinkler Device + if (xn.Attributes["OperationMode"] != null) + { + _status.devices.Add(new DeviceSprinkler(xn, _myVeraId)); + break; + } + _status.devices.Add(new DeviceGeneric(xn, _myVeraId)); + break; + } + } + } + } + + public long SecondsSinceLastUpdate + { + get { return (_helper.GetSecondsSince1970() - _lastUpdate); } + } + + public List<Scene> scenes + { + get { return _status.scenes; } + } + + public List<DeviceGeneric> devices + { + get { return _status.devices; } + } + + public List<Room> rooms + { + get { return _status.rooms; } + } + + public List<DevCategories> categories + { + get { return _status.categories; } + } + + public List<Section> sections + { + get { return _status.sections; } + } + + public bool lastUpdateFailed + { + get { return _lastUpdateFailed; } + set { _lastUpdateFailed = value; } + } + + public string lastUpdateError + { + get { return _lastUpdateErrorMessage; } + } + + public string name + { + get { + if (_name == "" || _name == "-") + { + return (_connectionType == ConnectionType.RemoteOnly ? _serial.ToString() : _ip); + } + return _name; + } + } + + /// <summary> + /// Invoking this method will clear the update ready flag -> so caller need to handle the screen update + /// </summary> + /// <returns>When true a screen update shall be preformed by the caller</returns> + public bool NewScreenUpdateWaitingAndClearFlag() + { + bool b = _screenUpdateRequired; + _screenUpdateRequired = false; + return b; + } + + public void setScreenUpdateRequired() + { + _screenUpdateRequired = true; + } + /// <summary> + /// A request is currently being handled by Vera, this request takes at least _minRefreshDelay msecs, at most _maxRefreshDelay seconds and will be finished the moment Vera detects a change. + /// As soon as this function returns false a new update request should be invoked (with UpdateCurrentStatus()), Vera will take care of the Refresh delays (by keeping open the http-connection) + /// </summary> + public bool updatePending + { + get { return _webUpdateClient.IsBusy; } + } + + + public VeraStatus status + { + get { return _status; } + } + + public int myId + { + get { return _myVeraId; } + } + + public int zeroId + { + get { return makeId(0); } + } + + public int makeId(int id) + { + return (_myVeraId * VeraCommunication.IDMASK) + id; + } + + public int makeId(string id) + { + return makeId(int.Parse(id)); + } + + public ConnectionType connectionType + { + get { return _connectionType; } + } + + public bool inFallback + { + get { return (_connectionType == ConnectionType.Auto ? _fallBackConnection : true); } + set { _fallBackConnection = (_connectionType == ConnectionType.Auto ? value : false); } + } + + public string discreteVeraAddress + { + get { + if (_discreteVeraAddress == null) + { // Accessing this variable will set the discrete value aswell + string dum = veraAddress; + } + return (_fallBackConnection || _connectionType == ConnectionType.RemoteOnly ? _discreteVeraAddress : _realLocalVeraAddress); + } + } + + public string veraAddress + { + get { + if (_realLocalVeraAddress == null && _realRemoteVeraAddress == null) + { + using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.MPSettings()) + { + string id = ""; + if (!_oldStyleConfig) + { + id = "_" + myId.ToString("00"); + } + _ip = xmlreader.GetValueAsString("veracontroller", "ipaddress" + id, "127.0.0.1"); + string port = xmlreader.GetValueAsString("veracontroller", "portnumber" + id, "3480"); + string user = xmlreader.GetValueAsString("veracontroller", "miosusername" + id, ""); + string pass = xmlreader.GetValueAsString("veracontroller", "miospassword" + id, ""); + _serial = xmlreader.GetValueAsInt ("veracontroller", "serialnumber" + id, -1); + _name = xmlreader.GetValueAsString("veracontroller", "name" + id, ""); + + if (_oldStyleConfig) + { + _connectionType = (xmlreader.GetValueAsBool("veracontroller", "remoteConnected", false) ? ConnectionType.RemoteOnly : ConnectionType.LocalOnly); + } + else + { + _connectionType = (ConnectionType)xmlreader.GetValueAsInt("veracontroller", "connectiontype" + id, (int)ConnectionType.Auto); + if (_connectionType == ConnectionType.Auto && (_serial < 99 || user == "" || pass == "")) + { + _connectionType = ConnectionType.LocalOnly; + } + } + + string fwd = "fwd" + ((_serial % 1) == 1 ? "1" : "2"); + _realLocalVeraAddress = (_connectionType == ConnectionType.RemoteOnly) ? "" : "http://" + _ip + ":" + port; + _realRemoteVeraAddress = (_connectionType == ConnectionType.LocalOnly) ? "" : "https://" + fwd + ".mios.com/" + user + "/" + pass + "/" + _serial.ToString(); + _discreteVeraAddress = (_connectionType == ConnectionType.LocalOnly) ? _realLocalVeraAddress : fwd + ".mios.com/" + user + "/xxxxx/" + _serial.ToString(); + } + } + else + { + // Check if we did receive a different serial number, than was stored by the config file + if (!_oldStyleConfig && status.system.serialno != _serial && status.system.serialno != -1) + { + using (MediaPortal.Profile.Settings xmlWriter = new MediaPortal.Profile.MPSettings()) + { + // Store new serial number.... + xmlWriter.SetValue("veracontroller", "serialnumber" + "_" + myId.ToString("00"), _serial.ToString()); + } + } + } + + return (_fallBackConnection || _connectionType == ConnectionType.RemoteOnly ? _realRemoteVeraAddress :_realLocalVeraAddress); + } + } + } +} + Modified: trunk/plugins/VeraControl/VeraCommunication.cs =================================================================== --- trunk/plugins/VeraControl/VeraCommunication.cs 2012-02-17 23:12:46 UTC (rev 4456) +++ trunk/plugins/VeraControl/VeraCommunication.cs 2012-02-19 22:21:45 UTC (rev 4457) @@ -193,21 +193,37 @@ public Room GetRoomById(int id) { + if (BoxId(id) >= _instance.numOfBoxes) + { + return new Room(null, 0); + } return boxes[BoxId(id)].status.GetRoomById(id); } public Section GetSectionById(int id) { + if (BoxId(id) >= _instance.numOfBoxes) + { + return new Section(null, 0); + } return boxes[BoxId(id)].status.GetSectionById(id); } public DeviceGeneric GetDeviceById(int id) { + if (BoxId(id) >= _instance.numOfBoxes) + { + return new DeviceGeneric(null, 0); + } return boxes[BoxId(id)].status.GetDeviceById(id); } public Scene GetSceneById(int id) { + if (BoxId(id) >= _instance.numOfBoxes) + { + return new Scene(null, 0); + } return boxes[BoxId(id)].status.GetSceneById(id); } @@ -225,6 +241,10 @@ public DevCategories GetCategoryById(int id) { + if (BoxId(id) >= _instance.numOfBoxes) + { + return new DevCategories(0); + } return boxes[BoxId(id)].status.GetCategoryById(id); } @@ -246,26 +266,46 @@ public bool IsSectionFound(int id) { + if (BoxId(id) >= _instance.numOfBoxes) + { + return false; + } return boxes[BoxId(id)].status.IsSectionFound(id); } public bool IsRoomFound(int id) { + if (BoxId(id) >= _instance.numOfBoxes) + { + return false; + } return boxes[BoxId(id)].status.IsRoomFound(id); } public bool IsDeviceFound(int id) { + if (BoxId(id) >= _instance.numOfBoxes) + { + return false; + } return boxes[BoxId(id)].status.IsDeviceFound(id); } public bool IsSceneFound(int id) { + if (BoxId(id) >= _instance.numOfBoxes) + { + return false; + } return boxes[BoxId(id)].status.IsSceneFound(id); } public bool IsCategoryFound(int id) { + if (BoxId(id) >= _instance.numOfBoxes) + { + return false; + } return boxes[BoxId(id)].status.IsCategoryFound(id); } @@ -280,7 +320,6 @@ { return false; } - return (room.section == sectionid); } Modified: trunk/plugins/VeraControl/VeraControl.cs =================================================================== --- trunk/plugins/VeraControl/VeraControl.cs 2012-02-17 23:12:46 UTC (rev 4456) +++ trunk/plugins/VeraControl/VeraControl.cs 2012-02-19 22:21:45 UTC (rev 4457) @@ -27,6 +27,7 @@ using Action = MediaPortal.GUI.Library.Action; using Player = MediaPortal.Player.g_Player; using MediaType = MediaPortal.Player.g_Player.MediaType; +using System.Windows; using MediaPortal.Common.Utils; [assembly: CompatibleVersion("1.1.6.27644")] @@ -83,6 +84,7 @@ [SkinControlAttribute(10)] protected GUILabelControl _title = null; [SkinControl(20)] protected GUISpinButton _sectionList = null; [SkinControl(40)] protected GUIListControl _leftList = null; + [SkinControl(41)] protected GUICoverFlow _flowList = null; [SkinControl(50)] protected GUIListControl _rightList = null; [SkinControl(30)] protected GUIImage _systemStatusImage = null; @@ -118,6 +120,8 @@ public bool _enableSceneTrigger = false; private bool _autoSelectRoom = true; private bool _viewPerCategory = false; + private bool _viewListStyle = true; + private bool _devicesFlow = false; private VeraSortStyle _selectedSortOption = VeraSortStyle.NO; private VeraFilterStyle _selectedFilterOption = VeraFilterStyle.NONE; @@ -143,8 +147,8 @@ public VeraControl() { - // TODO: remove this sleep - Thread.Sleep(5000); + // TO DO: remove this sleep + // Thread.Sleep(5000); } #region ISetupForm Members @@ -158,7 +162,7 @@ // Returns the description of the plugin is shown in the plugin menu public string Description() { - return "Micasa Verde Vera 2 controller, let Media Portal control your Z-wave devices"; + return "Micasa Verde Vera controller, let Media Portal control your Z-wave devices"; } // Returns the author of the plugin which is shown in the plugin menu @@ -239,9 +243,10 @@ { _enableSceneTrigger = xmlreader.GetValueAsBool("veracontroller", "enableSceneTrigger", false); _autoSelectRoom = xmlreader.GetValueAsBool("veracontroller", "AutoSelectRoom", true); - _selectedSortOption = (VeraSortStyle) xmlreader.GetValueAsInt("veracontroller", "Sort", 0); - _selectedFilterOption = (VeraFilterStyle)xmlreader.GetValueAsInt("veracontroller", "Filter", 0); - _viewPerCategory = xmlreader.GetValueAsBool("veracontroller", "ViewMode", false); + _selectedSortOption = (VeraSortStyle) xmlreader.GetValueAsInt("veracontroller", "Sort", 0); + _selectedFilterOption = (VeraFilterStyle)xmlreader.GetValueAsInt("veracontroller", "Filter", 0); + _viewPerCategory = xmlreader.GetValueAsBool("veracontroller", "ViewMode", false); + _viewListStyle = xmlreader.GetValueAsBool("veracontroller", "ViewList", true); } GUIWindowManager.OnNewAction += new OnActionHandler(OnNewAction); @@ -271,11 +276,18 @@ protected override void OnClicked(int controlId, GUIControl control, Action.ActionType actionType) { if (control == _rightList) - OnRightlistCrtl((GUIListControl)control, actionType); + OnRightlistCrtl(actionType); if (control == _leftList) - OnLeftlistCrtl((GUIListControl)control); - + OnLeftlistCrtl(); + + if (control == _flowList) + { + if (_devicesFlow) + OnRightlistCrtl(actionType); + else + OnLeftlistCrtl(); + } if (control == _sectionList) OnSectionList((GUISpinButton)control); @@ -351,12 +363,16 @@ default: break; } - + + // Now handle 'local' actions (only respond when Vera Controller is visible) if (GUIWindowManager.ActiveWindow == GetWindowId()) { switch(action.wID) { + case Action.ActionType.ACTION_PREVIOUS_MENU: + break; + case Action.ActionType.ACTION_MOUSE_MOVE: break; @@ -582,23 +598,44 @@ } RefreshNow(); - // Auto update right side list - if (_autoSelectRoom && - (!_viewPerCategory && _selectedRoom != _leftList.SelectedListItem.ItemId) || - ( _viewPerCategory && _selectedCategory != _leftList.SelectedListItem.ItemId) ) + // Auto update right side list (only valid when we see lists) + if (_autoSelectRoom && _viewListStyle) { - OnLeftlistCrtl(_leftList); + if ((!_viewPerCategory && _selectedRoom != _leftList.SelectedListItem.ItemId) || + ( _viewPerCategory && _selectedCategory != _leftList.SelectedListItem.ItemId) ) + { + OnLeftlistCrtl(); + } } - base.Render(timePassed); } + public List<GUIListItem> GetListItems() + { + if (_viewListStyle) + { + return _rightList.ListItems; + } + if (!_devicesFlow) + { + // No devices return empty list + return new List<GUIListItem>(); + } + + List<GUIListItem> list = new List<GUIListItem>(); + for (int i = 0; i < _flowList.Count; i++) + { + list.Add(_flowList.GetCard(i)); + } + return list; + } + public void RefreshNow() { int selectedItem = 0; - if (_rightList.SelectedListItem != null) + if ((_viewListStyle && _rightList.SelectedListItem != null) || (!_viewListStyle && _devicesFlow && _flowList.SelectedListItem != null)) { // Prevent Eception in case we have an empty room - selectedItem = _rightList.SelectedListItem.ItemId; + selectedItem = (_viewListStyle ? _rightList.SelectedListItem.ItemId : _flowList.SelectedListItem.ItemId); } else if (_lastSelectedItemId != 0) { @@ -611,28 +648,32 @@ if (_vera.NewScreenUpdateWaitingAndClearFlag() || newSelectedItem) { // if full reload has been found rebuild lists - if (_vera.FullReloadWaitingAndClearFlag() ) { + if (_vera.FullReloadWaitingAndClearFlag() ) + { FillLists(false); } else { // update device status - foreach (GUIListItem item in _rightList.ListItems) + foreach (GUIListItem item in GetListItems()) { - if (item.ItemId > 0) - { // ItemId > 0 so we have a device - DeviceGeneric dev = _vera.GetDeviceById(item.ItemId); - if (dev.NewScreenUpdateWaitingAndClearFlag() || (newSelectedItem && _lastSelectedItemId == item.ItemId)) - { - FillinDeviceInfo(item, dev); + if (item.ItemId != ALL) + { + if (item.ItemId > 0) + { // ItemId > 0 so we have a device + DeviceGeneric dev = _vera.GetDeviceById(item.ItemId); + if (dev.NewScreenUpdateWaitingAndClearFlag() || (newSelectedItem && _lastSelectedItemId == item.ItemId)) + { + FillinDeviceInfo(item, dev); + } } - } - else - { // ItemId < 0 so we have a scene - Scene scene = _vera.GetSceneById((item.ItemId * -1)); - if (scene.NewScreenUpdateWaitingAndClearFlag() || (newSelectedItem && _lastSelectedItemId == item.ItemId)) - { - FillinSceneInfo(item, scene); + else + { // ItemId < 0 so we have a scene + Scene scene = _vera.GetSceneById((item.ItemId * -1)); + if (scene.NewScreenUpdateWaitingAndClearFlag() || (newSelectedItem && _lastSelectedItemId == item.ItemId)) + { + FillinSceneInfo(item, scene); + } } } } @@ -660,7 +701,7 @@ _actionAutoRoomButton.Selected = _autoSelectRoom; _actionSortButton.Label = "Sort: " + _sortOptions[(int)_selectedSortOption].shorttext; _actionFilterButton.Label = "Filter: " + _filterOptions[(int)_selectedFilterOption].shorttext; - _actionViewButton.Label = "View: " + (_viewPerCategory ? "Category" : "Room");; + _actionViewButton.Label = "View: " + (_viewPerCategory ? "Category" : "Room") + (_viewListStyle ? " (list)" : " (flow)"); // Set selected box information - get availabiliy information here (not earlier, on init() not all boxes did have the change to response) using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.MPSettings()) @@ -694,23 +735,97 @@ { ListSections(); } - if (_viewPerCategory) + if (_viewListStyle) { - ListCategories(_selectedCategory); - if (_selectedCategory == ALL) { - ListScenes(ALL, _selectedSection); - } else { - ListDevicesPerCategory(_selectedCategory); + _rightList.Visibility = Visibility.Visible; + _leftList.Visibility = Visibility.Visible; + _flowList.Visibility = Visibility.Hidden; + + _sectionList.NavigateUp = _leftList.GetID; + _sectionList.NavigateDown = _leftList.GetID; + _sectionList.NavigateRight = _rightList.GetID; + + _actionVeraSelectButton.NavigateRight = _leftList.GetID; + _actionTriggerButton.NavigateRight = _leftList.GetID; + _actionSceneEditButton.NavigateRight = _leftList.GetID; + _actionFilterButton.NavigateRight = _leftList.GetID; + _actionSortButton.NavigateRight = _leftList.GetID; + _actionAutoRoomButton.NavigateRight = _leftList.GetID; + _actionViewButton.NavigateRight = _leftList.GetID; + + if (_viewPerCategory) + { + ListCategories(_selectedCategory); + if (_selectedCategory == ALL) { + ListScenes(ALL, _selectedSection); + } else { + ListDevicesPerCategory(_selectedCategory); + } } + else + { + ListRooms(_selectedSection, _selectedRoom); + if (_selectedRoom == ALL) { + ListScenes(ALL, _selectedSection); + } else { + ListDevicesPerRoom(_selectedRoom); + } + } } else { - ListRooms(_selectedSection, _selectedRoom); - if (_selectedRoom == ALL) { - ListScenes(ALL, _selectedSection); - } else { - ListDevicesPerRoom(_selectedRoom); + _rightList.Visibility = Visibility.Hidden; + _leftList.Visibility = Visibility.Hidden; + _flowList.Visibility = Visibility.Visible; + + _sectionList.NavigateUp = _flowList.GetID; + _sectionList.NavigateDown = _flowList.GetID; + _sectionList.NavigateRight = _flowList.GetID; + + _actionVeraSelectButton.NavigateRight = _flowList.GetID; + _actionTriggerButton.NavigateRight = _flowList.GetID; + _actionSceneEditButton.NavigateRight = _flowList.GetID; + _actionFilterButton.NavigateRight = _flowList.GetID; + _actionSortButton.NavigateRight = _flowList.GetID; + _actionAutoRoomButton.NavigateRight = _flowList.GetID; + _actionViewButton.NavigateRight = _flowList.GetID; + + if (_viewPerCategory) + { + if (_devicesFlow) + { + if (_selectedCategory == ALL) + { + ListScenes(ALL, _selectedSection); + } + else + { + ListDevicesPerCategory(_selectedCategory); + } + } + else + { + ListCategories(_selectedCategory); + } } + else + { + if (_devicesFlow) + { + if (_selectedCategory == ALL) + { + ListScenes(ALL, _selectedSection); + } + else + { + ListDevicesPerRoom(_selectedCategory); + } + } + else + { + ListRooms(_selectedSection, _selectedRoom); + } + } } } @@ -797,7 +912,7 @@ int cnt = 0; int selected = 0; // --- fill in left lisft with rooms and scene item - GUIControl.ClearControl(GetID, _leftList.GetID); + GUIControl.ClearControl(GetID, (_viewListStyle ? _leftList.GetID : _flowList.GetID)); GUIListItem sceneitem = new GUIListItem("Scenes"); sceneitem.ItemId = ALL; @@ -806,23 +921,49 @@ sceneitem.ThumbnailImage = "Vera\\Scenes.png"; Utils.SetDefaultIcons(sceneitem); - _leftList.Add(sceneitem); - + if (_viewListStyle) + { + _leftList.Add(sceneitem); + } + else + { + sceneitem.IsFolder = true; + _flowList.Add(sceneitem); + } foreach(Room room in _vera.GetSortedRooms(_selectedBox, _selectedSortOption)) { if (showSection == ALL || room.section == showSection) { GUIListItem item = new GUIListItem(room.name); + + string sectioname = _vera.GetSectionById(room.section).name; item.Label2 = _vera.GetSectionById(room.section).name; - item.ItemId = room.id; - item.IconImage = @"Vera\OpenList.png"; - item.IconImageBig = @"Vera\OpenList.png"; - item.ThumbnailImage = @"Vera\OpenList.png"; - - Utils.SetDefaultIcons(item); - _leftList.Add(item); - + if (_viewListStyle) + { + item.IconImage = @"Vera\OpenList.png"; + item.IconImageBig = @"Vera\OpenList.png"; + item.ThumbnailImage = @"Vera\OpenList.png"; + + Utils.SetDefaultIcons(item); + + _leftList.Add(item); + } + else + { + item.IconImage = @"Vera\room.png"; + item.IconImageBig = @"Vera\room.png"; + item.ThumbnailImage = @"Vera\room.png"; + + Utils.SetDefaultIcons(item); + + item.IsFolder = true; + if (sectioname != "") + { + item.Label = sectioname + ": " + room.name; + } + _flowList.Add(item); + } cnt++; if (selectedRoom == room.id) { @@ -831,7 +972,11 @@ } } // Set Current Selected Item - _leftList.SelectedListItemIndex = selected; + if (_viewListStyle) { + _leftList.SelectedListItemIndex = selected; + } else { + _flowList.SelectedListItemIndex = selected; + } } private void ListCategories(int selectedCategory) @@ -839,7 +984,8 @@ int cnt = 0; int selected = 0; // --- fill in left lisft with rooms and scene item - GUIControl.ClearControl(GetID, _leftList.GetID); + GUIControl.ClearControl(GetID, (_viewListStyle ? _leftList.GetID : _flowList.GetID)); + GUIListItem sceneitem = new GUIListItem("Scenes"); sceneitem.ItemId = ALL; @@ -848,8 +994,15 @@ sceneitem.ThumbnailImage = "Vera\\Scenes.png"; Utils.SetDefaultIcons(sceneitem); - _leftList.Add(sceneitem); - + if (_viewListStyle) + { + _leftList.Add(sceneitem); + } + else + { + sceneitem.IsFolder = true; + _flowList.Add(sceneitem); + } foreach(DevCategories category in (_selectedBox == ALL ? _vera.categories : _vera.boxes[_selectedBox].categories)) { if (_vera.ContainsSectionThisCategoyy(category.id, _selectedSection, _selectedFilterOption)) @@ -861,8 +1014,15 @@ item.ThumbnailImage = @"Vera\" + category.GetIconName() + ".png"; Utils.SetDefaultIcons(item); - _leftList.Add(item); - + if (_viewListStyle) + { + _leftList.Add(item); + } + else + { + item.IsFolder = true; + _flowList.Add(item); + } cnt++; if (selectedCategory == category.id) { @@ -871,27 +1031,54 @@ } } // Set Current Selected Item - _leftList.SelectedListItemIndex = selected; + if (_viewListStyle) { + _leftList.SelectedListItemIndex = selected; + } else { + _flowList.SelectedListItemIndex = selected; + } } private void ListScenes(int selectedRoom, int selectedSection) { - GUIControl.ClearControl(GetID, _rightList.GetID); + GUIControl.ClearControl(GetID, (_viewListStyle ? _rightList.GetID : _flowList.GetID)); + if (!_viewListStyle) + { + // --- fill in flowlist a return icon + GUIListItem backitem = new GUIListItem("back"); + backitem.ItemId = ALL; + + backitem.IconImage = "Vera\\back.png"; + backitem.IconImageBig = "Vera\\back.png"; + backitem.ThumbnailImage = "Vera\\back.png"; + + Utils.SetDefaultIcons(backitem); + backitem.IsFolder = true; + _flowList.Add(backitem); + } + foreach(Scene scene in _vera.GetSortedScenes(_selectedBox, _selectedSortOption)) { if ((selectedRoom == ALL || scene.InRoom(selectedRoom)) && _vera.IsRoomInSection(scene.room, selectedSection)) { GUIListItem item = new GUIListItem(scene.name); FillinSceneInfo(item, scene); - _rightList.Add(item); + if (_viewListStyle) { + _rightList.Add(item); + } else { + item.IsFolder = true; + _flowList.Add(item); + } } } GUIControl.FocusControl(GetID, _leftList.GetID); // Set Current Selected Item - _rightList.SelectedListItemIndex = 0; - + if (_viewListStyle) { + _rightList.SelectedListItemIndex = 0; + } else { + _flowList.SelectedListItemIndex = 0; + } _title.Label = _titleTxt + " - Scenes"; } @@ -923,7 +1110,12 @@ { GUIListItem item = new GUIListItem(dev.name); FillinDeviceInfo(item, dev); - _rightList.Add(item); + if (_viewListStyle) { + _rightList.Add(item); + } else { + item.IsFolder = true; + _flowList.Add(item); + } } } _title.Label = _titleTxt + " - " + _vera.GetRoomById(selectedRoom).name; @@ -931,8 +1123,23 @@ private void ListDevicesPerCategory(int selectedCategory) { - GUIControl.ClearControl(GetID, _rightList.GetID); + GUIControl.ClearControl(GetID, (_viewListStyle ? _rightList.GetID : _flowList.GetID)); + if (!_viewListStyle) + { + // --- fill in flowlist a return icon + GUIListItem backitem = new GUIListItem("back"); + backitem.ItemId = ALL; + + backitem.IconImage = "Vera\\back.png"; + backitem.IconImageBig = "Vera\\back.png"; + backitem.ThumbnailImage = "Vera\\back.png"; + + Utils.SetDefaultIcons(backitem); + backitem.IsFolder = true; + _flowList.Add(backitem); + } + foreach(DeviceGeneric dev in _vera.GetSortedDevices(_selectedBox, _selectedSortOption)) { if (dev.InCategory(selectedCategory) && dev.PassesFilter(_selectedFilterOption)) @@ -941,7 +1148,11 @@ { GUIListItem item = new GUIListItem(dev.name); FillinDeviceInfo(item, dev); - _rightList.Add(item); + if (_viewListStyle) { + _rightList.Add(item); + } else { + _flowList.Add(item); + } } } } @@ -960,17 +1171,23 @@ Utils.SetDefaultIcons(item); + if (!_viewListStyle) + { + item.Label = dev.name + (dev.GetStatusText() != "" ? " [" + dev.GetStatusText() +"]" : ""); + item.IsFolder = true; + } + if (_lastSelectedItemId == dev.id) { SetDeviceStatus(dev.commstate, dev.comment); } } - private void OnLeftlistCrtl(GUIListControl control) + private void OnLeftlistCrtl() { - int id = control.SelectedListItem.ItemId; + int id = (_viewListStyle ? _leftList.SelectedListItem.ItemId : _flowList.SelectedListItem.ItemId); - GUIAnimation.HideControl(GetID, _rightList.GetID); + _devicesFlow = true; if (_viewPerCategory) { _selectedCategory = id; @@ -996,8 +1213,6 @@ ListDevicesPerRoom(id); } } - - GUIAnimation.ShowControl(GetID, _rightList.GetID); } private void OnSectionList(GUISpinButton control) @@ -1005,13 +1220,12 @@ if (control.SpinValue > 0) { _selectedSection = _vera.GetSections(_selectedBox)[control.SpinValue-1].id;; - //_selectedSection = _vera.sections[control.SpinValue-1].id; } else { _selectedSection = ALL; } - if (_selectedSection == 0 ) + if (_selectedSection == 0) { _selectedSection = ALL; } @@ -1023,11 +1237,18 @@ FillLists(false); } - private void OnRightlistCrtl(GUIListControl control, Action.ActionType actionType) + private void OnRightlistCrtl(Action.ActionType actionType) { - if (control.SelectedListItem.ItemId < 0) + int itemId = (_viewListStyle ? _rightList.SelectedListItem.ItemId : _flowList.SelectedListItem.ItemId); + if (itemId == ALL) + { + _devicesFlow = false; + FillLists(false); + return; + } + if (itemId < 0) { // We have a scene as selected item (id <= 0) - Scene scene = _vera.GetSceneById((control.SelectedListItem.ItemId * -1)); + Scene scene = _vera.GetSceneById((itemId * -1)); if (scene != null) { @@ -1047,7 +1268,7 @@ } else { // We have a device as selected item - DeviceGeneric dev = _vera.GetDeviceById(control.SelectedListItem.ItemId); + DeviceGeneric dev = _vera.GetDeviceById(itemId); switch (actionType) { @@ -1122,6 +1343,7 @@ } // Update lists to reflect choice + _devicesFlow = false; FillLists(true); RefreshNow(); } @@ -1155,6 +1377,7 @@ } // Update lists to reflect choice + _devicesFlow = false; FillLists(true); RefreshNow(); } @@ -1169,24 +1392,30 @@ dlgMenu.Reset(); dlgMenu.SetHeading("Select viewing mode"); - dlgMenu.Add("View per room"); - dlgMenu.Add("View per category"); + dlgMenu.Add("View lists per room"); + dlgMenu.Add("View list per category"); + dlgMenu.Add("View flowstyle per room"); + dlgMenu.Add("View flowstyle per category"); dlgMenu.DoModal(GUIWindowManager.ActiveWindow); if (dlgMenu.SelectedLabel != -1) { // Something was selected - _viewPerCategory = (dlgMenu.SelectedId == 2); - control.Label = "View: " + (_viewPerCategory ? "Category" : "Room"); + _viewPerCategory = (dlgMenu.SelectedId == 2) || (dlgMenu.SelectedId == 4); + _viewListStyle = (dlgMenu.SelectedId <= 2); + control.Label = "... [truncated message content] |
From: <Ba...@us...> - 2012-02-17 23:12:58
|
Revision: 4456 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=4456&view=rev Author: BartEv Date: 2012-02-17 23:12:46 +0000 (Fri, 17 Feb 2012) Log Message: ----------- - Added multi box support - Added fallback to remote connectionType - Move scene trigger to side action menu - Added sort options - Added filter options - Add vie by category option Modified Paths: -------------- trunk/plugins/VeraControl/BaseDevice.cs trunk/plugins/VeraControl/DevCategories.cs trunk/plugins/VeraControl/DeviceCam.cs trunk/plugins/VeraControl/DeviceDimmer.cs trunk/plugins/VeraControl/DeviceDoorlock.cs trunk/plugins/VeraControl/DeviceGWeather.cs trunk/plugins/VeraControl/DeviceGeneric.cs trunk/plugins/VeraControl/DeviceHumidity.cs trunk/plugins/VeraControl/DeviceLightSensor.cs trunk/plugins/VeraControl/DevicePowerMeter.cs trunk/plugins/VeraControl/DeviceSceneController.cs trunk/plugins/VeraControl/DeviceSecurity.cs trunk/plugins/VeraControl/DeviceSprinkler.cs trunk/plugins/VeraControl/DeviceSwitch.cs trunk/plugins/VeraControl/DeviceSystem.cs trunk/plugins/VeraControl/DeviceTemperature.cs trunk/plugins/VeraControl/DeviceThermostat.cs trunk/plugins/VeraControl/DeviceWindowCovering.cs trunk/plugins/VeraControl/DialogActionTrigger.cs trunk/plugins/VeraControl/DialogDeviceControl.cs trunk/plugins/VeraControl/Room.cs trunk/plugins/VeraControl/Scene.cs trunk/plugins/VeraControl/Section.cs trunk/plugins/VeraControl/VeraCommunication.cs trunk/plugins/VeraControl/VeraControl.cs trunk/plugins/VeraControl/VeraControl.csproj trunk/plugins/VeraControl/VeraSetupForm.Designer.cs trunk/plugins/VeraControl/VeraSetupForm.cs trunk/plugins/VeraControl/skin/Default/VeraControl.xml trunk/plugins/VeraControl/skin/DefaultWide/VeraControl.xml Modified: trunk/plugins/VeraControl/BaseDevice.cs =================================================================== --- trunk/plugins/VeraControl/BaseDevice.cs 2012-02-17 15:42:33 UTC (rev 4455) +++ trunk/plugins/VeraControl/BaseDevice.cs 2012-02-17 23:12:46 UTC (rev 4456) @@ -18,22 +18,23 @@ /// </summary> public class BaseDevice { - private long _lastUpdate = 0; - private long _lastPendingUpdate = 0; - private bool _screenUpdateRequired = false; - private string _name = "unknown device"; - private int _id = 0; - private int _room = 0; + private long _lastUpdate = 0; + private long _lastPendingUpdate = 0; + private bool _screenUpdateRequired = false; + private string _name = "unknown device"; + private int _id = 0; + private int _room = 0; // not connected (-2), none (-1), pending (0,1,5,6), success(4), error (2,3) - private DevState _dsState = DevState.NONE; - private string _comment = ""; // red(error), green(success) or blue(pending) - icon/text + private DevState _dsState = DevState.NONE; + private string _comment = ""; // red(error), green(success) or blue(pending) - icon/text - public VeraHelper _helper = VeraHelper.Instance; - public VeraCommunication _vera = VeraCommunication.Instance; + public VeraHelper _helper = VeraHelper.Instance; + public VeraBox _myVeraBox = null; - public BaseDevice(XmlNode xn) + public BaseDevice(XmlNode xn, int veraid) { + _myVeraBox = VeraCommunication.Instance.boxes[veraid]; if (xn != null) { Update(xn); @@ -49,7 +50,7 @@ _id = _helper.GetAttrAsInt (xn, "id", _id); _room = _helper.GetAttrAsInt (xn, "room", _room); _comment = _helper.GetAttrAsString(xn, "comment", _comment ); - _dsState = _helper.ToDevState(_helper.GetAttrAsInt(xn, "state", -1)); + _dsState = _helper.ToDevState (_helper.GetAttrAsInt(xn, "state", -1)); if (_id == 0) { @@ -57,6 +58,16 @@ return false; } + if (room == _myVeraBox.zeroId || !_myVeraBox.status.IsRoomFound(room)) + { + room = _myVeraBox.zeroId; + if (!_myVeraBox.status.IsRoomFound(room)) + { // create dummy room to attach to + _myVeraBox.rooms.Add(new Room(null, _myVeraBox.myId)); + _myVeraBox.rooms[_myVeraBox.rooms.Count - 1].section = _myVeraBox.rooms[0].section; + } + } + // Set update flag screenUpdateRequired = true; lastUpdate = DateTime.Now.Ticks; @@ -75,37 +86,69 @@ public int id { - get { return _id; } - set { } + get + { + if (_myVeraBox == null) + { + return 0; + } + return (VeraCommunication.IDMASK * _myVeraBox.myId) + _id; + } } + public int internalId + { + get { return _id; } + } + + /// <summary> + /// Unique id based on Vera's serial id, so wil also stand on vera config/id changes. Should be used when id is stored over MP session (like in config files) + /// </summary> + public long configChangeProofId + { + get + { + if (_myVeraBox == null) + { + return 0; + } + return (long)((long)VeraCommunication.IDMASK * (long)_myVeraBox.status.system.serialno) + (long)_id; + } + } + public string name { - get { return _name; } - set { } + get { return _name; } } public bool InRoom(int id) { - return (_room == id); + return (room == id); } public int room { - get { return _room; } - set { _room = value; } + get { + if (_myVeraBox == null) + { + return 0; + } + return _room + (VeraCommunication.IDMASK * _myVeraBox.myId); + } + set + { + _room = value % VeraCommunication.IDMASK; + } } public DevState commstate { get { return _dsState; } - set { } } public string comment { get { return (commstate != DevState.NONE ? _comment : ""); } - set { } } public bool screenUpdateRequired @@ -114,7 +157,7 @@ set { if (value) { // If at least one device report screen update required, Vera should take over this report - _vera.setScreenUpdateRequired(); + _myVeraBox.setScreenUpdateRequired(); } _screenUpdateRequired = value; } Modified: trunk/plugins/VeraControl/DevCategories.cs =================================================================== --- trunk/plugins/VeraControl/DevCategories.cs 2012-02-17 15:42:33 UTC (rev 4455) +++ trunk/plugins/VeraControl/DevCategories.cs 2012-02-17 23:12:46 UTC (rev 4456) @@ -4,8 +4,8 @@ * Date: 22-12-2011 * Time: 14:14 * - * Copyright: 2012 GPL - Bart Eversdijk - * MediaPort plugin - MicasaVerde (TM) Vera Controller + * Copyright: 2012 GPL - Bart Eversdijk + * MediaPort plugin - MicasaVerde (TM) Vera Controller * E-mail: ba...@ev... */ using System; @@ -20,16 +20,28 @@ { public DevCategories(XmlNode xn) { - if (xn != null) + if (xn != null) { Update(xn); } } - private string _name = "unknown category"; - private int _id = 0; - public VeraHelper _helper = VeraHelper.Instance; + public DevCategories(int id) + { + _id = id; + } + public DevCategories(int id, string nm) + { + _id = id; + _name = nm; + } + + private string _name = "unknown category"; + private int _id = 0; + public VeraHelper _helper = VeraHelper.Instance; + + public bool Update(XmlNode xn) { _name = _helper.GetAttrAsString(xn, "name", _name); @@ -40,15 +52,90 @@ public int id { get { return _id; } - set { } } - + public string name { - get { return _name; } - set { } + get { return _name; } + set { _name = value; } } + + public string GetIconName() + { + switch (id) + { + case 1: // Interface + return "USB_UIRT"; + + case 2: // Dimmer + return "Dimmable_Light_100"; + + case 3: // Switch + return "Binary_Light_100"; + + case 4: // Generic Sensor + return "generic_sensor"; + + case 5: // Thermostat + return "Thermostat"; + + case 6: // Web Cam + return "Ip_Camera"; + + case 7: + return "Door_Lock_100"; + + case 8: // Window covering + return "Window_Covering"; + + case 9: // Remote control + case 10: // Ir TX + return "IR_Transmitter"; + + case 12: // Motion Sensor + return "Motion_Sensor_100"; + + case 11: // Generic IO + case 13: // Serial port + return "Generic_IO"; + + case 14: // Scene controller + return "Scenes_active"; + + case 15: // AV + return "music_audio"; + + case 16: // Humidity + return "Humidity_Sensor"; + + case 17: // Temperature + return "Temperature_Sensor"; + + case 18: // Light sensor + return "Light_Sensor"; + + case 19: // Z-wave + return "Zwave"; + + case 20: // Insteon + return "Insteon"; + + case 21: // Power meter + return "Power_Meter"; + + case 101: // Special Sprinkler device not support by Vera's UI + return "Sprinkler"; + + case 102: // Special (Google) Weather device not support by Vera's UI + return "location"; + + case 0: + default: + return "generic_sensor"; + } + } + public override string ToString() { return name; Modified: trunk/plugins/VeraControl/DeviceCam.cs =================================================================== --- trunk/plugins/VeraControl/DeviceCam.cs 2012-02-17 15:42:33 UTC (rev 4455) +++ trunk/plugins/VeraControl/DeviceCam.cs 2012-02-17 23:12:46 UTC (rev 4456) @@ -24,7 +24,7 @@ private string _user = ""; private string _pass = ""; - public DeviceCam(XmlNode xn): base (xn) + public DeviceCam(XmlNode xn, int verabox): base (xn, verabox) { if (xn != null) { @@ -53,21 +53,18 @@ } return _user + ":" + _pass + "@"; } - set { } } public string imgUrl { - get { return _vera.veraAddress + "/data_request?id=cam_image¶meters=get_video_frame&Device_Num=" + id + "&rand=" + DateTime.Now.Ticks; + get { return _myVeraBox.veraAddress + "/data_request?id=cam_image¶meters=get_video_frame&Device_Num=" + internalId.ToString() + "&rand=" + DateTime.Now.Ticks; // return "http://" + passString + m_sIp + "/" + m_sUrl.Replace("%2F", "/"); } - set { } } public string streamUrl { get { return "http://" + passString + _ip + "/" + _stream.Replace("%2F", "/"); } - set { } } public int refreshRate @@ -84,14 +81,8 @@ public override bool isControllable { get { return true; } - set { } } - public override string GetIconName() - { - return "Ip_Camera"; - } - public override bool NewScreenUpdateWaitingAndClearFlag( ) { // Invoking this method will clear the update ready flag -> so caller need to handle the update @@ -119,12 +110,12 @@ { if (id == 0) { - _vera.status.system.ReportCommandError("Unknown device"); + _myVeraBox.status.system.ReportCommandError("Unknown device"); screenUpdateRequired = true; return; } - string cmd = "?id=lu_action&DeviceNum=" + id + "&serviceId=urn:micasaverde-com:serviceId:PanTiltZoom1&action=" + direction; - _vera.DoVeraCommandRequest(cmd, ReportRequestError); + string cmd = "?id=lu_action&DeviceNum=" + internalId + "&serviceId=urn:micasaverde-com:serviceId:PanTiltZoom1&action=" + direction; + _myVeraBox.DoVeraCommandRequest(cmd, ReportRequestError); } public override void MoveUp() Modified: trunk/plugins/VeraControl/DeviceDimmer.cs =================================================================== --- trunk/plugins/VeraControl/DeviceDimmer.cs 2012-02-17 15:42:33 UTC (rev 4455) +++ trunk/plugins/VeraControl/DeviceDimmer.cs 2012-02-17 23:12:46 UTC (rev 4456) @@ -22,7 +22,7 @@ private string _watt = "-"; private string _kwh = "-"; - public DeviceDimmer(XmlNode xn): base (xn) + public DeviceDimmer(XmlNode xn, int verabox): base (xn, verabox) { if (xn != null) { @@ -42,7 +42,6 @@ public string watts { get { return _watt; } - set { } } public override bool status @@ -66,10 +65,10 @@ { ReportPendingRequest(); // Do something with vera - string cmd = "?id=lu_action&DeviceNum="+id.ToString() + + string cmd = "?id=lu_action&DeviceNum="+internalId.ToString() + "&serviceId=urn:upnp-org:serviceId:Dimming1&action=SetLoadLevelTarget" + "&newLoadlevelTarget=" + value; - _vera.DoVeraCommandRequest(cmd, ReportRequestError); + _myVeraBox.DoVeraCommandRequest(cmd, ReportRequestError); } _level = newValue; } @@ -78,7 +77,6 @@ public override int maxLevel { get { return 100; } - set { } } public override string ToString() @@ -89,7 +87,6 @@ public override bool isControllable { get { return true; } - set { } } public override string GetIconName() @@ -105,12 +102,49 @@ public override string GetExtraText() { - return (_kwh != "" ? _kwh + "kWh" : ""); + return ((_kwh != "" && _kwh != "-") ? "Power usage " + _kwh + " kWh" : ""); } public override string GetStatusText() { return (status ? level.ToString() + "%" : "Off"); } + + public override string mode + { + get { + string strmode = "Off"; + if (level > 0) { strmode = "25%"; } + if (level > 25) { strmode = "50%"; } + if (level > 50) { strmode = "75%"; } + if (level > 75) { strmode = "0n"; } + return strmode; + } + set { + switch (value) + { + case "Off": + level = 0; + break; + case "25%": + level = 25; + break; + case "50%": + level = 50; + break; + case "75%": + level = 75; + break; + case "On": + level = 100; + break; + } + } + } + + public override string [] GetCommands() + { + return new string [] {"Off", "On", "25%", "75%", "50%"}; + } } } Modified: trunk/plugins/VeraControl/DeviceDoorlock.cs =================================================================== --- trunk/plugins/VeraControl/DeviceDoorlock.cs 2012-02-17 15:42:33 UTC (rev 4455) +++ trunk/plugins/VeraControl/DeviceDoorlock.cs 2012-02-17 23:12:46 UTC (rev 4456) @@ -20,7 +20,7 @@ { private bool _status = false; - public DeviceDoorlock( XmlNode xn ): base (xn) + public DeviceDoorlock( XmlNode xn, int verabox ): base (xn, verabox) { if (xn != null) { @@ -43,10 +43,10 @@ { ReportPendingRequest(); // Do something with vera - string cmd = "?id=lu_action&DeviceNum="+id.ToString()+ + string cmd = "?id=lu_action&DeviceNum="+internalId.ToString()+ "&serviceId=urn:micasaverde-com:serviceId:DoorLock1&action=SetTarget" + "&newTargetValue="+(value ? "1" : "0"); - _vera.DoVeraCommandRequest(cmd, ReportRequestError); + _myVeraBox.DoVeraCommandRequest(cmd, ReportRequestError); } } } @@ -63,7 +63,6 @@ public override int maxLevel { get { return 1; } - set { } } public override string ToString() @@ -74,7 +73,6 @@ public override bool isControllable { get { return true; } - set { } } public override string GetIconName() Modified: trunk/plugins/VeraControl/DeviceGWeather.cs =================================================================== --- trunk/plugins/VeraControl/DeviceGWeather.cs 2012-02-17 15:42:33 UTC (rev 4455) +++ trunk/plugins/VeraControl/DeviceGWeather.cs 2012-02-17 23:12:46 UTC (rev 4456) @@ -21,7 +21,7 @@ private string _condition = "-"; private string _windCondition = "-"; - public DeviceGWeather(XmlNode xn): base (xn) + public DeviceGWeather(XmlNode xn, int verabox): base (xn, verabox) { if (xn != null) { @@ -35,8 +35,15 @@ _condition = _helper.GetAttrAsString(xn, "condition", _condition); // World Weather plugin _windCondition = _helper.GetAttrAsString(xn, "WindCondition", _windCondition); _windCondition = _helper.GetAttrAsString(xn, "windcondition", _windCondition); + + bool ret = base.Update(xn); + category = 102; // Override Vera's Cateogry with Speical ID code - return base.Update(xn); + if (!_myVeraBox.status.IsCategoryFound(category)) + { // create this category if it does not exists + _myVeraBox.categories.Add(new DevCategories(category, "Weather")); + } + return ret; } public override string ToString() Modified: trunk/plugins/VeraControl/DeviceGeneric.cs =================================================================== --- trunk/plugins/VeraControl/DeviceGeneric.cs 2012-02-17 15:42:33 UTC (rev 4455) +++ trunk/plugins/VeraControl/DeviceGeneric.cs 2012-02-17 23:12:46 UTC (rev 4456) @@ -10,6 +10,7 @@ */ using System; using System.Xml; +using System.Collections; using System.Collections.Generic; namespace VeraControl.Properties @@ -23,7 +24,7 @@ private int _category = 0; private int _stepsize = 0; - public DeviceGeneric(XmlNode xn): base (xn) + public DeviceGeneric(XmlNode xn, int verabox): base (xn, verabox) { if (xn != null) { @@ -40,33 +41,53 @@ _altId = _helper.GetAttrAsString(xn, "altid", _altId); _category = _helper.GetAttrAsInt (xn, "category", _category); - bool b = base.Update(xn); - // Make sure the room exists - if (room == 0 || !_vera.status.IsRoomFound(room)) + return base.Update(xn); + } + + public bool PassesFilter(VeraFilterStyle filter) + { + switch (filter) { - if (!_vera.status.IsRoomFound(0)) - { // create dummy room to attach to - _vera.rooms.Add(new Room(null)); - } - room = 0; + case VeraFilterStyle.UNKNOWN_DEVICES: + return isControllable|| !new ArrayList(new int [] {0}).Contains(category); + + case VeraFilterStyle.GENERIC_DEVICES: + return isControllable || !new ArrayList(new int [] {0,1,11,12}).Contains(category); + + case VeraFilterStyle.REMOTE_DEVICES: + return isControllable || !new ArrayList(new int [] {0,1,10,11,12,13,15,19,20}).Contains(category); + + case VeraFilterStyle.SCENE_CONTROLLERS: + return isControllable || !new ArrayList(new int [] {0,1,10,11,12,13,14,15,19,20}).Contains(category); + + case VeraFilterStyle.CONTROLABLE_ONLY: + return isControllable; + + default: + case VeraFilterStyle.NONE: + return true; } - return b; } - + public string altid { get { return _altId; } } - + + public bool InCategory(int id) + { + return (category == id); + } + public int category { get { return _category; } + set { _category = value; } } public virtual bool isControllable { get { return false; } - set { } } public virtual bool status @@ -92,7 +113,7 @@ if (stepSize > 0) { level += stepSize; - } + } } public virtual void DecreaseLevel() @@ -100,7 +121,7 @@ if (stepSize > 0) { level -= stepSize; - } + } } public virtual string mode @@ -123,7 +144,7 @@ public override string GetIconName() { - return "generic_sensor"; + return new DevCategories(category).GetIconName(); } public override string GetStatusText() Modified: trunk/plugins/VeraControl/DeviceHumidity.cs =================================================================== --- trunk/plugins/VeraControl/DeviceHumidity.cs 2012-02-17 15:42:33 UTC (rev 4455) +++ trunk/plugins/VeraControl/DeviceHumidity.cs 2012-02-17 23:12:46 UTC (rev 4456) @@ -20,7 +20,7 @@ { private int _level = 0; - public DeviceHumidity(XmlNode xn) : base (xn) + public DeviceHumidity(XmlNode xn, int verabox) : base (xn, verabox) { if (xn != null) { @@ -37,13 +37,11 @@ public override int level { get { return _level; } - set {} } public override int maxLevel { get { return 100; } - set { } } public override string ToString() @@ -51,11 +49,6 @@ return name + " [" + level.ToString() + "%]"; } - public override string GetIconName() - { - return "Humidity_Sensor"; - } - public override string GetStatusText() { return level + "%"; Modified: trunk/plugins/VeraControl/DeviceLightSensor.cs =================================================================== --- trunk/plugins/VeraControl/DeviceLightSensor.cs 2012-02-17 15:42:33 UTC (rev 4455) +++ trunk/plugins/VeraControl/DeviceLightSensor.cs 2012-02-17 23:12:46 UTC (rev 4456) @@ -20,7 +20,7 @@ { private int _level = 0; - public DeviceLightSensor(XmlNode xn) : base (xn) + public DeviceLightSensor(XmlNode xn, int verabox) : base (xn, verabox) { if (xn != null) { @@ -38,19 +38,16 @@ public override bool status { get { return (_level > 0); } - set { } } public override int level { get { return _level; } - set { } } public override int maxLevel { get { return 100; } - set { } } public override string ToString() Modified: trunk/plugins/VeraControl/DevicePowerMeter.cs =================================================================== --- trunk/plugins/VeraControl/DevicePowerMeter.cs 2012-02-17 15:42:33 UTC (rev 4455) +++ trunk/plugins/VeraControl/DevicePowerMeter.cs 2012-02-17 23:12:46 UTC (rev 4456) @@ -21,7 +21,7 @@ private int _level = 0; private string _kwh = ""; - public DevicePowerMeter(XmlNode xn) : base (xn) + public DevicePowerMeter(XmlNode xn, int verabox) : base (xn, verabox) { if (xn != null) { @@ -39,25 +39,21 @@ public string watts { get { return _level.ToString(); } - set { } } public override bool status { get { return (_level > 0); } - set { } } public override int level { get { return _level; } - set { } } public override int maxLevel { get { return 1000; } - set { } } public override string ToString() @@ -65,14 +61,9 @@ return name + " [" + GetStatusText() + "]"; } - public override string GetIconName() - { - return "Power_Meter"; - } - public override string GetExtraText() { - return (_kwh != "" ? _kwh + "kWh" : ""); + return ((_kwh != "" && _kwh != "-") ? "Power usage " + _kwh + " kWh" : ""); } public override string GetStatusText() Modified: trunk/plugins/VeraControl/DeviceSceneController.cs =================================================================== --- trunk/plugins/VeraControl/DeviceSceneController.cs 2012-02-17 15:42:33 UTC (rev 4455) +++ trunk/plugins/VeraControl/DeviceSceneController.cs 2012-02-17 23:12:46 UTC (rev 4456) @@ -18,7 +18,7 @@ { private bool _isTripped = false; - public DeviceSceneController( XmlNode xn ) : base (xn) + public DeviceSceneController( XmlNode xn, int verabox ) : base (xn, verabox) { if (xn != null) { @@ -36,19 +36,16 @@ public override bool status { get { return _isTripped; } - set { } } public bool isTripped { get { return _isTripped; } - set { } } public override int level { get { return (_isTripped ? 1 : 0); } - set { } } public override string ToString() @@ -58,7 +55,7 @@ public override string GetIconName() { - return "Motion_Sensor_" + (_isTripped ? "100" : "0"); + return "Scenes" + (_isTripped ? "_active" : ""); } public override string GetStatusText() Modified: trunk/plugins/VeraControl/DeviceSecurity.cs =================================================================== --- trunk/plugins/VeraControl/DeviceSecurity.cs 2012-02-17 15:42:33 UTC (rev 4455) +++ trunk/plugins/VeraControl/DeviceSecurity.cs 2012-02-17 23:12:46 UTC (rev 4456) @@ -22,7 +22,7 @@ private bool _isTripped = false; private bool _isArmed = true; - public DeviceSecurity(XmlNode xn) : base (xn) + public DeviceSecurity(XmlNode xn, int verabox) : base (xn, verabox) { if (xn != null) { @@ -45,10 +45,10 @@ { ReportPendingRequest(); // Do something with vera - string cmd = "?id=lu_action&DeviceNum="+id.ToString()+ + string cmd = "?id=lu_action&DeviceNum=" + internalId.ToString() + "&serviceId=urn:micasaverde-com:serviceId:SecuritySensor1&action=SetArmed" + "&newArmedValue=" + (value ? "1" : "0"); - _vera.DoVeraCommandRequest(cmd, ReportRequestError); + _myVeraBox.DoVeraCommandRequest(cmd, ReportRequestError); } } } @@ -56,7 +56,6 @@ public bool isTripped { get { return _isTripped; } - set { } } public override int level @@ -68,13 +67,11 @@ public override int maxLevel { get { return 1; } - set { } } public override bool isControllable { get { return true; } - set { } } public override string ToString() Modified: trunk/plugins/VeraControl/DeviceSprinkler.cs =================================================================== --- trunk/plugins/VeraControl/DeviceSprinkler.cs 2012-02-17 15:42:33 UTC (rev 4455) +++ trunk/plugins/VeraControl/DeviceSprinkler.cs 2012-02-17 23:12:46 UTC (rev 4456) @@ -4,8 +4,8 @@ * Date: 3-1-2012 * Time: 16:26 * - * Copyright: 2012 GPL - Bart Eversdijk - * MediaPort plugin - MicasaVerde (TM) Vera Controller + * Copyright: 2012 GPL - Bart Eversdijk + * MediaPort plugin - MicasaVerde (TM) Vera Controller * E-mail: ba...@ev... */ using System; @@ -25,7 +25,7 @@ private string _operationMode = "-"; private string _condition = "-"; - public DeviceSprinkler(XmlNode xn) : base (xn) + public DeviceSprinkler(XmlNode xn, int verabox) : base (xn, verabox) { if (xn != null) { @@ -33,29 +33,39 @@ } } - public override bool Update(XmlNode xn) + public override bool Update(XmlNode xn) { _status = _helper.GetAttrAsBool (xn, "status", _status); _mode = _helper.GetAttrAsString(xn, "Mode", _mode); _shortMode = _helper.GetAttrAsString(xn, "ShortMode", _shortMode); _operationMode = _helper.GetAttrAsString(xn, "OperationMode", _operationMode); _condition = _helper.GetAttrAsString(xn, "Condition", _condition); - return base.Update(xn); + + bool ret = base.Update(xn); + category = 101; // Override Vera's Cateogry with Speical ID code + + if (!_myVeraBox.status.IsCategoryFound(category)) + { + // create this category if it does not exists + _myVeraBox.categories.Add(new DevCategories(category, "Sprinklers")); + } + + return ret; } public override bool status { get { return _status; } - set { - if (id > 0) // Only send when a valid ID is found - { - ReportPendingRequest(); - // Do something with vera - string cmd = "?id=lu_action&DeviceNum="+id.ToString()+ - "&serviceId=urn:upnp-org:serviceId:SwitchPower1&action=SetTarget" + - "&newTargetValue="+(value ? "1" : "0"); - _vera.DoVeraCommandRequest(cmd, ReportRequestError); - } + set { + if (id > 0) // Only send when a valid ID is found + { + ReportPendingRequest(); + // Do something with vera + string cmd = "?id=lu_action&DeviceNum=" + internalId.ToString() + + "&serviceId=urn:upnp-org:serviceId:SwitchPower1&action=SetTarget" + + "&newTargetValue="+(value ? "1" : "0"); + _myVeraBox.DoVeraCommandRequest(cmd, ReportRequestError); + } } } @@ -68,16 +78,16 @@ public override string mode { get { return _mode; } - set { - if (id > 0) // Only send when a valid ID is found - { - ReportPendingRequest(); - // Do something with vera - string cmd = "?id=lu_action&DeviceNum="+id.ToString()+ - "&serviceId=urn:upnp-micasaverde-com:serviceId:Sprinkler1&action=" + - (value == "Auto" ? "SetModeAuto" : (value == "Block" ? "SetModeBlock" : "SetModeManual")); - _vera.DoVeraCommandRequest(cmd, ReportRequestError); - } + set { + if (id > 0) // Only send when a valid ID is found + { + ReportPendingRequest(); + // Do something with vera + string cmd = "?id=lu_action&DeviceNum=" + internalId.ToString() + + "&serviceId=urn:upnp-micasaverde-com:serviceId:Sprinkler1&action=" + + (value == "Auto" ? "SetModeAuto" : (value == "Block" ? "SetModeBlock" : "SetModeManual")); + _myVeraBox.DoVeraCommandRequest(cmd, ReportRequestError); + } } } @@ -89,19 +99,12 @@ public override bool isControllable { get { return true; } - set { } } public override int maxLevel { get { return 1; } - set { } } - - public override string GetIconName() - { - return "Sprinkler"; - } public override string GetStatusText() { Modified: trunk/plugins/VeraControl/DeviceSwitch.cs =================================================================== --- trunk/plugins/VeraControl/DeviceSwitch.cs 2012-02-17 15:42:33 UTC (rev 4455) +++ trunk/plugins/VeraControl/DeviceSwitch.cs 2012-02-17 23:12:46 UTC (rev 4456) @@ -22,7 +22,7 @@ private string _watt = "-"; private string _kwh = "-"; - public DeviceSwitch(XmlNode xn) : base (xn) + public DeviceSwitch(XmlNode xn, int verabox) : base (xn, verabox) { if (xn != null) { @@ -42,7 +42,6 @@ public string watts { get { return _watt; } - set { } } public override bool status @@ -53,10 +52,10 @@ { ReportPendingRequest(); // Do something with vera - string cmd = "?id=lu_action&DeviceNum="+id.ToString()+ + string cmd = "?id=lu_action&DeviceNum=" + internalId.ToString() + "&serviceId=urn:upnp-org:serviceId:SwitchPower1&action=SetTarget" + "&newTargetValue="+(value ? "1" : "0"); - _vera.DoVeraCommandRequest(cmd, ReportRequestError); + _myVeraBox.DoVeraCommandRequest(cmd, ReportRequestError); } } } @@ -70,7 +69,6 @@ public override int maxLevel { get { return 1; } - set { } } public override string ToString() @@ -81,7 +79,6 @@ public override bool isControllable { get { return true; } - set { } } public override string GetIconName() @@ -91,7 +88,7 @@ public override string GetExtraText() { - return (_kwh != "" ? _kwh + "kWh" : ""); + return ((_kwh != "" && _kwh != "-") ? "Power usage " + _kwh + " kWh" : ""); } public override string GetStatusText() Modified: trunk/plugins/VeraControl/DeviceSystem.cs =================================================================== --- trunk/plugins/VeraControl/DeviceSystem.cs 2012-02-17 15:42:33 UTC (rev 4455) +++ trunk/plugins/VeraControl/DeviceSystem.cs 2012-02-17 23:12:46 UTC (rev 4456) @@ -26,12 +26,12 @@ public long _lastUpdate = 0; public bool _screenUpdateRequired = false; private bool _fullReload = true; - private string _version = ""; + private string _version = "-"; private string _model = ""; private bool _zWaveHeal = false; private bool _metric = true; - private string _serial = ""; - private string _fwd1Server = ""; + private int _serial = -1; + private string _fwd1Server = "-"; private string _fwd2Server = ""; private string _loadTime = "0"; private string _dataVersion = "0"; @@ -43,22 +43,22 @@ { _fullReload = _helper.GetAttrAsBool (xn, "full", _fullReload); _version = _helper.GetAttrAsString(xn, "version", _version); + _serial = _helper.GetAttrAsInt (xn, "serial_number", _serial); _model = _helper.GetAttrAsString(xn, "model", _model); _zWaveHeal = _helper.GetAttrAsBool (xn, "zwave_heal", _zWaveHeal); - _serial = _helper.GetAttrAsString(xn, "serial_number", _serial); _fwd1Server = _helper.GetAttrAsString(xn, "fwd1", _fwd1Server); _fwd2Server = _helper.GetAttrAsString(xn, "fwd2", _fwd2Server); _loadTime = _helper.GetAttrAsString(xn, "loadtime", _loadTime); // Set update flag - string tempDataversion = _helper.GetAttrAsString (xn, "dataversion", _dataVersion); - DevState tempVeraState = _helper.ToDevState(_helper.GetAttrAsInt(xn, "state", -1)); - string tempComment = _helper.GetAttrAsString (xn, "comment", ""); + string tempDataversion = _helper.GetAttrAsString (xn, "dataversion", _dataVersion); + DevState tempVeraState = _helper.ToDevState(_helper.GetAttrAsInt(xn, "state", -1)); + string tempComment = _helper.GetAttrAsString (xn, "comment", ""); if ((_dataVersion != tempDataversion) || _comment != tempComment || _dsVeraState != tempVeraState) { _screenUpdateRequired = true; - _lastUpdate = DateTime.Now.Ticks; + _lastUpdate = DateTime.Now.Ticks; } _dataVersion = tempDataversion; _dsVeraState = tempVeraState; @@ -91,61 +91,51 @@ public bool fullReload { get { return _fullReload; } - set { } } public string versionInfo { get { return _model + " " + _version; } - set { } } public bool zWaveHeal { get { return _zWaveHeal; } - set { } } - public string serialno + public int serialno { get { return _serial; } - set { } } public string fwd { get { return _fwd1Server; } - set { } } public string fwdBackup { get { return _fwd2Server; } - set { } } public string loadtime { get { return _loadTime; } - set { } } public string dataversion { get { return _dataVersion; } - set { } } public DevState state { - get { return _dsVeraState; } - set { } + get { return (serialno == -1 ? DevState.CONNECTION_ERROR :_dsVeraState); } } public string comment { - get { return _comment; } - set { } + get { return (serialno == -1 ? "Unable to connect" : _comment); } } public void ReportConnectionError(string errmsg) Modified: trunk/plugins/VeraControl/DeviceTemperature.cs =================================================================== --- trunk/plugins/VeraControl/DeviceTemperature.cs 2012-02-17 15:42:33 UTC (rev 4455) +++ trunk/plugins/VeraControl/DeviceTemperature.cs 2012-02-17 23:12:46 UTC (rev 4456) @@ -21,7 +21,7 @@ public string _temperature = "0"; // public thermostat class private bool _metric = true; - public DeviceTemperature(XmlNode xn, bool metric) : base (xn) + public DeviceTemperature(XmlNode xn, int verabox, bool metric) : base (xn, verabox) { _metric = metric; if (xn != null) @@ -39,31 +39,23 @@ public override int level { get { return int.Parse(_temperature); } - set { } } public override int maxLevel { get { return (_metric ? 100 : 212); } - set { } } public override int minLevel { get { return (_metric ? -22 : -7); } - set { } } public override string ToString() { return name + " [" + GetStatusText() + "]"; } - - public override string GetIconName() - { - return "Temperature_Sensor"; - } - + public override string GetStatusText() { return _temperature + (_metric ? "°C" : "°F"); Modified: trunk/plugins/VeraControl/DeviceThermostat.cs =================================================================== --- trunk/plugins/VeraControl/DeviceThermostat.cs 2012-02-17 15:42:33 UTC (rev 4455) +++ trunk/plugins/VeraControl/DeviceThermostat.cs 2012-02-17 23:12:46 UTC (rev 4456) @@ -24,7 +24,7 @@ private string _mode = "Off"; // "Off', "InDeadBand", "HeatOn", "CoolOn", "AutoChangeOver", "AuxHeatOn", "EconomyHeatOn", "EmergencyHeatOn", // "AuxCoolOn", "EconomyCoolOn", "BuildingProtection", "EnergySavingsHeating", "EnergySavingsCooling" - public DeviceThermostat(XmlNode xn, bool metric) : base (xn, metric) + public DeviceThermostat(XmlNode xn, int verabox, bool metric) : base (xn, verabox, metric) { _metric = metric; if (xn != null) @@ -51,7 +51,6 @@ public override int level { get { return -1; } - set { } } public override string mode @@ -62,11 +61,11 @@ { ReportPendingRequest(); // Do something with vera - string cmd = "?id=lu_action&DeviceNum="+id.ToString()+ + string cmd = "?id=lu_action&DeviceNum=" + internalId.ToString( )+ "&serviceId=urn:upnp-org:serviceId:HVAC_UserOperatingMode1&action=SetModeTarget" + - "&NewModeTarget="+(value == "Off" ? "Off" : (value == "Cool" ? "CoolOn" : (value == "Heat" ? "HeatOn" : "AutoChangeOver")) + "&NewModeTarget=" + (value == "Off" ? "Off" : (value == "Cool" ? "CoolOn" : (value == "Heat" ? "HeatOn" : "AutoChangeOver")) ); - _vera.DoVeraCommandRequest(cmd, ReportRequestError); + _myVeraBox.DoVeraCommandRequest(cmd, ReportRequestError); } } } @@ -79,13 +78,11 @@ public override bool isControllable { get { return true; } - set { } } public override int maxLevel { get { return -1; } - set { } } public override string GetStatusText() @@ -97,12 +94,7 @@ { return _hvacState + " - Fan : " + _fanMode + " - " + _temperature + (_metric ? "°C" : "°F") ; } - - public override string GetIconName() - { - return "Thermostat"; - } - + public override string [] GetCommands() { return new string [] {"Off", "On", "Auto", "Heat", "Cool"}; Modified: trunk/plugins/VeraControl/DeviceWindowCovering.cs =================================================================== --- trunk/plugins/VeraControl/DeviceWindowCovering.cs 2012-02-17 15:42:33 UTC (rev 4455) +++ trunk/plugins/VeraControl/DeviceWindowCovering.cs 2012-02-17 23:12:46 UTC (rev 4456) @@ -18,17 +18,12 @@ /// </summary> public class DeviceWindowCovering : DeviceDimmer { - public DeviceWindowCovering(XmlNode xn) : base (xn) + public DeviceWindowCovering(XmlNode xn, int verabox) : base (xn, verabox) { if (xn != null) { Update(xn); } } - - public override string GetIconName() - { - return "Window_Covering"; - } } } Modified: trunk/plugins/VeraControl/DialogActionTrigger.cs =================================================================== --- trunk/plugins/VeraControl/DialogActionTrigger.cs 2012-02-17 15:42:33 UTC (rev 4455) +++ trunk/plugins/VeraControl/DialogActionTrigger.cs 2012-02-17 23:12:46 UTC (rev 4456) @@ -116,7 +116,7 @@ base.OnClicked(controlId, control, actionType); } - private void InitSpinButtons(GUISpinButton spin, int selectedScene) + private void InitSpinButtons(GUISpinButton spin, long selectedScene) { GUIControl.ClearControl(GetID, spin.GetID); int iSceneIndex = 0; @@ -124,8 +124,8 @@ for (int i = 0; i < _vera.scenes.Count; i++) { - spin.AddSpinLabel(shortString(_vera.scenes[i].name), _vera.scenes[i].id); - if (_vera.scenes[i].id == selectedScene) + spin.AddSpinLabel(shortString(_vera.scenes[i].name), i + 1); + if (_vera.scenes[i].configChangeProofId == selectedScene) { iSceneIndex = i + 1; // 0 is - none - } @@ -160,7 +160,7 @@ if (spinList[i].SpinValue == 0) { _vera.actionTriggerTable[i] = 0; } else { - _vera.actionTriggerTable[i] = _vera.scenes[spinList[i].SpinValue - 1].id; + _vera.actionTriggerTable[i] = _vera.scenes[spinList[i].SpinValue - 1].configChangeProofId; } xmlwritter.SetValue("veracontroller", ((Actiontrigger) i).ToString(), _vera.actionTriggerTable[i].ToString()); } Modified: trunk/plugins/VeraControl/DialogDeviceControl.cs =================================================================== --- trunk/plugins/VeraControl/DialogDeviceControl.cs 2012-02-17 15:42:33 UTC (rev 4455) +++ trunk/plugins/VeraControl/DialogDeviceControl.cs 2012-02-17 23:12:46 UTC (rev 4456) @@ -135,26 +135,33 @@ if (_myDev.isControllable) { if (_myDev.GetType() == typeof(DeviceSprinkler)) - { + { // Special Sprinkler device SetText(_myDev.name, _myDev.GetStatusText() + " - " + _myDev.mode, _myDev.GetExtraText() ); SetActiveBut((_myDev.status ? 1 : 0), (_myDev.mode == "Auto" ? 0 : (_myDev.mode == "Block" ? 2 : 1) )); } else if (_myDev.GetType() == typeof(DeviceThermostat)) - { + { // Thermostat device SetText(_myDev.name, _myDev.GetStatusText(), _myDev.GetExtraText() ); SetActiveBut((_myDev.status ? 1 : 0), (_myDev.mode == "Auto" ? 0 : (_myDev.mode == "CoolOn" || _myDev.mode == "Cool" ? 1 : (_myDev.mode == "HeatOn" || _myDev.mode == "Heat" ? 2 : 3) ))); } + else if (_myDev.GetType() == typeof(DeviceDimmer)) + { // Dimmer device + SetText(_myDev.name, "Dim level: " + _myDev.GetStatusText(), _myDev.GetExtraText() ); + SetActiveBut((_myDev.mode == "Off" ? 0 : (_myDev.mode == "On" ? 1 : 2)), + (_myDev.mode == "25%" ? 0 : (_myDev.mode == "50%" ? 1 : (_myDev.mode == "75%" ? 2 : 3) ))); + } else if (_myDev.GetType() == typeof(DeviceCam)) - { + { // WebCam device SetText(_myDev.name, _myDev.GetStatusText(), _myDev.GetExtraText()); } else - { + { // Rest of the devices SetText(_myDev.name, "", ""); SetActiveBut(_myDev.status ? 1 : 0, -1); } + // No slider or status buttons for a cam-device if (_myDev.GetType() != typeof(DeviceCam)) { @@ -169,6 +176,7 @@ { SetText(_myDev.name, _myDev.GetStatusText(), _myDev.GetExtraText()); } + // save last update ticks _lastUpdate = DateTime.Now.Ticks; } @@ -316,7 +324,7 @@ public int camUpdateDelay { - get { return _camUpdateDelay; } + get { return _camUpdateDelay; } set { _camUpdateDelay = value; } } Modified: trunk/plugins/VeraControl/Room.cs =================================================================== --- trunk/plugins/VeraControl/Room.cs 2012-02-17 15:42:33 UTC (rev 4455) +++ trunk/plugins/VeraControl/Room.cs 2012-02-17 23:12:46 UTC (rev 4456) @@ -4,8 +4,8 @@ * Date: 22-12-2011 * Time: 14:05 * - * Copyright: 2012 GPL - Bart Eversdijk - * MediaPort plugin - MicasaVerde (TM) Vera Controller + * Copyright: 2012 GPL - Bart Eversdijk + * MediaPort plugin - MicasaVerde (TM) Vera Controller * E-mail: ba...@ev... */ using System; @@ -18,18 +18,19 @@ /// </summary> public class Room { - public Room(XmlNode xn) + public Room(XmlNode xn, int veraid) { + _myVeraBox = VeraCommunication.Instance.boxes[veraid]; if (xn != null) { Update(xn); } } - public VeraHelper _helper = VeraHelper.Instance; - public VeraCommunication _vera = VeraCommunication.Instance; + public VeraHelper _helper = VeraHelper.Instance; + public VeraBox _myVeraBox; - private string _name = "unknown room"; + private string _name = "unassigned"; private int _id = 0; private int _section = 0; @@ -44,14 +45,15 @@ // void room no further processing needed return true; } + // Make sure room exists - if (_section == 0 || !_vera.status.IsSectionFound(_section)) + if (section == _myVeraBox.zeroId || !_myVeraBox.status.IsSectionFound(section)) { - if (!_vera.status.IsSectionFound(0)) + section = _myVeraBox.zeroId; + if (!_myVeraBox.status.IsSectionFound(section)) { // create dummy room to attach to - _vera.sections.Add(new Section(null)); + _myVeraBox.sections.Add(new Section(null, _myVeraBox.myId)); } - _section = 0; } return true; @@ -59,20 +61,38 @@ public int id { + get { + if (_myVeraBox == null) + { + return 0; + } + return _id + (VeraCommunication.IDMASK * _myVeraBox.myId); + } + } + + public int internalId + { get { return _id; } - set { } } - + public string name { - get { return _name; } - set { } + get { return _name; } } public int section { - get { return _section; } - set { } + get { + if (_myVeraBox == null) + { + return 0; + } + return _section + (VeraCommunication.IDMASK * _myVeraBox.myId); + } + set + { + _section = (value % VeraCommunication.IDMASK); + } } public override string ToString() Modified: trunk/plugins/VeraControl/Scene.cs =================================================================== --- trunk/plugins/VeraControl/Scene.cs 2012-02-17 15:42:33 UTC (rev 4455) +++ trunk/plugins/VeraControl/Scene.cs 2012-02-17 23:12:46 UTC (rev 4456) @@ -19,8 +19,9 @@ /// </summary> public class Scene : BaseDevice { - public Scene(XmlNode xn) : base (xn) + public Scene(XmlNode xn, int verabox) : base (xn, verabox) { + _myVeraBox = VeraCommunication.Instance.boxes[verabox]; if (xn != null) { Update(xn); @@ -32,14 +33,7 @@ public override bool Update(XmlNode xn) { _active = _helper.GetAttrAsBool(xn, "active", _active); - bool b = base.Update(xn); - - // Make sure the room exists or else make it 0 - if (room != 0 && !_vera.status.IsRoomFound(room)) - { - room = 0; - } - return b; + return base.Update(xn); } public override string GetIconName() @@ -49,7 +43,7 @@ public override string GetStatusText() { - return (room == 0 ? "" : _vera.status.GetRoomById(room).name); + return (room == _myVeraBox.zeroId ? "" : _myVeraBox.status.GetRoomById(room).name); } public bool IsActive() @@ -61,13 +55,13 @@ { if (id == 0) { - _vera.status.system.ReportCommandError("Unknown scene"); + _myVeraBox.status.system.ReportCommandError("Unknown scene"); screenUpdateRequired = true; return; } ReportPendingRequest(); string cmd = "?id=lu_action&serviceId=urn:micasaverde-com:serviceId:HomeAutomationGateway1&action=RunScene&SceneNum="+id; - _vera.DoVeraCommandRequest(cmd, ReportRequestError); + _myVeraBox.DoVeraCommandRequest(cmd, ReportRequestError); } } } Modified: trunk/plugins/VeraControl/Section.cs =================================================================== --- trunk/plugins/VeraControl/Section.cs 2012-02-17 15:42:33 UTC (rev 4455) +++ trunk/plugins/VeraControl/Section.cs 2012-02-17 23:12:46 UTC (rev 4456) @@ -4,8 +4,8 @@ * Date: 23-12-2011 * Time: 21:05 * - * Copyright: 2012 GPL - Bart Eversdijk - * MediaPort plugin - MicasaVerde (TM) Vera Controller + * Copyright: 2012 GPL - Bart Eversdijk + * MediaPort plugin - MicasaVerde (TM) Vera Controller * E-mail: ba...@ev... */ using System; @@ -18,8 +18,9 @@ /// </summary> public class Section { - public Section(XmlNode xn) + public Section(XmlNode xn, int verabox) { + _myVeraBox = VeraCommunication.Instance.boxes[verabox]; if (xn != null) { Update(xn); @@ -28,8 +29,9 @@ public VeraHelper _helper = VeraHelper.Instance; - private string _name = "unknown section"; - private int _id = 0; + private string _name = ""; + private int _id = 0; + public VeraBox _myVeraBox = null; public bool Update(XmlNode xn) { @@ -40,16 +42,44 @@ public int id { + get { + if (_myVeraBox == null) + { + return 0; + } + return (VeraCommunication.IDMASK * _myVeraBox.myId) + _id; + } + } + + public int _internalId + { get { return _id; } - set { } } - + public string name { - get { return _name; } - set { } + get + { + if (_myVeraBox == null) + { + return (_name == "" ? "unknown section" : _name); + } + return (_name == "" ? _myVeraBox.name : _name); + } } + public string longName + { + get + { + if (_myVeraBox == null) + { + return _name; + } + return ((_myVeraBox.name != "" && _myVeraBox.name != "-") ? _myVeraBox.name + " : " : "") + _name; + } + } + public override string ToString() { return name; Modified: trunk/plugins/VeraControl/VeraCommunication.cs =================================================================== --- trunk/plugins/VeraControl/VeraCommunication.cs 2012-02-17 15:42:33 UTC (rev 4455) +++ trunk/plugins/VeraControl/VeraCommunication.cs 2012-02-17 23:12:46 UTC (rev 4456) @@ -17,684 +17,575 @@ namespace VeraControl.Properties { + public enum VeraSortStyle + { + NO = 0, + ROOMS_ONLY_ASORT, + ROOMS_ONLY_DSORT, + GROUP_BOXES_ASORT, + GROUP_BOXES_DSORT, + + LAST + }; + + public class SortItem + { + public SortItem(VeraSortStyle sort, string t, string s) + { + option = sort; + fulltext = t; + shorttext = s; + } + public VeraSortStyle option; + public string fulltext; + public string shorttext; + } + + public enum VeraFilterStyle + { + NONE = 0, + UNKNOWN_DEVICES, + GENERIC_DEVICES, + REMOTE_DEVICES, + SCENE_CONTROLLERS, + CONTROLABLE_ONLY, + + LAST + }; + + public class FilterItem + { + public FilterItem(VeraFilterStyle f, string t, string s) + { + option = f; + fulltext = t; + shorttext = s; + } + public VeraFilterStyle option; + public string fulltext; + public string shorttext; + } + + /// <summary> /// Description of VeraCommunication. /// </summary> - public class VeraStatus + public sealed class VeraCommunication { - public DeviceSystem system = new DeviceSystem(); - public List<DeviceGeneric> devices = new List<DeviceGeneric>(); - public List<Scene> scenes = new List<Scene>(); - public List<Room> rooms = new List<Room>(); - public List<DevCategories> categories = new List<DevCategories>(); - public List<Section> sections = new List<Section>(); + private static volatile VeraCommunication _instance; + private static object _syncRoot = new Object(); + private VeraHelper _helper = VeraHelper.Instance; - #region Vers get by id support functions - - public void ClearAllLists() + // Config data + private int _numOfBoxes = 1; + public VeraBox [] boxes; + + public const int IDMASK = 0xFFFF; + public const int ALL = Int32.MaxValue; + + // Action control table + public long [] actionTriggerTable = new long[(int)Actiontrigger.LAST_ACTIONTRIGGER]; + + public static VeraCommunication Instance { - devices.Clear(); - scenes.Clear(); - rooms.Clear(); - categories.Clear(); - sections.Clear(); - } - public Room GetRoomById(int id) - { - foreach(Room room in rooms) + get { - if (room.id == id) + if (_instance == null) { - return room; + lock (_syncRoot) + { + if (_instance == null) + { + _instance = new VeraCommunication(); + + using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.MPSettings()) + { + int maxRefreshDelay = xmlreader.GetValueAsInt("veracontroller", "maxrefreshdelay", 60); + _instance._numOfBoxes = xmlreader.GetValueAsInt("veracontroller", "NumOfBoxes", -1); + bool oldStyleConfig = (_instance._numOfBoxes == -1); + if (oldStyleConfig) + { + _instance._numOfBoxes = 1; + _instance.boxes = new VeraBox[1]; + _instance.boxes[0] = new VeraBox(0, maxRefreshDelay, 1000); + _instance.boxes[0]._oldStyleConfig = true; + } + else + { + _instance.boxes = new VeraBox[_instance._numOfBoxes]; + for (int i = 0; i < _instance._numOfBoxes; i++) + { + _instance.boxes[i] = new VeraBox(i, maxRefreshDelay, 1000); + } + } + + for (Actiontrigger i = 0; i < Actiontrigger.LAST_ACTIONTRIGGER; i++) + { + _instance.actionTriggerTable[(int)i] = long.Parse(xmlreader.GetValueAsString("veracontroller", i.ToString(), "0")); + } + } + } + } } + + return _instance; } - return new Room(null); } - public Section GetSectionById(int id) + private VeraCommunication() { - foreach(Section section in sections) - { - if (section.id == id) - { - return section; - } - } - return new Section(null); } - public DeviceGeneric GetDeviceById(int id) + public bool IsVeraAlive(string ip, string port) { - foreach(DeviceGeneric dev in devices) - { - if (dev.id == id) - { - return dev; - } - } - return new DeviceGeneric(null); + string response = RetrieveURL("http://" + ip + ":" + port + "/data_request?id=lu_alive&time=" + DateTime.Now.Ticks); + return (response == "OK"); } - public Scene GetSceneById(int id) + private string RetrieveURL(string url) { - foreach(Scene scene in scenes) + // No callback thus Synchronised call (wait for response) + try { + WebClient wc = new WebClient(); + wc.CancelAsync(); // Cancel any current pending Async calls... + return wc.DownloadString(url); + } catch( Exception ) { - if (scene.id == id) - { - return scene; - } + return "ERROR"; } - return new Scene(null); } - public DevCategories GetCategoryById(int id) + public int numOfBoxes { - foreach(DevCategories cat in categories) - { - if (cat.id == id) - { - return cat; - } - } - return new DevCategories(null); + get { return _numOfBoxes; } } - public bool IsSectionFound(int id) + public int BoxId(long id) { - foreach(Section section in sections) - { - if (section.id == id) - { - return true; - } - } - return false; + return (int)(id / IDMASK); } - public bool IsRoomFound(int id) + public int DeviceId(long id) { - foreach(Room room in rooms) + return (int)(id % IDMASK); + } + + public void UpdateStatusOfAllBoxes() + { + for (int i = 0; i < numOfBoxes; i++) { - if (room.id == id) - { - return true; - } + boxes[i].UpdateCurrentStatus(); } - return false; } - public bool IsDeviceFound(int id) + public bool IsABoxPendingUnpdate() { - foreach(DeviceGeneric dev in devices) + for (int i = 0; i < numOfBoxes; i++) { - if (dev.id == id) + if (boxes[i].updatePending) { return true; } } return false; } + + public Room GetRoomById(int id) + { + return boxes[BoxId(id)].status.GetRoomById(id); + } + + public Section GetSectionById(int id) + { + return boxes[BoxId(id)].status.GetSectionById(id); + } + + public DeviceGeneric GetDeviceById(int id) + { + return boxes[BoxId(id)].status.GetDeviceById(id); + } - public bool IsSceneFound(int id) + public Scene GetSceneById(int id) { - foreach(Scene scene in scenes) + return boxes[BoxId(id)].status.GetSceneById(id); + } + + public Scene GetSceneByConfigProofId(long id) + { + for (int i = 0; i < numOfBoxes; i++) { - if (scene.id == id) + if (boxes[i].status.system.serialno == BoxId(id)) { - return true; + return boxes[i].status.GetSceneById(boxes[i].makeId((int)(id % IDMASK))) ; } } - return false; + return new Scene(null, 0); } - public bool IsCategoryFound(int id) + public DevCategorie... [truncated message content] |
From: <mic...@us...> - 2012-02-17 15:42:39
|
Revision: 4455 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=4455&view=rev Author: michael-t Date: 2012-02-17 15:42:33 +0000 (Fri, 17 Feb 2012) Log Message: ----------- Removed Paths: ------------- trunk/plugins/PowerScheduler++/Test/new/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mic...@us...> - 2012-02-17 15:41:36
|
Revision: 4454 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=4454&view=rev Author: michael-t Date: 2012-02-17 15:41:22 +0000 (Fri, 17 Feb 2012) Log Message: ----------- Version 1.2.6.0 (beta) Modified Paths: -------------- trunk/plugins/PowerScheduler++/Test/1.2.6.0/MPEI/PowerScheduler++.xmp2 trunk/plugins/PowerScheduler++/Test/1.2.6.0/MPEI/update.xml trunk/plugins/PowerScheduler++/Test/1.2.6.0/TvEngine3/TVLibrary/Plugins/PowerScheduler/Handlers/ActiveNetworkStandbyHandler.cs trunk/plugins/PowerScheduler++/Test/1.2.6.0/TvEngine3/TVLibrary/Plugins/PowerScheduler/Setup/PowerSchedulerSetup.Designer.cs trunk/plugins/PowerScheduler++/Test/1.2.6.0/TvEngine3/TVLibrary/Plugins/PowerScheduler/Setup/PowerSchedulerSetup.cs trunk/plugins/PowerScheduler++/Test/1.2.6.0/TvEngine3/TVLibrary/Plugins/PowerScheduler/Setup/PowerSchedulerSetup.resx trunk/plugins/PowerScheduler++/Test/1.2.6.0/VersionInfo.cs trunk/plugins/PowerScheduler++/Test/1.2.6.0/mediaportal/PowerSchedulerClientPlugin/Handlers/ActiveNetworkStandbyHandler.cs trunk/plugins/PowerScheduler++/Test/1.2.6.0/mediaportal/PowerSchedulerClientPlugin/PowerScheduler.cs trunk/plugins/PowerScheduler++/Test/1.2.6.0/mediaportal/PowerSchedulerClientPlugin/Setup/PowerSchedulerSetup.Designer.cs trunk/plugins/PowerScheduler++/Test/1.2.6.0/mediaportal/PowerSchedulerClientPlugin/Setup/PowerSchedulerSetup.cs trunk/plugins/PowerScheduler++/Test/1.2.6.0/mediaportal/PowerSchedulerClientPlugin/Setup/PowerSchedulerSetup.resx Added Paths: ----------- trunk/plugins/PowerScheduler++/Test/1.2.6.0/MPEI/PowerScheduler++ 1.2.6.0.mpe1 Removed Paths: ------------- trunk/plugins/PowerScheduler++/Test/1.2.6.0/MPEI/PowerScheduler++ 1.2.5.12.mpe1 Deleted: trunk/plugins/PowerScheduler++/Test/1.2.6.0/MPEI/PowerScheduler++ 1.2.5.12.mpe1 =================================================================== (Binary files differ) Copied: trunk/plugins/PowerScheduler++/Test/1.2.6.0/MPEI/PowerScheduler++ 1.2.6.0.mpe1 (from rev 4453, trunk/plugins/PowerScheduler++/Test/new/MPEI/PowerScheduler++ 1.2.6.0.mpe1) =================================================================== (Binary files differ) Modified: trunk/plugins/PowerScheduler++/Test/1.2.6.0/MPEI/PowerScheduler++.xmp2 =================================================================== --- trunk/plugins/PowerScheduler++/Test/1.2.6.0/MPEI/PowerScheduler++.xmp2 2012-02-16 17:06:59 UTC (rev 4453) +++ trunk/plugins/PowerScheduler++/Test/1.2.6.0/MPEI/PowerScheduler++.xmp2 2012-02-17 15:41:22 UTC (rev 4454) @@ -482,12 +482,12 @@ </MinVersion> <MaxVersion> <Major>1</Major> - <Minor>2</Minor> - <Build>5</Build> - <Revision>0</Revision> + <Minor>3</Minor> + <Build>0</Build> + <Revision>99999</Revision> </MaxVersion> <WarnOnly>true</WarnOnly> - <Message>For MediaPortal release 1.2.x (not compatible with 1.1.x releases)</Message> + <Message>For MediaPortal release 1.2.x and 1.3.x (not compatible with 1.1.x releases)</Message> <Name>PowerScheduler++</Name> </DependencyItem> <DependencyItem> @@ -524,16 +524,14 @@ <Version> <Major>1</Major> <Minor>2</Minor> - <Build>5</Build> - <Revision>12</Revision> + <Build>6</Build> + <Revision>0</Revision> </Version> <ExtensionDescription>The PowerScheduler++ plugin is a replacement for the PowerScheduler plugin that comes as part of MediaPortal. Compared to the original PowerScheduler plugin it provides additional features (easier configuration, reboot option, ...) and configurable support for "away mode" on Vista and Win7 systems.</ExtensionDescription> - <VersionDescription>Version 1.2.5.12 - Alpha / experimental version for MP 1.2.x - -- Bugfix: No sudden suspend after client is started</VersionDescription> - <DevelopmentStatus>Alpha</DevelopmentStatus> + <VersionDescription>Version 1.2.6.0 - Beta version for MP 1.2.x and 1.3.x</VersionDescription> + <DevelopmentStatus>Beta</DevelopmentStatus> <OnlineLocation>http://www.team-mediaportal.com/index.php?option=com_mtree&task=att_download&link_id=87&cf_id=40</OnlineLocation> - <ReleaseDate>2012-01-27T16:03:54</ReleaseDate> + <ReleaseDate>2012-01-29T16:03:54</ReleaseDate> <Tags>tv server plugins, automation</Tags> <Location>..\MPEI\[Name] [Version].mpe1</Location> <Params> @@ -616,14 +614,14 @@ <Param1 /> <UpdateOption>OverwriteIfOlder</UpdateOption> <LocalFileName>PowerScheduler_high.png</LocalFileName> - <ZipFileName>Installer{CopyFile}\{e6303b5e-f675-44fb-8d06-8d5fa3b6bcee}-PowerScheduler_high.png</ZipFileName> + <ZipFileName>Installer{CopyFile}\{fa2ede5d-3194-44b3-aee9-d1c15d3afbce}-PowerScheduler_high.png</ZipFileName> <DestinationFilename /> </FileItem> <FileItem InstallType="CopyFile" SystemFile="true" Modified="true"> <Param1 /> <UpdateOption>OverwriteIfOlder</UpdateOption> <LocalFileName>..\mediaportal\PowerSchedulerClientPlugin\PowerScheduler.gif</LocalFileName> - <ZipFileName>Installer{CopyFile}\{09df5c74-9759-4525-b00d-0be0ae237295}-PowerScheduler.gif</ZipFileName> + <ZipFileName>Installer{CopyFile}\{bbb5447e-7524-4a9f-b516-cba334470cbc}-PowerScheduler.gif</ZipFileName> <DestinationFilename /> </FileItem> </Items> Modified: trunk/plugins/PowerScheduler++/Test/1.2.6.0/MPEI/update.xml =================================================================== --- trunk/plugins/PowerScheduler++/Test/1.2.6.0/MPEI/update.xml 2012-02-16 17:06:59 UTC (rev 4453) +++ trunk/plugins/PowerScheduler++/Test/1.2.6.0/MPEI/update.xml 2012-02-17 15:41:22 UTC (rev 4454) @@ -144,5 +144,146 @@ </ProjectSettings> <IsSkin>false</IsSkin> </PackageClass> + <PackageClass> + <Version>2.0</Version> + <Groups> + <Items> + <GroupItem Name="Server files"> + <DisplayName>Server files</DisplayName> + <DefaulChecked>true</DefaulChecked> + <Description>Server files</Description> + <Files> + <Items /> + </Files> + </GroupItem> + <GroupItem Name="Client files"> + <DisplayName>Client files</DisplayName> + <DefaulChecked>true</DefaulChecked> + <Description>Client files</Description> + <Files> + <Items /> + </Files> + </GroupItem> + <GroupItem Name="Original Files"> + <DisplayName>Original Files</DisplayName> + <DefaulChecked>true</DefaulChecked> + <Description>Original Files</Description> + <Files> + <Items /> + </Files> + </GroupItem> + <GroupItem Name="Never"> + <DisplayName>Never</DisplayName> + <DefaulChecked>true</DefaulChecked> + <Description>Never</Description> + <Files> + <Items /> + </Files> + </GroupItem> + </Items> + </Groups> + <Sections> + <Items /> + </Sections> + <Dependencies> + <Items> + <DependencyItem> + <Type>Installer</Type> + <Id /> + <MinVersion> + <Major>1</Major> + <Minor>1</Minor> + <Build>6</Build> + <Revision>27644</Revision> + </MinVersion> + <MaxVersion> + <Major>1</Major> + <Minor>3</Minor> + <Build>0</Build> + <Revision>99999</Revision> + </MaxVersion> + <WarnOnly>true</WarnOnly> + <Message>For MediaPortal release 1.2.x and 1.3.x (not compatible with 1.1.x releases)</Message> + <Name>PowerScheduler++</Name> + </DependencyItem> + <DependencyItem> + <Type>MediaPortal</Type> + <Id /> + <MinVersion> + <Major>1</Major> + <Minor>1</Minor> + <Build>6</Build> + <Revision>27644</Revision> + </MinVersion> + <MaxVersion> + <Major>1</Major> + <Minor>1</Minor> + <Build>6</Build> + <Revision>27644</Revision> + </MaxVersion> + <WarnOnly>false</WarnOnly> + <Message>For MediaPortal release 1.2.x (not compatible with 1.1.x releases)</Message> + <Name>PowerScheduler++</Name> + </DependencyItem> + </Items> + </Dependencies> + <PluginDependencies> + <Items /> + </PluginDependencies> + <GeneralInfo> + <Name>PowerScheduler++</Name> + <Id>9b9bc24e-69ca-4abc-8810-f8f95bd4bbe6</Id> + <Author>michael_t (based on PowerScheduler by micheloe)</Author> + <HomePage>http://www.team-mediaportal.com/extensions/other/powerscheduler</HomePage> + <ForumPage>http://forum.team-mediaportal.com/tv-server-plugins-294/powerscheduler-test-version-1-2-5-0-mediaportal-1-2-x-1-3-alpha-87446/</ForumPage> + <UpdateUrl>http://www.team-mediaportal.com/index.php?option=com_mtree&task=att_download&link_id=87&cf_id=49</UpdateUrl> + <Version> + <Major>1</Major> + <Minor>2</Minor> + <Build>6</Build> + <Revision>0</Revision> + </Version> + <ExtensionDescription>The PowerScheduler++ plugin is a replacement for the PowerScheduler plugin that comes as part of MediaPortal. Compared to the original PowerScheduler plugin it provides additional features (easier configuration, reboot option, ...) and configurable support for "away mode" on Vista and Win7 systems.</ExtensionDescription> + <VersionDescription>Version 1.2.6.0 - Beta version for MP 1.2.x and 1.3.x</VersionDescription> + <DevelopmentStatus>Beta</DevelopmentStatus> + <OnlineLocation>http://www.team-mediaportal.com/index.php?option=com_mtree&task=att_download&link_id=87&cf_id=40</OnlineLocation> + <ReleaseDate>2012-01-29T16:03:54</ReleaseDate> + <Tags>tv server plugins, automation</Tags> + <Location>..\MPEI\[Name] [Version].mpe1</Location> + <Params> + <Items> + <SectionParam Name="Online Icon"> + <Value>http://www.team-mediaportal.com/components/com_mtree/img/listings/m/471.gif</Value> + <ValueType>String</ValueType> + <Description>The icon file of the package stored online (jpg,png,bmp)</Description> + </SectionParam> + <SectionParam Name="Configuration file"> + <Value>%TvServerBase%\SetupTv.exe</Value> + <ValueType>Template</ValueType> + <Description>The file used to configure the extension. + If have .exe extension the will be executed + If have .dll extension used like MP plugin configuration</Description> + </SectionParam> + <SectionParam Name="Online Screenshots"> + <Value /> + <ValueType>String</ValueType> + <Description>Online stored screenshot urls separated by ; </Description> + </SectionParam> + <SectionParam Name="Force to uninstall on update"> + <Value>YES</Value> + <ValueType>Bool</ValueType> + <Description>Show dialog and force to uninstall previous version when updating an extension. Should only be disabled if you are using an NSIS/MSI installer.</Description> + </SectionParam> + </Items> + </Params> + </GeneralInfo> + <UniqueFileList> + <Items /> + </UniqueFileList> + <ProjectSettings> + <FolderGroups /> + </ProjectSettings> + <IsSkin>false</IsSkin> + </PackageClass> </Items> </ExtensionCollection> \ No newline at end of file Modified: trunk/plugins/PowerScheduler++/Test/1.2.6.0/TvEngine3/TVLibrary/Plugins/PowerScheduler/Handlers/ActiveNetworkStandbyHandler.cs =================================================================== --- trunk/plugins/PowerScheduler++/Test/1.2.6.0/TvEngine3/TVLibrary/Plugins/PowerScheduler/Handlers/ActiveNetworkStandbyHandler.cs 2012-02-16 17:06:59 UTC (rev 4453) +++ trunk/plugins/PowerScheduler++/Test/1.2.6.0/TvEngine3/TVLibrary/Plugins/PowerScheduler/Handlers/ActiveNetworkStandbyHandler.cs 2012-02-17 15:41:22 UTC (rev 4454) @@ -20,10 +20,7 @@ using System; using System.Collections; -using System.Collections.Generic; using System.Diagnostics; -using System.Threading; -using System.Timers; using TvDatabase; using TvEngine.PowerScheduler.Interfaces; using TvLibrary.Interfaces; @@ -39,13 +36,12 @@ { #region Variables - private PerformanceCounter dlCounter, ulCounter; // Performance counters to monitor download and upload speed. - private long dlValueOld, ulValueOld; // Download Upload counter value one second earlier, in bytes. - private DateTime lastSampleTime; + private PerformanceCounter _dlCounter, _ulCounter; // Performance counters to monitor download and upload speed. + private long _dlValueOld, _ulValueOld; // Download Upload counter value one second earlier, in bytes. + private DateTime _lastSampleTime = DateTime.Now; + private long _dlSpeed, _ulSpeed; // Download Upload peak values in KB/s + private string _name; // The name of the adapter. - internal long dlSpeedPeak, ulSpeedPeak; // Download Upload peak values in KB/s - internal string name; // The name of the adapter. - #endregion #region Private methods @@ -55,54 +51,55 @@ /// </summary> internal NetworkAdapter(string name) { - this.name = name; + _name = name; // Create performance counters for the adapter. - dlCounter = new PerformanceCounter("Network Interface", "Bytes Received/sec", this.name); - ulCounter = new PerformanceCounter("Network Interface", "Bytes Sent/sec", this.name); + _dlCounter = new PerformanceCounter("Network Interface", "Bytes Received/sec", this._name); + _ulCounter = new PerformanceCounter("Network Interface", "Bytes Sent/sec", this._name); // Since dlValueOld and ulValueOld are used in method update() to calculate network speed, // they must have be initialized. - lastSampleTime = DateTime.Now; - dlValueOld = dlCounter.NextSample().RawValue; - ulValueOld = ulCounter.NextSample().RawValue; - - // Clear peak values - dlSpeedPeak = 0; - ulSpeedPeak = 0; + _dlValueOld = _dlCounter.NextSample().RawValue; + _ulValueOld = _ulCounter.NextSample().RawValue; } /// <summary> /// Obtain new sample from performance counters, and update the values saved in dlSpeed, ulSpeed, etc. /// This method is supposed to be called only in NetworkMonitorHandler, one time every second. /// </summary> - internal void update() + internal void Update() { DateTime thisSampleTime = DateTime.Now; + // Download Upload counter value in bytes. - long dlValue = dlCounter.NextSample().RawValue; - long ulValue = ulCounter.NextSample().RawValue; + long dlValue = _dlCounter.NextSample().RawValue; + long ulValue = _ulCounter.NextSample().RawValue; // Calculates download and upload speed. - double monitorInterval = thisSampleTime.Subtract(lastSampleTime).TotalSeconds; - lastSampleTime = thisSampleTime; - long dlSpeed = (long)((dlValue - dlValueOld) / monitorInterval); - long ulSpeed = (long)((ulValue - ulValueOld) / monitorInterval); + double monitorInterval = thisSampleTime.Subtract(_lastSampleTime).TotalSeconds; + _lastSampleTime = thisSampleTime; + _dlSpeed = (long)((dlValue - _dlValueOld) / monitorInterval / 1024); + _ulSpeed = (long)((ulValue - _ulValueOld) / monitorInterval / 1024); - dlValueOld = dlValue; - ulValueOld = ulValue; + _dlValueOld = dlValue; + _ulValueOld = ulValue; + } - if ((dlSpeed / 1024) > dlSpeedPeak) // Store peak values in KB/s - { - dlSpeedPeak = (dlSpeed / 1024); - } + internal string Name + { + get { return _name; } + } - if ((ulSpeed / 1024) > ulSpeedPeak) // Store peak values in KB/s - { - ulSpeedPeak = (ulSpeed / 1024); - } + internal long DlSpeed + { + get { return _dlSpeed; } } + internal long UlSpeed + { + get { return _ulSpeed; } + } + #endregion } @@ -111,19 +108,12 @@ /// </summary> public class ActiveNetworkStandbyHandler : IStandbyHandler, IStandbyHandlerEx { - #region Constants - - private const int MonitorInteval = 10; // seconds - - #endregion - #region Variables - private System.Timers.Timer timer; // The timer event executes every second to refresh the values in adapters. - private Int32 idleLimit; // Minimum transferrate considered as network activity in KB/s. + private Int32 _idleLimit; // Minimum transferrate considered as network activity in KB/s. - private ArrayList monitoredAdapters = new ArrayList(); // The list of monitored adapters on the computer. - private List<string> _preventers = new List<string>(); // The list of standby preventers. + private ArrayList _monitoredAdapters = new ArrayList(); // The list of monitored adapters on the computer. + private int _preventers = 0; /// <summary> /// Use away mode setting @@ -170,8 +160,7 @@ if (enabled) // Start { Log.Debug("NetworkMonitorHandler: Network monitor started"); - Thread netmonThr = new Thread(new ThreadStart(StartNetworkMonitor)); - netmonThr.Start(); + StartNetworkMonitor(); } else // Stop { @@ -184,13 +173,13 @@ if (enabled) { setting = ps.Settings.GetSetting("NetworkMonitorIdleLimit"); - idleLimit = Int32.Parse(layer.GetSetting("PowerSchedulerNetworkMonitorIdleLimit", "2").Value); - if (setting.Get<Int32>() != idleLimit) + _idleLimit = Int32.Parse(layer.GetSetting("PowerSchedulerNetworkMonitorIdleLimit", "2").Value); + if (setting.Get<Int32>() != _idleLimit) { - setting.Set<Int32>(idleLimit); - Log.Debug("NetworkMonitorHandler: Idle limit in KB/s: {0}", idleLimit); + setting.Set<Int32>(_idleLimit); + Log.Debug("NetworkMonitorHandler: Idle limit in KB/s: {0}", _idleLimit); + } } - } // Check if away mode should be used setting = ps.Settings.GetSetting("NetworkMonitorAwayMode"); @@ -209,7 +198,7 @@ { try { - monitoredAdapters.Clear(); + _monitoredAdapters.Clear(); PerformanceCounterCategory category = new PerformanceCounterCategory("Network Interface"); @@ -223,13 +212,8 @@ // Create an instance of NetworkAdapter class. NetworkAdapter adapter = new NetworkAdapter(name); - monitoredAdapters.Add(adapter); // Add it to monitored adapters + _monitoredAdapters.Add(adapter); // Add it to monitored adapters } - - // Create and enable the timer - timer = new System.Timers.Timer(MonitorInteval * 1000); - timer.Elapsed += new ElapsedEventHandler(timer_Elapsed); - timer.Enabled = true; } catch (Exception ex) { @@ -240,27 +224,16 @@ // Disable the timer, and clear the monitoredAdapters list. private void StopNetworkMonitor() { - monitoredAdapters.Clear(); - timer.Enabled = false; + _monitoredAdapters.Clear(); } - // Timer elapsed - private void timer_Elapsed(object sender, ElapsedEventArgs e) - { - foreach (NetworkAdapter adapter in monitoredAdapters) - adapter.update(); - } - #endregion #region IStandbyHandler implementation public bool DisAllowShutdown { - get - { - return (StandbyMode != StandbyMode.StandbyAllowed); - } + get { return (StandbyMode != StandbyMode.StandbyAllowed); } } public void UserShutdownNow() {} @@ -278,24 +251,21 @@ { get { - _preventers.Clear(); + _preventers = 0; - foreach (NetworkAdapter adapter in monitoredAdapters) + foreach (NetworkAdapter adapter in _monitoredAdapters) { - if ((adapter.ulSpeedPeak >= idleLimit) || (adapter.dlSpeedPeak >= idleLimit)) + adapter.Update(); + if ((adapter.DlSpeed >= _idleLimit) || (adapter.UlSpeed >= _idleLimit)) { - // Log.Debug("NetworkMonitorHandler: standby prevented: {0}", adapter.name); - // Log.Debug("NetworkMonitorHandler: ulSpeed: {0}", adapter.ulSpeedPeak); - // Log.Debug("NetworkMonitorHandler: dlSpeed: {0}", adapter.dlSpeedPeak); - - adapter.ulSpeedPeak = 0; // Clear peak values - adapter.dlSpeedPeak = 0; - - _preventers.Add(adapter.name); // Add adapter to preventers + // Log.Debug("NetworkMonitorHandler: standby prevented: {0}", adapter.Name); + // Log.Debug("NetworkMonitorHandler: dlSpeed: {0}", adapter.DlSpeed); + // Log.Debug("NetworkMonitorHandler: ulSpeed: {0}", adapter.UlSpeed); + _preventers++; } } - if (_preventers.Count > 0) + if (_preventers > 0) { return _useAwayMode ? StandbyMode.AwayModeRequested : StandbyMode.StandbyPrevented; } Modified: trunk/plugins/PowerScheduler++/Test/1.2.6.0/TvEngine3/TVLibrary/Plugins/PowerScheduler/Setup/PowerSchedulerSetup.Designer.cs =================================================================== --- trunk/plugins/PowerScheduler++/Test/1.2.6.0/TvEngine3/TVLibrary/Plugins/PowerScheduler/Setup/PowerSchedulerSetup.Designer.cs 2012-02-16 17:06:59 UTC (rev 4453) +++ trunk/plugins/PowerScheduler++/Test/1.2.6.0/TvEngine3/TVLibrary/Plugins/PowerScheduler/Setup/PowerSchedulerSetup.Designer.cs 2012-02-17 15:41:22 UTC (rev 4454) @@ -64,6 +64,7 @@ this.comboBoxProfile = new System.Windows.Forms.ComboBox(); this.buttonExpertMode = new System.Windows.Forms.Button(); this.numericUpDownIdleTimeout = new System.Windows.Forms.NumericUpDown(); + this.checkBoxHomeOnly = new System.Windows.Forms.CheckBox(); this.groupBoxProcesses = new System.Windows.Forms.GroupBox(); this.groupBoxEPG = new System.Windows.Forms.GroupBox(); this.flowLayoutPanelEPG = new System.Windows.Forms.FlowLayoutPanel(); @@ -120,13 +121,15 @@ this.tabPageEPG = new System.Windows.Forms.TabPage(); this.tabPageGeneral = new System.Windows.Forms.TabPage(); this.groupBoxGeneral = new System.Windows.Forms.GroupBox(); - this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel(); + this.flowLayoutPanelGeneral = new System.Windows.Forms.FlowLayoutPanel(); this.textBoxProfile = new System.Windows.Forms.TextBox(); this.flowLayoutPanelIdleTimeout = new System.Windows.Forms.FlowLayoutPanel(); this.labelIdleTimeout1 = new System.Windows.Forms.Label(); this.labelIdleTimeout2 = new System.Windows.Forms.Label(); this.labelExpertMode = new System.Windows.Forms.Label(); this.tabControl = new System.Windows.Forms.TabControl(); + this.tabPageClient = new System.Windows.Forms.TabPage(); + this.groupBoxClient = new System.Windows.Forms.GroupBox(); ((System.ComponentModel.ISupportInitialize)(this.dataGridShares)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownNetworkIdleLimit)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownIdleTimeout)).BeginInit(); @@ -151,9 +154,11 @@ this.tabPageEPG.SuspendLayout(); this.tabPageGeneral.SuspendLayout(); this.groupBoxGeneral.SuspendLayout(); - this.flowLayoutPanel1.SuspendLayout(); + this.flowLayoutPanelGeneral.SuspendLayout(); this.flowLayoutPanelIdleTimeout.SuspendLayout(); this.tabControl.SuspendLayout(); + this.tabPageClient.SuspendLayout(); + this.groupBoxClient.SuspendLayout(); this.SuspendLayout(); // // textBoxStandbyWakeupCommand @@ -277,8 +282,8 @@ this.checkBoxMPClientRunning.Name = "checkBoxMPClientRunning"; this.checkBoxMPClientRunning.Size = new System.Drawing.Size(309, 17); this.checkBoxMPClientRunning.TabIndex = 2; - this.checkBoxMPClientRunning.Text = "No automatic standby while MediaPortal client is not running"; - this.toolTip.SetToolTip(this.checkBoxMPClientRunning, "Prevents standby while doing administrative work\r\n(only recommended for a single-" + + this.checkBoxMPClientRunning.Text = "No standby after idle timeout while MediaPortal client is not running"; + this.toolTip.SetToolTip(this.checkBoxMPClientRunning, "Prevents standby after idle timeout while doing administrative work\r\n(only recommended for a single-" + "seat HTPC)."); this.checkBoxMPClientRunning.UseVisualStyleBackColor = true; this.checkBoxMPClientRunning.CheckedChanged += new System.EventHandler(this.checkBoxMPClientRunning_CheckedChanged); @@ -288,9 +293,9 @@ this.checkBoxProcessesAwayMode.AutoSize = true; this.checkBoxProcessesAwayMode.Location = new System.Drawing.Point(34, 77); this.checkBoxProcessesAwayMode.Name = "checkBoxProcessesAwayMode"; - this.checkBoxProcessesAwayMode.Size = new System.Drawing.Size(358, 17); + this.checkBoxProcessesAwayMode.Size = new System.Drawing.Size(372, 17); this.checkBoxProcessesAwayMode.TabIndex = 3; - this.checkBoxProcessesAwayMode.Text = "Disable power button while processes are running (enable away mode)"; + this.checkBoxProcessesAwayMode.Text = "No user standby while processes are running (enable away mode)"; this.toolTip.SetToolTip(this.checkBoxProcessesAwayMode, "Not even a \"Power Off\" or \"Remote Control Off\"causes the\r\nsystem to go to standby" + " while the selected processes are running.\r\n"); this.checkBoxProcessesAwayMode.UseVisualStyleBackColor = true; @@ -323,9 +328,9 @@ this.checkBoxEPGAwayMode.AutoSize = true; this.checkBoxEPGAwayMode.Location = new System.Drawing.Point(34, 175); this.checkBoxEPGAwayMode.Name = "checkBoxEPGAwayMode"; - this.checkBoxEPGAwayMode.Size = new System.Drawing.Size(320, 17); + this.checkBoxEPGAwayMode.Size = new System.Drawing.Size(334, 17); this.checkBoxEPGAwayMode.TabIndex = 6; - this.checkBoxEPGAwayMode.Text = "Disable power button while grabbing EPG (enable away mode)"; + this.checkBoxEPGAwayMode.Text = "No user standby while grabbing EPG (enable away mode)"; this.toolTip.SetToolTip(this.checkBoxEPGAwayMode, "Not even a \"Power Off\" or \"Remote Control Off\"causes the\r\nsystem to go to standby" + " until EPG grabbing is completed."); this.checkBoxEPGAwayMode.UseVisualStyleBackColor = true; @@ -348,7 +353,7 @@ this.checkBoxEPGPreventStandby.Name = "checkBoxEPGPreventStandby"; this.checkBoxEPGPreventStandby.Size = new System.Drawing.Size(225, 17); this.checkBoxEPGPreventStandby.TabIndex = 5; - this.checkBoxEPGPreventStandby.Text = "No automatic standby while grabbing EPG"; + this.checkBoxEPGPreventStandby.Text = "No standby after idle timeout while grabbing EPG"; this.toolTip.SetToolTip(this.checkBoxEPGPreventStandby, "The system will not go to standby until EPG grabbing is completed."); this.checkBoxEPGPreventStandby.UseVisualStyleBackColor = true; this.checkBoxEPGPreventStandby.CheckedChanged += new System.EventHandler(this.checkBoxEPGPreventStandby_CheckedChanged); @@ -358,9 +363,9 @@ this.checkBoxNetworkAwayMode.AutoSize = true; this.checkBoxNetworkAwayMode.Location = new System.Drawing.Point(34, 72); this.checkBoxNetworkAwayMode.Name = "checkBoxNetworkAwayMode"; - this.checkBoxNetworkAwayMode.Size = new System.Drawing.Size(334, 17); + this.checkBoxNetworkAwayMode.Size = new System.Drawing.Size(348, 17); this.checkBoxNetworkAwayMode.TabIndex = 3; - this.checkBoxNetworkAwayMode.Text = "Disable power button while network is active (enable away mode)"; + this.checkBoxNetworkAwayMode.Text = "No user standby while network is active (enable away mode)"; this.toolTip.SetToolTip(this.checkBoxNetworkAwayMode, "Not even a \"Power Off\" or \"Remote Control Off\"causes the\r\nsystem to go to standby" + " while the network is active.\r\n"); this.checkBoxNetworkAwayMode.UseVisualStyleBackColor = true; @@ -371,9 +376,9 @@ this.checkBoxSharesAwayMode.AutoSize = true; this.checkBoxSharesAwayMode.Location = new System.Drawing.Point(34, 200); this.checkBoxSharesAwayMode.Name = "checkBoxSharesAwayMode"; - this.checkBoxSharesAwayMode.Size = new System.Drawing.Size(335, 17); + this.checkBoxSharesAwayMode.Size = new System.Drawing.Size(349, 17); this.checkBoxSharesAwayMode.TabIndex = 4; - this.checkBoxSharesAwayMode.Text = "Disable power button while shares are active (enable away mode)"; + this.checkBoxSharesAwayMode.Text = "No user standby while shares are active (enable away mode)"; this.toolTip.SetToolTip(this.checkBoxSharesAwayMode, "Not even a \"Power Off\" or \"Remote Control Off\"causes the\r\nsystem to go to standby" + " while the selected shares are active.\r\n"); this.checkBoxSharesAwayMode.UseVisualStyleBackColor = true; @@ -396,7 +401,6 @@ // this.comboBoxShutdownMode.Anchor = System.Windows.Forms.AnchorStyles.None; this.comboBoxShutdownMode.Enabled = false; - this.comboBoxShutdownMode.FormattingEnabled = true; this.comboBoxShutdownMode.Items.AddRange(new object[] { "(Hybrid) Sleep - S3", "Hibernate - S4", @@ -508,7 +512,7 @@ this.checkBoxNetworkEnabled.Name = "checkBoxNetworkEnabled"; this.checkBoxNetworkEnabled.Size = new System.Drawing.Size(239, 17); this.checkBoxNetworkEnabled.TabIndex = 0; - this.checkBoxNetworkEnabled.Text = "No automatic standby while network is active"; + this.checkBoxNetworkEnabled.Text = "No standby after idle timeout while network is active"; this.toolTip.SetToolTip(this.checkBoxNetworkEnabled, "The system will not go to standby while the network is active."); this.checkBoxNetworkEnabled.UseVisualStyleBackColor = true; this.checkBoxNetworkEnabled.CheckedChanged += new System.EventHandler(this.checkBoxNetworkEnabled_CheckedChanged); @@ -520,7 +524,7 @@ this.checkBoxSharesEnabled.Name = "checkBoxSharesEnabled"; this.checkBoxSharesEnabled.Size = new System.Drawing.Size(240, 17); this.checkBoxSharesEnabled.TabIndex = 0; - this.checkBoxSharesEnabled.Text = "No automatic standby while shares are active"; + this.checkBoxSharesEnabled.Text = "No standby after idle timeout while shares are active"; this.toolTip.SetToolTip(this.checkBoxSharesEnabled, "The system will not go to standby while the selected shares are active."); this.checkBoxSharesEnabled.UseVisualStyleBackColor = true; this.checkBoxSharesEnabled.CheckedChanged += new System.EventHandler(this.checkBoxSharesEnabled_CheckedChanged); @@ -529,7 +533,6 @@ // this.comboBoxProfile.Anchor = System.Windows.Forms.AnchorStyles.Left; this.comboBoxProfile.ForeColor = System.Drawing.SystemColors.WindowText; - this.comboBoxProfile.FormattingEnabled = true; this.comboBoxProfile.Items.AddRange(new object[] { "HTPC", "Desktop", @@ -571,6 +574,18 @@ this.numericUpDownIdleTimeout.ValueChanged += new System.EventHandler(this.numericUpDownIdleTimeout_ValueChanged); this.numericUpDownIdleTimeout.EnabledChanged += new System.EventHandler(this.numericUpDownIdleTimeout_EnabledChanged); // + // checkBoxHomeOnly + // + this.checkBoxHomeOnly.AutoSize = true; + this.checkBoxHomeOnly.Location = new System.Drawing.Point(12, 22); + this.checkBoxHomeOnly.Name = "checkBoxHomeOnly"; + this.checkBoxHomeOnly.Size = new System.Drawing.Size(226, 17); + this.checkBoxHomeOnly.TabIndex = 2; + this.checkBoxHomeOnly.Text = "Only allow standby when on home window"; + this.toolTip.SetToolTip(this.checkBoxHomeOnly, "Prevents standby while the MP client is not on home window"); + this.checkBoxHomeOnly.UseVisualStyleBackColor = true; + this.checkBoxHomeOnly.CheckedChanged += new System.EventHandler(this.buttonApply_Enable); + // // groupBoxProcesses // this.groupBoxProcesses.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) @@ -1210,7 +1225,7 @@ // this.groupBoxGeneral.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.groupBoxGeneral.Controls.Add(this.flowLayoutPanel1); + this.groupBoxGeneral.Controls.Add(this.flowLayoutPanelGeneral); this.groupBoxGeneral.Controls.Add(this.labelExpertMode); this.groupBoxGeneral.Controls.Add(this.buttonExpertMode); this.groupBoxGeneral.Location = new System.Drawing.Point(6, 6); @@ -1218,21 +1233,21 @@ this.groupBoxGeneral.Size = new System.Drawing.Size(464, 252); this.groupBoxGeneral.TabIndex = 0; this.groupBoxGeneral.TabStop = false; - this.groupBoxGeneral.Text = "Select profile"; + this.groupBoxGeneral.Text = "General settings"; // - // flowLayoutPanel1 + // flowLayoutPanelGeneral // - this.flowLayoutPanel1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + this.flowLayoutPanelGeneral.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.flowLayoutPanel1.AutoSize = true; - this.flowLayoutPanel1.Controls.Add(this.textBoxProfile); - this.flowLayoutPanel1.Controls.Add(this.comboBoxProfile); - this.flowLayoutPanel1.Controls.Add(this.flowLayoutPanelIdleTimeout); - this.flowLayoutPanel1.FlowDirection = System.Windows.Forms.FlowDirection.TopDown; - this.flowLayoutPanel1.Location = new System.Drawing.Point(9, 23); - this.flowLayoutPanel1.Name = "flowLayoutPanel1"; - this.flowLayoutPanel1.Size = new System.Drawing.Size(455, 158); - this.flowLayoutPanel1.TabIndex = 15; + this.flowLayoutPanelGeneral.AutoSize = true; + this.flowLayoutPanelGeneral.Controls.Add(this.textBoxProfile); + this.flowLayoutPanelGeneral.Controls.Add(this.comboBoxProfile); + this.flowLayoutPanelGeneral.Controls.Add(this.flowLayoutPanelIdleTimeout); + this.flowLayoutPanelGeneral.FlowDirection = System.Windows.Forms.FlowDirection.TopDown; + this.flowLayoutPanelGeneral.Location = new System.Drawing.Point(9, 23); + this.flowLayoutPanelGeneral.Name = "flowLayoutPanelGeneral"; + this.flowLayoutPanelGeneral.Size = new System.Drawing.Size(455, 158); + this.flowLayoutPanelGeneral.TabIndex = 15; // // textBoxProfile // @@ -1278,9 +1293,9 @@ this.labelIdleTimeout2.AutoSize = true; this.labelIdleTimeout2.Location = new System.Drawing.Point(126, 6); this.labelIdleTimeout2.Name = "labelIdleTimeout2"; - this.labelIdleTimeout2.Size = new System.Drawing.Size(43, 13); + this.labelIdleTimeout2.Size = new System.Drawing.Size(105, 13); this.labelIdleTimeout2.TabIndex = 12; - this.labelIdleTimeout2.Text = "minutes"; + this.labelIdleTimeout2.Text = "minutes (idle timeout)"; // // labelExpertMode // @@ -1301,6 +1316,7 @@ this.tabControl.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.tabControl.Controls.Add(this.tabPageGeneral); + this.tabControl.Controls.Add(this.tabPageClient); this.tabControl.Controls.Add(this.tabPageEPG); this.tabControl.Controls.Add(this.tabPageReboot); this.tabControl.Controls.Add(this.tabPageProcesses); @@ -1314,7 +1330,31 @@ this.tabControl.ShowToolTips = true; this.tabControl.Size = new System.Drawing.Size(484, 290); this.tabControl.TabIndex = 1; + this.tabControl.Tag = ""; // + // tabPageClient + // + this.tabPageClient.Controls.Add(this.groupBoxClient); + this.tabPageClient.Location = new System.Drawing.Point(4, 22); + this.tabPageClient.Name = "tabPageClient"; + this.tabPageClient.Padding = new System.Windows.Forms.Padding(3); + this.tabPageClient.Size = new System.Drawing.Size(476, 264); + this.tabPageClient.TabIndex = 7; + this.tabPageClient.Text = "Client"; + this.tabPageClient.UseVisualStyleBackColor = true; + // + // groupBoxClient + // + this.groupBoxClient.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.groupBoxClient.Controls.Add(this.checkBoxHomeOnly); + this.groupBoxClient.Location = new System.Drawing.Point(6, 7); + this.groupBoxClient.Name = "groupBoxClient"; + this.groupBoxClient.Size = new System.Drawing.Size(464, 250); + this.groupBoxClient.TabIndex = 1; + this.groupBoxClient.TabStop = false; + this.groupBoxClient.Text = "Client settings"; + // // PowerSchedulerSetup // this.Controls.Add(this.groupBoxStatus); @@ -1361,11 +1401,14 @@ this.tabPageGeneral.ResumeLayout(false); this.groupBoxGeneral.ResumeLayout(false); this.groupBoxGeneral.PerformLayout(); - this.flowLayoutPanel1.ResumeLayout(false); - this.flowLayoutPanel1.PerformLayout(); + this.flowLayoutPanelGeneral.ResumeLayout(false); + this.flowLayoutPanelGeneral.PerformLayout(); this.flowLayoutPanelIdleTimeout.ResumeLayout(false); this.flowLayoutPanelIdleTimeout.PerformLayout(); this.tabControl.ResumeLayout(false); + this.tabPageClient.ResumeLayout(false); + this.groupBoxClient.ResumeLayout(false); + this.groupBoxClient.PerformLayout(); this.ResumeLayout(false); this.PerformLayout(); @@ -1464,7 +1507,10 @@ private System.Windows.Forms.FlowLayoutPanel flowLayoutPanelReboot; private System.Windows.Forms.FlowLayoutPanel flowLayoutPanelNetworkIdleLimit; private System.Windows.Forms.FlowLayoutPanel flowLayoutPanelIdleTimeout; - private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1; + private System.Windows.Forms.FlowLayoutPanel flowLayoutPanelGeneral; + private System.Windows.Forms.TabPage tabPageClient; + private System.Windows.Forms.GroupBox groupBoxClient; + private System.Windows.Forms.CheckBox checkBoxHomeOnly; } } \ No newline at end of file Modified: trunk/plugins/PowerScheduler++/Test/1.2.6.0/TvEngine3/TVLibrary/Plugins/PowerScheduler/Setup/PowerSchedulerSetup.cs =================================================================== --- trunk/plugins/PowerScheduler++/Test/1.2.6.0/TvEngine3/TVLibrary/Plugins/PowerScheduler/Setup/PowerSchedulerSetup.cs 2012-02-16 17:06:59 UTC (rev 4453) +++ trunk/plugins/PowerScheduler++/Test/1.2.6.0/TvEngine3/TVLibrary/Plugins/PowerScheduler/Setup/PowerSchedulerSetup.cs 2012-02-17 15:41:22 UTC (rev 4454) @@ -60,7 +60,7 @@ #endif #if CLIENT private Settings _settings; - private bool _singleSeat = true; + private bool _singleSeat; #endif private const bool AC = true; @@ -132,12 +132,15 @@ public PowerSchedulerSetup() { InitializeComponent(); - #if SERVER _layer = new TvBusinessLayer(); + // Add server profile, no Client tab + textBoxProfile.Text += + "\r\nServer: Dedicated server without GUI provides TV and recording services"; comboBoxProfile.Items.Add("Server"); + tabControl.Controls.Remove(tabPageClient); #endif #if CLIENT @@ -159,10 +162,10 @@ // For Windows XP change away mode label texts if (Environment.OSVersion.Version.Major < 6) { - checkBoxEPGAwayMode.Text = "Disable power button while grabbing EPG"; - checkBoxProcessesAwayMode.Text = "Disable power button while processes are running"; - checkBoxNetworkAwayMode.Text = "Disable power button while network is active"; - checkBoxSharesAwayMode.Text = "Disable power button while shares are active"; + checkBoxEPGAwayMode.Text = "No user standby while grabbing EPG"; + checkBoxProcessesAwayMode.Text = "No user standby while processes are running"; + checkBoxNetworkAwayMode.Text = "No user standby while network is active"; + checkBoxSharesAwayMode.Text = "No user standby while shares are active"; } #if SERVER @@ -185,6 +188,8 @@ #else private void LoadSettings() { + buttonApply.Enabled = false; + using (_settings = new MPSettings()) { // Detect singleseat/multiseat @@ -198,6 +203,7 @@ if (hostName != String.Empty && PowerManager.IsLocal(hostName)) { _singleSeat = true; + Text = "PowerScheduler++ Client Plugin (TV-Server on local system)"; } else if (hostName == String.Empty) { @@ -219,11 +225,19 @@ if (_singleSeat) { - Hide(); - this.Shown += new System.EventHandler(this.PowerSchedulerSetup_Shown); - MessageBox.Show("Standby / wakeup settings have to be made in TV-Server Configuration", - "PowerScheduler++ Client Plugin (TV-Server on local system)", - MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1); + textBoxProfile.Text = "Standby / wakeup settings have to be made in the TV-Server Configuration"; + comboBoxProfile.Visible = false; + flowLayoutPanelIdleTimeout.Visible = false; + buttonExpertMode.Visible = false; + labelExpertMode.Visible = false; + + tabControl.Controls.Remove(tabPageReboot); + tabControl.Controls.Remove(tabPageProcesses); + tabControl.Controls.Remove(tabPageNetwork); + tabControl.Controls.Remove(tabPageShares); + tabControl.Controls.Remove(tabPageAdvanced); + + checkBoxHomeOnly.Checked = Convert.ToBoolean(GetSetting("HomeOnly", "false")); return; } @@ -245,14 +259,16 @@ int idleTimeout = Convert.ToInt32(GetSetting("IdleTimeout", "-1")); if (idleTimeout == -1) - idleTimeout = (int)(PowerManager.RunningOnAC ? _recommendedSettingsAC.idleTimeout : _recommendedSettingsDC.idleTimeout); + { + idleTimeout = (int)(PowerManager.RunningOnAC ? _defaultSettingsDesktopAC.idleTimeout : _defaultSettingsDesktopDC.idleTimeout); + buttonApplyEnabled = true; + } numericUpDownIdleTimeout.Value = idleTimeout; labelExpertMode.Text = Convert.ToBoolean(GetSetting("ExpertMode", "false")) ? "Expert Mode" : "Plug&&Play Mode"; if (labelExpertMode.Text == "Expert Mode") { comboBoxProfile.ForeColor = SystemColors.GrayText; - buttonExpertMode.Text = "-> Plug&&Play Mode"; } else @@ -277,6 +293,12 @@ buttonExpertMode.Text = "-> Expert Mode"; } +#if CLIENT + // Client + checkBoxHomeOnly.Checked = Convert.ToBoolean(GetSetting("HomeOnly", "false")); + +#endif +#if SERVER // EPG { EPGWakeupConfig config = new EPGWakeupConfig(GetSetting("EPGWakeupConfig", String.Empty)); @@ -317,18 +339,20 @@ else mFormat = "{0}"; textBoxEPG.Text = String.Format(hFormat, config.Hour) + ":" + String.Format(mFormat, config.Minutes); - } - checkBoxEPGPreventStandby.Checked = Convert.ToBoolean(GetSetting("EPGPreventStandby", "false")); - if (!checkBoxEPGPreventStandby.Checked) - checkBoxEPGAwayMode.Enabled = false; + checkBoxEPGPreventStandby.Checked = Convert.ToBoolean(GetSetting("EPGPreventStandby", "false")); + if (!checkBoxEPGPreventStandby.Checked) + checkBoxEPGAwayMode.Enabled = false; - checkBoxEPGAwayMode.Checked = Convert.ToBoolean(GetSetting("EPGAwayMode", "false")); + checkBoxEPGAwayMode.Checked = Convert.ToBoolean(GetSetting("EPGAwayMode", "false")); - checkBoxEPGWakeup.Checked = Convert.ToBoolean(GetSetting("EPGWakeup", "false")); + checkBoxEPGWakeup.Checked = Convert.ToBoolean(GetSetting("EPGWakeup", "false")); - textBoxEPGCommand.Text = GetSetting("EPGCommand", String.Empty); + textBoxEPGCommand.Text = GetSetting("EPGCommand", String.Empty); + } +#endif + // Reboot { EPGWakeupConfig config = new EPGWakeupConfig(GetSetting("RebootConfig", String.Empty)); @@ -369,11 +393,11 @@ else mFormat = "{0}"; textBoxReboot.Text = String.Format(hFormat, config.Hour) + ":" + String.Format(mFormat, config.Minutes); - } - checkBoxRebootWakeup.Checked = Convert.ToBoolean(GetSetting("RebootWakeup", "false")); + checkBoxRebootWakeup.Checked = Convert.ToBoolean(GetSetting("RebootWakeup", "false")); - textBoxRebootCommand.Text = GetSetting("RebootCommand", String.Empty); + textBoxRebootCommand.Text = GetSetting("RebootCommand", String.Empty); + } // Processes textBoxProcesses.Text = GetSetting("Processes", String.Empty); @@ -430,8 +454,10 @@ checkBoxNetworkAwayMode.Checked = Convert.ToBoolean(GetSetting("NetworkMonitorAwayMode", "false")); // Advanced +#if SERVER checkBoxReinitializeController.Checked = Convert.ToBoolean(GetSetting("ReinitializeController", "false")); +#endif textBoxStandbyWakeupCommand.Text = GetSetting("Command", string.Empty); checkBoxAutoPowerSettings.Checked = Convert.ToBoolean(GetSetting("AutoPowerSettings", "true")); @@ -466,6 +492,11 @@ { using (_settings = new MPSettings()) { + if (_singleSeat) + { + SetSetting("HomeOnly", checkBoxHomeOnly.Checked.ToString()); + return; + } #endif // General SetSetting("Profile", comboBoxProfile.SelectedIndex.ToString()); @@ -474,6 +505,12 @@ SetSetting("ExpertMode", (labelExpertMode.Text == "Expert Mode").ToString()); +#if CLIENT + // Client + SetSetting("HomeOnly", checkBoxHomeOnly.Checked.ToString()); + +#endif +#if SERVER // EPG { EPGWakeupConfig cfg = new EPGWakeupConfig(GetSetting("EPGWakeupConfig", String.Empty)); @@ -507,9 +544,9 @@ SetSetting("EPGCommand", textBoxEPGCommand.Text); +#endif // Reboot { - ; EPGWakeupConfig cfg = new EPGWakeupConfig(GetSetting("RebootConfig", String.Empty)); EPGWakeupConfig newcfg = new EPGWakeupConfig(); newcfg.Hour = cfg.Hour; @@ -566,9 +603,10 @@ SetSetting("NetworkMonitorAwayMode", checkBoxNetworkAwayMode.Checked.ToString()); // Advanced - +#if SERVER SetSetting("ReinitializeController", checkBoxReinitializeController.Checked.ToString()); +#endif SetSetting("Command", textBoxStandbyWakeupCommand.Text); SetSetting("AutoPowerSettings", checkBoxAutoPowerSettings.Checked.ToString()); @@ -699,30 +737,30 @@ private void RefreshStatus() { + bool unattended, disAllowShutdown = false; + DateTime nextWakeupTime = DateTime.MaxValue; + string disAllowShutdownHandler = ""; + string nextWakeupHandler = ""; + lock (this) { - bool unattended, disAllowShutdown = false; - DateTime nextWakeupTime = DateTime.MaxValue; - string disAllowShutdownHandler = ""; - string nextWakeupHandler = ""; - // Connect to the local TVserver's IPowerController instance if (RemotePowerControl.Instance != null && RemotePowerControl.Isconnected) RemotePowerControl.Instance.GetCurrentState(true, out unattended, out disAllowShutdown, out disAllowShutdownHandler, out nextWakeupTime, out nextWakeupHandler); + } - if (Convert.ToBoolean(GetSetting("ShutdownEnabled", "false"))) - labelStandbyStatus.Text = "Standby is handled by PowerScheduler++"; - else - labelStandbyStatus.Text = "Standby is handled by Windows"; + labelWakeupHandler.Text = nextWakeupHandler; + if (nextWakeupHandler != String.Empty) + labelWakeupTimeValue.Text = nextWakeupTime.ToString(); + else + labelWakeupTimeValue.Text = ""; - labelWakeupHandler.Text = nextWakeupHandler; + if (Convert.ToBoolean(GetSetting("ShutdownEnabled", "false"))) + labelStandbyStatus.Text = "Standby is handled by PowerScheduler++"; + else + labelStandbyStatus.Text = "Standby is handled by Windows"; - textBoxStandbyHandler.Text = disAllowShutdownHandler; - if (nextWakeupHandler != String.Empty) - labelWakeupTimeValue.Text = nextWakeupTime.ToString(); - else - labelWakeupTimeValue.Text = ""; - } + textBoxStandbyHandler.Text = disAllowShutdownHandler; } #endif @@ -731,15 +769,7 @@ #region Forms Control Events #region MasterSetup -#if CLIENT - private void PowerSchedulerSetup_Shown(object sender, EventArgs e) - { - if (_singleSeat) - Close(); - } -#endif - private void buttonApply_Click(object sender, EventArgs e) { buttonApply.Enabled = false; @@ -793,13 +823,7 @@ // Power Settings _recommendedSettingsAC = _defaultSettingsDesktopAC; _recommendedSettingsDC = _defaultSettingsDesktopDC; - if (PowerManager.RunningOnAC) - _recommendedSettingsAC.idleTimeout = (uint)numericUpDownIdleTimeout.Value; - else - _recommendedSettingsAC.idleTimeout = (uint)numericUpDownIdleTimeout.Value * 2; - _recommendedSettingsDC.idleTimeout = _recommendedSettingsAC.idleTimeout / 2; - // Profile specific switch (comboBoxProfile.SelectedIndex) { @@ -831,6 +855,9 @@ checkBoxEPGPreventStandby.Checked = false; // Reboot checkBoxRebootWakeup.Checked = false; + // Power settings + _recommendedSettingsAC = _defaultSettingsNotebookAC; + _recommendedSettingsDC = _defaultSettingsNotebookDC; break; #if SERVER @@ -844,6 +871,13 @@ break; #endif } + + // Idle timeout + if (PowerManager.RunningOnAC) + _recommendedSettingsAC.idleTimeout = (uint)numericUpDownIdleTimeout.Value; + else + _recommendedSettingsAC.idleTimeout = (uint)numericUpDownIdleTimeout.Value * 2; + _recommendedSettingsDC.idleTimeout = _recommendedSettingsAC.idleTimeout / 2; } private void numericUpDownIdleTimeout_ValueChanged(object sender, EventArgs e) Modified: trunk/plugins/PowerScheduler++/Test/1.2.6.0/TvEngine3/TVLibrary/Plugins/PowerScheduler/Setup/PowerSchedulerSetup.resx =================================================================== --- trunk/plugins/PowerScheduler++/Test/1.2.6.0/TvEngine3/TVLibrary/Plugins/PowerScheduler/Setup/PowerSchedulerSetup.resx 2012-02-16 17:06:59 UTC (rev 4453) +++ trunk/plugins/PowerScheduler++/Test/1.2.6.0/TvEngine3/TVLibrary/Plugins/PowerScheduler/Setup/PowerSchedulerSetup.resx 2012-02-17 15:41:22 UTC (rev 4454) @@ -170,7 +170,6 @@ <value>Available Profiles: HTPC: Dedicated multimedia appliance with MediaPortal GUI Desktop: MediaPortal as application for viewing media and recording TV -Notebook: Optimized for mobile use, no scheduled recordings -Server: Dedicated server without GUI provides TV and recording services</value> +Notebook: Optimized for mobile use, no scheduled recordings</value> </data> </root> \ No newline at end of file Modified: trunk/plugins/PowerScheduler++/Test/1.2.6.0/VersionInfo.cs =================================================================== --- trunk/plugins/PowerScheduler++/Test/1.2.6.0/VersionInfo.cs 2012-02-16 17:06:59 UTC (rev 4453) +++ trunk/plugins/PowerScheduler++/Test/1.2.6.0/VersionInfo.cs 2012-02-17 15:41:22 UTC (rev 4454) @@ -47,9 +47,9 @@ // // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("1.2.5.12")] -[assembly: AssemblyFileVersion("1.2.5.12")] -[assembly: AssemblyInformationalVersion("1.2.5.12 alpha version for MP 1.2.x")] +[assembly: AssemblyVersion("1.2.6.0")] +[assembly: AssemblyFileVersion("1.2.6.0")] +[assembly: AssemblyInformationalVersion("1.2.6.0 beta version for MP 1.2.x and 1.3.x")] Modified: trunk/plugins/PowerScheduler++/Test/1.2.6.0/mediaportal/PowerSchedulerClientPlugin/Handlers/ActiveNetworkStandbyHandler.cs =================================================================== --- trunk/plugins/PowerScheduler++/Test/1.2.6.0/mediaportal/PowerSchedulerClientPlugin/Handlers/ActiveNetworkStandbyHandler.cs 2012-02-16 17:06:59 UTC (rev 4453) +++ trunk/plugins/PowerScheduler++/Test/1.2.6.0/mediaportal/PowerSchedulerClientPlugin/Handlers/ActiveNetworkStandbyHandler.cs 2012-02-17 15:41:22 UTC (rev 4454) @@ -20,13 +20,11 @@ using System; using System.Collections; -using System.Collections.Generic; using System.Diagnostics; -using System.Threading; -using System.Timers; using MediaPortal.GUI.Library; using MediaPortal.Profile; using MediaPortal.Services; + using TvEngine.PowerScheduler.Interfaces; namespace MediaPortal.Plugins.Process.Handlers @@ -39,13 +37,12 @@ { #region Variables - private PerformanceCounter dlCounter, ulCounter; // Performance counters to monitor download and upload speed. - private long dlValueOld, ulValueOld; // Download Upload counter value one second earlier, in bytes. - private DateTime lastSampleTime; + private PerformanceCounter _dlCounter, _ulCounter; // Performance counters to monitor download and upload speed. + private long _dlValueOld, _ulValueOld; // Download Upload counter value one second earlier, in bytes. + private DateTime _lastSampleTime = DateTime.Now; + private long _dlSpeed, _ulSpeed; // Download Upload peak values in KB/s + private string _name; // The name of the adapter. - internal long dlSpeedPeak, ulSpeedPeak; // Download Upload peak values in KB/s - internal string name; // The name of the adapter. - #endregion #region Private methods @@ -55,54 +52,55 @@ /// </summary> internal NetworkAdapter(string name) { - this.name = name; + _name = name; // Create performance counters for the adapter. - dlCounter = new PerformanceCounter("Network Interface", "Bytes Received/sec", this.name); - ulCounter = new PerformanceCounter("Network Interface", "Bytes Sent/sec", this.name); + _dlCounter = new PerformanceCounter("Network Interface", "Bytes Received/sec", this._name); + _ulCounter = new PerformanceCounter("Network Interface", "Bytes Sent/sec", this._name); // Since dlValueOld and ulValueOld are used in method update() to calculate network speed, // they must have be initialized. - lastSampleTime = DateTime.Now; - dlValueOld = dlCounter.NextSample().RawValue; - ulValueOld = ulCounter.NextSample().RawValue; - - // Clear peak values - dlSpeedPeak = 0; - ulSpeedPeak = 0; + _dlValueOld = _dlCounter.NextSample().RawValue; + _ulValueOld = _ulCounter.NextSample().RawValue; } /// <summary> /// Obtain new sample from performance counters, and update the values saved in dlSpeed, ulSpeed, etc. /// This method is supposed to be called only in NetworkMonitorHandler, one time every second. /// </summary> - internal void update() + internal void Update() { DateTime thisSampleTime = DateTime.Now; + // Download Upload counter value in bytes. - long dlValue = dlCounter.NextSample().RawValue; - long ulValue = ulCounter.NextSample().RawValue; + long dlValue = _dlCounter.NextSample().RawValue; + long ulValue = _ulCounter.NextSample().RawValue; // Calculates download and upload speed. - double monitorInterval = thisSampleTime.Subtract(lastSampleTime).TotalSeconds; - lastSampleTime = thisSampleTime; - long dlSpeed = (long)((dlValue - dlValueOld) / monitorInterval); - long ulSpeed = (long)((ulValue - ulValueOld) / monitorInterval); + double monitorInterval = thisSampleTime.Subtract(_lastSampleTime).TotalSeconds; + _lastSampleTime = thisSampleTime; + _dlSpeed = (long)((dlValue - _dlValueOld) / monitorInterval / 1024); + _ulSpeed = (long)((ulValue - _ulValueOld) / monitorInterval / 1024); - dlValueOld = dlValue; - ulValueOld = ulValue; + _dlValueOld = dlValue; + _ulValueOld = ulValue; + } - if ((dlSpeed / 1024) > dlSpeedPeak) // Store peak values in KB/s - { - dlSpeedPeak = (dlSpeed / 1024); - } + internal string Name + { + get { return _name; } + } - if ((ulSpeed / 1024) > ulSpeedPeak) // Store peak values in KB/s - { - ulSpeedPeak = (ulSpeed / 1024); - } + internal long DlSpeed + { + get { return _dlSpeed; } } + internal long UlSpeed + { + get { return _ulSpeed; } + } + #endregion } @@ -111,19 +109,12 @@ /// </summary> public class ActiveNetworkStandbyHandler : IStandbyHandler, IStandbyHandlerEx { - #region Constants - - private const int MonitorInteval = 10; // seconds - - #endregion - #region Variables - private System.Timers.Timer timer; // The timer event executes every second to refresh the values in adapters. - private Int32 idleLimit; // Minimum transferrate considered as network activity in KB/s. + private Int32 _idleLimit; // Minimum transferrate considered as network activity in KB/s. - private ArrayList monitoredAdapters = new ArrayList(); // The list of monitored adapters on the computer. - private List<string> _preventers = new List<string>(); // The list of standby preventers. + private ArrayList _monitoredAdapters = new ArrayList(); // The list of monitored adapters on the computer. + private int _preventers = 0; /// <summary> /// Use away mode setting @@ -155,7 +146,9 @@ if (ps == null) return; + PowerSetting setting; + bool enabled; using (Settings reader = new MPSettings()) @@ -164,14 +157,14 @@ setting = ps.Settings.GetSetting("NetworkMonitorEnabled"); enabled = reader.GetValueAsBool("psclientplugin", "NetworkMonitorEnabled", false); + if (setting.Get<bool>() != enabled) // Setting changed { setting.Set<bool>(enabled); if (enabled) // Start { Log.Debug("NetworkMonitorHandler: Network monitor started"); - Thread netmonThr = new Thread(new ThreadStart(StartNetworkMonitor)); - netmonThr.Start(); + StartNetworkMonitor(); } else // Stop { @@ -184,17 +177,19 @@ if (enabled) { setting = ps.Settings.GetSetting("NetworkMonitorIdleLimit"); - idleLimit = reader.GetValueAsInt("psclientplugin", "NetworkMonitorIdleLimit", 0); - if (setting.Get<Int32>() != idleLimit) + _idleLimit = reader.GetValueAsInt("psclientplugin", "NetworkMonitorIdleLimit", 0); + + if (setting.Get<Int32>() != _idleL... [truncated message content] |
From: <mic...@us...> - 2012-02-16 17:07:13
|
Revision: 4453 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=4453&view=rev Author: michael-t Date: 2012-02-16 17:06:59 +0000 (Thu, 16 Feb 2012) Log Message: ----------- Added Paths: ----------- trunk/plugins/PowerScheduler++/Test/new/ trunk/plugins/PowerScheduler++/Test/new/Binaries/ trunk/plugins/PowerScheduler++/Test/new/Binaries/Common.Utils.dll trunk/plugins/PowerScheduler++/Test/new/Binaries/Core.dll trunk/plugins/PowerScheduler++/Test/new/Binaries/Gentle.Common.dll trunk/plugins/PowerScheduler++/Test/new/Binaries/Gentle.Framework.dll trunk/plugins/PowerScheduler++/Test/new/Binaries/PluginBase.dll trunk/plugins/PowerScheduler++/Test/new/Binaries/PowerScheduler.Interfaces.dll trunk/plugins/PowerScheduler++/Test/new/Binaries/PowerScheduler.dll trunk/plugins/PowerScheduler++/Test/new/Binaries/PowerSchedulerClientPlugin.dll trunk/plugins/PowerScheduler++/Test/new/Binaries/SetupControls.dll trunk/plugins/PowerScheduler++/Test/new/Binaries/TVDatabase.dll trunk/plugins/PowerScheduler++/Test/new/Binaries/TVLibrary.dll trunk/plugins/PowerScheduler++/Test/new/Binaries/TvBusinessLayer.dll trunk/plugins/PowerScheduler++/Test/new/Binaries/TvControl.dll trunk/plugins/PowerScheduler++/Test/new/Binaries/TvLibrary.Interfaces.dll trunk/plugins/PowerScheduler++/Test/new/Binaries/TvService.exe trunk/plugins/PowerScheduler++/Test/new/Binaries/Utils.dll trunk/plugins/PowerScheduler++/Test/new/CleanupFiles.bat trunk/plugins/PowerScheduler++/Test/new/Common-MP-TVE3/ trunk/plugins/PowerScheduler++/Test/new/Common-MP-TVE3/PowerScheduler.Interfaces/ trunk/plugins/PowerScheduler++/Test/new/Common-MP-TVE3/PowerScheduler.Interfaces/EPGWakeupConfig.cs trunk/plugins/PowerScheduler++/Test/new/Common-MP-TVE3/PowerScheduler.Interfaces/Interfaces/ trunk/plugins/PowerScheduler++/Test/new/Common-MP-TVE3/PowerScheduler.Interfaces/Interfaces/IEpgHandler.cs trunk/plugins/PowerScheduler++/Test/new/Common-MP-TVE3/PowerScheduler.Interfaces/Interfaces/IPowerController.cs trunk/plugins/PowerScheduler++/Test/new/Common-MP-TVE3/PowerScheduler.Interfaces/Interfaces/IPowerScheduler.cs trunk/plugins/PowerScheduler++/Test/new/Common-MP-TVE3/PowerScheduler.Interfaces/Interfaces/IPowerSettings.cs trunk/plugins/PowerScheduler++/Test/new/Common-MP-TVE3/PowerScheduler.Interfaces/Interfaces/IStandbyHandler.cs trunk/plugins/PowerScheduler++/Test/new/Common-MP-TVE3/PowerScheduler.Interfaces/Interfaces/IWakeupHandler.cs trunk/plugins/PowerScheduler++/Test/new/Common-MP-TVE3/PowerScheduler.Interfaces/PowerManager.cs trunk/plugins/PowerScheduler++/Test/new/Common-MP-TVE3/PowerScheduler.Interfaces/PowerScheduler.Interfaces.csproj trunk/plugins/PowerScheduler++/Test/new/Common-MP-TVE3/PowerScheduler.Interfaces/PowerSchedulerEventArgs.cs trunk/plugins/PowerScheduler++/Test/new/Common-MP-TVE3/PowerScheduler.Interfaces/PowerSettings.cs trunk/plugins/PowerScheduler++/Test/new/Common-MP-TVE3/PowerScheduler.Interfaces/Properties/ trunk/plugins/PowerScheduler++/Test/new/Common-MP-TVE3/PowerScheduler.Interfaces/Properties/AssemblyInfo.cs trunk/plugins/PowerScheduler++/Test/new/Common-MP-TVE3/PowerScheduler.Interfaces/RemotePowerControl.cs trunk/plugins/PowerScheduler++/Test/new/Common-MP-TVE3/PowerScheduler.Interfaces/TimerException.cs trunk/plugins/PowerScheduler++/Test/new/Common-MP-TVE3/PowerScheduler.Interfaces/WaitableTimer.cs trunk/plugins/PowerScheduler++/Test/new/Common-MP-TVE3/PowerScheduler.Interfaces/WakeOnLanManager.cs trunk/plugins/PowerScheduler++/Test/new/CopyFiles.bat trunk/plugins/PowerScheduler++/Test/new/MPEI/ trunk/plugins/PowerScheduler++/Test/new/MPEI/PowerScheduler++ 1.2.6.0.mpe1 trunk/plugins/PowerScheduler++/Test/new/MPEI/PowerScheduler++.xmp2 trunk/plugins/PowerScheduler++/Test/new/MPEI/PowerScheduler_high.png trunk/plugins/PowerScheduler++/Test/new/MPEI/update.xml trunk/plugins/PowerScheduler++/Test/new/PowerScheduler++.sln trunk/plugins/PowerScheduler++/Test/new/RestoreFiles.bat trunk/plugins/PowerScheduler++/Test/new/TvEngine3/ trunk/plugins/PowerScheduler++/Test/new/TvEngine3/TVLibrary/ trunk/plugins/PowerScheduler++/Test/new/TvEngine3/TVLibrary/Plugins/ trunk/plugins/PowerScheduler++/Test/new/TvEngine3/TVLibrary/Plugins/PowerScheduler/ trunk/plugins/PowerScheduler++/Test/new/TvEngine3/TVLibrary/Plugins/PowerScheduler/Handlers/ trunk/plugins/PowerScheduler++/Test/new/TvEngine3/TVLibrary/Plugins/PowerScheduler/Handlers/ActiveNetworkStandbyHandler.cs trunk/plugins/PowerScheduler++/Test/new/TvEngine3/TVLibrary/Plugins/PowerScheduler/Handlers/ActiveSharesStandbyHandler.cs trunk/plugins/PowerScheduler++/Test/new/TvEngine3/TVLibrary/Plugins/PowerScheduler/Handlers/ActiveStreamsStandbyHandler.cs trunk/plugins/PowerScheduler++/Test/new/TvEngine3/TVLibrary/Plugins/PowerScheduler/Handlers/ControllerActiveStandbyHandler.cs trunk/plugins/PowerScheduler++/Test/new/TvEngine3/TVLibrary/Plugins/PowerScheduler/Handlers/EpgGrabbingStandbyWakeupHandler.cs trunk/plugins/PowerScheduler++/Test/new/TvEngine3/TVLibrary/Plugins/PowerScheduler/Handlers/LocalClientStandbyHandler.cs trunk/plugins/PowerScheduler++/Test/new/TvEngine3/TVLibrary/Plugins/PowerScheduler/Handlers/LocalClientWakeupHandler.cs trunk/plugins/PowerScheduler++/Test/new/TvEngine3/TVLibrary/Plugins/PowerScheduler/Handlers/PowerControllerStandbyHandler.cs trunk/plugins/PowerScheduler++/Test/new/TvEngine3/TVLibrary/Plugins/PowerScheduler/Handlers/PowerControllerWakeupHandler.cs trunk/plugins/PowerScheduler++/Test/new/TvEngine3/TVLibrary/Plugins/PowerScheduler/Handlers/ProcessActiveStandbyHandler.cs trunk/plugins/PowerScheduler++/Test/new/TvEngine3/TVLibrary/Plugins/PowerScheduler/Handlers/RebootWakeupHandler.cs trunk/plugins/PowerScheduler++/Test/new/TvEngine3/TVLibrary/Plugins/PowerScheduler/Handlers/RemoteClientStandbyHandler.cs trunk/plugins/PowerScheduler++/Test/new/TvEngine3/TVLibrary/Plugins/PowerScheduler/Handlers/ScheduledRecordingsWakeupHandler.cs trunk/plugins/PowerScheduler++/Test/new/TvEngine3/TVLibrary/Plugins/PowerScheduler/Handlers/XmlTvImportWakeupHandler.cs trunk/plugins/PowerScheduler++/Test/new/TvEngine3/TVLibrary/Plugins/PowerScheduler/PowerScheduler.cs trunk/plugins/PowerScheduler++/Test/new/TvEngine3/TVLibrary/Plugins/PowerScheduler/PowerScheduler.csproj trunk/plugins/PowerScheduler++/Test/new/TvEngine3/TVLibrary/Plugins/PowerScheduler/PowerSchedulerFactory.cs trunk/plugins/PowerScheduler++/Test/new/TvEngine3/TVLibrary/Plugins/PowerScheduler/PowerSchedulerPlugin.cs trunk/plugins/PowerScheduler++/Test/new/TvEngine3/TVLibrary/Plugins/PowerScheduler/Properties/ trunk/plugins/PowerScheduler++/Test/new/TvEngine3/TVLibrary/Plugins/PowerScheduler/Properties/AssemblyInfo.cs trunk/plugins/PowerScheduler++/Test/new/TvEngine3/TVLibrary/Plugins/PowerScheduler/Setup/ trunk/plugins/PowerScheduler++/Test/new/TvEngine3/TVLibrary/Plugins/PowerScheduler/Setup/PowerSchedulerSetup.Designer.cs trunk/plugins/PowerScheduler++/Test/new/TvEngine3/TVLibrary/Plugins/PowerScheduler/Setup/PowerSchedulerSetup.cs trunk/plugins/PowerScheduler++/Test/new/TvEngine3/TVLibrary/Plugins/PowerScheduler/Setup/PowerSchedulerSetup.resx trunk/plugins/PowerScheduler++/Test/new/TvEngine3/TVLibrary/Plugins/PowerScheduler/Setup/PowerSettingsForm.Designer.cs trunk/plugins/PowerScheduler++/Test/new/TvEngine3/TVLibrary/Plugins/PowerScheduler/Setup/PowerSettingsForm.cs trunk/plugins/PowerScheduler++/Test/new/TvEngine3/TVLibrary/Plugins/PowerScheduler/Setup/SelectProcessForm.cs trunk/plugins/PowerScheduler++/Test/new/TvEngine3/TVLibrary/Plugins/PowerScheduler/Setup/SelectProcessForm.designer.cs trunk/plugins/PowerScheduler++/Test/new/TvEngine3/TVLibrary/Plugins/PowerScheduler/Setup/SelectShareForm.cs trunk/plugins/PowerScheduler++/Test/new/TvEngine3/TVLibrary/Plugins/PowerScheduler/Setup/SelectShareForm.designer.cs trunk/plugins/PowerScheduler++/Test/new/TvEngine3/TVLibrary/Plugins/PowerScheduler/TheAlgorithm.txt trunk/plugins/PowerScheduler++/Test/new/TvEngine3/TVLibrary/Plugins/PowerScheduler/WindowsController.cs trunk/plugins/PowerScheduler++/Test/new/VersionInfo.cs trunk/plugins/PowerScheduler++/Test/new/mediaportal/ trunk/plugins/PowerScheduler++/Test/new/mediaportal/PowerSchedulerClientPlugin/ trunk/plugins/PowerScheduler++/Test/new/mediaportal/PowerSchedulerClientPlugin/Handlers/ trunk/plugins/PowerScheduler++/Test/new/mediaportal/PowerSchedulerClientPlugin/Handlers/ActiveNetworkStandbyHandler.cs trunk/plugins/PowerScheduler++/Test/new/mediaportal/PowerSchedulerClientPlugin/Handlers/ActiveSharesStandbyHandler.cs trunk/plugins/PowerScheduler++/Test/new/mediaportal/PowerSchedulerClientPlugin/Handlers/ProcessActiveStandbyHandler.cs trunk/plugins/PowerScheduler++/Test/new/mediaportal/PowerSchedulerClientPlugin/Handlers/RebootWakeupHandler.cs trunk/plugins/PowerScheduler++/Test/new/mediaportal/PowerSchedulerClientPlugin/Handlers/WakeableStandbyHandler.cs trunk/plugins/PowerScheduler++/Test/new/mediaportal/PowerSchedulerClientPlugin/Handlers/WakeableWakeupHandler.cs trunk/plugins/PowerScheduler++/Test/new/mediaportal/PowerSchedulerClientPlugin/MasterVolume.cs trunk/plugins/PowerScheduler++/Test/new/mediaportal/PowerSchedulerClientPlugin/PowerScheduler.cs trunk/plugins/PowerScheduler++/Test/new/mediaportal/PowerSchedulerClientPlugin/PowerScheduler.gif trunk/plugins/PowerScheduler++/Test/new/mediaportal/PowerSchedulerClientPlugin/PowerSchedulerClientPlugin.cs trunk/plugins/PowerScheduler++/Test/new/mediaportal/PowerSchedulerClientPlugin/PowerSchedulerClientPlugin.csproj trunk/plugins/PowerScheduler++/Test/new/mediaportal/PowerSchedulerClientPlugin/PowerSchedulerFactory.cs trunk/plugins/PowerScheduler++/Test/new/mediaportal/PowerSchedulerClientPlugin/PowerScheduler_disabled.gif trunk/plugins/PowerScheduler++/Test/new/mediaportal/PowerSchedulerClientPlugin/Properties/ trunk/plugins/PowerScheduler++/Test/new/mediaportal/PowerSchedulerClientPlugin/Properties/AssemblyInfo.cs trunk/plugins/PowerScheduler++/Test/new/mediaportal/PowerSchedulerClientPlugin/Setup/ trunk/plugins/PowerScheduler++/Test/new/mediaportal/PowerSchedulerClientPlugin/Setup/PowerSchedulerSetup.Designer.cs trunk/plugins/PowerScheduler++/Test/new/mediaportal/PowerSchedulerClientPlugin/Setup/PowerSchedulerSetup.cs trunk/plugins/PowerScheduler++/Test/new/mediaportal/PowerSchedulerClientPlugin/Setup/PowerSchedulerSetup.resx trunk/plugins/PowerScheduler++/Test/new/mediaportal/PowerSchedulerClientPlugin/Setup/PowerSettingsForm.Designer.cs trunk/plugins/PowerScheduler++/Test/new/mediaportal/PowerSchedulerClientPlugin/Setup/PowerSettingsForm.cs trunk/plugins/PowerScheduler++/Test/new/mediaportal/PowerSchedulerClientPlugin/Setup/SelectProcessForm.cs trunk/plugins/PowerScheduler++/Test/new/mediaportal/PowerSchedulerClientPlugin/Setup/SelectProcessForm.designer.cs trunk/plugins/PowerScheduler++/Test/new/mediaportal/PowerSchedulerClientPlugin/Setup/SelectShareForm.cs trunk/plugins/PowerScheduler++/Test/new/mediaportal/PowerSchedulerClientPlugin/Setup/SelectShareForm.designer.cs trunk/plugins/PowerScheduler++/Test/new/mediaportal/PowerSchedulerClientPlugin/UnattendedWindow.cs Added: trunk/plugins/PowerScheduler++/Test/new/Binaries/Common.Utils.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/PowerScheduler++/Test/new/Binaries/Common.Utils.dll ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/PowerScheduler++/Test/new/Binaries/Core.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/PowerScheduler++/Test/new/Binaries/Core.dll ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/PowerScheduler++/Test/new/Binaries/Gentle.Common.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/PowerScheduler++/Test/new/Binaries/Gentle.Common.dll ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/PowerScheduler++/Test/new/Binaries/Gentle.Framework.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/PowerScheduler++/Test/new/Binaries/Gentle.Framework.dll ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/PowerScheduler++/Test/new/Binaries/PluginBase.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/PowerScheduler++/Test/new/Binaries/PluginBase.dll ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/PowerScheduler++/Test/new/Binaries/PowerScheduler.Interfaces.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/PowerScheduler++/Test/new/Binaries/PowerScheduler.Interfaces.dll ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/PowerScheduler++/Test/new/Binaries/PowerScheduler.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/PowerScheduler++/Test/new/Binaries/PowerScheduler.dll ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/PowerScheduler++/Test/new/Binaries/PowerSchedulerClientPlugin.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/PowerScheduler++/Test/new/Binaries/PowerSchedulerClientPlugin.dll ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/PowerScheduler++/Test/new/Binaries/SetupControls.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/PowerScheduler++/Test/new/Binaries/SetupControls.dll ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/PowerScheduler++/Test/new/Binaries/TVDatabase.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/PowerScheduler++/Test/new/Binaries/TVDatabase.dll ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/PowerScheduler++/Test/new/Binaries/TVLibrary.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/PowerScheduler++/Test/new/Binaries/TVLibrary.dll ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/PowerScheduler++/Test/new/Binaries/TvBusinessLayer.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/PowerScheduler++/Test/new/Binaries/TvBusinessLayer.dll ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/PowerScheduler++/Test/new/Binaries/TvControl.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/PowerScheduler++/Test/new/Binaries/TvControl.dll ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/PowerScheduler++/Test/new/Binaries/TvLibrary.Interfaces.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/PowerScheduler++/Test/new/Binaries/TvLibrary.Interfaces.dll ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/PowerScheduler++/Test/new/Binaries/TvService.exe =================================================================== (Binary files differ) Property changes on: trunk/plugins/PowerScheduler++/Test/new/Binaries/TvService.exe ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/PowerScheduler++/Test/new/Binaries/Utils.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/PowerScheduler++/Test/new/Binaries/Utils.dll ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/PowerScheduler++/Test/new/CleanupFiles.bat =================================================================== --- trunk/plugins/PowerScheduler++/Test/new/CleanupFiles.bat (rev 0) +++ trunk/plugins/PowerScheduler++/Test/new/CleanupFiles.bat 2012-02-16 17:06:59 UTC (rev 4453) @@ -0,0 +1,75 @@ +@echo off +set PROJECTPATH=%~dp0 +if "%ProgramFiles(x86)%" == "" goto 32bit +set SERVERPATH=%ProgramFiles(x86)%\Team MediaPortal\MediaPortal TV Server +set CLIENTPATH=%ProgramFiles(x86)%\Team MediaPortal\MediaPortal +goto data +:32bit +set SERVERPATH=%ProgramFiles%\Team MediaPortal\MediaPortal TV Server +set CLIENTPATH=%ProgramFiles%\Team MediaPortal\MediaPortal +:data +if "%ProgramData%" == "" goto winXP +set SERVERLOGPATH=%ProgramData%\Team MediaPortal\MediaPortal TV Server\log +goto count +:winXP +set SERVERLOGPATH=%ALLUSERSPROFILE%\Application Data\Team MediaPortal\MediaPortal TV Server\log + +:count +set COUNT=1 + +echo Stopping TV Server +echo --------------------- +:stop +echo trying... +net stop tvservice > nul 2>nul +tasklist | find /i "tvservice" >nul 2>nul +if not %ERRORLEVEL% == 1 ( + ping localhost >nul 2>nul + set /a COUNT=%COUNT%+1 + if %COUNT% GTR 5 goto end + goto stop +) +echo. + +echo MediaPortal TV Server +echo --------------------- +for %%f in (Plugins\PowerScheduler.dll) do ( + echo %%f + if exist "%SERVERPATH%\%%f.org" ( + del "%SERVERPATH%\%%f" + move /Y "%SERVERPATH%\%%f.org" "%SERVERPATH%\%%f" + ) 2>nul +) +echo. +echo MediaPortal Common Library +echo ---------------------------------- +for %%f in (PowerScheduler.Interfaces.dll) do ( + echo %%f + if exist "%SERVERPATH%\%%f.org" ( + del "%SERVERPATH%\%%f" + move /Y "%SERVERPATH%\%%f.org" "%SERVERPATH%\%%f" + ) 2>nul + if exist "%CLIENTPATH%\%%f.org" ( + del "%CLIENTPATH%\%%f" + move /Y "%CLIENTPATH%\%%f.org" "%CLIENTPATH%\%%f" + ) 2>nul +) +echo. +echo MediaPortal Client +echo ------------------ +for %%f in (plugins\process\PowerSchedulerClientPlugin.dll) do ( + echo %%f + if exist "%CLIENTPATH%\%%f.org" ( + del "%CLIENTPATH%\%%f" + move /Y "%CLIENTPATH%\%%f.org" "%CLIENTPATH%\%%f" + ) 2>nul +) +echo. +echo Cleanup +echo ------------------ +move /Y "%SERVERLOGPATH%\tv.log" "%SERVERLOGPATH%\tv_old.log" +net start tvservice +echo. +:end +pause +exit \ No newline at end of file Added: trunk/plugins/PowerScheduler++/Test/new/Common-MP-TVE3/PowerScheduler.Interfaces/EPGWakeupConfig.cs =================================================================== --- trunk/plugins/PowerScheduler++/Test/new/Common-MP-TVE3/PowerScheduler.Interfaces/EPGWakeupConfig.cs (rev 0) +++ trunk/plugins/PowerScheduler++/Test/new/Common-MP-TVE3/PowerScheduler.Interfaces/EPGWakeupConfig.cs 2012-02-16 17:06:59 UTC (rev 4453) @@ -0,0 +1,125 @@ +#region Copyright (C) 2005-2011 Team MediaPortal + +// Copyright (C) 2005-2011 Team MediaPortal +// http://www.team-mediaportal.com +// +// MediaPortal 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 of the License, or +// (at your option) any later version. +// +// MediaPortal 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 MediaPortal. If not, see <http://www.gnu.org/licenses/>. + +#endregion + +#region Usings + +using System; +using System.Collections.Generic; +using System.IO; +using System.Runtime.Serialization.Formatters.Binary; + +#endregion + +namespace TvEngine.PowerScheduler +{ + + #region Enums + + public enum EPGGrabDays + { + Monday, + Tuesday, + Wednesday, + Thursday, + Friday, + Saturday, + Sunday + } + + #endregion + + [Serializable] + public class EPGWakeupConfig + { + public DateTime LastRun = DateTime.MinValue; + public List<EPGGrabDays> Days = new List<EPGGrabDays>(); + public int Hour; + public int Minutes; + + public EPGWakeupConfig() {} + + public EPGWakeupConfig(string serializedConfig) + { + EPGWakeupConfig cfg = new EPGWakeupConfig(); + try + { + BinaryFormatter formatter = new BinaryFormatter(); + byte[] buffer = Convert.FromBase64String(serializedConfig); + using (MemoryStream stream = new MemoryStream(buffer, 0, buffer.Length)) + { + cfg = (EPGWakeupConfig)formatter.Deserialize(stream); + } + } + catch (Exception) {} + Hour = cfg.Hour; + Minutes = cfg.Minutes; + Days = cfg.Days; + LastRun = cfg.LastRun; + } + + public string SerializeAsString() + { + BinaryFormatter formatter = new BinaryFormatter(); + string result; + using (MemoryStream stream = new MemoryStream()) + { + formatter.Serialize(stream, this); + stream.Flush(); + stream.Seek(0, SeekOrigin.Begin); + byte[] buffer = new byte[stream.Length]; + int bytesRead = stream.Read(buffer, 0, buffer.Length); + result = Convert.ToBase64String(buffer, 0, bytesRead); + } + return result; + } + + public override bool Equals(object obj) + { + if (obj is EPGWakeupConfig) + { + EPGWakeupConfig cfg = (EPGWakeupConfig)obj; + if (cfg.Hour == Hour && cfg.Minutes == Minutes) + { + foreach (EPGGrabDays day in cfg.Days) + { + if (!Days.Contains(day)) + { + return false; + } + } + foreach (EPGGrabDays day in Days) + { + if (!cfg.Days.Contains(day)) + { + return false; + } + } + return true; + } + } + return false; + } + + public override int GetHashCode() + { + return base.GetHashCode(); + } + } +} \ No newline at end of file Added: trunk/plugins/PowerScheduler++/Test/new/Common-MP-TVE3/PowerScheduler.Interfaces/Interfaces/IEpgHandler.cs =================================================================== --- trunk/plugins/PowerScheduler++/Test/new/Common-MP-TVE3/PowerScheduler.Interfaces/Interfaces/IEpgHandler.cs (rev 0) +++ trunk/plugins/PowerScheduler++/Test/new/Common-MP-TVE3/PowerScheduler.Interfaces/Interfaces/IEpgHandler.cs 2012-02-16 17:06:59 UTC (rev 4453) @@ -0,0 +1,65 @@ +#region Copyright (C) 2005-2011 Team MediaPortal + +// Copyright (C) 2005-2011 Team MediaPortal +// http://www.team-mediaportal.com +// +// MediaPortal 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 of the License, or +// (at your option) any later version. +// +// MediaPortal 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 MediaPortal. If not, see <http://www.gnu.org/licenses/>. + +#endregion + +#region Usings + +using System; + +#endregion + +namespace TvEngine.PowerScheduler.Interfaces +{ + public delegate void EPGScheduleHandler(); + + /// <summary> + /// Provides access to PowerScheduler's EPG interface for + /// EPG plugins. + /// </summary> + public interface IEpgHandler + { + /// <summary> + /// Allows an external EPG source to prevent standby when it's + /// grabbing EPG + /// </summary> + /// <param name="source">the source preventing standby</param> + /// <param name="allowed">is standby allowed?</param> + void SetStandbyAllowed(object source, bool allowed, int timeout); + + /// <summary> + /// Allows an external EPG source to set a preferred next wakeup time + /// </summary> + /// <param name="source">the source that wants to wakeup the system for EPG grabbing</param> + /// <param name="time">the desired time to wakeup the system</param> + void SetNextEPGWakeupTime(object source, DateTime time); + + /// <summary> + /// Allows an external EPG source to retrieve the next wakeup time + /// for EPG grabbing. This time can be used to start an actual EPG + /// grabbing process. + /// </summary> + /// <returns>next EPG grab wakeup time</returns> + DateTime GetNextEPGWakeupTime(); + + /// <summary> + /// Event which gets fired when the configured EPG wakeup schedule is due. + /// </summary> + event EPGScheduleHandler EPGScheduleDue; + } +} \ No newline at end of file Added: trunk/plugins/PowerScheduler++/Test/new/Common-MP-TVE3/PowerScheduler.Interfaces/Interfaces/IPowerController.cs =================================================================== --- trunk/plugins/PowerScheduler++/Test/new/Common-MP-TVE3/PowerScheduler.Interfaces/Interfaces/IPowerController.cs (rev 0) +++ trunk/plugins/PowerScheduler++/Test/new/Common-MP-TVE3/PowerScheduler.Interfaces/Interfaces/IPowerController.cs 2012-02-16 17:06:59 UTC (rev 4453) @@ -0,0 +1,108 @@ +#region Copyright (C) 2005-2011 Team MediaPortal + +// Copyright (C) 2005-2011 Team MediaPortal +// http://www.team-mediaportal.com +// +// MediaPortal 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 of the License, or +// (at your option) any later version. +// +// MediaPortal 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 MediaPortal. If not, see <http://www.gnu.org/licenses/>. + +#endregion + +#region Usings + +using System; + +#endregion + +namespace TvEngine.PowerScheduler.Interfaces +{ + /// <summary> + /// Public interface to PowerScheduler power control + /// Intented to be used by singleseat setups + /// </summary> + public interface IPowerController + { + /// <summary> + /// Requests suspension of the system. Uses default action. + /// </summary> + /// <param name="source">description of who wants to suspend the system</param> + /// <param name="force">force the system to suspend (not recommended)</param> + void SuspendSystem(string source, bool force); + + /// <summary> + /// Requests suspension of the system. + /// </summary> + /// <param name="source"></param> + /// <param name="how">How to suspend, see MediaPortal.Util.RestartOptions</param> + /// <param name="force"></param> + void SuspendSystem(string source, int how, bool force); + + /// <summary> + /// Enables clients on singleseat setups to indicate whether or not the system + /// is allowed to enter standby + /// </summary> + /// <param name="standbyAllowed">is standby allowed?</param> + /// <param name="handlerName">client handlername which prevents standby</param> + void SetStandbyAllowed(bool standbyAllowed, string handlerName); + + /// <summary> + /// Enables clients on singleseat setups to indicate when the next + /// earliest wakeup time is due + /// </summary> + /// <param name="nextWakeupTime">DateTime when to wakeup the system</param> + /// <param name="handlerName">client handlername which is responsible for this wakeup time</param> + void SetNextWakeupTime(DateTime nextWakeupTime, string handlerName); + + /// <summary> + /// Resets the idle timer of the PowerScheduler. When enough time has passed (IdleTimeout), the system + /// is suspended as soon as possible (no handler disallows shutdown). + /// Note that the idle timer is automatically reset to now when the user moves the mouse or touchs the keyboard. + /// </summary> + void UserActivityDetected(DateTime when); + + /// <summary> + /// Register remote handlers. If an empty string or null is passed, no handler is registered for + /// that type. It returns a tag used to unregister the later. The returned tag is always not 0. + /// </summary> + /// <param name="standbyHandlerURI"></param> + /// <param name="wakeupHandlerURI"></param> + int RegisterRemote(String standbyHandlerURI, String wakeupHandlerURI); + + /// <summary> + /// Unregister remote handlers. + /// </summary> + void UnregisterRemote(int tag); + + /// <summary> + /// Indicates whether or not we're connected to the PowerScheduler power control interfaces + /// </summary> + bool IsConnected { get; } + + /// <summary> + /// Get the current state. If refresh is true, the state is the most current state, otherwise the state could be some seconds old. + /// Special case: If shutdown is not allowed because an event is almost due, the handler name is "EVENT-DUE". + /// </summary> + /// <param name="refresh"></param> + /// <param name="disAllowShutdown"></param> + /// <param name="disAllowShutdownHandler"></param> + /// <param name="nextWakeupTime"></param> + /// <param name="nextWakeupHandler"></param> + void GetCurrentState(bool refresh, out bool unattended, out bool disAllowShutdown, + out String disAllowShutdownHandler, out DateTime nextWakeupTime, out String nextWakeupHandler); + + /// <summary> + /// Provides access to PowerScheduler's settings + /// </summary> + IPowerSettings PowerSettings { get; } + } +} \ No newline at end of file Added: trunk/plugins/PowerScheduler++/Test/new/Common-MP-TVE3/PowerScheduler.Interfaces/Interfaces/IPowerScheduler.cs =================================================================== --- trunk/plugins/PowerScheduler++/Test/new/Common-MP-TVE3/PowerScheduler.Interfaces/Interfaces/IPowerScheduler.cs (rev 0) +++ trunk/plugins/PowerScheduler++/Test/new/Common-MP-TVE3/PowerScheduler.Interfaces/Interfaces/IPowerScheduler.cs 2012-02-16 17:06:59 UTC (rev 4453) @@ -0,0 +1,129 @@ +#region Copyright (C) 2005-2011 Team MediaPortal + +// Copyright (C) 2005-2011 Team MediaPortal +// http://www.team-mediaportal.com +// +// MediaPortal 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 of the License, or +// (at your option) any later version. +// +// MediaPortal 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 MediaPortal. If not, see <http://www.gnu.org/licenses/>. + +#endregion + +#region Usings + +using System; + +#endregion + +namespace TvEngine.PowerScheduler.Interfaces +{ + /// <summary> + /// EvenHandler delegate for PowerScheduler events + /// </summary> + /// <param name="args"></param> + public delegate void PowerSchedulerEventHandler(PowerSchedulerEventArgs args); + + /// <summary> + /// Interface to PowerScheduler + /// </summary> + public interface IPowerScheduler + { + /// <summary> + /// Register to this event to receive status changes from the PowerScheduler + /// </summary> + event PowerSchedulerEventHandler OnPowerSchedulerEvent; + + /// <summary> + /// Registers an IStandbyHandler implementation + /// </summary> + /// <param name="handler">implementation to register for handling standby requests</param> + void Register(IStandbyHandler handler); + + /// <summary> + /// Registers an IWakeupHandler implementation + /// </summary> + /// <param name="handler">implementation to register for handling system resume time</param> + void Register(IWakeupHandler handler); + + /// <summary> + /// Unregisters an IStandbyHandler implementation + /// </summary> + /// <param name="handler">implementation to unregister for handling standby requests</param> + void Unregister(IStandbyHandler handler); + + /// <summary> + /// Registers an IWakeupHandler implementation + /// </summary> + /// <param name="handler">implementation to register for handling system resume time</param> + void Unregister(IWakeupHandler handler); + + /// <summary> + /// Checks if the given IStandbyHandler is registered + /// </summary> + /// <param name="handler">IStandbyHandler to check</param> + /// <returns>is the given handler registered?</returns> + bool IsRegistered(IStandbyHandler handler); + + /// <summary> + /// Checks if the given IWakeupHandler is registered + /// </summary> + /// <param name="handler">IWakeupHandler to check</param> + /// <returns>is the given handler registered?</returns> + bool IsRegistered(IWakeupHandler handler); + + /// <summary> + /// Requests suspension of the system + /// </summary> + /// <param name="source">description of who wants to suspend the system</param> + /// <param name="force">force the system to suspend (not recommended)</param> + void SuspendSystem(string source, bool force); + + /// <summary> + /// Requests suspension of the system. + /// </summary> + /// <param name="source"></param> + /// <param name="how">How to suspend, see MediaPortal.Util.RestartOptions</param> + /// <param name="force"></param> + void SuspendSystem(string source, int how, bool force); + + /// <summary> + /// Resets the idle timer of the PowerScheduler. When enough time has passed (IdleTimeout), the system + /// is suspended as soon as possible (no handler disallows shutdown). + /// Note that the idle timer is automatically reset to now when the user moves the mouse or touchs the keyboard. + /// </summary> + void UserActivityDetected(DateTime when); + + /// <summary> + /// Get the current state. If refresh is true, the state is the most current state, otherwise the state could be some seconds old. + /// Special case: If shutdown is not allowed because an event is almost due, the handler name is "EVENT-DUE". + /// </summary> + /// <param name="refresh"></param> + /// <param name="disAllowShutdown"></param> + /// <param name="disAllowShutdownHandler"></param> + /// <param name="nextWakeupTime"></param> + /// <param name="nextWakeupHandler"></param> + void GetCurrentState(bool refresh, out bool unattended, out bool disAllowShutdown, + out String disAllowShutdownHandler, out DateTime nextWakeupTime, out String nextWakeupHandler); + + + /// <summary> + /// Checks if a suspend request is in progress + /// </summary> + /// <returns>is the system currently trying to suspend?</returns> + bool IsSuspendInProgress(); + + /// <summary> + /// Provides access to PowerScheduler's settings + /// </summary> + PowerSettings Settings { get; } + } +} \ No newline at end of file Added: trunk/plugins/PowerScheduler++/Test/new/Common-MP-TVE3/PowerScheduler.Interfaces/Interfaces/IPowerSettings.cs =================================================================== --- trunk/plugins/PowerScheduler++/Test/new/Common-MP-TVE3/PowerScheduler.Interfaces/Interfaces/IPowerSettings.cs (rev 0) +++ trunk/plugins/PowerScheduler++/Test/new/Common-MP-TVE3/PowerScheduler.Interfaces/Interfaces/IPowerSettings.cs 2012-02-16 17:06:59 UTC (rev 4453) @@ -0,0 +1,76 @@ +#region Copyright (C) 2005-2011 Team MediaPortal + +// Copyright (C) 2005-2011 Team MediaPortal +// http://www.team-mediaportal.com +// +// MediaPortal 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 of the License, or +// (at your option) any later version. +// +// MediaPortal 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 MediaPortal. If not, see <http://www.gnu.org/licenses/>. + +#endregion + +#region Usings + +#endregion + +namespace TvEngine.PowerScheduler.Interfaces +{ + /// <summary> + /// Provides access to PowerScheduler's settings + /// </summary> + public interface IPowerSettings + { + /// <summary> + /// Should PowerScheduler actively try to put the system into standby? + /// </summary> + bool ShutdownEnabled { get; } + + /// <summary> + /// Should PowerScheduler check when any plugin wants to wakeup the system? + /// </summary> + bool WakeupEnabled { get; } + + /// <summary> + /// Should the shutdown attemps be forced? + /// </summary> + bool ForceShutdown { get; } + + /// <summary> + /// Should PowerScheduler be verbose when logging? + /// </summary> + bool ExtensiveLogging { get; } + + /// <summary> + /// If ShutdownEnabled, how long (in minutes) to wait before putting the + /// system into standby + /// </summary> + int IdleTimeout { get; } + + /// <summary> + /// if WakeupEnabled, the time (in seconds) to wakeup the system earlier than + /// the actual wakeup time + /// </summary> + int PreWakeupTime { get; } + + /// <summary> + /// Controls the granularity of the standby/wakeup checks in seconds + /// </summary> + int CheckInterval { get; } + + /// <summary> + /// How should put the system into standby? suspend/hibernate/stayon + /// suspend uses S3, hibernate uses S4, stayon is for debugging purposes and + /// doesn't put the system into standby at all + /// </summary> + ShutdownMode ShutdownMode { get; } + } +} \ No newline at end of file Added: trunk/plugins/PowerScheduler++/Test/new/Common-MP-TVE3/PowerScheduler.Interfaces/Interfaces/IStandbyHandler.cs =================================================================== --- trunk/plugins/PowerScheduler++/Test/new/Common-MP-TVE3/PowerScheduler.Interfaces/Interfaces/IStandbyHandler.cs (rev 0) +++ trunk/plugins/PowerScheduler++/Test/new/Common-MP-TVE3/PowerScheduler.Interfaces/Interfaces/IStandbyHandler.cs 2012-02-16 17:06:59 UTC (rev 4453) @@ -0,0 +1,68 @@ +#region Copyright (C) 2005-2011 Team MediaPortal + +// Copyright (C) 2005-2011 Team MediaPortal +// http://www.team-mediaportal.com +// +// MediaPortal 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 of the License, or +// (at your option) any later version. +// +// MediaPortal 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 MediaPortal. If not, see <http://www.gnu.org/licenses/>. + +#endregion + +#region Usings + +#endregion + +namespace TvEngine.PowerScheduler.Interfaces +{ + /// <summary> + /// StandbyHandler interface for PowerScheduler + /// </summary> + public interface IStandbyHandler + { + /// <summary> + /// Indicator whether or not to allow suspension/hibernation of the system + /// </summary> + bool DisAllowShutdown { get; } + + /// <summary> + /// Called when the user turns away from the system. + /// </summary> + void UserShutdownNow(); + + /// <summary> + /// Description of the source that allows / disallows shutdown + /// </summary> + string HandlerName { get; } + } + + /// <summary> + /// PowerScheduler++ standby mode enumeration + /// </summary> + public enum StandbyMode + { + StandbyAllowed, + StandbyPrevented, + AwayModeRequested + } + + /// <summary> + /// Extension to the IStandbyHandler interface for PowerScheduler++ + /// </summary> + public interface IStandbyHandlerEx : IStandbyHandler + { + /// <summary> + /// Indicator which standby mode is requested by the handler + /// </summary> + StandbyMode StandbyMode { get; } + } +} \ No newline at end of file Added: trunk/plugins/PowerScheduler++/Test/new/Common-MP-TVE3/PowerScheduler.Interfaces/Interfaces/IWakeupHandler.cs =================================================================== --- trunk/plugins/PowerScheduler++/Test/new/Common-MP-TVE3/PowerScheduler.Interfaces/Interfaces/IWakeupHandler.cs (rev 0) +++ trunk/plugins/PowerScheduler++/Test/new/Common-MP-TVE3/PowerScheduler.Interfaces/Interfaces/IWakeupHandler.cs 2012-02-16 17:06:59 UTC (rev 4453) @@ -0,0 +1,46 @@ +#region Copyright (C) 2005-2011 Team MediaPortal + +// Copyright (C) 2005-2011 Team MediaPortal +// http://www.team-mediaportal.com +// +// MediaPortal 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 of the License, or +// (at your option) any later version. +// +// MediaPortal 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 MediaPortal. If not, see <http://www.gnu.org/licenses/>. + +#endregion + +#region Usings + +using System; + +#endregion + +namespace TvEngine.PowerScheduler.Interfaces +{ + /// <summary> + /// To be implemented by classes who want to control system resume + /// </summary> + public interface IWakeupHandler + { + /// <summary> + /// Should return the earliest time the implementation desires to wake up the system. + /// </summary> + /// <param name="earliestWakeupTime">indicates the earliest valid wake up time that is considered valid by the PowerScheduler</param> + /// <returns>earliest time the implementation wants to wake up the system</returns> + DateTime GetNextWakeupTime(DateTime earliestWakeupTime); + + /// <summary> + /// Description of the source that want to wake up the system at the given time + /// </summary> + string HandlerName { get; } + } +} \ No newline at end of file Added: trunk/plugins/PowerScheduler++/Test/new/Common-MP-TVE3/PowerScheduler.Interfaces/PowerManager.cs =================================================================== --- trunk/plugins/PowerScheduler++/Test/new/Common-MP-TVE3/PowerScheduler.Interfaces/PowerManager.cs (rev 0) +++ trunk/plugins/PowerScheduler++/Test/new/Common-MP-TVE3/PowerScheduler.Interfaces/PowerManager.cs 2012-02-16 17:06:59 UTC (rev 4453) @@ -0,0 +1,1268 @@ +#region Copyright (C) 2005-2011 Team MediaPortal + +// Copyright (C) 2005-2011 Team MediaPortal +// http://www.team-mediaportal.com +// +// MediaPortal 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 of the License, or +// (at your option) any later version. +// +// MediaPortal 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 MediaPortal. If not, see <http://www.gnu.org/licenses/>. + +#endregion + +#region Usings + +using System; +using System.Net; +using System.Runtime.InteropServices; + +#endregion + +namespace TvEngine.PowerScheduler.Interfaces +{ + /// <summary> + /// Provides static methods for managing system power states, events and settings + /// </summary> + public static class PowerManager + { + #region Variables + + /// <summary> + /// Handle to unregister for power setting change notification + /// </summary> + private static IntPtr _hAwayMode = (IntPtr)null; + + #endregion + + #region System power structures and enumerations + + /// <summary> + /// The thread's execution requirements + /// </summary> + [Flags] + enum ExecutionState : uint + { + /// <summary> + /// Some error. + /// </summary> + Error = 0, + + /// <summary> + /// System is required, do not hibernate. + /// </summary> + ES_SYSTEM_REQUIRED = 0x00000001, + + /// <summary> + /// Display is required, do not hibernate. + /// </summary> + ES_DISPLAY_REQUIRED = 0x00000002, + + /// <summary> + /// User is active, do not hibernate. + /// </summary> + ES_USER_PRESENT = 0x00000004, + + /// <summary> + /// Enables away mode. + /// </summary> + ES_AWAYMODE_REQUIRED = 0x00000040, + + /// <summary> + /// Use together with the above options to report a + /// state until explicitly changed. + /// </summary> + ES_CONTINUOUS = 0x80000000 + } + + /// <summary> + /// Flags to register for power setting change notification + /// </summary> + const int DEVICE_NOTIFY_WINDOW_HANDLE = 0x00000000; + const int DEVICE_NOTIFY_SERVICE_HANDLE = 0x00000001; + + /// <summary> + /// Constants for power notifications + /// </summary> + public const int WM_POWERBROADCAST = 0x0218; + public const int PBT_APMQUERYSUSPEND = 0x0000; + public const int PBT_APMQUERYSUSPENDFAILED = 0x0002; + public const int PBT_APMSUSPEND = 0x0004; + public const int PBT_APMRESUMECRITICAL = 0x0006; + public const int PBT_APMRESUMESUSPEND = 0x0007; + public const int PBT_APMRESUMEAUTOMATIC = 0x0012; + public const int PBT_POWERSETTINGCHANGE = 0x8013; + public const int BROADCAST_QUERY_DENY = 0x424D5144; + + /// <summary> + /// This structure is sent when the PBT_POWERSETTINGSCHANGE message is sent. + /// It describes the power setting that has changed and contains data about the change + /// </summary> + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public struct POWERBROADCAST_SETTING + { + public Guid PowerSetting; + public uint DataLength; + public byte Data; + } + + /// <summary> + /// Guid to register for power setting change notification + /// </summary> + public static Guid GUID_SYSTEM_AWAYMODE = new Guid("98a7f580-01f7-48aa-9c0f-44352c29e5C0"); + + /// <summary> + /// System power setting guids + /// </summary> + static Guid NO_SUBGROUP_GUID = new Guid("fea3413e-7e05-4911-9a71-700331f1c294"); + static Guid GUID_LOCK_CONSOLE_ON_WAKE = new Guid("0e796bdb-100d-47d6-a2d5-f7d2daa51f51"); + static Guid GUID_SUB_SLEEP = new Guid("238c9fa8-0aad-41ed-83f4-97be242c8f20"); + static Guid GUID_ALLOW_AWAY_MODE = new Guid("25dfa149-5dd1-4736-b5ab-e8a37b5b8187"); + static Guid GUID_SLEEP_AFTER = new Guid("29f6c1db-86da-48c5-9fdb-f2b67b1f44da"); + static Guid GUID_ALLOW_HYBRID_SLEEP = new Guid("94ac6d29-73ce-41a6-809f-6363ba21b47e"); + static Guid GUID_HIBERNATE_AFTER = new Guid("9d7815a6-7ee4-497e-8888-515a05f02364"); + static Guid GUID_ALLOW_RTC_WAKE = new Guid("bd3b718a-0680-4d9d-8ab2-e1d2b4ac806d"); + static Guid GUID_SUB_POWER_BUTTONS_AND_LID = new Guid("4f971e89-eebd-4455-a8de-9e59040e7347"); + static Guid GUID_LID_CLOSE_ACTION = new Guid("5ca83367-6e45-459f-a27b-476b1d01c936"); + static Guid GUID_POWER_BUTTON_ACTION = new Guid("7648efa3-dd9c-4e3e-b566-50f929386280"); + static Guid GUID_SLEEP_BUTTON_ACTION = new Guid("96996bc0-ad50-47ec-923b-6f41874dd9eb"); + static Guid GUID_SUB_MULTIMEDIA = new Guid("9596fb26-9850-41fd-ac3e-f7c3c00afd4b"); + static Guid GUID_WHEN_SHARING_MEDIA = new Guid("03680956-93bc-4294-bba6-4e0f09bb717f"); + + /// <summary> + /// Contains information about the power capabilities of the system. + /// </summary> + [StructLayout(LayoutKind.Sequential)] + struct SYSTEM_POWER_CAPABILITIES + { + [MarshalAs(UnmanagedType.I1)] + public bool PowerButtonPresent; + [MarshalAs(UnmanagedType.I1)] + public bool SleepButtonPresent; + [MarshalAs(UnmanagedType.I1)] + public bool LidPresent; + [MarshalAs(UnmanagedType.I1)] + public bool SystemS1; + [MarshalAs(UnmanagedType.I1)] + public bool SystemS2; + [MarshalAs(UnmanagedType.I1)] + public bool SystemS3; + [MarshalAs(UnmanagedType.I1)] + public bool SystemS4; + [MarshalAs(UnmanagedType.I1)] + public bool SystemS5; + [MarshalAs(UnmanagedType.I1)] + public bool HiberFilePresent; + [MarshalAs(UnmanagedType.I1)] + public bool FullWake; + [MarshalAs(UnmanagedType.I1)] + public bool VideoDimPresent; + [MarshalAs(UnmanagedType.I1)] + public bool ApmPresent; + [MarshalAs(UnmanagedType.I1)] + public bool UpsPresent; + [MarshalAs(UnmanagedType.I1)] + public bool ThermalControl; + [MarshalAs(UnmanagedType.I1)] + public bool ProcessorThrottle; + public byte ProcessorMinimumThrottle; + public byte ProcessorMaximumThrottle; + [MarshalAs(UnmanagedType.I1)] + public bool FastSystemS4; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)] + public byte[] spare2; + [MarshalAs(UnmanagedType.I1)] + public bool DiskSpinDown; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] + public byte[] spare3; + [MarshalAs(UnmanagedType.I1)] + public bool SystemBatteriesPresent; + [MarshalAs(UnmanagedType.I1)] + public bool BatteriesAreShortTerm; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)] + public BATTERY_REPORTING_SCALE[] BatteryScale; + public SYSTEM_POWER_STATE AcOnlineWake; + public SYSTEM_POWER_STATE SoftLidWake; + public SYSTEM_POWER_STATE RtcWake; + public SYSTEM_POWER_STATE MinimumDeviceWakeState; + public SYSTEM_POWER_STATE DefaultLowLatencyWake; + } + + /// <summary> + /// Contains the granularity of the battery capacity that is reported by IOCTL_BATTERY_QUERY_STATUS. + /// </summary> + [StructLayout(LayoutKind.Sequential)] + struct BATTERY_REPORTING_SCALE + { + public UInt32 Granularity; + public UInt32 Capacity; + } + + /// <summary> + /// Contains information about the power status of the system. + /// </summary> + struct SYSTEM_POWER_STATUS + { + public ACLineStatus ACLineStatus; + public BatteryFlag BatteryFlag; + public Byte BatteryLifePercent; + public Byte Reserved1; + public Int32 BatteryLifeTime; + public Int32 BatteryFullLifeTime; + } + + /// <summary> + /// The AC power status. + /// </summary> + enum ACLineStatus : byte + { + Offline = 0, + Online = 1, + Unknown = 255 + } + + /// <summary> + /// The battery charge status. + /// </summary> + enum BatteryFlag : byte + { + High = 1, + Low = 2, + Critical = 4, + Charging = 8, + NoSystemBattery = 128, + Unknown = 255 + } + + /// <summary> + /// Contains information used to set the system power state. + /// </summary> + [StructLayout(LayoutKind.Sequential, Pack=1)] + struct POWER_ACTION_POLICY + { + public POWER_ACTION Action; + public PowerActionFlags Flags; + public PowerActionEventCode EventCode; + } + + /// <summary> + /// Defines values that are used to specify system power action types. + /// </summary> + enum POWER_ACTION : uint + { + PowerActionNone = 0, // No system power action. + PowerActionReserved, // Reserved; do not use. + PowerActionSleep, // Sleep. + PowerActionHibernate, // Hibernate. + PowerActionShutdown, // Shutdown. + PowerActionShutdownReset, // Shutdown and reset. + PowerActionShutdownOff, // Shutdown and power off. + PowerActionWarmEject, // Warm eject. + } + + /// <summary> + /// + /// </summary> + [Flags] + enum PowerActionFlags : uint + { + POWER_ACTION_QUERY_ALLOWED = 0x00000001, // Broadcasts a PBT_APMQUERYSUSPEND event to each application to request permission to suspend operation. + POWER_ACTION_UI_ALLOWED = 0x00000002, // Applications can prompt the user for directions on how to prepare for suspension. Sets bit 0 in the Flags parameter passed in the lParam parameter of WM_POWERBROADCAST. + POWER_ACTION_OVERRIDE_APPS = 0x00000004, // Ignores applications that do not respond to the PBT_APMQUERYSUSPEND event broadcast in the WM_POWERBROADCAST message. + POWER_ACTION_LIGHTEST_FIRST = 0x10000000, // Uses the first lightest available sleep state. + POWER_ACTION_LOCK_CONSOLE = 0x20000000, // Requires entry of the system password upon resume from one of the system standby states. + POWER_ACTION_DISABLE_WAKES = 0x40000000, // Disables all wake events. + POWER_ACTION_CRITICAL = 0x80000000, // Forces a critical suspension. + } + + [Flags] + enum PowerActionEventCode : uint + { + POWER_LEVEL_USER_NOTIFY_TEXT = 0x00000001, // User notified using the UI. + POWER_LEVEL_USER_NOTIFY_SOUND = 0x00000002, // User notified using sound. + POWER_LEVEL_USER_NOTIFY_EXEC = 0x00000004, // Specifies a program to be executed. + POWER_USER_NOTIFY_BUTTON = 0x00000008, // Indicates that the power action is in response to a user power button press. + POWER_USER_NOTIFY_SHUTDOWN = 0x00000010, // Indicates a power action of shutdown/off. + POWER_FORCE_TRIGGER_RESET = 0x80000000, // Clears a user power button press. + } + + /// <summary> + /// The global flags constants are used to enable or disable user power policy options + /// </summary> + [Flags] + enum GlobalFlags : uint + { + EnableMultiBatteryDisplay = 0x02, // Enables or disables multiple battery display in the system Power Meter. + EnablePasswordLogon = 0x04, // Enables or disables requiring password logon when the system resumes from standby or hibernate. + EnableSysTrayBatteryMeter = 0x01, // Enables or disables the battery meter icon in the system tray. When this flag is cleared, the battery meter icon is not displayed. + EnableVideoDimDisplay = 0x10, // Enables or disables support for dimming the video display when the system changes from running on AC power to running on battery power. + EnableWakeOnRing = 0x08, // Enables or disables wake on ring support. + } + + /// <summary> + /// Contains power policy settings that are unique to each power scheme. + /// </summary> + struct POWER_POLICY + { + public USER_POWER_POLICY user; + public MACHINE_POWER_POLICY mach; + } + + /// <summary> + /// Contains power policy settings that are unique to each power scheme for a user. + /// </summary> + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)] + struct USER_POWER_POLICY { + public uint Revision; + public POWER_ACTION_POLICY IdleAc; + public POWER_ACTION_POLICY IdleDc; + public uint IdleTimeoutAc; + public uint IdleTimeoutDc; + public byte IdleSensitivityAc; + public byte IdleSensitivityDc; + public byte ThrottlePolicyAc; + public byte ThrottlePolicyDc; + public SYSTEM_POWER_STATE MaxSleepAc; + public SYSTEM_POWER_STATE MaxSleepDc; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)] + public uint[] Reserved; + public uint VideoTimeoutAc; + public uint VideoTimeoutDc; + public uint SpindownTimeoutAc; + public uint SpindownTimeoutDc; + [MarshalAs(UnmanagedType.I1)] + public bool OptimizeForPowerAc; + [MarshalAs(UnmanagedType.I1)] + public bool OptimizeForPowerDc; + public byte FanThrottleToleranceAc; + public byte FanThrottleToleranceDc; + public byte ForcedThrottleAc; + public byte ForcedThrottleDc; + } + + /// <summary> + /// Contains computer power policy settings that are unique to each power scheme on the computer. + /// </summary> + struct MACHINE_POWER_POLICY { + public uint Revision; + public SYSTEM_POWER_STATE MinSleepAc; + public SYSTEM_POWER_STATE MinSleepDc; + public SYSTEM_POWER_STATE ReducedLatencySleepAc; + public SYSTEM_POWER_STATE ReducedLatencySleepDc; + public uint DozeTimeoutAc; + public uint DozeTimeoutDc; + public uint DozeS4TimeoutAc; + public uint DozeS4TimeoutDc; + public byte MinThrottleAc; + public byte MinThrottleDc; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)] + public byte[] pad1; + public POWER_ACTION_POLICY OverThrottledAc; + public POWER_ACTION_POLICY OverThrottledDc; + } + + /// <summary> + /// Contains global power policy settings that apply to all power schemes. + /// </summary> + [StructLayout(LayoutKind.Sequential, Pack = 1)] + struct GLOBAL_POWER_POLICY + { + public GLOBAL_USER_POWER_POLICY user; + public GLOBAL_MACHINE_POWER_POLICY mach; + } + + /// <summary> + /// Contains global user power policy settings that apply to all power schemes for a user. + /// </summary> + [StructLayout(LayoutKind.Sequential, Pack = 1)] + struct GLOBAL_USER_POWER_POLICY + { + public const int NUM_DISCHARGE_POLICIES = 4; + + public uint Revision; + public POWER_ACTION_POLICY PowerButtonAc; + public POWER_ACTION_POLICY PowerButtonDc; + public POWER_ACTION_POLICY SleepButtonAc; + public POWER_ACTION_POLICY SleepButtonDc; + public POWER_ACTION_POLICY LidCloseAc; + public POWER_ACTION_POLICY LidCloseDc; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = NUM_DISCHARGE_POLICIES)] + public SYSTEM_POWER_LEVEL[] DischargePolicy; + public GlobalFlags GlobalFlags; + } + + /// <summary> + /// Contains information about system battery drain policy settings. + /// </summary> + [StructLayout(LayoutKind.Sequential, Pack = 1)] + struct SYSTEM_POWER_LEVEL + { + public bool Enable; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)] + public byte[] Spare; + public uint BatteryLevel; + public POWER_ACTION_POLICY PowerPolicy; + public SYSTEM_POWER_STATE MinSystemState; + } + + /// <summary> + /// Contains global computer power policy settings that ap... [truncated message content] |
From: <mic...@us...> - 2012-02-16 17:06:28
|
Revision: 4452 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=4452&view=rev Author: michael-t Date: 2012-02-16 17:06:17 +0000 (Thu, 16 Feb 2012) Log Message: ----------- Added Paths: ----------- trunk/plugins/PowerScheduler++/Test/1.2.6.0/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ks...@us...> - 2012-02-14 20:21:59
|
Revision: 4451 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=4451&view=rev Author: ksya Date: 2012-02-14 20:21:46 +0000 (Tue, 14 Feb 2012) Log Message: ----------- Added Paths: ----------- trunk/plugins/OperaMobileLauncher/ trunk/plugins/OperaMobileLauncher/Opera Mobile/ trunk/plugins/OperaMobileLauncher/Opera Mobile/FormSettings.Designer.cs trunk/plugins/OperaMobileLauncher/Opera Mobile/FormSettings.cs trunk/plugins/OperaMobileLauncher/Opera Mobile/FormSettings.resx trunk/plugins/OperaMobileLauncher/Opera Mobile/IniFile.cs trunk/plugins/OperaMobileLauncher/Opera Mobile/OperaLauncher.cs trunk/plugins/OperaMobileLauncher/Opera Mobile/OperaLauncher.cs.bak trunk/plugins/OperaMobileLauncher/Opera Mobile/OperaLauncher.cs.new trunk/plugins/OperaMobileLauncher/Opera Mobile/OperaLauncher.csproj trunk/plugins/OperaMobileLauncher/Opera Mobile/OperaLauncher.csproj.user trunk/plugins/OperaMobileLauncher/Opera Mobile/Properties/ trunk/plugins/OperaMobileLauncher/Opera Mobile/Properties/AssemblyInfo.cs trunk/plugins/OperaMobileLauncher/Opera Mobile/Properties/Resources.Designer.cs trunk/plugins/OperaMobileLauncher/Opera Mobile/Properties/Resources.resx trunk/plugins/OperaMobileLauncher/Opera Mobile/bin/ trunk/plugins/OperaMobileLauncher/Opera Mobile/bin/Debug/ trunk/plugins/OperaMobileLauncher/Opera Mobile/bin/Debug/OperaMobile.dll trunk/plugins/OperaMobileLauncher/Opera Mobile/bin/Debug/OperaMobile.pdb trunk/plugins/OperaMobileLauncher/Opera Mobile/bin/Debug/Utils.dll trunk/plugins/OperaMobileLauncher/Opera Mobile/bin/Release/ trunk/plugins/OperaMobileLauncher/Opera Mobile/bin/Release/OperaMobile.png trunk/plugins/OperaMobileLauncher/Opera Mobile/bin/Release/OperaMobile.xml trunk/plugins/OperaMobileLauncher/Opera Mobile/bin/Release/OperaMobileLauncher - kopie.xmp2 trunk/plugins/OperaMobileLauncher/Opera Mobile/bin/Release/OperaMobileLauncher.dll trunk/plugins/OperaMobileLauncher/Opera Mobile/bin/Release/OperaMobileLauncher.mpe1 trunk/plugins/OperaMobileLauncher/Opera Mobile/bin/Release/OperaMobileLauncher.pdb trunk/plugins/OperaMobileLauncher/Opera Mobile/bin/Release/OperaMobileLauncher.xmp2 trunk/plugins/OperaMobileLauncher/Opera Mobile/bin/Release/OperaMobileLauncher_0.2.zip trunk/plugins/OperaMobileLauncher/Opera Mobile/bin/Release/OperaMobileLauncher_0.3.zip trunk/plugins/OperaMobileLauncher/Opera Mobile/bin/Release/OperaMobileSettings.png trunk/plugins/OperaMobileLauncher/Opera Mobile/bin/Release/hover_Opera Mobile Launcher.png trunk/plugins/OperaMobileLauncher/Opera Mobile/bin/Release/hover_Opera Mobile Launcher1.png trunk/plugins/OperaMobileLauncher/Opera Mobile/bin/Release/opera_left_installer.jpg trunk/plugins/OperaMobileLauncher/Opera Mobile/bin/Release/update.xml trunk/plugins/OperaMobileLauncher/Opera Mobile/obj/ trunk/plugins/OperaMobileLauncher/Opera Mobile/obj/Debug/ trunk/plugins/OperaMobileLauncher/Opera Mobile/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache trunk/plugins/OperaMobileLauncher/Opera Mobile/obj/Debug/Opera Mobile.csproj.FileListAbsolute.txt trunk/plugins/OperaMobileLauncher/Opera Mobile/obj/Debug/OperaLauncher.FormSettings.resources trunk/plugins/OperaMobileLauncher/Opera Mobile/obj/Debug/OperaLauncher.csproj.FileListAbsolute.txt trunk/plugins/OperaMobileLauncher/Opera Mobile/obj/Debug/OperaMobile.csproj.FileListAbsolute.txt trunk/plugins/OperaMobileLauncher/Opera Mobile/obj/Debug/OperaMobile.dll trunk/plugins/OperaMobileLauncher/Opera Mobile/obj/Debug/OperaMobile.pdb trunk/plugins/OperaMobileLauncher/Opera Mobile/obj/Debug/ResGen.read.1.tlog trunk/plugins/OperaMobileLauncher/Opera Mobile/obj/Debug/ResGen.write.1.tlog trunk/plugins/OperaMobileLauncher/Opera Mobile/obj/Debug/ResolveAssemblyReference.cache trunk/plugins/OperaMobileLauncher/Opera Mobile/obj/Debug/TempPE/ trunk/plugins/OperaMobileLauncher/Opera Mobile/obj/Debug/eventGhostTrigger.FormSettings.resources trunk/plugins/OperaMobileLauncher/Opera Mobile/obj/Release/ trunk/plugins/OperaMobileLauncher/Opera Mobile/obj/Release/DesignTimeResolveAssemblyReferencesInput.cache trunk/plugins/OperaMobileLauncher/Opera Mobile/obj/Release/Opera Mobile.csproj.FileListAbsolute.txt trunk/plugins/OperaMobileLauncher/Opera Mobile/obj/Release/OperaLauncher.FormSettings.resources trunk/plugins/OperaMobileLauncher/Opera Mobile/obj/Release/OperaLauncher.Properties.Resources.resources trunk/plugins/OperaMobileLauncher/Opera Mobile/obj/Release/OperaLauncher.csproj.FileListAbsolute.txt trunk/plugins/OperaMobileLauncher/Opera Mobile/obj/Release/OperaMobile.csproj.FileListAbsolute.txt trunk/plugins/OperaMobileLauncher/Opera Mobile/obj/Release/OperaMobileLauncher.dll trunk/plugins/OperaMobileLauncher/Opera Mobile/obj/Release/OperaMobileLauncher.pdb trunk/plugins/OperaMobileLauncher/Opera Mobile/obj/Release/ResGen.read.1.tlog trunk/plugins/OperaMobileLauncher/Opera Mobile/obj/Release/ResGen.write.1.tlog trunk/plugins/OperaMobileLauncher/Opera Mobile/obj/Release/ResolveAssemblyReference.cache trunk/plugins/OperaMobileLauncher/Opera Mobile/obj/Release/TempPE/ trunk/plugins/OperaMobileLauncher/Opera Mobile/obj/Release/TempPE/Properties.Resources.Designer.cs.dll trunk/plugins/OperaMobileLauncher/Opera Mobile/opera-logo.png trunk/plugins/OperaMobileLauncher/Opera Mobile/opera-logo_disabled.png trunk/plugins/OperaMobileLauncher/OperaMobileLauncher.sln trunk/plugins/OperaMobileLauncher/OperaMobileLauncher.suo Added: trunk/plugins/OperaMobileLauncher/Opera Mobile/FormSettings.Designer.cs =================================================================== --- trunk/plugins/OperaMobileLauncher/Opera Mobile/FormSettings.Designer.cs (rev 0) +++ trunk/plugins/OperaMobileLauncher/Opera Mobile/FormSettings.Designer.cs 2012-02-14 20:21:46 UTC (rev 4451) @@ -0,0 +1,388 @@ +namespace OperaLauncher +{ + partial class FormSettings + { + /// <summary> + /// Required designer variable. + /// </summary> + private System.ComponentModel.IContainer components = null; + + /// <summary> + /// Clean up any resources being used. + /// </summary> + /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// <summary> + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// </summary> + private void InitializeComponent() + { + this.buttonOk = new System.Windows.Forms.Button(); + this.buttonCancel = new System.Windows.Forms.Button(); + this.imageFileName_Button = new System.Windows.Forms.Button(); + this.imageFileName_Editbox = new System.Windows.Forms.TextBox(); + this.label4 = new System.Windows.Forms.Label(); + this.test_btn = new System.Windows.Forms.Button(); + this.fullscreen_chk = new System.Windows.Forms.CheckBox(); + this.touchinterface_chk = new System.Windows.Forms.CheckBox(); + this.customargs_txt = new System.Windows.Forms.TextBox(); + this.label1 = new System.Windows.Forms.Label(); + this.widthZoom_txt = new System.Windows.Forms.TextBox(); + this.widthZoom_chk = new System.Windows.Forms.CheckBox(); + this.ApplyOpera_btn = new System.Windows.Forms.Button(); + this.downloadLink = new System.Windows.Forms.LinkLabel(); + this.minFontSize_nud = new System.Windows.Forms.NumericUpDown(); + this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.setToDesktopUA_btn = new System.Windows.Forms.Button(); + this.customUA_txt = new System.Windows.Forms.TextBox(); + this.useCustomUA_chk = new System.Windows.Forms.CheckBox(); + this.label2 = new System.Windows.Forms.Label(); + this.useMinFontsize_chk = new System.Windows.Forms.CheckBox(); + this.label3 = new System.Windows.Forms.Label(); + this.openHelp_btn = new System.Windows.Forms.Button(); + this.useButtonForwarding = new System.Windows.Forms.CheckBox(); + ((System.ComponentModel.ISupportInitialize)(this.minFontSize_nud)).BeginInit(); + this.groupBox1.SuspendLayout(); + this.SuspendLayout(); + // + // buttonOk + // + this.buttonOk.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.buttonOk.DialogResult = System.Windows.Forms.DialogResult.OK; + this.buttonOk.Location = new System.Drawing.Point(362, 436); + this.buttonOk.Name = "buttonOk"; + this.buttonOk.Size = new System.Drawing.Size(75, 23); + this.buttonOk.TabIndex = 2; + this.buttonOk.Text = "Save"; + this.buttonOk.UseVisualStyleBackColor = true; + this.buttonOk.Click += new System.EventHandler(this.buttonOk_Click); + // + // buttonCancel + // + this.buttonCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.buttonCancel.Location = new System.Drawing.Point(443, 436); + this.buttonCancel.Name = "buttonCancel"; + this.buttonCancel.Size = new System.Drawing.Size(75, 23); + this.buttonCancel.TabIndex = 2; + this.buttonCancel.Text = "Cancel"; + this.buttonCancel.UseVisualStyleBackColor = true; + // + // imageFileName_Button + // + this.imageFileName_Button.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.imageFileName_Button.Location = new System.Drawing.Point(493, 24); + this.imageFileName_Button.Name = "imageFileName_Button"; + this.imageFileName_Button.Size = new System.Drawing.Size(27, 23); + this.imageFileName_Button.TabIndex = 19; + this.imageFileName_Button.Text = "..."; + this.imageFileName_Button.UseVisualStyleBackColor = true; + this.imageFileName_Button.Click += new System.EventHandler(this.imageFileName_Button_Click); + // + // imageFileName_Editbox + // + this.imageFileName_Editbox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.imageFileName_Editbox.Location = new System.Drawing.Point(15, 26); + this.imageFileName_Editbox.Name = "imageFileName_Editbox"; + this.imageFileName_Editbox.Size = new System.Drawing.Size(472, 20); + this.imageFileName_Editbox.TabIndex = 20; + // + // label4 + // + this.label4.AutoSize = true; + this.label4.Location = new System.Drawing.Point(12, 9); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(179, 13); + this.label4.TabIndex = 21; + this.label4.Text = "Select the Opera Mobile executable:"; + // + // test_btn + // + this.test_btn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.test_btn.Location = new System.Drawing.Point(15, 436); + this.test_btn.Name = "test_btn"; + this.test_btn.Size = new System.Drawing.Size(52, 23); + this.test_btn.TabIndex = 22; + this.test_btn.Text = "Test"; + this.test_btn.UseVisualStyleBackColor = true; + this.test_btn.Click += new System.EventHandler(this.test_btn_Click); + // + // fullscreen_chk + // + this.fullscreen_chk.AutoSize = true; + this.fullscreen_chk.Location = new System.Drawing.Point(15, 53); + this.fullscreen_chk.Name = "fullscreen_chk"; + this.fullscreen_chk.Size = new System.Drawing.Size(293, 17); + this.fullscreen_chk.TabIndex = 23; + this.fullscreen_chk.Text = "Do not start in fullscreen (clears the -fullscreen argument)"; + this.fullscreen_chk.UseVisualStyleBackColor = true; + // + // touchinterface_chk + // + this.touchinterface_chk.AutoSize = true; + this.touchinterface_chk.Location = new System.Drawing.Point(15, 73); + this.touchinterface_chk.Name = "touchinterface_chk"; + this.touchinterface_chk.Size = new System.Drawing.Size(231, 17); + this.touchinterface_chk.TabIndex = 24; + this.touchinterface_chk.Text = "Use the touch interface (not recommended)"; + this.touchinterface_chk.UseVisualStyleBackColor = true; + // + // customargs_txt + // + this.customargs_txt.Location = new System.Drawing.Point(15, 116); + this.customargs_txt.Name = "customargs_txt"; + this.customargs_txt.Size = new System.Drawing.Size(250, 20); + this.customargs_txt.TabIndex = 25; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(12, 99); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(97, 13); + this.label1.TabIndex = 26; + this.label1.Text = "Custom arguments:"; + // + // widthZoom_txt + // + this.widthZoom_txt.Enabled = false; + this.widthZoom_txt.Location = new System.Drawing.Point(9, 44); + this.widthZoom_txt.Name = "widthZoom_txt"; + this.widthZoom_txt.Size = new System.Drawing.Size(59, 20); + this.widthZoom_txt.TabIndex = 28; + // + // widthZoom_chk + // + this.widthZoom_chk.AutoSize = true; + this.widthZoom_chk.Location = new System.Drawing.Point(9, 24); + this.widthZoom_chk.Name = "widthZoom_chk"; + this.widthZoom_chk.Size = new System.Drawing.Size(279, 17); + this.widthZoom_chk.TabIndex = 29; + this.widthZoom_chk.Text = "Zoom to fit and use minimum width of: (recommended)"; + this.widthZoom_chk.UseVisualStyleBackColor = true; + this.widthZoom_chk.CheckedChanged += new System.EventHandler(this.widthZoom_chk_CheckedChanged); + // + // ApplyOpera_btn + // + this.ApplyOpera_btn.Anchor = System.Windows.Forms.AnchorStyles.Bottom; + this.ApplyOpera_btn.ForeColor = System.Drawing.Color.DarkBlue; + this.ApplyOpera_btn.Location = new System.Drawing.Point(165, 172); + this.ApplyOpera_btn.Name = "ApplyOpera_btn"; + this.ApplyOpera_btn.Size = new System.Drawing.Size(173, 23); + this.ApplyOpera_btn.TabIndex = 30; + this.ApplyOpera_btn.Text = "Apply settings to Opera Mobile"; + this.ApplyOpera_btn.UseVisualStyleBackColor = false; + this.ApplyOpera_btn.Click += new System.EventHandler(this.ApplyOpera_btn_Click); + // + // downloadLink + // + this.downloadLink.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.downloadLink.AutoSize = true; + this.downloadLink.Location = new System.Drawing.Point(343, 416); + this.downloadLink.Name = "downloadLink"; + this.downloadLink.Size = new System.Drawing.Size(165, 13); + this.downloadLink.TabIndex = 31; + this.downloadLink.TabStop = true; + this.downloadLink.Text = "Download Opera Mobile Emulator"; + this.downloadLink.TextAlign = System.Drawing.ContentAlignment.TopRight; + this.downloadLink.Click += new System.EventHandler(this.downloadLink_Click); + // + // minFontSize_nud + // + this.minFontSize_nud.Enabled = false; + this.minFontSize_nud.Location = new System.Drawing.Point(9, 88); + this.minFontSize_nud.Name = "minFontSize_nud"; + this.minFontSize_nud.Size = new System.Drawing.Size(51, 20); + this.minFontSize_nud.TabIndex = 33; + this.minFontSize_nud.Value = new decimal(new int[] { + 10, + 0, + 0, + 0}); + // + // groupBox1 + // + this.groupBox1.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.groupBox1.Controls.Add(this.setToDesktopUA_btn); + this.groupBox1.Controls.Add(this.customUA_txt); + this.groupBox1.Controls.Add(this.useCustomUA_chk); + this.groupBox1.Controls.Add(this.label2); + this.groupBox1.Controls.Add(this.useMinFontsize_chk); + this.groupBox1.Controls.Add(this.minFontSize_nud); + this.groupBox1.Controls.Add(this.ApplyOpera_btn); + this.groupBox1.Controls.Add(this.widthZoom_txt); + this.groupBox1.Controls.Add(this.widthZoom_chk); + this.groupBox1.Location = new System.Drawing.Point(12, 196); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.Size = new System.Drawing.Size(505, 201); + this.groupBox1.TabIndex = 34; + this.groupBox1.TabStop = false; + this.groupBox1.Text = "These settings need to be applied first"; + // + // setToDesktopUA_btn + // + this.setToDesktopUA_btn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.setToDesktopUA_btn.Enabled = false; + this.setToDesktopUA_btn.Location = new System.Drawing.Point(406, 133); + this.setToDesktopUA_btn.Name = "setToDesktopUA_btn"; + this.setToDesktopUA_btn.Size = new System.Drawing.Size(88, 23); + this.setToDesktopUA_btn.TabIndex = 38; + this.setToDesktopUA_btn.Text = "Set to desktop"; + this.setToDesktopUA_btn.UseVisualStyleBackColor = true; + this.setToDesktopUA_btn.Click += new System.EventHandler(this.setToDesktopUA_Click); + // + // customUA_txt + // + this.customUA_txt.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.customUA_txt.Enabled = false; + this.customUA_txt.Location = new System.Drawing.Point(9, 135); + this.customUA_txt.Name = "customUA_txt"; + this.customUA_txt.Size = new System.Drawing.Size(391, 20); + this.customUA_txt.TabIndex = 37; + // + // useCustomUA_chk + // + this.useCustomUA_chk.AutoSize = true; + this.useCustomUA_chk.Location = new System.Drawing.Point(9, 114); + this.useCustomUA_chk.Name = "useCustomUA_chk"; + this.useCustomUA_chk.Size = new System.Drawing.Size(276, 17); + this.useCustomUA_chk.TabIndex = 36; + this.useCustomUA_chk.Text = "Use custom User-Agent: (standard is Android/Mobile)"; + this.useCustomUA_chk.UseVisualStyleBackColor = true; + this.useCustomUA_chk.CheckedChanged += new System.EventHandler(this.useCustomUA_chk_CheckedChanged); + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(69, 44); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(33, 13); + this.label2.TabIndex = 35; + this.label2.Text = "pixels"; + // + // useMinFontsize_chk + // + this.useMinFontsize_chk.AutoSize = true; + this.useMinFontsize_chk.Location = new System.Drawing.Point(9, 69); + this.useMinFontsize_chk.Name = "useMinFontsize_chk"; + this.useMinFontsize_chk.Size = new System.Drawing.Size(133, 17); + this.useMinFontsize_chk.TabIndex = 34; + this.useMinFontsize_chk.Text = "Use minimum font size:"; + this.useMinFontsize_chk.UseVisualStyleBackColor = true; + this.useMinFontsize_chk.CheckedChanged += new System.EventHandler(this.useMinFontsize_chk_CheckedChanged); + // + // label3 + // + this.label3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(14, 416); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(83, 13); + this.label3.TabIndex = 35; + this.label3.Text = "0.3 beta - Dragy"; + // + // openHelp_btn + // + this.openHelp_btn.Location = new System.Drawing.Point(268, 114); + this.openHelp_btn.Name = "openHelp_btn"; + this.openHelp_btn.Size = new System.Drawing.Size(75, 23); + this.openHelp_btn.TabIndex = 36; + this.openHelp_btn.Text = "Open help"; + this.openHelp_btn.UseVisualStyleBackColor = true; + this.openHelp_btn.Click += new System.EventHandler(this.openHelp_btn_Click); + // + // useButtonForwarding + // + this.useButtonForwarding.AutoSize = true; + this.useButtonForwarding.Checked = true; + this.useButtonForwarding.CheckState = System.Windows.Forms.CheckState.Checked; + this.useButtonForwarding.Location = new System.Drawing.Point(15, 145); + this.useButtonForwarding.Name = "useButtonForwarding"; + this.useButtonForwarding.Size = new System.Drawing.Size(445, 30); + this.useButtonForwarding.TabIndex = 37; + this.useButtonForwarding.Text = "Use MP to forward remote buttons to Opera Mobile (T9 typing not yet supported/wor" + + "king)\r\n(External app to re-map buttons is still recommended. Don\'t enable when u" + + "sing such app)\r\n"; + this.useButtonForwarding.UseVisualStyleBackColor = true; + // + // FormSettings + // + this.AcceptButton = this.buttonOk; + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.CancelButton = this.buttonCancel; + this.ClientSize = new System.Drawing.Size(529, 471); + this.Controls.Add(this.useButtonForwarding); + this.Controls.Add(this.openHelp_btn); + this.Controls.Add(this.label3); + this.Controls.Add(this.downloadLink); + this.Controls.Add(this.label1); + this.Controls.Add(this.customargs_txt); + this.Controls.Add(this.touchinterface_chk); + this.Controls.Add(this.fullscreen_chk); + this.Controls.Add(this.test_btn); + this.Controls.Add(this.label4); + this.Controls.Add(this.imageFileName_Editbox); + this.Controls.Add(this.imageFileName_Button); + this.Controls.Add(this.buttonCancel); + this.Controls.Add(this.buttonOk); + this.Controls.Add(this.groupBox1); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "FormSettings"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; + this.Text = "Opera Mobile Launcher Settings"; + this.Load += new System.EventHandler(this.FormSettings_Load); + ((System.ComponentModel.ISupportInitialize)(this.minFontSize_nud)).EndInit(); + this.groupBox1.ResumeLayout(false); + this.groupBox1.PerformLayout(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Button buttonOk; + private System.Windows.Forms.Button buttonCancel; + private System.Windows.Forms.Button imageFileName_Button; + private System.Windows.Forms.TextBox imageFileName_Editbox; + private System.Windows.Forms.Label label4; + private System.Windows.Forms.Button test_btn; + private System.Windows.Forms.CheckBox fullscreen_chk; + private System.Windows.Forms.CheckBox touchinterface_chk; + private System.Windows.Forms.TextBox customargs_txt; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.TextBox widthZoom_txt; + private System.Windows.Forms.CheckBox widthZoom_chk; + private System.Windows.Forms.Button ApplyOpera_btn; + private System.Windows.Forms.LinkLabel downloadLink; + private System.Windows.Forms.NumericUpDown minFontSize_nud; + private System.Windows.Forms.GroupBox groupBox1; + private System.Windows.Forms.CheckBox useMinFontsize_chk; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.Button openHelp_btn; + private System.Windows.Forms.TextBox customUA_txt; + private System.Windows.Forms.CheckBox useCustomUA_chk; + private System.Windows.Forms.Button setToDesktopUA_btn; + private System.Windows.Forms.CheckBox useButtonForwarding; + + } +} \ No newline at end of file Added: trunk/plugins/OperaMobileLauncher/Opera Mobile/FormSettings.cs =================================================================== --- trunk/plugins/OperaMobileLauncher/Opera Mobile/FormSettings.cs (rev 0) +++ trunk/plugins/OperaMobileLauncher/Opera Mobile/FormSettings.cs 2012-02-14 20:21:46 UTC (rev 4451) @@ -0,0 +1,256 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Text; +using System.Threading; +using System.Windows.Forms; +using MediaPortal.GUI.Library; +//using MediaPortal.Util; +using MediaPortal.Configuration; +using System.Diagnostics; +using System.IO; +using System.Runtime.InteropServices; + +namespace OperaLauncher +{ + public partial class FormSettings : Form + { + public string arguments; + + public FormSettings() + { + InitializeComponent(); + } + + + private void displayDeviceSettings() + { + using (MediaPortal.Profile.Settings xmlReader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) + { + + string Path = xmlReader.GetValueAsString(OperaLauncher.PLUGIN_NAME, "Path", ""); + bool noFullscreen = xmlReader.GetValueAsBool(OperaLauncher.PLUGIN_NAME, "noFullscreen", false); + bool TouchInferface = xmlReader.GetValueAsBool(OperaLauncher.PLUGIN_NAME, "TouchInferface", false); + string Arguments = xmlReader.GetValueAsString(OperaLauncher.PLUGIN_NAME, "Arguments", ""); + bool UseZoomWidth = xmlReader.GetValueAsBool(OperaLauncher.PLUGIN_NAME, "UseZoomWidth", false); + string ZoomWidth = xmlReader.GetValueAsString(OperaLauncher.PLUGIN_NAME, "ZoomWidth", "950"); + bool UseMinFontSize = xmlReader.GetValueAsBool(OperaLauncher.PLUGIN_NAME, "UseMinFontSize", false); + string MinFontSize = xmlReader.GetValueAsString(OperaLauncher.PLUGIN_NAME, "MinFontSize", "9"); + bool UseCustomUserAgent = xmlReader.GetValueAsBool(OperaLauncher.PLUGIN_NAME, "UseCustomUserAgent", false); + string CustomUserAgent = xmlReader.GetValueAsString(OperaLauncher.PLUGIN_NAME, "CustomUserAgent", ""); + bool UseButtonForwarding = xmlReader.GetValueAsBool(OperaLauncher.PLUGIN_NAME, "UseButtonForwarding", true); + + imageFileName_Editbox.Text = Path; + fullscreen_chk.Checked = noFullscreen; + touchinterface_chk.Checked = TouchInferface; + customargs_txt.Text = Arguments; + useButtonForwarding.Checked = UseButtonForwarding; + + widthZoom_txt.Text = ZoomWidth; + if (UseZoomWidth) + { + widthZoom_chk.Checked = true; + widthZoom_txt.Enabled = true; + } + + minFontSize_nud.Value = Convert.ToDecimal(MinFontSize); + if (UseMinFontSize) + { + useMinFontsize_chk.Checked = true; + minFontSize_nud.Enabled = true; + } + + customUA_txt.Text = CustomUserAgent; + if (UseCustomUserAgent) + { + useCustomUA_chk.Checked = true; + customUA_txt.Enabled = true; + setToDesktopUA_btn.Enabled = true; + } + + } + } + private void FormSettings_Load(object sender, EventArgs e) + { + displayDeviceSettings(); + } + + public static void Main() + { + FormSettings frm = new FormSettings(); + if (frm.ShowDialog() == DialogResult.OK) + { + } + } + + private void buttonOk_Click(object sender, EventArgs e) + { + using (MediaPortal.Profile.Settings xmlWriter = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) + { + xmlWriter.SetValue(OperaLauncher.PLUGIN_NAME, "Path", imageFileName_Editbox.Text); + xmlWriter.SetValueAsBool(OperaLauncher.PLUGIN_NAME, "noFullscreen", fullscreen_chk.Checked); + xmlWriter.SetValueAsBool(OperaLauncher.PLUGIN_NAME, "TouchInferface", touchinterface_chk.Checked); + xmlWriter.SetValue(OperaLauncher.PLUGIN_NAME, "Arguments", customargs_txt.Text); + xmlWriter.SetValueAsBool(OperaLauncher.PLUGIN_NAME, "UseZoomWidth", widthZoom_chk.Checked); + xmlWriter.SetValue(OperaLauncher.PLUGIN_NAME, "ZoomWidth", widthZoom_txt.Text); + xmlWriter.SetValueAsBool(OperaLauncher.PLUGIN_NAME, "UseMinFontSize", useMinFontsize_chk.Checked); + xmlWriter.SetValue(OperaLauncher.PLUGIN_NAME, "MinFontSize", minFontSize_nud.Value); + xmlWriter.SetValueAsBool(OperaLauncher.PLUGIN_NAME, "UseCustomUserAgent", useCustomUA_chk.Checked); + xmlWriter.SetValue(OperaLauncher.PLUGIN_NAME, "CustomUserAgent", customUA_txt.Text); + xmlWriter.SetValueAsBool(OperaLauncher.PLUGIN_NAME, "UseButtonForwarding", useButtonForwarding.Checked); + } + } + + private void imageFileName_Button_Click(object sender, EventArgs e) + { + OpenFileDialog fdlg = new OpenFileDialog(); + fdlg.Title = "Select the Opera Mobile Emulator executable"; + fdlg.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles); + fdlg.Filter = "Opera Mobile|OperaMobileEmu.exe"; + fdlg.FilterIndex = 2; + fdlg.RestoreDirectory = true; + + if (fdlg.ShowDialog() == DialogResult.OK) + { + imageFileName_Editbox.Text = fdlg.FileName; + } + } + + private void test_btn_Click(object sender, EventArgs e) + { + arguments = ""; + Process opera = new Process(); + if (!fullscreen_chk.Checked) + arguments += " -fullscreen"; + if (touchinterface_chk.Checked) + arguments += " -tabletui"; + else + arguments += " -notouchwithtouchevents"; + + arguments += " "+customargs_txt.Text; + + opera.StartInfo.FileName = imageFileName_Editbox.Text; + opera.StartInfo.WorkingDirectory = Directory.GetParent(imageFileName_Editbox.Text).FullName; + opera.StartInfo.Arguments = arguments; + + try + { + opera.Start(); + } + catch (Exception ex) + { + MessageBox.Show(ex.Message, "Could not start.."); + Log.Error("Start Opera failed: " + ex.Message); + } + } + + private void ApplyOpera_btn_Click(object sender, EventArgs e) + { + //make scripts/user.js file + string operaLocation = Directory.GetParent(imageFileName_Editbox.Text).FullName; + string scriptsFile = System.IO.Path.Combine(operaLocation, @"opera\user.js"); + + // Delete the file if it exists. + if (File.Exists(scriptsFile)) + { + File.Delete(scriptsFile); + } + + // Create the file. + if (!File.Exists(scriptsFile)) + { + using (FileStream fs = File.Create(scriptsFile)) + { + } + } + + // create a writer and open the file + TextWriter tw = new StreamWriter(scriptsFile); + tw.WriteLine("if(" + widthZoom_chk.Checked.ToString().ToLower() + ")"); + tw.WriteLine("{"); + tw.WriteLine("var yourTag=document.createElement('meta');"); + tw.WriteLine("yourTag.name = \"viewport\";"); + tw.WriteLine("yourTag.content = \"width=" + widthZoom_txt.Text + "px;\";"); + tw.WriteLine("document.getElementsByTagName('head')[0].appendChild(yourTag);"); + tw.WriteLine("}"); + tw.Close(); + + string OperaIniFile = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + @"\Opera\OperaMobileEmulator\opera.ini"; + + if (File.Exists(OperaIniFile)) + { + IniFile ini = new IniFile(OperaIniFile); + + //write values to opera.ini + ini.IniWriteValue("User Prefs", "User JavaScript", "1"); + ini.IniWriteValue("User Prefs", "User JavaScript File", scriptsFile); + + if (useMinFontsize_chk.Checked) + ini.IniWriteValue("User Prefs", "Minimum Font Size", minFontSize_nud.Value.ToString()); + else + ini.IniWriteValue("User Prefs", "Minimum Font Size", null); + + if (useCustomUA_chk.Checked) + ini.IniWriteValue("User Prefs", "Custom User-Agent", customUA_txt.Text); + else + ini.IniWriteValue("User Prefs", "Custom User-Agent", null); + + } + else + { + MessageBox.Show("Opera Program Data not yet created. Please, press the test button first and try to apply settings again.", "Error Message"); + } + } + + private void widthZoom_chk_CheckedChanged(object sender, EventArgs e) + { + if (widthZoom_chk.Checked) + widthZoom_txt.Enabled = true; + else + widthZoom_txt.Enabled = false; + } + private void useMinFontsize_chk_CheckedChanged(object sender, EventArgs e) + { + if (useMinFontsize_chk.Checked) + minFontSize_nud.Enabled = true; + else + minFontSize_nud.Enabled = false; + } + private void useCustomUA_chk_CheckedChanged(object sender, EventArgs e) + { + if (useCustomUA_chk.Checked) + { + customUA_txt.Enabled = true; + setToDesktopUA_btn.Enabled = true; + } + else + { + customUA_txt.Enabled = false; + setToDesktopUA_btn.Enabled = false; + } + } + + + private void downloadLink_Click(object sender, EventArgs e) + { + Process.Start("http://www.opera.com/developer/tools/mobile/"); + } + + private void openHelp_btn_Click(object sender, EventArgs e) + { + Process opera = new Process(); + opera.StartInfo.FileName = imageFileName_Editbox.Text; + opera.StartInfo.WorkingDirectory = Directory.GetParent(imageFileName_Editbox.Text).FullName; + opera.StartInfo.Arguments = "-?"; + opera.Start(); + } + + private void setToDesktopUA_Click(object sender, EventArgs e) + { + customUA_txt.Text = "Opera/9.80 (Windows NT 6.0; U; en) Presto/2.8.99 Version/11.10"; + } + + } +} \ No newline at end of file Added: trunk/plugins/OperaMobileLauncher/Opera Mobile/FormSettings.resx =================================================================== --- trunk/plugins/OperaMobileLauncher/Opera Mobile/FormSettings.resx (rev 0) +++ trunk/plugins/OperaMobileLauncher/Opera Mobile/FormSettings.resx 2012-02-14 20:21:46 UTC (rev 4451) @@ -0,0 +1,120 @@ +<?xml version="1.0" encoding="utf-8"?> +<root> + <!-- + Microsoft ResX Schema + + Version 2.0 + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes + associated with the data types. + + Example: + + ... ado.net/XML headers & schema ... + <resheader name="resmimetype">text/microsoft-resx</resheader> + <resheader name="version">2.0</resheader> + <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> + <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> + <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> + <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> + <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> + <value>[base64 mime encoded serialized .NET Framework object]</value> + </data> + <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> + <comment>This is a comment</comment> + </data> + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> + <xsd:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:element name="metadata"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" /> + </xsd:sequence> + <xsd:attribute name="name" use="required" type="xsd:string" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="assembly"> + <xsd:complexType> + <xsd:attribute name="alias" type="xsd:string" /> + <xsd:attribute name="name" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="data"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="resheader"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + </xsd:schema> + <resheader name="resmimetype"> + <value>text/microsoft-resx</value> + </resheader> + <resheader name="version"> + <value>2.0</value> + </resheader> + <resheader name="reader"> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> +</root> \ No newline at end of file Added: trunk/plugins/OperaMobileLauncher/Opera Mobile/IniFile.cs =================================================================== --- trunk/plugins/OperaMobileLauncher/Opera Mobile/IniFile.cs (rev 0) +++ trunk/plugins/OperaMobileLauncher/Opera Mobile/IniFile.cs 2012-02-14 20:21:46 UTC (rev 4451) @@ -0,0 +1,56 @@ +using System; +using System.Runtime.InteropServices; +using System.Text; + + public class IniFile + { + public string path; + + [DllImport("kernel32")] + private static extern long WritePrivateProfileString(string section, + string key, string val, string filePath); + [DllImport("kernel32")] + private static extern int GetPrivateProfileString(string section, + string key, string def, StringBuilder retVal, int size, string filePath); + + /// <summary> + /// INIFile Constructor. + /// </summary> + /// <PARAM name="INIPath"></PARAM> + + public IniFile(string INIPath) + { + path = INIPath; + } + /// <summary> + /// Write Data to the INI File + /// </summary> + /// <PARAM name="Section"></PARAM> + /// Section name + /// <PARAM name="Key"></PARAM> + /// Key Name + /// <PARAM name="Value"></PARAM> + /// Value Name + + public void IniWriteValue(string Section, string Key, string Value) + { + WritePrivateProfileString(Section, Key, Value, this.path); + } + + /// <summary> + /// Read Data Value From the Ini File + /// </summary> + /// <PARAM name="Section"></PARAM> + /// <PARAM name="Key"></PARAM> + /// <PARAM name="Path"></PARAM> + /// <returns></returns> + + public string IniReadValue(string Section, string Key) + { + StringBuilder temp = new StringBuilder(255); + int i = GetPrivateProfileString(Section, Key, "", temp, + 255, this.path); + return temp.ToString(); + + } + } Added: trunk/plugins/OperaMobileLauncher/Opera Mobile/OperaLauncher.cs =================================================================== --- trunk/plugins/OperaMobileLauncher/Opera Mobile/OperaLauncher.cs (rev 0) +++ trunk/plugins/OperaMobileLauncher/Opera Mobile/OperaLauncher.cs 2012-02-14 20:21:46 UTC (rev 4451) @@ -0,0 +1,299 @@ +using System; +using System.Diagnostics; +using MediaPortal.GUI.Library; +using MediaPortal.Configuration; +using System.IO; +using System.Windows.Forms; +using System.Runtime.InteropServices; + +namespace OperaLauncher +{ + [PluginIcons("OperaLauncher.opera-logo.png", "OperaLauncher.opera-logo_disabled.png")] + + public class OperaLauncher : GUIWindow, ISetupForm + { + public const string PLUGIN_NAME = "Opera Mobile Launcher"; + public string Path; + public bool noFullscreen; + public bool TouchInferface; + public string Arguments; + public bool UseButtonForwarding; + + [DllImport("user32.dll")] + public static extern int FindWindow( + string lpClassName, // class name + string lpWindowName // window name + ); + + [DllImport("user32.dll")] + public static extern int SendMessage( + int hWnd, // handle to destination window + uint Msg, // message + int wParam, // first message parameter + int lParam // second message parameter + ); + + [DllImport("user32.dll")] + private static extern bool ShowWindowAsync(int hWnd, int nCmdShow); + + [DllImport("user32.dll")] + private static extern bool BringWindowToTop(int hWnd); + + [DllImport("user32.dll")] + private static extern bool EnableWindow(int hWnd, bool bEnable); + + [DllImport("user32.dll")] + private static extern int SetFocus(int hWnd); + + + const int WM_KEYDOWN = 0x0100; + const int WM_KEYUP = 0x0101; + const int WM_APPCOMMAND = 0x0319; + const int SW_HIDE = 0; + const int SW_SHOWNORMAL = 1; + const int SW_SHOWMINIMIZED = 2; + const int SW_SHOWMAXIMIZED = 3; + const int SW_RESTORE = 9; + const int VK_F1 = 0x70; + const int VK_F2 = 0x71; + const int VK_NUMPAD0 = 0x60; + const int VK_NUMPAD1 = 0x61; + const int VK_NUMPAD2 = 0x62; + const int VK_NUMPAD3 = 0x63; + const int VK_NUMPAD4 = 0x64; + const int VK_NUMPAD5 = 0x65; + const int VK_NUMPAD6 = 0x66; + const int VK_NUMPAD7 = 0x67; + const int VK_NUMPAD8 = 0x68; + const int VK_NUMPAD9 = 0x69; + + ProcessStartInfo startInfo = new ProcessStartInfo(); + Process opera = new Process(); + public OperaLauncher() + { + using (MediaPortal.Profile.Settings xmlReader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) + { + Path = xmlReader.GetValueAsString(OperaLauncher.PLUGIN_NAME, "Path", ""); + noFullscreen = xmlReader.GetValueAsBool(OperaLauncher.PLUGIN_NAME, "noFullscreen", false); + TouchInferface = xmlReader.GetValueAsBool(OperaLauncher.PLUGIN_NAME, "TouchInferface", false); + Arguments = xmlReader.GetValueAsString(OperaLauncher.PLUGIN_NAME, "Arguments", ""); + UseButtonForwarding = xmlReader.GetValueAsBool(OperaLauncher.PLUGIN_NAME, "UseButtonForwarding", true); + } + } + + protected override void OnPageLoad() + { + string strUrl = GUIPropertyManager.GetProperty("#browserlink"); + startOpera(strUrl); + + if(!UseButtonForwarding) + GUIWindowManager.ShowPreviousWindow(); + base.OnPageLoad(); + } + + protected override void OnPageDestroy(int newWindowId) + { + //close opera + opera.CloseMainWindow(); + + /*int WindowToFind = FindWindow("WindowsForms10.Window.8.app.0.2386859", null); + bool test = ShowWindowAsync(WindowToFind, SW_RESTORE);*/ + } + + public void startOpera(string strUrl = null) + { + string arguments = ""; + if (!noFullscreen) + arguments += " -fullscreen"; + if (TouchInferface) + arguments += " -tabletui"; + else + arguments += " -notouchwithtouchevents"; + + arguments += " " + Arguments; + + opera.StartInfo.FileName = @Path; + opera.StartInfo.WorkingDirectory = Directory.GetParent(Path).FullName; + if (strUrl != null) + opera.StartInfo.Arguments = arguments + " -url " + strUrl; + else + opera.StartInfo.Arguments = arguments; + + try + { + opera.Start(); + + int OperaHandle = FindWindow("QWidget", null); + bool top = BringWindowToTop(OperaHandle); + + if (UseButtonForwarding) + { + int MPHandle = FindWindow("WindowsForms10.Window.8.app.0.2386859", null); + int disableinput = SetFocus(MPHandle); + Log.Info("Set focus: (MP Handle: " + MPHandle.ToString() + ", Focus: " + disableinput + ")"); + } + //bool test = ShowWindowAsync(WindowToFind, SW_HIDE); + Cursor.Hide(); + } + catch (Exception ex) + { + Log.Error("Start Opera failed: " + ex.Message); + Cursor.Show(); + } + } + + + public override void OnAction(MediaPortal.GUI.Library.Action action) + { + if (UseButtonForwarding) + { + int WindowToFind = FindWindow("QWidget", null); + + switch (action.wID) + { + case MediaPortal.GUI.Library.Action.ActionType.ACTION_CONTEXT_MENU: + GUIPropertyManager.SetProperty("#keypressed", "Info"); + SendMessage(WindowToFind, WM_KEYDOWN, VK_F1, 0); + SendMessage(WindowToFind, WM_KEYUP, VK_F1, 0); + break; + + case MediaPortal.GUI.Library.Action.ActionType.ACTION_PREV_ITEM: + GUIPropertyManager.SetProperty("#keypressed", "Replay"); + SendMessage(WindowToFind, WM_KEYDOWN, VK_F2, 0); + SendMessage(WindowToFind, WM_KEYUP, VK_F2, 0); + break; + + case MediaPortal.GUI.Library.Action.ActionType.ACTION_PAGE_UP: + GUIPropertyManager.SetProperty("#keypressed", "Channel Up"); + SendMessage(WindowToFind, WM_KEYDOWN, VK_NUMPAD8, 0); + SendMessage(WindowToFind, WM_KEYUP, VK_NUMPAD8, 0); + break; + + case MediaPortal.GUI.Library.Action.ActionType.ACTION_PAGE_DOWN: + GUIPropertyManager.SetProperty("#keypressed", "Channel Down"); + SendMessage(WindowToFind, WM_KEYDOWN, VK_NUMPAD2, 0); + SendMessage(WindowToFind, WM_KEYUP, VK_NUMPAD2, 0); + break; + + case MediaPortal.GUI.Library.Action.ActionType.REMOTE_0: + GUIPropertyManager.SetProperty("#keypressed", "0"); + SendMessage(WindowToFind, WM_KEYDOWN, VK_NUMPAD0, 0); + SendMessage(WindowToFind, WM_KEYUP, VK_NUMPAD0, 0); + break; + case MediaPortal.GUI.Library.Action.ActionType.REMOTE_1: + GUIPropertyManager.SetProperty("#keypressed", "1"); + SendMessage(WindowToFind, WM_KEYDOWN, VK_NUMPAD1, 0); + SendMessage(WindowToFind, WM_KEYUP, VK_NUMPAD1, 0); + break; + case MediaPortal.GUI.Library.Action.ActionType.REMOTE_2: + GUIPropertyManager.SetProperty("#keypressed", "2"); + SendMessage(WindowToFind, WM_KEYDOWN, VK_NUMPAD2, 0); + SendMessage(WindowToFind, WM_KEYUP, VK_NUMPAD2, 0); + break; + } + } + base.OnAction(action); + } + + + public override bool Init() //bij het laden van MediaPortal + { + Log.Debug("Init Opera Mobile Launcher"); + if (UseButtonForwarding) + return Load(GUIGraphicsContext.Skin + @"\OperaMobile.xml"); + else + return true; + } + + #region ISetupForm Members + + // Returns the name of the plugin which is shown in the plugin menu + public string PluginName() + { + return PLUGIN_NAME; + } + + // Returns the description of the plugin is shown in the plugin menu + public string Description() + { + return "Starts Opera Mobile Emulator from MediaPortal"; + } + + // Returns the author of the plugin which is shown in the plugin menu + public string Author() + { + return "Dragy"; + } + + // show the setup dialog + public void ShowPlugin() + { + FormSettings frm = new FormSettings(); + frm.ShowDialog(); + } + + // Indicates whether plugin can be enabled/disabled + public bool CanEnable() + { + return true; + } + + // Get Windows-ID + public int GetWindowId() + { + // WindowID of windowplugin belonging to this setup + // enter your own unique code + return 156778; + } + + // Indicates if plugin is enabled by default; + public bool DefaultEnabled() + { + return true; + } + + // indicates if a plugin has it's own setup screen + public bool HasSetup() + { + return true; + } + + /// <summary> + /// If the plugin should have it's own button on the main menu of MediaPortal then it + /// should return true to this method, otherwise if it should not be on home + /// it should return false + /// </summary> + /// <param name="strButtonText">text the button should have</param> + /// <param name="strButtonImage">image for the button, or empty for default</param> + /// <param name="strButtonImageFocus">image for the button, or empty for default</param> + /// <param name="strPictureImage">subpicture for the button or empty for none</param> + /// <returns>true : plugin needs it's own button on home + /// false : plugin does not need it's own button on home</returns> + + public bool GetHome(out string strButtonText, out string strButtonImage, out string strButtonImageFocus, out string strPictureImage) + { + strButtonText = "Opera Mobile"; + strButtonImage = String.Empty; + strButtonImageFocus = String.Empty; + strPictureImage = String.Empty; + return true; + } + + // With GetID it will be an window-plugin / otherwise a process-plugin + // Enter the id number here again + public override int GetID + { + get + { + return 156778; + } + + set + { + } + } + + #endregion + + } +} \ No newline at end of file Added: trunk/plugins/OperaMobileLauncher/Opera Mobile/OperaLauncher.cs.bak =================================================================== --- trunk/plugins/OperaMobileLauncher/Opera Mobile/OperaLauncher.cs.bak (rev 0) +++ trunk/plugins/OperaMobileLauncher/Opera Mobile/OperaLauncher.cs.bak 2012-02-14 20:21:46 UTC (rev 4451) @@ -0,0 +1,260 @@ +using System; +using System.Diagnostics; +using MediaPortal.GUI.Library; +using MediaPortal.Configuration; +using System.IO; +using System.Windows.Forms; +using System.Runtime.InteropServices; + +namespace OperaLauncher +{ + [PluginIcons("OperaLauncher.opera-logo.png", "OperaLauncher.opera-logo_disabled.png")] + + public class OperaLauncher : GUIWindow, ISetupForm + { + public const string PLUGIN_NAME = "Opera Mobile Launcher"; + public string Path; + public bool noFullscreen; + public bool TouchInferface; + public string Arguments; + public bool UseButtonForwarding; + + [DllImport("user32.dll")] + public static extern int FindWindow( + string lpClassName, // class name + string lpWindowName // window name + ); + + [DllImport("user32.dll")] + public static extern int SendMessage( + int hWnd, // handle to destination window + uint Msg, // message + int wParam, // first message parameter + int lParam // second message parameter + ); + + const int WM_KEYDOWN = 0x0100; + const int WM_KEYUP = 0x0101; + //const int WM_APPCOMMAND = 0x0319; + const int VK_F1 = 0x70; + const int VK_F2 = 0x71; + const int VK_NUMPAD0 = 0x60; + const int VK_NUMPAD1 = 0x61; + const int VK_NUMPAD2 = 0x62; + const int VK_NUMPAD3 = 0x63; + const int VK_NUMPAD4 = 0x64; + const int VK_NUMPAD5 = 0x65; + const int VK_NUMPAD6 = 0x66; + const int VK_NUMPAD7 = 0x67; + const int VK_NUMPAD8 = 0x68; + const int VK_NUMPAD9 = 0x69; + + ProcessStartInfo startInfo = new ProcessStartInfo(); + Process opera = new Process(); + public OperaLauncher() + { + using (MediaPortal.Profile.Settings xmlReader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) + { + Path = xmlReader.GetValueAsString(OperaLauncher.PLUGIN_NAME, "Path", ""); + noFullscreen = xmlReader.GetValueAsBool(OperaLauncher.PLUGIN_NAME, "noFullscreen", false); + TouchInferface = xmlReader.GetValueAsBool(OperaLauncher.PLUGIN_NAME, "TouchInferface", false); + Arguments = xmlReader.GetValueAsString(OperaLauncher.PLUGIN_NAME, "Arguments", ""); + UseButtonForwarding = xmlReader.GetValueAsBool(OperaLauncher.PLUGIN_NAME, "UseButtonForwarding", true); + } + } + + protected override void OnPageLoad() + { + string strUrl = GUIPropertyManager.GetProperty("#browserlink"); + startOpera(strUrl); + + if(!UseButtonForwarding) + GUIWindowManager.ShowPreviousWindow(); + base.OnPageLoad(); + } + + protected override void OnPageDestroy(int newWindowId) + { + //close opera + opera.CloseMainWindow(); + } + + public void startOpera(string strUrl = null) + { + string arguments = ""; + if (!noFullscreen) + arguments += " -fullscreen"; + if (TouchInferface) + arguments += " -tabletui"; + else + arguments += " -notouchwithtouchevents"; + + arguments += " " + Arguments; + + opera.StartInfo.FileName = @Path; + opera.StartInfo.WorkingDirectory = Directory.GetParent(Path).FullName; + if (strUrl != null) + opera.StartInfo.Arguments = arguments + " -url " + strUrl; + else + opera.StartInfo.Arguments = arguments; + + try + { + opera.Start(); + } + catch (Exception ex) + { + Log.Error("Start Opera failed: " + ex.Message); + } + } + + + public override void OnAction(MediaPortal.GUI.Library.Action action) + { + if (UseButtonForwarding) + { + int WindowToFind = FindWindow("QWidget", null); + + switch (action.wID) + { + case MediaPortal.GUI.Library.Action.ActionType.ACTION_CONTEXT_MENU: + GUIPropertyManager.SetProperty("#keypressed", "Info"); + SendMessage(WindowToFind, WM_KEYDOWN, VK_F1, 0); + SendMessage(WindowToFind, WM_KEYUP, VK_F1, 0); + break; + + case MediaPortal.GUI.Library.Action.ActionType.ACTION_PREV_ITEM: + GUIPropertyManager.SetProperty("#keypressed", "Replay"); + SendMessage(WindowToFind, WM_KEYDOWN, VK_F2, 0); + SendMessage(WindowToFind, WM_KEYUP, VK_F2, 0); + break; + + case MediaPortal.GUI.Library.Action.ActionType.ACTION_PAGE_UP: + GUIPropertyManager.SetProperty("#keypressed", "Channel Up"); + SendMessage(WindowToFind, WM_KEYDOWN, VK_NUMPAD8, 0); + SendMessage(WindowToFind, WM_KEYUP, VK_NUMPAD8, 0); + break; + + case MediaPortal.GUI.Library.Action.ActionType.ACTION_PAGE_DOWN: + GUIPropertyManager.SetProperty("#keypressed", "Channel Down"); + SendMessage(WindowToFind, WM_KEYDOWN, VK_NUMPAD2, 0); + SendMessage(WindowToFind, WM_KEYUP, VK_NUMPAD2, 0); + break; + + case MediaPortal.GUI.Library.Action.ActionType.REMOTE_0: + GUIPropertyManager.SetProperty("#keypressed", "0"); + SendMessage(WindowToFind, WM_KEYDOWN, VK_NUMPAD0, 0); + SendMessage(WindowToFind, WM_KEYUP, VK_NUMPAD0, 0); + break; + case MediaPortal.GUI.Library.Action.ActionType.REMOTE_1: + GUIPropertyManager.SetProperty("#keypressed", "1"); + SendMessage(WindowToFind, WM_KEYDOWN, VK_NUMPAD1, 0); + SendMessage(WindowToFind, WM_KEYUP, VK_NUMPAD1, 0); + break; + } + } + base.OnAction(action); + } + + + public override bool Init() //bij het laden van MediaPortal + { + Log.Debug("Init Opera Mobile Launcher"); + if (UseButtonForwarding) + return Load(GUIGraphicsContext.Skin + @"\OperaMobile.xml")... [truncated message content] |
From: <hor...@us...> - 2012-02-10 23:13:50
|
Revision: 4450 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=4450&view=rev Author: horned-reaper Date: 2012-02-10 23:13:42 +0000 (Fri, 10 Feb 2012) Log Message: ----------- Modified Paths: -------------- trunk/plugins/FritzBox/Build/Build.log trunk/plugins/FritzBox/Docs/Ausstehend.txt trunk/plugins/FritzBox/Docs/Changes.txt trunk/plugins/FritzBox/FritzBox/FritzBox.cs trunk/plugins/FritzBox/FritzBox/Skin/Default/FritzManager.xml trunk/plugins/FritzBox/FritzBox/Skin/DefaultWide/FritzManager.xml trunk/plugins/FritzBox/FritzBox/bin/Release/FritzBox.dll trunk/plugins/FritzBox/FritzBox/bin/Release/FritzBox.pdb trunk/plugins/FritzBox/FritzBox/obj/Debug/FritzBox.dll trunk/plugins/FritzBox/FritzBox/obj/Debug/FritzBox.pdb 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/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.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/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/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.exe trunk/plugins/FritzBox/Tools/FritzBoxDebugger/obj/Debug/FritzBoxDebugger.pdb trunk/plugins/FritzBox/Tools/FritzBoxDebugger/obj/Release/FritzBoxDebugger.csproj.FileListAbsolute.txt 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/Skin/Streamed MP/ trunk/plugins/FritzBox/FritzBox/Skin/Streamed MP/Media/ trunk/plugins/FritzBox/FritzBox/Skin/Streamed MP/Media/FritzBox/ trunk/plugins/FritzBox/FritzBox/Skin/Streamed MP/Media/FritzBox/Phone_Icon_Home.png trunk/plugins/FritzBox/FritzBox/Skin/Streamed MP/Media/FritzBox/Phone_Icon_Mobile.png trunk/plugins/FritzBox/FritzBox/Skin/Streamed MP/Media/FritzBox/Phone_Icon_Work.png trunk/plugins/FritzBox/Tools/FritzBoxDebugger/obj/Release/GenerateResource.read.6.tlog trunk/plugins/FritzBox/Tools/FritzBoxDebugger/obj/Release/GenerateResource.write.6.tlog trunk/plugins/FritzBox/releases/FritzBox_v0.4.1.4449.mpe1 Removed Paths: ------------- trunk/plugins/FritzBox/FritzBox/LocalizeStrings.cs trunk/plugins/FritzBox/Tools/FritzBoxDebugger/obj/Release/GenerateResource.read.7.tlog trunk/plugins/FritzBox/Tools/FritzBoxDebugger/obj/Release/GenerateResource.write.7.tlog Modified: trunk/plugins/FritzBox/Build/Build.log =================================================================== --- trunk/plugins/FritzBox/Build/Build.log 2012-02-10 15:26:34 UTC (rev 4449) +++ trunk/plugins/FritzBox/Build/Build.log 2012-02-10 23:13:42 UTC (rev 4450) @@ -1,6 +1,6 @@ Running : C:\Program Files\TortoiseSVN\bin\SubWCRev.exe -SVN Version: 4448 +SVN Version: 4449 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 10.02.2012 16:17:35. +Build started 11.02.2012 00:03:28. Project "D:\FritzBox\FritzBox.sln" on node 1 (Rebuild target(s)). ValidateSolutionConfiguration: Building solution configuration "Release|Mixed Platforms". @@ -154,6 +154,8 @@ Deleting file "D:\FritzBox\Tools\FritzBoxDebugger\obj\Release\FritzBoxDebugger.DebugForm.resources". Deleting file "D:\FritzBox\Tools\FritzBoxDebugger\obj\Release\FritzBoxDebugger.exe". 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.read.7.tlog". Deleting file "D:\FritzBox\Tools\FritzBoxDebugger\obj\Release\GenerateResource.write.7.tlog". CoreResGen: @@ -195,7 +197,7 @@ 0 Warning(s) 0 Error(s) -Time Elapsed 00:00:03.28 +Time Elapsed 00:00:02.04 Reverting to build 0 Updating: D:\FritzBox\FritzBox\Properties\AssemblyInfo.cs Updating: D:\FritzBox\MP2version\Listeners\FritzBox\Properties\AssemblyInfo.cs @@ -256,7 +258,10 @@ ..\FritzBox\Skin\Maya\Media\FritzBox\Phone_Icon_Mobile.png ..\FritzBox\Skin\Maya\Media\FritzBox\Phone_Icon_Work.png ..\FritzBox\Skin\Maya\Media\FritzBox\rejected.png -50 File(s) copied +..\FritzBox\Skin\Streamed MP\Media\FritzBox\Phone_Icon_Home.png +..\FritzBox\Skin\Streamed MP\Media\FritzBox\Phone_Icon_Mobile.png +..\FritzBox\Skin\Streamed MP\Media\FritzBox\Phone_Icon_Work.png +53 File(s) copied ..\FritzBox\Languages\strings_de.xml ..\FritzBox\Languages\strings_el.xml ..\FritzBox\Languages\strings_en-US.xml @@ -295,7 +300,7 @@ ..\FritzBox\Languages\Unsupported\strings_zh-CN.xml 36 File(s) copied MpeMaker version: 1.2.1.0 -Build started at 16:17:41 +Build started at 00:03:32 Building "D:\FritzBox\MpeRelease\FritzBox.xmp2" Output: "..\MpeRelease\FritzBox.mpe1" Writing UpdateXML to "update.xml" Modified: trunk/plugins/FritzBox/Docs/Ausstehend.txt =================================================================== --- trunk/plugins/FritzBox/Docs/Ausstehend.txt 2012-02-10 15:26:34 UTC (rev 4449) +++ trunk/plugins/FritzBox/Docs/Ausstehend.txt 2012-02-10 23:13:42 UTC (rev 4450) @@ -2,9 +2,6 @@ - Problem bei schnell aufeinander folgenden Anrufen Optimierungen: -- btnModus umbenennen? -- blauer Hintergrund f\xFCr Default und DefaultWide Skins -- GUI-Properties \xFCberpr\xFCfen und Dokumentation vervollst\xE4ndigen - Einstellungen-Eintr\xE4ge in XML-Datei in Kategorie "FRITZ!Box Manager" zusammenfassen Neue Funktionen/Erweiterungen: Modified: trunk/plugins/FritzBox/Docs/Changes.txt =================================================================== --- trunk/plugins/FritzBox/Docs/Changes.txt 2012-02-10 15:26:34 UTC (rev 4449) +++ trunk/plugins/FritzBox/Docs/Changes.txt 2012-02-10 23:13:42 UTC (rev 4450) @@ -1,12 +1,5 @@ -New release 0.4.1.4448: -New features: -- phone book: - - phone numbers are grouped by contact name - - contact picture preview in contact list -- phone type display in call notifications, call list and voice box item list +New release 0.4.1.44x: +Optimization: -Optimizations: -- improved localization function, plugin starts faster now -Fixed bugs: -- FRITZ!Box connection is not established on startup in some circumstances \ No newline at end of file +Fixed bug: Modified: trunk/plugins/FritzBox/FritzBox/FritzBox.cs =================================================================== --- trunk/plugins/FritzBox/FritzBox/FritzBox.cs 2012-02-10 15:26:34 UTC (rev 4449) +++ trunk/plugins/FritzBox/FritzBox/FritzBox.cs 2012-02-10 23:13:42 UTC (rev 4450) @@ -570,7 +570,7 @@ [SkinControl(3)] protected GUISortButtonControl btnFilter; [SkinControl(4)] - protected GUIButtonControl btnModus; + protected GUIButtonControl btnMode; [SkinControl(9)] protected GUIButtonControl btnUpdate; [SkinControl(2)] @@ -1339,9 +1339,8 @@ GUIControl.FocusControl(GetID, controlId); } - // mode button - // Messages -> Call list -> Phone book - if (control == btnModus) + // mode button (voice box messages -> call list -> phone book) + if (control == btnMode) { switch (Settings.CurrentMode) { @@ -1482,15 +1481,15 @@ { case GUIMode.VoiceBox: if (headerLabel != null) headerLabel.Label = LocalizeStrings.Get(19); // 19 = FRITZ!Box messages - btnModus.Label = LocalizeStrings.Get(18); // 18 = Call list + btnMode.Label = LocalizeStrings.Get(18); // 18 = Call list break; case GUIMode.CallList: if (headerLabel != null) headerLabel.Label = LocalizeStrings.Get(21); // 21 = FRITZ!Box call list - btnModus.Label = LocalizeStrings.Get(20); // 20 = Phone book + btnMode.Label = LocalizeStrings.Get(20); // 20 = Phone book break; case GUIMode.PhoneBook: if (headerLabel != null) headerLabel.Label = LocalizeStrings.Get(22); // 22 = FRITZ!Box phone book - btnModus.Label = LocalizeStrings.Get(7); // 7 = Messages + btnMode.Label = LocalizeStrings.Get(7); // 7 = Messages break; } } Deleted: trunk/plugins/FritzBox/FritzBox/LocalizeStrings.cs =================================================================== --- trunk/plugins/FritzBox/FritzBox/LocalizeStrings.cs 2012-02-10 15:26:34 UTC (rev 4449) +++ trunk/plugins/FritzBox/FritzBox/LocalizeStrings.cs 2012-02-10 23:13:42 UTC (rev 4450) @@ -1,319 +0,0 @@ -#region Copyright (C) 2005-2011 Team MediaPortal - -// Original MediaPortal code except lines 31, 33, 38, 99 and 104 - -// Copyright (C) 2005-2011 Team MediaPortal -// http://www.team-mediaportal.com -// -// MediaPortal 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 of the License, or -// (at your option) any later version. -// -// MediaPortal 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 MediaPortal. If not, see <http://www.gnu.org/licenses/>. - -#endregion - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Globalization; -using MediaPortal.Configuration; -using MediaPortal.ExtensionMethods; -using MediaPortal.Localisation; -using MediaPortal.Profile; -using MediaPortal.GUI.Library; // Not included in original code - -namespace FritzBox // Original code: namespace MediaPortal.GUI.Library -{ - /// <summary> - /// This class will hold all text used in the application - /// The text is loaded for the current language from - /// the file language\FritzBox Manager\strings_[language code].xml // Original code: /// the file language/[language]/strings.xml - /// </summary> - public class GUILocalizeStrings - { - #region Variables - - private static LocalisationProvider _stringProvider; - private static Dictionary<string, string> _cultures; - private static string[] _languages; - - #endregion - - #region Constructors/Destructors - - // singleton. Dont allow any instance of this class - private GUILocalizeStrings() {} - - public static void Dispose() - { - if (_stringProvider != null) - { - _stringProvider.SafeDispose(); - } - } - - #endregion - - #region Properties - - public static bool UseRTL - { - get - { - if (_stringProvider == null) - { - Load(null); - } - - if (_stringProvider != null) - return _stringProvider.UseRTL; - else - return false; - } - } - - #endregion - - #region Public Methods - - /// <summary> - /// Public method to load the text from a strings/xml file into memory - /// </summary> - /// <param name="strFileName">Contains the filename+path for the string.xml file</param> - /// <returns> - /// true when text is loaded - /// false when it was unable to load the text - /// </returns> - //[Obsolete("This method has changed", true)] - public static bool Load(string language) - { - bool isPrefixEnabled = true; - using (MediaPortal.Profile.Settings reader = new MPSettings()) // Original code: using (Settings reader = new MPSettings()) - { - isPrefixEnabled = reader.GetValueAsBool("gui", "myprefix", true); - } - - string directory = Config.GetFolder(Config.Dir.Language) + "\\FritzBox Manager"; // Original code: string directory = Config.GetFolder(Config.Dir.Language); - string cultureName = null; - if (language != null) - { - cultureName = GetCultureName(language); - } - - Log.Info(" Loading localized Strings - Path: {0} Culture: {1} Language: {2} Prefix: {3}", directory, cultureName, - language, isPrefixEnabled); - - // http://msdn.microsoft.com/en-us/library/system.globalization.cultureinfo.aspx - _stringProvider = new LocalisationProvider(directory, cultureName, isPrefixEnabled); - - if (_stringProvider.Characters > GUIGraphicsContext.CharsInCharacterSet) - { - GUIGraphicsContext.CharsInCharacterSet = _stringProvider.Characters; - } - return true; - } - - public static string CurrentLanguage() - { - if (_stringProvider == null) - { - Load(null); - } - - return _stringProvider.CurrentLanguage.EnglishName; - } - - public static void ChangeLanguage(string language) - { - GUIFontManager.ClearFontCache(); - if (_stringProvider == null) - { - Load(language); - } - else - { - _stringProvider.ChangeLanguage(GetCultureName(language)); - if (_stringProvider.Characters > GUIGraphicsContext.CharsInCharacterSet) - { - GUIGraphicsContext.CharsInCharacterSet = _stringProvider.Characters; - } - } - } - - /// <summary> - /// Get the translation for a given id and format the sting with - /// the given parameters - /// </summary> - /// <param name="dwCode">id of text</param> - /// <param name="parameters">parameters used in the formating</param> - /// <returns> - /// string containing the translated text - /// </returns> - public static string Get(int dwCode, object[] parameters) - { - if (_stringProvider == null) - { - Load(null); - } - - string translation = _stringProvider.GetString("unmapped", dwCode); - // if parameters or the translation is null, return the translation. - if ((translation == null) || (parameters == null)) - { - return translation; - } - // return the formatted string. If formatting fails, log the error - // and return the unformatted string. - try - { - return String.Format(translation, parameters); - } - catch (FormatException e) - { - Log.Error("Error formatting translation with id {0}", dwCode); - Log.Error("Unformatted translation: {0}", translation); - Log.Error(e); - return translation; - } - } - - /// <summary> - /// Get the translation for a given id - /// </summary> - /// <param name="dwCode">id of text</param> - /// <returns> - /// string containing the translated text - /// </returns> - public static string Get(int dwCode) - { - if (_stringProvider == null) - { - Load(null); - } - - string translation = _stringProvider.GetString("unmapped", dwCode); - - if (translation == null) - { - Log.Error("No translation found for id {0}", dwCode); - return string.Empty; - } - - return translation; - } - - public static void LocalizeLabel(ref string strLabel) - { - if (_stringProvider == null) - { - Load(null); - } - - if (strLabel == null) - { - strLabel = string.Empty; - } - if (strLabel == "-") - { - strLabel = ""; - } - if (strLabel == "") - { - return; - } - - // This can't be a valid string code if the first character isn't a number. - // This check will save us from catching unnecessary exceptions. - if (!char.IsNumber(strLabel, 0)) - { - return; - } - - // Attempt to parse an int from the string. On failure just return leaving the input string unchanged. - int dwLabelID; - if (!Int32.TryParse(strLabel, out dwLabelID)) - { - return; - } - - strLabel = _stringProvider.GetString("unmapped", dwLabelID); - if (strLabel == null) - { - Log.Error("No translation found for id {0}", dwLabelID); - strLabel = string.Empty; - } - } - - public static string LocalSupported() - { - if (_stringProvider == null) - { - Load(null); - } - - CultureInfo culture = _stringProvider.GetBestLanguage(); - - return culture.EnglishName; - } - - public static string[] SupportedLanguages() - { - if (_languages == null) - { - if (_stringProvider == null) - { - Load(null); - } - - CultureInfo[] cultures = _stringProvider.AvailableLanguages(); - - SortedList sortedLanguages = new SortedList(); - foreach (CultureInfo culture in cultures) - { - sortedLanguages.Add(culture.EnglishName, culture.EnglishName); - } - - _languages = new string[sortedLanguages.Count]; - - for (int i = 0; i < sortedLanguages.Count; i++) - { - _languages[i] = (string)sortedLanguages.GetByIndex(i); - } - } - - return _languages; - } - - public static string GetCultureName(string language) - { - if (_cultures == null) - { - _cultures = new Dictionary<string, string>(); - - CultureInfo[] cultureList = CultureInfo.GetCultures(CultureTypes.AllCultures); - - for (int i = 0; i < cultureList.Length; i++) - { - _cultures.Add(cultureList[i].EnglishName, cultureList[i].Name); - } - } - string cultures = null; - if (_cultures.TryGetValue(language, out cultures)) - { - return cultures; - } - - return null; - } - - #endregion - } -} \ No newline at end of file Modified: trunk/plugins/FritzBox/FritzBox/Skin/Default/FritzManager.xml =================================================================== --- trunk/plugins/FritzBox/FritzBox/Skin/Default/FritzManager.xml 2012-02-10 15:26:34 UTC (rev 4449) +++ trunk/plugins/FritzBox/FritzBox/Skin/Default/FritzManager.xml 2012-02-10 23:13:42 UTC (rev 4450) @@ -6,6 +6,14 @@ <define>#header.label:666</define> <define>#header.hover:-</define> <controls> + <control> + <description>BG</description> + <type>image</type> + <id>1</id> + <texture>Background.png</texture> + <width>1280</width> + <height>720</height> + </control> <import>common.window.xml</import> <import>common.time.xml</import> <control> Modified: trunk/plugins/FritzBox/FritzBox/Skin/DefaultWide/FritzManager.xml =================================================================== --- trunk/plugins/FritzBox/FritzBox/Skin/DefaultWide/FritzManager.xml 2012-02-10 15:26:34 UTC (rev 4449) +++ trunk/plugins/FritzBox/FritzBox/Skin/DefaultWide/FritzManager.xml 2012-02-10 23:13:42 UTC (rev 4450) @@ -6,6 +6,14 @@ <define>#header.label:666</define> <define>#header.hover:-</define> <controls> + <control> + <description>BG</description> + <type>image</type> + <id>1</id> + <texture>Background.png</texture> + <width>1280</width> + <height>720</height> + </control> <import>common.window.xml</import> <import>common.time.xml</import> <control> Added: trunk/plugins/FritzBox/FritzBox/Skin/Streamed MP/Media/FritzBox/Phone_Icon_Home.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/FritzBox/FritzBox/Skin/Streamed MP/Media/FritzBox/Phone_Icon_Home.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/FritzBox/FritzBox/Skin/Streamed MP/Media/FritzBox/Phone_Icon_Mobile.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/FritzBox/FritzBox/Skin/Streamed MP/Media/FritzBox/Phone_Icon_Mobile.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/FritzBox/FritzBox/Skin/Streamed MP/Media/FritzBox/Phone_Icon_Work.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/FritzBox/FritzBox/Skin/Streamed MP/Media/FritzBox/Phone_Icon_Work.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: trunk/plugins/FritzBox/FritzBox/bin/Release/FritzBox.dll =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/FritzBox/bin/Release/FritzBox.pdb =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/FritzBox/obj/Debug/FritzBox.dll =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/FritzBox/obj/Debug/FritzBox.pdb =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/FritzBox/obj/Release/FritzBox.dll =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/FritzBox/obj/Release/FritzBox.pdb =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/MpeRelease/FritzBox.xmp2 =================================================================== --- trunk/plugins/FritzBox/MpeRelease/FritzBox.xmp2 2012-02-10 15:26:34 UTC (rev 4449) +++ trunk/plugins/FritzBox/MpeRelease/FritzBox.xmp2 2012-02-10 23:13:42 UTC (rev 4450) @@ -497,6 +497,37 @@ </Items> </Files> </GroupItem> + <GroupItem Name="Streamed MP Skin"> + <ParentGroup /> + <DisplayName>Streamed MP Skin</DisplayName> + <DefaulChecked>false</DefaulChecked> + <Description>Streamed MP Skin</Description> + <Files> + <Items> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="true"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\_release\skin\Streamed MP\Media\FritzBox\Phone_Icon_Home.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{8ab0c9b4-7ff0-40a2-8bfd-df087808365d}-Phone_Icon_Home.png</ZipFileName> + <DestinationFilename>%Skin%\StreamedMP\Media\FritzBox\Phone_Icon_Home.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="true"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\_release\skin\Streamed MP\Media\FritzBox\Phone_Icon_Mobile.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{9b80b980-8b07-4c56-a7c8-01224cde8ca9}-Phone_Icon_Mobile.png</ZipFileName> + <DestinationFilename>%Skin%\StreamedMP\Media\FritzBox\Phone_Icon_Mobile.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="true"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\_release\skin\Streamed MP\Media\FritzBox\Phone_Icon_Work.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{ca228657-f8bf-468f-8437-ee3d484bd8e0}-Phone_Icon_Work.png</ZipFileName> + <DestinationFilename>%Skin%\StreamedMP\Media\FritzBox\Phone_Icon_Work.png</DestinationFilename> + </FileItem> + </Items> + </Files> + </GroupItem> </Items> </Groups> <Sections> @@ -564,9 +595,10 @@ <Items /> </Actions> <IncludedGroups> + <string>Black & White Skin</string> <string>Blue3 Skin</string> - <string>Black & White Skin</string> <string>Maya Skin</string> + <string>Streamed MP Skin</string> </IncludedGroups> <PanelName>Tree View Selector</PanelName> <WizardButtonsEnum>BackNextCancel</WizardButtonsEnum> @@ -671,7 +703,7 @@ <Items> <CompatibleVersionItem> <MinRequiredVersion>1.1.0.0</MinRequiredVersion> - <DesignedForVersion>1.1.7.4448</DesignedForVersion> + <DesignedForVersion>1.1.7.4449</DesignedForVersion> </CompatibleVersionItem> </Items> </CompatibleVersion> @@ -694,7 +726,7 @@ <Major>0</Major> <Minor>4</Minor> <Build>1</Build> - <Revision>4448</Revision> + <Revision>4449</Revision> </Version> <ExtensionDescription>With FRITZ!Box Manager you can access several AVM FRITZ!Box informations from MediaPortal. @@ -708,7 +740,7 @@ <VersionDescription /> <DevelopmentStatus>Stable</DevelopmentStatus> <OnlineLocation>http://www.team-mediaportal.com/index.php?option=com_mtree&task=att_download&link_id=118&cf_id=24</OnlineLocation> - <ReleaseDate>2012-02-10T16:17:41.314754+01:00</ReleaseDate> + <ReleaseDate>2012-02-11T00:03:32.848032+01:00</ReleaseDate> <Tags>fritzbox, fritzbox manager, callmonitor</Tags> <Location>..\MpeRelease\FritzBox.mpe1</Location> <Params> @@ -1172,6 +1204,27 @@ <ZipFileName>Installer{CopyFile}\{2011ea30-6207-4c4f-8dc0-1d9a4114a04b}-Phone_Icon_Work.png</ZipFileName> <DestinationFilename>%Skin%\DefaultWide\Media\FritzBox\Phone_Icon_Work.png</DestinationFilename> </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="true"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\_release\skin\Streamed MP\Media\FritzBox\Phone_Icon_Home.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{8ab0c9b4-7ff0-40a2-8bfd-df087808365d}-Phone_Icon_Home.png</ZipFileName> + <DestinationFilename>%Skin%\StreamedMP\Media\FritzBox\Phone_Icon_Home.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="true"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\_release\skin\Streamed MP\Media\FritzBox\Phone_Icon_Mobile.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{9b80b980-8b07-4c56-a7c8-01224cde8ca9}-Phone_Icon_Mobile.png</ZipFileName> + <DestinationFilename>%Skin%\StreamedMP\Media\FritzBox\Phone_Icon_Mobile.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="true"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\_release\skin\Streamed MP\Media\FritzBox\Phone_Icon_Work.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{ca228657-f8bf-468f-8437-ee3d484bd8e0}-Phone_Icon_Work.png</ZipFileName> + <DestinationFilename>%Skin%\StreamedMP\Media\FritzBox\Phone_Icon_Work.png</DestinationFilename> + </FileItem> </Items> </UniqueFileList> <ProjectSettings> Modified: trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Debug/FritzBox.dll =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Debug/FritzBox.pdb =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Debug/FritzBoxConfigTester.exe =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Debug/FritzBoxConfigTester.pdb =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Release/FritzBox.dll =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Release/FritzBox.pdb =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Release/FritzBoxConfigTester.exe =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Release/FritzBoxConfigTester.pdb =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/obj/Debug/FritzBoxConfigTester.exe =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/obj/Debug/FritzBoxConfigTester.pdb =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/obj/Debug/ResolveAssemblyReference.cache =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/obj/Release/FritzBoxConfigTester.exe =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/obj/Release/FritzBoxConfigTester.pdb =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/obj/Release/ResolveAssemblyReference.cache =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Debug/FritzBox.dll =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Debug/FritzBox.pdb =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Debug/FritzBoxDebugger.exe =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Debug/FritzBoxDebugger.pdb =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Release/FritzBox.dll =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Release/FritzBox.pdb =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Release/FritzBoxDebugger.exe =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Release/FritzBoxDebugger.pdb =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxDebugger/obj/Debug/FritzBoxDebugger.exe =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxDebugger/obj/Debug/FritzBoxDebugger.pdb =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxDebugger/obj/Release/FritzBoxDebugger.csproj.FileListAbsolute.txt =================================================================== --- trunk/plugins/FritzBox/Tools/FritzBoxDebugger/obj/Release/FritzBoxDebugger.csproj.FileListAbsolute.txt 2012-02-10 15:26:34 UTC (rev 4449) +++ trunk/plugins/FritzBox/Tools/FritzBoxDebugger/obj/Release/FritzBoxDebugger.csproj.FileListAbsolute.txt 2012-02-10 23:13:42 UTC (rev 4450) @@ -23,5 +23,5 @@ D:\FritzBox\Tools\FritzBoxDebugger\bin\Release\log4net.dll D:\FritzBox\Tools\FritzBoxDebugger\bin\Release\Ionic.Zip.dll D:\FritzBox\Tools\FritzBoxDebugger\bin\Release\FritzBox.pdb -D:\FritzBox\Tools\FritzBoxDebugger\obj\Release\GenerateResource.read.7.tlog -D:\FritzBox\Tools\FritzBoxDebugger\obj\Release\GenerateResource.write.7.tlog +D:\FritzBox\Tools\FritzBoxDebugger\obj\Release\GenerateResource.read.6.tlog +D:\FritzBox\Tools\FritzBoxDebugger\obj\Release\GenerateResource.write.6.tlog Modified: trunk/plugins/FritzBox/Tools/FritzBoxDebugger/obj/Release/FritzBoxDebugger.exe =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxDebugger/obj/Release/FritzBoxDebugger.pdb =================================================================== (Binary files differ) Added: trunk/plugins/FritzBox/Tools/FritzBoxDebugger/obj/Release/GenerateResource.read.6.tlog =================================================================== (Binary files differ) Property changes on: trunk/plugins/FritzBox/Tools/FritzBoxDebugger/obj/Release/GenerateResource.read.6.tlog ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Deleted: trunk/plugins/FritzBox/Tools/FritzBoxDebugger/obj/Release/GenerateResource.read.7.tlog =================================================================== (Binary files differ) Added: trunk/plugins/FritzBox/Tools/FritzBoxDebugger/obj/Release/GenerateResource.write.6.tlog =================================================================== (Binary files differ) Property changes on: trunk/plugins/FritzBox/Tools/FritzBoxDebugger/obj/Release/GenerateResource.write.6.tlog ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Deleted: trunk/plugins/FritzBox/Tools/FritzBoxDebugger/obj/Release/GenerateResource.write.7.tlog =================================================================== (Binary files differ) Added: trunk/plugins/FritzBox/releases/FritzBox_v0.4.1.4449.mpe1 =================================================================== (Binary files differ) Property changes on: trunk/plugins/FritzBox/releases/FritzBox_v0.4.1.4449.mpe1 ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: trunk/plugins/FritzBox/releases/update.xml =================================================================== --- trunk/plugins/FritzBox/releases/update.xml 2012-02-10 15:26:34 UTC (rev 4449) +++ trunk/plugins/FritzBox/releases/update.xml 2012-02-10 23:13:42 UTC (rev 4450) @@ -53,6 +53,14 @@ <Items /> </Files> </GroupItem> + <GroupItem Name="Streamed MP Skin"> + <DisplayName>Streamed MP Skin</DisplayName> + <DefaulChecked>false</DefaulChecked> + <Description>Streamed MP Skin</Description> + <Files> + <Items /> + </Files> + </GroupItem> </Items> </Groups> <Sections> @@ -88,7 +96,7 @@ <Items> <CompatibleVersionItem> <MinRequiredVersion>1.1.0.0</MinRequiredVersion> - <DesignedForVersion>1.1.7.4448</DesignedForVersion> + <DesignedForVersion>1.1.7.4449</DesignedForVersion> </CompatibleVersionItem> </Items> </CompatibleVersion> @@ -111,7 +119,7 @@ <Major>0</Major> <Minor>4</Minor> <Build>1</Build> - <Revision>4448</Revision> + <Revision>4449</Revision> </Version> <ExtensionDescription>With FRITZ!Box Manager you can access several AVM FRITZ!Box informations from MediaPortal. @@ -125,7 +133,7 @@ <VersionDescription /> <DevelopmentStatus>Stable</DevelopmentStatus> <OnlineLocation>http://www.team-mediaportal.com/index.php?option=com_mtree&task=att_download&link_id=118&cf_id=24</OnlineLocation> - <ReleaseDate>2012-02-10T16:17:41.314754+01:00</ReleaseDate> + <ReleaseDate>2012-02-11T00:03:32.848032+01:00</ReleaseDate> <Tags>fritzbox, fritzbox manager, callmonitor</Tags> <Location>..\MpeRelease\FritzBox.mpe1</Location> <Params> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hor...@us...> - 2012-02-10 15:26:47
|
Revision: 4449 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=4449&view=rev Author: horned-reaper Date: 2012-02-10 15:26:34 +0000 (Fri, 10 Feb 2012) Log Message: ----------- Modified Paths: -------------- trunk/plugins/FritzBox/Build/Build.log trunk/plugins/FritzBox/Docs/Ausstehend.txt trunk/plugins/FritzBox/Docs/Changes.txt trunk/plugins/FritzBox/FritzBox/EditPhoneBook.cs 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/Caller.cs trunk/plugins/FritzBox/FritzBox/FritzManager/BackGroundWorker.cs trunk/plugins/FritzBox/FritzBox/FritzManager/Fritz.cs trunk/plugins/FritzBox/FritzBox/FritzManager/FritzboxPhonebook.cs trunk/plugins/FritzBox/FritzBox/FritzManager/MyBinaryReader.cs trunk/plugins/FritzBox/FritzBox/FritzManager/PhoneBook.cs trunk/plugins/FritzBox/FritzBox/Languages/strings_de.xml trunk/plugins/FritzBox/FritzBox/Languages/strings_el.xml trunk/plugins/FritzBox/FritzBox/Languages/strings_en-US.xml trunk/plugins/FritzBox/FritzBox/Languages/strings_en.xml trunk/plugins/FritzBox/FritzBox/Languages/strings_es.xml trunk/plugins/FritzBox/FritzBox/Languages/strings_fr.xml trunk/plugins/FritzBox/FritzBox/Languages/strings_it.xml trunk/plugins/FritzBox/FritzBox/Languages/strings_nl.xml trunk/plugins/FritzBox/FritzBox/Languages/strings_ru.xml 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.dll trunk/plugins/FritzBox/FritzBox/obj/Debug/FritzBox.pdb 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/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.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/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/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.exe trunk/plugins/FritzBox/Tools/FritzBoxDebugger/obj/Debug/FritzBoxDebugger.pdb 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/FritzManager/LocalizeStrings.cs trunk/plugins/FritzBox/FritzBox/Skin/Black & White/Media/FritzBox/Phone_Icon_Home.png trunk/plugins/FritzBox/FritzBox/Skin/Black & White/Media/FritzBox/Phone_Icon_Mobile.png trunk/plugins/FritzBox/FritzBox/Skin/Black & White/Media/FritzBox/Phone_Icon_Work.png trunk/plugins/FritzBox/FritzBox/Skin/Blue3/Media/FritzBox/Phone_Icon_Home.png trunk/plugins/FritzBox/FritzBox/Skin/Blue3/Media/FritzBox/Phone_Icon_Mobile.png trunk/plugins/FritzBox/FritzBox/Skin/Blue3/Media/FritzBox/Phone_Icon_Work.png trunk/plugins/FritzBox/FritzBox/Skin/Default/Media/FritzBox/Phone_Icon_Home.png trunk/plugins/FritzBox/FritzBox/Skin/Default/Media/FritzBox/Phone_Icon_Mobile.png trunk/plugins/FritzBox/FritzBox/Skin/Default/Media/FritzBox/Phone_Icon_Work.png trunk/plugins/FritzBox/FritzBox/Skin/DefaultWide/Media/FritzBox/Phone_Icon_Home.png trunk/plugins/FritzBox/FritzBox/Skin/DefaultWide/Media/FritzBox/Phone_Icon_Mobile.png trunk/plugins/FritzBox/FritzBox/Skin/DefaultWide/Media/FritzBox/Phone_Icon_Work.png trunk/plugins/FritzBox/FritzBox/Skin/Maya/Media/FritzBox/Phone_Icon_Home.png trunk/plugins/FritzBox/FritzBox/Skin/Maya/Media/FritzBox/Phone_Icon_Mobile.png trunk/plugins/FritzBox/FritzBox/Skin/Maya/Media/FritzBox/Phone_Icon_Work.png trunk/plugins/FritzBox/releases/FritzBox_v0.4.1.4448.mpe1 Modified: trunk/plugins/FritzBox/Build/Build.log =================================================================== --- trunk/plugins/FritzBox/Build/Build.log 2012-02-09 17:08:05 UTC (rev 4448) +++ trunk/plugins/FritzBox/Build/Build.log 2012-02-10 15:26:34 UTC (rev 4449) @@ -1,6 +1,6 @@ Running : C:\Program Files\TortoiseSVN\bin\SubWCRev.exe -SVN Version: 4434 +SVN Version: 4448 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 02.02.2012 12:38:15. +Build started 10.02.2012 16:17:35. Project "D:\FritzBox\FritzBox.sln" on node 1 (Rebuild target(s)). ValidateSolutionConfiguration: Building solution configuration "Release|Mixed Platforms". @@ -46,7 +46,7 @@ CoreResGen: C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin\ResGen.exe /useSourcePath /r:"C:\Program Files\Team MediaPortal\MediaPortal\Common.Utils.dll" /r:"C:\Program Files\Team MediaPortal\MediaPortal\Core.dll" /r:"C:\Program Files\Team MediaPortal\MediaPortal\plugins\Windows\Dialogs.dll" /r:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\mscorlib.dll /r:"c:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5\System.Core.dll" /r:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Data.dll /r:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.dll /r:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Drawing.dll /r:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Windows.Forms.dll /r:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Xml.dll /r:"C:\Program Files\Team MediaPortal\MediaPortal\Utils.dll" /compile EditPhoneBook.resx,obj\Release\FritzBox.EditPhoneBook.resources Properties\Resources.resx,obj\Release\FritzBox.Properties.Resources.resources FritzBoxConfig.resx,obj\Release\FritzBox.FritzBoxConfig.resources CoreCompile: - c:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Csc.exe /noconfig /unsafe+ /nowarn:1701,1702 /nostdlib+ /platform:AnyCPU /errorreport:prompt /warn:4 /baseaddress:4194304 /define:TRACE /reference:"C:\Program Files\Team MediaPortal\MediaPortal\Common.Utils.dll" /reference:"C:\Program Files\Team MediaPortal\MediaPortal\Core.dll" /reference:"C:\Program Files\Team MediaPortal\MediaPortal\plugins\Windows\Dialogs.dll" /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\mscorlib.dll /reference:"c:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5\System.Core.dll" /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Data.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Drawing.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Windows.Forms.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Xml.dll /reference:"C:\Program Files\Team MediaPortal\MediaPortal\Utils.dll" /debug:pdbonly /filealign:4096 /optimize+ /out:obj\Release\FritzBox.dll /resource:obj\Release\FritzBox.EditPhoneBook.resources /resource:obj\Release\FritzBox.Properties.Resources.resources /resource:obj\Release\FritzBox.FritzBoxConfig.resources /resource:FritzBox.png,FritzBox.FritzBox.png /resource:FritzBoxDisabled.png,FritzBox.FritzBoxDisabled.png /target:library /warnaserror- EditPhoneBook.cs EditPhoneBook.Designer.cs FritzCallMonitor\FritzBoxClient.cs FritzManager\StringEncryption.cs FritzManager\VBReader.cs FritzManager\BackGroundWorker.cs FritzManager\BlockingQueue.cs FritzManager\CallItem.cs FritzManager\Fritz.cs FritzManager\FritzboxPhoneBook.cs FritzManager\Logger.cs FritzManager\LoggerFactory.cs FritzManager\MyBinaryReader.cs FritzManager\PhoneBookItem.cs FritzManager\Task.cs FritzManager\VoiceBoxItem.cs LocalizeStrings.cs Properties\AssemblyInfo.cs FritzCallMonitor\Caller.cs FritzCallMonitor\CallAction.cs FritzBoxConfig.cs FritzBoxConfig.Designer.cs FritzBox.cs FritzManager\PhoneBook.cs Properties\Resources.Designer.cs Settings.cs + c:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Csc.exe /noconfig /unsafe+ /nowarn:1701,1702 /nostdlib+ /platform:AnyCPU /errorreport:prompt /warn:4 /baseaddress:4194304 /define:TRACE /reference:"C:\Program Files\Team MediaPortal\MediaPortal\Common.Utils.dll" /reference:"C:\Program Files\Team MediaPortal\MediaPortal\Core.dll" /reference:"C:\Program Files\Team MediaPortal\MediaPortal\plugins\Windows\Dialogs.dll" /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\mscorlib.dll /reference:"c:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5\System.Core.dll" /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Data.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Drawing.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Windows.Forms.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Xml.dll /reference:"C:\Program Files\Team MediaPortal\MediaPortal\Utils.dll" /debug:pdbonly /filealign:4096 /optimize+ /out:obj\Release\FritzBox.dll /resource:obj\Release\FritzBox.EditPhoneBook.resources /resource:obj\Release\FritzBox.Properties.Resources.resources /resource:obj\Release\FritzBox.FritzBoxConfig.resources /resource:FritzBox.png,FritzBox.FritzBox.png /resource:FritzBoxDisabled.png,FritzBox.FritzBoxDisabled.png /target:library /warnaserror- EditPhoneBook.cs EditPhoneBook.Designer.cs FritzCallMonitor\FritzBoxClient.cs FritzManager\LocalizeStrings.cs FritzManager\StringEncryption.cs FritzManager\VBReader.cs FritzManager\BackGroundWorker.cs FritzManager\BlockingQueue.cs FritzManager\CallItem.cs FritzManager\Fritz.cs FritzManager\FritzboxPhoneBook.cs FritzManager\Logger.cs FritzManager\LoggerFactory.cs FritzManager\MyBinaryReader.cs FritzManager\PhoneBookItem.cs FritzManager\Task.cs FritzManager\VoiceBoxItem.cs Properties\AssemblyInfo.cs FritzCallMonitor\Caller.cs FritzCallMonitor\CallAction.cs FritzBoxConfig.cs FritzBoxConfig.Designer.cs FritzBox.cs FritzManager\PhoneBook.cs Properties\Resources.Designer.cs Settings.cs _CopyFilesMarkedCopyLocal: Copying file from "C:\Program Files\Team MediaPortal\MediaPortal\Common.Utils.dll" to "bin\Release\Common.Utils.dll". Copying file from "C:\Program Files\Team MediaPortal\MediaPortal\Core.dll" to "bin\Release\Core.dll". @@ -195,7 +195,7 @@ 0 Warning(s) 0 Error(s) -Time Elapsed 00:00:03.25 +Time Elapsed 00:00:03.28 Reverting to build 0 Updating: D:\FritzBox\FritzBox\Properties\AssemblyInfo.cs Updating: D:\FritzBox\MP2version\Listeners\FritzBox\Properties\AssemblyInfo.cs @@ -212,6 +212,9 @@ ..\FritzBox\Skin\Black & White\Media\FritzBox\CallMonitor.Missing.png ..\FritzBox\Skin\Black & White\Media\FritzBox\CallMonitor.Unknown.png ..\FritzBox\Skin\Black & White\Media\FritzBox\callout.png +..\FritzBox\Skin\Black & White\Media\FritzBox\Phone_Icon_Home.png +..\FritzBox\Skin\Black & White\Media\FritzBox\Phone_Icon_Mobile.png +..\FritzBox\Skin\Black & White\Media\FritzBox\Phone_Icon_Work.png ..\FritzBox\Skin\Black & White\Media\FritzBox\rejected.png ..\FritzBox\Skin\Blue3\FritzManager.xml ..\FritzBox\Skin\Blue3\Media\hover_FritzBox.png @@ -219,6 +222,9 @@ ..\FritzBox\Skin\Blue3\Media\FritzBox\CallMonitor.Missing.png ..\FritzBox\Skin\Blue3\Media\FritzBox\CallMonitor.Unknown.png ..\FritzBox\Skin\Blue3\Media\FritzBox\callout.png +..\FritzBox\Skin\Blue3\Media\FritzBox\Phone_Icon_Home.png +..\FritzBox\Skin\Blue3\Media\FritzBox\Phone_Icon_Mobile.png +..\FritzBox\Skin\Blue3\Media\FritzBox\Phone_Icon_Work.png ..\FritzBox\Skin\Blue3\Media\FritzBox\rejected.png ..\FritzBox\Skin\Default\FritzManager.xml ..\FritzBox\Skin\Default\Media\hover_FritzBox.png @@ -226,6 +232,9 @@ ..\FritzBox\Skin\Default\Media\FritzBox\CallMonitor.Missing.png ..\FritzBox\Skin\Default\Media\FritzBox\CallMonitor.Unknown.png ..\FritzBox\Skin\Default\Media\FritzBox\callout.png +..\FritzBox\Skin\Default\Media\FritzBox\Phone_Icon_Home.png +..\FritzBox\Skin\Default\Media\FritzBox\Phone_Icon_Mobile.png +..\FritzBox\Skin\Default\Media\FritzBox\Phone_Icon_Work.png ..\FritzBox\Skin\Default\Media\FritzBox\rejected.png ..\FritzBox\Skin\DefaultWide\FritzManager.xml ..\FritzBox\Skin\DefaultWide\Media\hover_FritzBox.png @@ -233,6 +242,9 @@ ..\FritzBox\Skin\DefaultWide\Media\FritzBox\CallMonitor.Missing.png ..\FritzBox\Skin\DefaultWide\Media\FritzBox\CallMonitor.Unknown.png ..\FritzBox\Skin\DefaultWide\Media\FritzBox\callout.png +..\FritzBox\Skin\DefaultWide\Media\FritzBox\Phone_Icon_Home.png +..\FritzBox\Skin\DefaultWide\Media\FritzBox\Phone_Icon_Mobile.png +..\FritzBox\Skin\DefaultWide\Media\FritzBox\Phone_Icon_Work.png ..\FritzBox\Skin\DefaultWide\Media\FritzBox\rejected.png ..\FritzBox\Skin\Maya\FritzManager.xml ..\FritzBox\Skin\Maya\Media\hover_FritzBox.png @@ -240,8 +252,11 @@ ..\FritzBox\Skin\Maya\Media\FritzBox\CallMonitor.Missing.png ..\FritzBox\Skin\Maya\Media\FritzBox\CallMonitor.Unknown.png ..\FritzBox\Skin\Maya\Media\FritzBox\callout.png +..\FritzBox\Skin\Maya\Media\FritzBox\Phone_Icon_Home.png +..\FritzBox\Skin\Maya\Media\FritzBox\Phone_Icon_Mobile.png +..\FritzBox\Skin\Maya\Media\FritzBox\Phone_Icon_Work.png ..\FritzBox\Skin\Maya\Media\FritzBox\rejected.png -35 File(s) copied +50 File(s) copied ..\FritzBox\Languages\strings_de.xml ..\FritzBox\Languages\strings_el.xml ..\FritzBox\Languages\strings_en-US.xml @@ -280,7 +295,7 @@ ..\FritzBox\Languages\Unsupported\strings_zh-CN.xml 36 File(s) copied MpeMaker version: 1.2.1.0 -Build started at 12:38:22 +Build started at 16:17:41 Building "D:\FritzBox\MpeRelease\FritzBox.xmp2" Output: "..\MpeRelease\FritzBox.mpe1" Writing UpdateXML to "update.xml" Modified: trunk/plugins/FritzBox/Docs/Ausstehend.txt =================================================================== --- trunk/plugins/FritzBox/Docs/Ausstehend.txt 2012-02-09 17:08:05 UTC (rev 4448) +++ trunk/plugins/FritzBox/Docs/Ausstehend.txt 2012-02-10 15:26:34 UTC (rev 4449) @@ -1,24 +1,20 @@ Fehler beheben: -- auch bei einem "Unbekannten Anrufer" (unterdr\xFCckte bzw. nicht \xFCbertragene Rufnummer) \xF6ffnet sich \xFCber das Kontextrufen "zur\xFCckrufen". Sollte man deaktivieren -- ObjectDisposed-Exception bei Client-Stop +- Problem bei schnell aufeinander folgenden Anrufen Optimierungen: - btnModus umbenennen? - blauer Hintergrund f\xFCr Default und DefaultWide Skins - GUI-Properties \xFCberpr\xFCfen und Dokumentation vervollst\xE4ndigen -- Einstellungen-Eintr\xE4ge in XML-Datei in Kategorie "FRITZ"Box Manager" zusammenfassen +- Einstellungen-Eintr\xE4ge in XML-Datei in Kategorie "FRITZ!Box Manager" zusammenfassen Neue Funktionen/Erweiterungen: -- Rufnummer-Typ hinzuf\xFCgen - - GUI-Adressbuch - - Anruf-Benachrichtigungen +- Tastenk\xFCrzel-Unterst\xFCtzung f\xFCr Telefonbuch - Telefonbuch editierbar machen (f\xFCr FRITZ!Box-Versionen ohne Telefonbuch), ImageURL-Feld hinzuf\xFCgen und nur synchronisieren, wenn im FRITZ!Box-Telefonbuch vorhanden - Nachrichtenl\xE4nge zur Anzeige hinzuf\xFCgen - "Nachricht l\xF6schen"-Funktion - "Nachricht als geh\xF6rt markieren"-Funktion - "Anrufen"-Funktion zur Anrufliste hinzuf\xFCgen - R\xFCckw\xE4rtssuche wieder integrieren -- Kontextmen\xFC f\xFCr Telefonbuch - Wiki-Eintrag - Skin-Erweiterungen - Anzahl der neuen Anrufe @@ -70,4 +66,7 @@ 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 \ No newline at end of file +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. \ No newline at end of file Modified: trunk/plugins/FritzBox/Docs/Changes.txt =================================================================== --- trunk/plugins/FritzBox/Docs/Changes.txt 2012-02-09 17:08:05 UTC (rev 4448) +++ trunk/plugins/FritzBox/Docs/Changes.txt 2012-02-10 15:26:34 UTC (rev 4449) @@ -1,12 +1,12 @@ -0.4.1.4434: +New release 0.4.1.4448: New features: -- added call action to voice box context menu and phone book +- phone book: + - phone numbers are grouped by contact name + - contact picture preview in contact list +- phone type display in call notifications, call list and voice box item list Optimizations: -- added checks for context menu actions +- improved localization function, plugin starts faster now Fixed bugs: -- the first digit of call notification gets cropped -- call notification is not shown when dialling from plugin if MSN filter is enabled -- FRITZ!Box 7390 specific: - - contact images are not synchronized with FRITZ!Box (second issue) \ No newline at end of file +- FRITZ!Box connection is not established on startup in some circumstances \ No newline at end of file Modified: trunk/plugins/FritzBox/FritzBox/EditPhoneBook.cs =================================================================== --- trunk/plugins/FritzBox/FritzBox/EditPhoneBook.cs 2012-02-09 17:08:05 UTC (rev 4448) +++ trunk/plugins/FritzBox/FritzBox/EditPhoneBook.cs 2012-02-10 15:26:34 UTC (rev 4449) @@ -21,7 +21,7 @@ private void fillTable() { - string uniqueID, name, type = "", number = "", ringTonePath; + string uniqueID, name, type = String.Empty, number = String.Empty, ringTonePath; bool showCallNotification; phoneBook.LoadPhoneBookFromXMLFile(); @@ -76,7 +76,7 @@ string contactPicturePath = phoneBook.GetContactImagePath(contact); // show picture - if (contactPicturePath != "") pictureBoxCaller.ImageLocation = contactPicturePath; + if (contactPicturePath != String.Empty) pictureBoxCaller.ImageLocation = contactPicturePath; } private void dataGridView_CellValueChanged(object sender, DataGridViewCellEventArgs e) Modified: trunk/plugins/FritzBox/FritzBox/FritzBox.cs =================================================================== --- trunk/plugins/FritzBox/FritzBox/FritzBox.cs 2012-02-09 17:08:05 UTC (rev 4448) +++ trunk/plugins/FritzBox/FritzBox/FritzBox.cs 2012-02-10 15:26:34 UTC (rev 4449) @@ -87,7 +87,8 @@ private void OnCallAction(CallAction callAction) { - Log.Info("FRITZ!Box: OnCallAction()"); + Log.Debug("OnCallAction()"); + callAction.WriteToLog(); if (!_showNotification) @@ -110,7 +111,7 @@ case CallAction.CallType.ConnectionClosed: if (Settings.CloseNotificationOnConnectionClosed) { - Log.Info("\"Close On Connection Close\" setting is enabled. Trying to close active notification"); + Log.Info("\"Auto-close after connection is closed\" setting is enabled. Trying to close active notification"); if (_tempNotification != null) { @@ -121,7 +122,7 @@ } break; default: - Log.Error("Incorrect CallAction.CallType"); + Log.Error("Incorrect CallAction type"); break; } } @@ -151,15 +152,16 @@ { fritz.Login(); + Log.Debug("Forcing data load after login"); + loadDataInBackground(); - - worker.queue.Enqueue(new Task(Task.TaskAction.RefreshView, null)); // schedule refresh view task } private void OnCall(CallAction callAction) { Log.Info("New call"); + // check for queued actions if (_tempNotification != null) { Log.Info("Yet another dialog is active. Action is sent to queue"); @@ -232,10 +234,10 @@ switch (callAction.Type) { case CallAction.CallType.Incoming: - strHeading = GUILocalizeStrings.Get(1); // 1 = Incoming call + strHeading = LocalizeStrings.Get(1); // 1 = Incoming call break; case CallAction.CallType.Outgoing: - strHeading = GUILocalizeStrings.Get(2); // 2 = Outgoing call + strHeading = LocalizeStrings.Get(2); // 2 = Outgoing call break; } @@ -245,25 +247,27 @@ // ...message text strText = Environment.NewLine; - if (callAction.Caller.PhoneNumber != "") + if (callAction.Caller.PhoneNumber != String.Empty) { - if (phoneBookItem != null) strText += phoneBookItem.Name + Environment.NewLine; + if (phoneBookItem != null) + { + strText += phoneBookItem.Name + Environment.NewLine; + if (Settings.ShowPhoneTypeOnNotification) strText += phoneBook.GetPhoneNumberTypeLabel(callAction.Caller.PhoneType) + Environment.NewLine; + } - if (Settings.ShowPhoneNumberOnNotification) strText += callAction.Caller.PhoneNumber; + if (Settings.ShowPhoneNumberOnNotification) strText += callAction.Caller.PhoneNumber + Environment.NewLine; } - else strText += GUILocalizeStrings.Get(3); // 3 = Unknown + else strText += LocalizeStrings.Get(3) + Environment.NewLine; // 3 = Unknown. The new line on string end avoids that the first number of the message box text gets cropped - strText += Environment.NewLine; // avoids that the first number of the message box text gets cropped - // show call notification showNotificationWindow(callAction.Type, strHeading, strImage, strText); } } // update call list and voice box items and refresh GUI - worker.queue.Enqueue(new Task(Task.TaskAction.LoadCallListItems, null)); - worker.queue.Enqueue(new Task(Task.TaskAction.LoadVoiceBoxItems, null)); - worker.queue.Enqueue(new Task(Task.TaskAction.RefreshView, null)); + worker.EnqueueTask(new Task(Task.TaskAction.LoadCallListItems, null)); + worker.EnqueueTask(new Task(Task.TaskAction.LoadVoiceBoxItems, null)); + worker.EnqueueTask(new Task(Task.TaskAction.RefreshView, null)); } } @@ -280,7 +284,7 @@ } else { - if (mSN != "") + if (mSN != String.Empty) { if (Settings.MSNList.Contains(mSN)) { @@ -399,26 +403,31 @@ public void Start() { Log.Info("FRITZ!Box Manager {0} plugin is starting", Assembly.GetExecutingAssembly().GetName().Version); + + thePlugin = this; + LocalizeStrings.LoadLocalization(); + Settings.Load(); // register events Utils.OnStartExternal += OnStartExternal; Utils.OnStopExternal += OnStopExternal; - FritzBoxClient.LogEvent += OnLogAction; FritzBoxClient.CallEvent += OnCallAction; - FritzBoxClient.ConnectedEvent += OnConnectedAction; - SystemEvents.PowerModeChanged += new PowerModeChangedEventHandler(SystemEvents_PowerModeChanged); // power mode changes (Standby & Hibernate) FritzBoxClient.StartClient(); - thePlugin = this; + startBackGroundWorker(); - // open FRITZ!Box connection and login + // open FRITZ!Box connection fritz = new Fritz(Settings.Password, Config.GetFolder(Config.Dir.Config), FritzBoxClient.Address, Settings.DialPort); + + // load phone book from XML file + phoneBook = new PhoneBook(fritz); + phoneBook.LoadPhoneBookFromXMLFile(); // set session timer interval and start the timer sessionTimer.Interval = 30000; @@ -435,12 +444,6 @@ updateTimer.Start(); } - // load phone book from XML file - phoneBook = new PhoneBook(fritz); - phoneBook.LoadPhoneBookFromXMLFile(); - - startBackGroundWorker(); - loadDataInBackground(); } @@ -529,7 +532,7 @@ public bool GetHome(out string strButtonText, out string strButtonImage, out string strButtonImageFocus, out string strPictureImage) { - strButtonText = GUILocalizeStrings.Get(28); // 28 = Telefon + strButtonText = LocalizeStrings.Get(28); // 28 = phone strButtonImage = String.Empty; strButtonImageFocus = String.Empty; strPictureImage = "hover_FritzBox.png"; @@ -605,6 +608,8 @@ private Thread workerThread; // sync the access to call list private System.Object sync = new System.Object(); + // last selected phone book item in phone book list; used for phone book browsing + private int selectedPhoneBookItemIndex = -1; #endregion fields @@ -637,7 +642,7 @@ { if (worker == null || !worker.Running) { - worker = new BackGroundWorker(fritz, this); + worker = new BackGroundWorker(this); workerThread = new Thread(worker.Run); workerThread.Start(); } @@ -686,9 +691,9 @@ showThumbPanel(); // display error on missing FRITZ!Box settings - if (String.IsNullOrEmpty(Settings.Password) && String.IsNullOrEmpty(Settings.VBPath)) showError(GUILocalizeStrings.Get(24)); // 24 = FRITZ!Box password and voice box path are missing in settings! + if (String.IsNullOrEmpty(Settings.Password) && String.IsNullOrEmpty(Settings.VBPath)) showError(LocalizeStrings.Get(24)); // 24 = FRITZ!Box password and voice box path are missing in settings! - btnUpdate.Label = GUILocalizeStrings.Get(25); // 25 = Update + btnUpdate.Label = LocalizeStrings.Get(25); // 25 = Update RefreshView(Settings.CurrentMode); @@ -699,12 +704,15 @@ { BackGroundWorker worker = thePlugin.worker; - worker.queue.Enqueue(new Task(Task.TaskAction.LoadCallListItems, null)); - if (!String.IsNullOrEmpty(Settings.VBPath)) worker.queue.Enqueue(new Task(Task.TaskAction.LoadVoiceBoxItems, null)); - worker.queue.Enqueue(new Task(Task.TaskAction.SynchronizePhoneBook, null)); - if (!String.IsNullOrEmpty(Settings.NASShareName)) worker.queue.Enqueue(new Task(Task.TaskAction.SynchronizeContactImages, null)); + 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)); + worker.EnqueueTask(new Task(Task.TaskAction.UpdateGUIProperties, null)); - worker.queue.Enqueue(new Task(Task.TaskAction.UpdateGUIProperties, null)); + // reset update timer to get the countdown timer reset + updateTimer.Stop(); + updateTimer.Start(); } private static void OnSessionTimerEvent(object source, System.Timers.ElapsedEventArgs e) @@ -714,7 +722,6 @@ if (fritz.LoggedIn) { fritz.KeepAlive(); - fritz.Refresh(); } } @@ -722,7 +729,6 @@ private static void OnUpdateTimerEvent(object source, System.Timers.ElapsedEventArgs e) { Log.Debug("Processing update timer event"); - loadDataInBackground(); } @@ -788,8 +794,7 @@ lock (sync) { voiceBoxItemList = newVoiceBoxItemList; - - worker.queue.Enqueue(new Task(Task.TaskAction.RefreshView, null)); + worker.EnqueueTask(new Task(Task.TaskAction.RefreshView, null)); } } else Log.Debug("No voice box items on the FRITZ!Box"); @@ -800,7 +805,7 @@ public void SynchronizePhoneBook() { - if (phoneBook.SynchronizePhoneBook()) worker.queue.Enqueue(new Task(Task.TaskAction.RefreshView, null)); + if (phoneBook.SynchronizePhoneBook()) worker.EnqueueTask(new Task(Task.TaskAction.RefreshView, null)); } public void SynchronizeContactImages() @@ -821,7 +826,18 @@ if (Settings.CurrentMode == GUIMode.CallList) populateCallListItems(); else if (Settings.CurrentMode == GUIMode.VoiceBox) populateVoiceBoxItems(); - else if (Settings.CurrentMode == GUIMode.PhoneBook) populatePhoneBookItems(); + else if (Settings.CurrentMode == GUIMode.PhoneBook) + { + if (facadeView.Count > 0) + { + if (!facadeView[0].IsFolder && facadeView[0].Label == "..") + { + if (phoneBook.Items.ContainsKey(facadeView[0].Path)) populatePhoneBookItemNumbers(phoneBook.Items[facadeView[0].Path]); // when phone number list is opened update phone number list + } + else populatePhoneBookItems(); + } + else populatePhoneBookItems(); + } // set focus to the item as before the list update, if none item is selected select the first one // the GUIFacadeControl control does not support to have none list item selected. The first item is always marked but not really selected (e. g. the picture is not shown) @@ -877,8 +893,7 @@ lock (sync) { callItemList = newCallItemList; - - worker.queue.Enqueue(new Task(Task.TaskAction.RefreshView, null)); + worker.EnqueueTask(new Task(Task.TaskAction.RefreshView, null)); } } else Log.Debug("No voice box items on the FRITZ!Box"); @@ -905,29 +920,61 @@ protected void populatePhoneBookItems() { - facadeView.Clear(); - if (phoneBook.Count > 0) { - int i = 0; + GUIListItem elem; + string contactImagePath; + facadeView.Clear(); + + // add contacts to list view foreach (PhoneBookItem phoneBookItem in phoneBook.Items.Values) { - foreach (PhoneNumber phoneNumber in phoneBookItem.PhoneNumbers) - { - GUIListItem elem = new GUIListItem(); - elem.Label = phoneBookItem.Name; - elem.Label2 = phoneNumber.Value; + elem = new GUIListItem(); + elem.IsFolder = true; + elem.Path = phoneBookItem.UniqueID; + elem.Label = phoneBookItem.Name; - if (elem.Label2.Length > 0) - { - elem.ThumbnailImage = phoneBook.GetContactImagePath(phoneBookItem); + contactImagePath = phoneBook.GetContactImagePath(phoneBookItem); + elem.ThumbnailImage = contactImagePath; + if (contactImagePath != Settings.SkinMediaFolderPath + @"\FritzBox\CallMonitor.Missing.png") elem.IconImage = contactImagePath; - elem.Path = Convert.ToString(i++); + facadeView.Add(elem); + } - facadeView.Add(elem); - } - } + if (selectedPhoneBookItemIndex < facadeView.Count) facadeView.SelectedListItemIndex = selectedPhoneBookItemIndex; + else facadeView.SelectedItem = facadeView.Count - 1; // select last phone book item + } + } + + protected void populatePhoneBookItemNumbers(PhoneBookItem phoneBookItem) + { + GUIListItem elem; + selectedPhoneBookItemIndex = facadeView.SelectedListItemIndex; + + facadeView.Clear(); + + // add up folder item + elem = new GUIListItem(".."); + + elem.IconImage = "defaultFolderBack.png"; + elem.IconImageBig = "defaultFolderBackBig.png"; + + facadeView.Add(elem); + + foreach (PhoneNumber phoneNumber in phoneBookItem.PhoneNumbers) + { + elem = new GUIListItem(); + + elem.IconImage = phoneBook.GetPhoneNumberIconName(phoneNumber.type); + elem.Label = phoneBook.GetPhoneNumberTypeLabel(phoneNumber.type); + elem.Label2 = phoneNumber.Value; + + if (elem.Label2.Length > 0) + { + elem.ThumbnailImage = phoneBook.GetContactImagePath(phoneBookItem); + + facadeView.Add(elem); } } } @@ -962,14 +1009,14 @@ elem.Label = (voiceBoxItem.isNew == 1 ? "* " : " ") + voiceBoxItem.time.ToString(format, ci); // add caller name/phone number and MSN - if (caller.PhoneBookItem != null) callerName = caller.PhoneBookItem.Name; + if (caller.PhoneBookItem != null) callerName = caller.PhoneBookItem.Name + " (" + phoneBook.GetPhoneNumberTypeLabel(caller.PhoneType).ToLower() + ")"; else { - if (caller.PhoneNumber != "") callerName = caller.PhoneNumber; - else callerName = GUILocalizeStrings.Get(3); // 3 = Unknown + if (caller.PhoneNumber != String.Empty) callerName = caller.PhoneNumber; + else callerName = LocalizeStrings.Get(3); // 3 = Unknown } - elem.Label2 = callerName + " " + GUILocalizeStrings.Get(26) + " " + mSNName; // 26 = to + elem.Label2 = callerName + " " + LocalizeStrings.Get(26) + " " + mSNName; // 26 = to elem.Path = Convert.ToString(i); @@ -990,7 +1037,7 @@ public void updateGUIProperties() { Caller caller = new Caller(); - string lastNewCallerName = ""; + string lastNewCallerName = String.Empty; int newVoiceBoxItemsCount = 0, voiceBoxItemsCount = 0; Log.Debug("Updating GUI properties"); @@ -1009,7 +1056,7 @@ if (voiceBoxItem.isNew > 0) { - if (lastNewCallerName == "" && caller.PhoneBookItem != null) lastNewCallerName = caller.PhoneBookItem.Name; + if (lastNewCallerName == String.Empty && caller.PhoneBookItem != null) lastNewCallerName = caller.PhoneBookItem.Name; newVoiceBoxItemsCount++; } @@ -1026,8 +1073,8 @@ } else { - if (newVoiceBoxItemsCount > 1) GUIPropertyManager.SetProperty("#FritzManager.NewMessages", newVoiceBoxItemsCount + " " + GUILocalizeStrings.Get(7)); // 7 = Messages - else GUIPropertyManager.SetProperty("#FritzManager.NewMessages", newVoiceBoxItemsCount + " " + GUILocalizeStrings.Get(27)); // 27 = Message + if (newVoiceBoxItemsCount > 1) GUIPropertyManager.SetProperty("#FritzManager.NewMessages", newVoiceBoxItemsCount + " " + LocalizeStrings.Get(7)); // 7 = Messages + else GUIPropertyManager.SetProperty("#FritzManager.NewMessages", newVoiceBoxItemsCount + " " + LocalizeStrings.Get(27)); // 27 = Message GUIPropertyManager.SetProperty("#FritzManager.Caller", lastNewCallerName); GUIPropertyManager.SetProperty("#FritzManager.NewMessageCount", newVoiceBoxItemsCount.ToString()); @@ -1041,8 +1088,8 @@ } else { - if (voiceBoxItemsCount > 1) GUIPropertyManager.SetProperty("#FritzManager.TotalMessages", voiceBoxItemsCount + " " + GUILocalizeStrings.Get(7)); // 7 = Messages - else GUIPropertyManager.SetProperty("#FritzManager.TotalMessages", voiceBoxItemsCount + " " + GUILocalizeStrings.Get(27)); // 27 = Message + if (voiceBoxItemsCount > 1) GUIPropertyManager.SetProperty("#FritzManager.TotalMessages", voiceBoxItemsCount + " " + LocalizeStrings.Get(7)); // 7 = Messages + else GUIPropertyManager.SetProperty("#FritzManager.TotalMessages", voiceBoxItemsCount + " " + LocalizeStrings.Get(27)); // 27 = Message GUIPropertyManager.SetProperty("#FritzManager.TotalMessageCount", voiceBoxItemsCount.ToString()); } @@ -1079,11 +1126,11 @@ elem.Label = item.timestamp.ToString(format, ci) + " - " + item.duration.ToString("HH:mm", ci); // add caller name/phone number - if (caller.PhoneBookItem != null) elem.Label2 = caller.PhoneBookItem.Name; + if (caller.PhoneBookItem != null) elem.Label2 = caller.PhoneBookItem.Name + " (" + phoneBook.GetPhoneNumberTypeLabel(caller.PhoneType).ToLower() + ")"; else { - if (caller.PhoneNumber != "") elem.Label2 = caller.PhoneNumber; - else elem.Label2 = GUILocalizeStrings.Get(3); // 3 = Unknown + if (caller.PhoneNumber != String.Empty) elem.Label2 = caller.PhoneNumber; + else elem.Label2 = LocalizeStrings.Get(3); // 3 = Unknown } elem.DVDLabel = item.mynumber + item.extension; @@ -1129,46 +1176,48 @@ base.OnShowContextMenu(); - if (Settings.CurrentMode == GUIMode.VoiceBox) + switch (Settings.CurrentMode) { - int r = showVoiceboxContextMenu(); - phoneNumber = voiceBoxItemList[Convert.ToInt16(facadeView.SelectedListItem.Path)].callerId; + case GUIMode.VoiceBox: + int result = showVoiceBoxContextMenu(); - switch (r) - { - case 0: // play - g_Player.Play(decode(voiceBoxItemList[Convert.ToInt16(facadeView.SelectedListItem.Path)])); - break; - case 1: // call - fritz.Dial(phoneNumber); - break; - } - } - else if (Settings.CurrentMode == GUIMode.CallList) - { - int r = showCallListContextMenu(); - int idx = Convert.ToInt16(facadeView.SelectedListItem.Path); - phoneNumber = callItemList[idx].number; + switch (result) + { + case 0: // play + g_Player.Play(decode(voiceBoxItemList[Convert.ToInt16(facadeView.SelectedListItem.Path)])); + break; + case 1: // call + phoneNumber = facadeView.SelectedListItem.Label2; + fritz.Dial(phoneNumber); + break; + } + break; + case GUIMode.CallList: + result = showCallListContextMenu(); - switch (r) - { - case 0: // call - fritz.Dial(phoneNumber); - break; - } - } - else if (Settings.CurrentMode == GUIMode.PhoneBook) - { - int r = showPhoneBookContextMenu(); - int idx = Convert.ToInt16(facadeView.SelectedListItem.Path); - phoneNumber = facadeView.SelectedListItem.Label2; + switch (result) + { + case 0: // call + phoneNumber = facadeView.SelectedListItem.Label2; + fritz.Dial(phoneNumber); + break; + } + break; + case GUIMode.PhoneBook: + result = showPhoneBookContextMenu(); - switch (r) - { - case 0: // call - fritz.Dial(phoneNumber); - break; - } + switch (result) + { + case 0: // call + if (facadeView.SelectedListItem.IsFolder) populatePhoneBookItemNumbers(phoneBook.Items[facadeView.SelectedListItem.Path]); + else + { + phoneNumber = facadeView.SelectedListItem.Label2; + fritz.Dial(phoneNumber); + } + break; + } + break; } } @@ -1192,10 +1241,24 @@ { GUIListItem actual = facadeView.SelectedListItem; - if (Settings.CurrentMode == GUIMode.VoiceBox) + switch (Settings.CurrentMode) { - string tmp = decode(voiceBoxItemList[Convert.ToInt16(actual.Path)]); - g_Player.Play(tmp); + case GUIMode.VoiceBox: + string tmp = decode(voiceBoxItemList[Convert.ToInt16(actual.Path)]); + g_Player.Play(tmp); + break; + case GUIMode.PhoneBook: + if (facadeView.SelectedListItem.IsFolder) populatePhoneBookItemNumbers(phoneBook.Items[facadeView.SelectedListItem.Path]); + else + { + if (facadeView.SelectedListItem.Label != "..") OnShowContextMenu(); + else + { + facadeView.Clear(); // indicates that the phone number list is being left; necessary to avoid that the phone number list is updated only + populatePhoneBookItems(); + } + } + break; } } } @@ -1304,15 +1367,15 @@ { bool callActionEnabled = false; - if (callItemList[Convert.ToInt16(facadeView.SelectedListItem.Path)].number != "") callActionEnabled = true; + if (callItemList[Convert.ToInt16(facadeView.SelectedListItem.Path)].number != String.Empty) callActionEnabled = true; GUIDialogMenu dlgMenu = (GUIDialogMenu)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_MENU); if (dlgMenu != null) { dlgMenu.Reset(); - dlgMenu.SetHeading(GUILocalizeStrings.Get(4)); // 4 = Caller - if (fritz.LoggedIn && callActionEnabled) dlgMenu.Add(GUILocalizeStrings.Get(5)); // 5 = Call + dlgMenu.SetHeading(LocalizeStrings.Get(4)); // 4 = Caller + if (fritz.LoggedIn && callActionEnabled) dlgMenu.Add(LocalizeStrings.Get(5)); // 5 = Call dlgMenu.DoModal(GetID); if (dlgMenu.SelectedLabel == -1) return -1; // nothing was selected @@ -1323,22 +1386,22 @@ return -1; } - private int showVoiceboxContextMenu() + private int showVoiceBoxContextMenu() { bool callActionEnabled = false; - if (voiceBoxItemList[Convert.ToInt16(facadeView.SelectedListItem.Path)].callerId != "") callActionEnabled = true; + if (voiceBoxItemList[Convert.ToInt16(facadeView.SelectedListItem.Path)].callerId != String.Empty) callActionEnabled = true; GUIDialogMenu dlgMenu = (GUIDialogMenu)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_MENU); if (dlgMenu != null) { dlgMenu.Reset(); - dlgMenu.SetHeading(GUILocalizeStrings.Get(7)); // 7 = Message - dlgMenu.Add(GUILocalizeStrings.Get(8)); // 8 = Play message - //dlgMenu.Add(GUILocalizeStrings.Get(9)); // 9 = Mark message as heard - //dlgMenu.Add(GUILocalizeStrings.Get(10)); // 10 = Delete message - if (fritz.LoggedIn && callActionEnabled) dlgMenu.Add(GUILocalizeStrings.Get(5)); // 8 = Call + dlgMenu.SetHeading(LocalizeStrings.Get(7)); // 7 = Message + dlgMenu.Add(LocalizeStrings.Get(8)); // 8 = Play message + //dlgMenu.Add(LocalizeStrings.Get(9)); // 9 = Mark message as heard + //dlgMenu.Add(LocalizeStrings.Get(10)); // 10 = Delete message + if (fritz.LoggedIn && callActionEnabled) dlgMenu.Add(LocalizeStrings.Get(5)); // 8 = Call dlgMenu.DoModal(GetID); if (dlgMenu.SelectedLabel == -1) return -1; // nothing was selected @@ -1356,8 +1419,8 @@ if (dlgMenu != null) { dlgMenu.Reset(); - dlgMenu.SetHeading(GUILocalizeStrings.Get(6)); // 4 = Contact - if (fritz.LoggedIn) dlgMenu.Add(GUILocalizeStrings.Get(5)); // 5 = Call + dlgMenu.SetHeading(LocalizeStrings.Get(6)); // 4 = Contact + if (fritz.LoggedIn && facadeView.SelectedListItem.Label != "..") dlgMenu.Add(LocalizeStrings.Get(5)); // 5 = Call dlgMenu.DoModal(GetID); if (dlgMenu.SelectedLabel == -1) return -1; // nothing was selected @@ -1380,13 +1443,13 @@ switch (view) { case View.List: - strLine = GUILocalizeStrings.Get(11); // 11 = View: List + strLine = LocalizeStrings.Get(11); // 11 = View: List break; case View.Icons: - strLine = GUILocalizeStrings.Get(12); // 12 = View: Small icons + strLine = LocalizeStrings.Get(12); // 12 = View: Small icons break; case View.LargeIcons: - strLine = GUILocalizeStrings.Get(13); // 13 = View: Large icons + strLine = LocalizeStrings.Get(13); // 13 = View: Large icons break; } @@ -1395,16 +1458,16 @@ switch (Settings.CurrentFilter) { case CallListFilter.All: - strLine = GUILocalizeStrings.Get(14); // 14 = All + strLine = LocalizeStrings.Get(14); // 14 = All break; case CallListFilter.Incoming: - strLine = GUILocalizeStrings.Get(15); // 15 = Incoming + strLine = LocalizeStrings.Get(15); // 15 = Incoming break; case CallListFilter.Outgoing: - strLine = GUILocalizeStrings.Get(16); // 16 = Outgoing + strLine = LocalizeStrings.Get(16); // 16 = Outgoing break; case CallListFilter.Rejected: - strLine = GUILocalizeStrings.Get(17); // 17 = Rejected + strLine = LocalizeStrings.Get(17); // 17 = Rejected break; } @@ -1418,16 +1481,16 @@ switch (Settings.CurrentMode) { case GUIMode.VoiceBox: - if (headerLabel != null) headerLabel.Label = GUILocalizeStrings.Get(19); // 19 = FritzBox messages - btnModus.Label = GUILocalizeStrings.Get(18); // 18 = Call list + if (headerLabel != null) headerLabel.Label = LocalizeStrings.Get(19); // 19 = FRITZ!Box messages + btnModus.Label = LocalizeStrings.Get(18); // 18 = Call list break; case GUIMode.CallList: - if (headerLabel != null) headerLabel.Label = GUILocalizeStrings.Get(21); // 21 = FritzBox call list - btnModus.Label = GUILocalizeStrings.Get(20); // 20 = Phone book + if (headerLabel != null) headerLabel.Label = LocalizeStrings.Get(21); // 21 = FRITZ!Box call list + btnModus.Label = LocalizeStrings.Get(20); // 20 = Phone book break; case GUIMode.PhoneBook: - if (headerLabel != null) headerLabel.Label = GUILocalizeStrings.Get(22); // 22 = FritzBox phone book - btnModus.Label = GUILocalizeStrings.Get(7); // 7 = Messages + if (headerLabel != null) headerLabel.Label = LocalizeStrings.Get(22); // 22 = FRITZ!Box phone book + btnModus.Label = LocalizeStrings.Get(7); // 7 = Messages break; } } @@ -1435,7 +1498,7 @@ private void showError(string msg) { GUIDialogOK dlg = (GUIDialogOK)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_OK); - dlg.SetHeading(GUILocalizeStrings.Get(23)); // 23 = Error + dlg.SetHeading(LocalizeStrings.Get(23)); // 23 = Error dlg.SetLine(1, msg); // the text must be added to the first line, otherwise scrolling is not enabled dlg.SetLine(2, String.Empty); dlg.SetLine(3, String.Empty); Modified: trunk/plugins/FritzBox/FritzBox/FritzBox.csproj =================================================================== --- trunk/plugins/FritzBox/FritzBox/FritzBox.csproj 2012-02-09 17:08:05 UTC (rev 4448) +++ trunk/plugins/FritzBox/FritzBox/FritzBox.csproj 2012-02-10 15:26:34 UTC (rev 4449) @@ -96,6 +96,7 @@ <DependentUpon>EditPhoneBook.cs</DependentUpon> </Compile> <Compile Include="FritzCallMonitor\FritzBoxClient.cs" /> + <Compile Include="FritzManager\LocalizeStrings.cs" /> <Compile Include="FritzManager\StringEncryption.cs"> <SubType>Code</SubType> </Compile> @@ -111,7 +112,6 @@ <Compile Include="FritzManager\PhoneBookItem.cs" /> <Compile Include="FritzManager\Task.cs" /> <Compile Include="FritzManager\VoiceBoxItem.cs" /> - <Compile Include="LocalizeStrings.cs" /> <Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="FritzCallMonitor\Caller.cs" /> <Compile Include="FritzCallMonitor\CallAction.cs" /> @@ -133,6 +133,7 @@ <ItemGroup> <EmbeddedResource Include="EditPhoneBook.resx"> <DependentUpon>EditPhoneBook.cs</DependentUpon> + <SubType>Designer</SubType> </EmbeddedResource> <EmbeddedResource Include="Properties\Resources.resx"> <Generator>ResXFileCodeGenerator</Generator> Modified: trunk/plugins/FritzBox/FritzBox/FritzBoxConfig.Designer.cs =================================================================== --- trunk/plugins/FritzBox/FritzBox/FritzBoxConfig.Designer.cs 2012-02-09 17:08:05 UTC (rev 4448) +++ trunk/plugins/FritzBox/FritzBox/FritzBoxConfig.Designer.cs 2012-02-10 15:26:34 UTC (rev 4449) @@ -39,14 +39,12 @@ this.tabPagePhoneBook = new System.Windows.Forms.TabPage(); this.buttonEditPhoneBook = new System.Windows.Forms.Button(); this.tabPageCallNotification = new System.Windows.Forms.TabPage(); - this.groupBoxPhonebook = new MediaPortal.UserInterface.Controls.MPGroupBox(); - this.checkBoxShowUnknownCaller = new MediaPortal.UserInterface.Controls.MPCheckBox(); - this.checkBoxUsePhonebook = new MediaPortal.UserInterface.Controls.MPCheckBox(); this.groupBoxNotification = new MediaPortal.UserInterface.Controls.MPGroupBox(); + this.checkBoxShowNotificationOnOutgoingCall = new MediaPortal.UserInterface.Controls.MPCheckBox(); this.checkBoxCloseOnConnectionClosed = new MediaPortal.UserInterface.Controls.MPCheckBox(); + this.checkBoxShowNotificationOnIncomingCall = new MediaPortal.UserInterface.Controls.MPCheckBox(); this.lblMaxNotifies = new MediaPortal.UserInterface.Controls.MPLabel(); this.numericUpDownMaxNotifies = new MediaPortal.UserInterface.Controls.MPNumericUpDown(); - this.checkBoxShowPhoneNumberOnNotification = 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(); @@ -61,6 +59,9 @@ this.checkBoxResumeMediaOnIncomingCall = new MediaPortal.UserInterface.Controls.MPCheckBox(); this.checkBoxPauseMediaOnIncomingCall = new MediaPortal.UserInterface.Controls.MPCheckBox(); this.tabPageConnection = new System.Windows.Forms.TabPage(); + this.numericUpDownDialPort = new System.Windows.Forms.NumericUpDown(); + this.label6 = new System.Windows.Forms.Label(); + this.textBoxNASShareName = new System.Windows.Forms.TextBox(); this.label2 = new System.Windows.Forms.Label(); this.vBPath = new System.Windows.Forms.TextBox(); this.passwd = new System.Windows.Forms.TextBox(); @@ -73,29 +74,27 @@ this.labelAddress = new MediaPortal.UserInterface.Controls.MPLabel(); this.tabControlConfiguration = new MediaPortal.UserInterface.Controls.MPTabControl(); this.tabPageMiscellaneous = new System.Windows.Forms.TabPage(); + this.updateInterval = new MediaPortal.UserInterface.Controls.MPNumericUpDown(); this.checkBoxExtensiveLogging = new MediaPortal.UserInterface.Controls.MPCheckBox(); this.label4 = new System.Windows.Forms.Label(); - this.updateInterval = new MediaPortal.UserInterface.Controls.MPNumericUpDown(); - this.checkBoxShowNotificationOnOutgoingCall = new MediaPortal.UserInterface.Controls.MPCheckBox(); - this.checkBoxShowNotificationOnIncomingCall = new MediaPortal.UserInterface.Controls.MPCheckBox(); - this.label6 = new System.Windows.Forms.Label(); - this.textBoxNASShareName = new System.Windows.Forms.TextBox(); - this.numericUpDownDialPort = new System.Windows.Forms.NumericUpDown(); + this.checkBoxShowPhoneTypeOnNotification = new MediaPortal.UserInterface.Controls.MPCheckBox(); + this.checkBoxShowUnknownCaller = new MediaPortal.UserInterface.Controls.MPCheckBox(); + this.checkBoxUsePhonebook = new MediaPortal.UserInterface.Controls.MPCheckBox(); + this.checkBoxShowPhoneNumberOnNotification = new MediaPortal.UserInterface.Controls.MPCheckBox(); this.tabPageDiagnostics.SuspendLayout(); this.tabPagePhoneBook.SuspendLayout(); this.tabPageCallNotification.SuspendLayout(); - this.groupBoxPhonebook.SuspendLayout(); this.groupBoxNotification.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownMaxNotifies)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownTimeout)).BeginInit(); this.groupBoxMedia.SuspendLayout(); this.tabPageConnection.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDownDialPort)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownPort)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); this.tabControlConfiguration.SuspendLayout(); this.tabPageMiscellaneous.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.updateInterval)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.numericUpDownDialPort)).BeginInit(); this.SuspendLayout(); // // labelVersion @@ -200,7 +199,6 @@ // // tabPageCallNotification // - this.tabPageCallNotification.Controls.Add(this.groupBoxPhonebook); this.tabPageCallNotification.Controls.Add(this.groupBoxNotification); this.tabPageCallNotification.Controls.Add(this.groupBoxMedia); this.tabPageCallNotification.Location = new System.Drawing.Point(4, 22); @@ -211,51 +209,19 @@ this.tabPageCallNotification.Text = "Call notfication"; this.tabPageCallNotification.UseVisualStyleBackColor = true; // - // groupBoxPhonebook - // - this.groupBoxPhonebook.Controls.Add(this.checkBoxShowUnknownCaller); - this.groupBoxPhonebook.Controls.Add(this.checkBoxUsePhonebook); - this.groupBoxPhonebook.FlatStyle = System.Windows.Forms.FlatStyle.Popup; - ... [truncated message content] |
From: <mic...@us...> - 2012-02-09 17:08:15
|
Revision: 4448 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=4448&view=rev Author: michael-t Date: 2012-02-09 17:08:05 +0000 (Thu, 09 Feb 2012) Log Message: ----------- Removed Paths: ------------- trunk/plugins/PowerScheduler++/Stable/test/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mic...@us...> - 2012-02-09 17:07:36
|
Revision: 4447 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=4447&view=rev Author: michael-t Date: 2012-02-09 17:07:29 +0000 (Thu, 09 Feb 2012) Log Message: ----------- Version 1.2.2.1 Modified Paths: -------------- trunk/plugins/PowerScheduler++/Stable/1.2.2.1/MPEI/PowerScheduler++.xmp2 trunk/plugins/PowerScheduler++/Stable/1.2.2.1/MPEI/update.xml trunk/plugins/PowerScheduler++/Stable/1.2.2.1/TvEngine3/TVLibrary/Plugins/PowerScheduler/PowerScheduler.cs trunk/plugins/PowerScheduler++/Stable/1.2.2.1/VersionInfo.cs Added Paths: ----------- trunk/plugins/PowerScheduler++/Stable/1.2.2.1/MPEI/PowerScheduler++ 1.2.2.1.mpe1 Removed Paths: ------------- trunk/plugins/PowerScheduler++/Stable/1.2.2.1/Common-MP-TVE3/PowerScheduler.Interfaces/bin/ trunk/plugins/PowerScheduler++/Stable/1.2.2.1/Common-MP-TVE3/PowerScheduler.Interfaces/obj/ trunk/plugins/PowerScheduler++/Stable/1.2.2.1/MPEI/PowerScheduler++ 1.2.1.2.mpe1 trunk/plugins/PowerScheduler++/Stable/1.2.2.1/TvEngine3/TVLibrary/Plugins/PowerScheduler/bin/ trunk/plugins/PowerScheduler++/Stable/1.2.2.1/TvEngine3/TVLibrary/Plugins/PowerScheduler/obj/ trunk/plugins/PowerScheduler++/Stable/1.2.2.1/mediaportal/PowerSchedulerClientPlugin/bin/ trunk/plugins/PowerScheduler++/Stable/1.2.2.1/mediaportal/PowerSchedulerClientPlugin/obj/ Property Changed: ---------------- trunk/plugins/PowerScheduler++/Stable/1.2.2.1/ Property changes on: trunk/plugins/PowerScheduler++/Stable/1.2.2.1 ___________________________________________________________________ Deleted: svn:ignore - PowerScheduler++.suo Deleted: trunk/plugins/PowerScheduler++/Stable/1.2.2.1/MPEI/PowerScheduler++ 1.2.1.2.mpe1 =================================================================== (Binary files differ) Copied: trunk/plugins/PowerScheduler++/Stable/1.2.2.1/MPEI/PowerScheduler++ 1.2.2.1.mpe1 (from rev 4445, trunk/plugins/PowerScheduler++/Stable/test/MPEI/PowerScheduler++ 1.2.2.1.mpe1) =================================================================== (Binary files differ) Modified: trunk/plugins/PowerScheduler++/Stable/1.2.2.1/MPEI/PowerScheduler++.xmp2 =================================================================== --- trunk/plugins/PowerScheduler++/Stable/1.2.2.1/MPEI/PowerScheduler++.xmp2 2012-02-09 17:03:58 UTC (rev 4446) +++ trunk/plugins/PowerScheduler++/Stable/1.2.2.1/MPEI/PowerScheduler++.xmp2 2012-02-09 17:07:29 UTC (rev 4447) @@ -44,7 +44,7 @@ <FileItem InstallType="CopyFile" SystemFile="false" Modified="true"> <Param1 /> <UpdateOption>AlwaysOverwrite</UpdateOption> - <LocalFileName>..\Common-MP-TVE3\PowerScheduler.Interfaces\bin\Debug\PowerScheduler.Interfaces.dll</LocalFileName> + <LocalFileName>..\mediaportal\PowerSchedulerClientPlugin\bin\Debug\PowerScheduler.Interfaces.dll</LocalFileName> <ZipFileName>Installer{CopyFile}\{ac7155e9-4a57-4108-8731-81f3fd669737}-PowerScheduler.Interfaces.dll</ZipFileName> <DestinationFilename>%Base%\PowerScheduler.Interfaces.dll</DestinationFilename> </FileItem> @@ -64,7 +64,7 @@ <Description /> </SectionParam> <SectionParam Name="Description"> - <Value>This will install the [Name] [Version] plugin on your computer. This plugin is designed for MediaPortal 1.2.1 FINAL and will not work with other MediaPortal releases. + <Value>This will install the [Name] [Version] plugin on your computer. This plugin is designed for MediaPortal 1.2.x and will not work with other MediaPortal releases. It is recommended that you close all other applications before continuing. @@ -425,11 +425,11 @@ <MaxVersion> <Major>1</Major> <Minor>2</Minor> - <Build>1</Build> + <Build>4</Build> <Revision>0</Revision> </MaxVersion> <WarnOnly>true</WarnOnly> - <Message>For MediaPortal release 1.2.1 FINAL (not compatible with 1.1.x releases)</Message> + <Message>For MediaPortal release 1.2.x (not compatible with 1.1.x releases)</Message> <Name>MediaPortal</Name> </DependencyItem> <DependencyItem> @@ -448,7 +448,7 @@ <Revision>27644</Revision> </MaxVersion> <WarnOnly>false</WarnOnly> - <Message>For MediaPortal release 1.2.1 FINAL (not compatible with 1.1.x releases)</Message> + <Message>For MediaPortal release 1.2.x (not compatible with 1.1.x releases)</Message> <Name>MediaPortal</Name> </DependencyItem> </Items> @@ -482,19 +482,21 @@ <Version> <Major>1</Major> <Minor>2</Minor> - <Build>1</Build> - <Revision>2</Revision> + <Build>2</Build> + <Revision>1</Revision> </Version> <ExtensionDescription>The PowerScheduler++ plugin is a replacement for the PowerScheduler plugin that comes as part of MediaPortal. Compared to the original PowerScheduler it provides additional features (easy configuration, shares monitoring, reboot option, ...) and is supporting "away mode" for Vista and Win 7 systems.</ExtensionDescription> - <VersionDescription>Version 1.2.1.2 - Stable version for MP 1.2.1 FINAL - -Release Notes: -Version 1.2.1.2 - Bugfix: Fixed periodic 100% CPU load on Windows XP (thx to daniel_1980 and umlaut) -Version 1.2.1.1 - Bugfix: Changes to NetworkMonitor minimum transfer rate had no effect + <VersionDescription>Version 1.2.2.1 - Stable version for MP 1.2.x + +Release Notes: +Version 1.2.2.1 - Updated file versions, fixed bug in uninstall +Version 1.2.2.0 - Changed version check in MPEI for MP 1.2.2 +Version 1.2.1.2 - Fixed periodic 100% CPU load on Windows XP +Version 1.2.1.1 - Changes to NetworkMonitor minimum transfer rate had no effect Version 1.2.1.0 - Initial version</VersionDescription> <DevelopmentStatus>Stable</DevelopmentStatus> <OnlineLocation>http://www.team-mediaportal.com/index.php?option=com_mtree&task=att_download&link_id=87&cf_id=24</OnlineLocation> - <ReleaseDate>2011-11-01T16:03:54</ReleaseDate> + <ReleaseDate>2012-01-08T16:03:54</ReleaseDate> <Tags>tv server plugins, automation</Tags> <Location>..\MPEI\[Name] [Version].mpe1</Location> <Params> @@ -559,18 +561,25 @@ <ZipFileName>Installer{CopyFile}\{ed9d9027-eca3-460f-b94e-d17ff4ab38ba}-PowerSchedulerClientPlugin.dll</ZipFileName> <DestinationFilename>%Plugins%\process\PowerSchedulerClientPlugin.dll</DestinationFilename> </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="true"> + <Param1 /> + <UpdateOption>AlwaysOverwrite</UpdateOption> + <LocalFileName>..\mediaportal\PowerSchedulerClientPlugin\bin\Debug\PowerScheduler.Interfaces.dll</LocalFileName> + <ZipFileName>Installer{CopyFile}\{ac7155e9-4a57-4108-8731-81f3fd669737}-PowerScheduler.Interfaces.dll</ZipFileName> + <DestinationFilename>%Base%\PowerScheduler.Interfaces.dll</DestinationFilename> + </FileItem> <FileItem InstallType="CopyFile" SystemFile="true" Modified="true"> <Param1 /> <UpdateOption>OverwriteIfOlder</UpdateOption> <LocalFileName>PowerScheduler_high.png</LocalFileName> - <ZipFileName>Installer{CopyFile}\{cf7fec65-3cd1-4bba-9522-cf1e8617c50b}-PowerScheduler_high.png</ZipFileName> + <ZipFileName>Installer{CopyFile}\{fe2eac06-332b-4ed4-8f6c-d31c0d745b28}-PowerScheduler_high.png</ZipFileName> <DestinationFilename /> </FileItem> <FileItem InstallType="CopyFile" SystemFile="true" Modified="true"> <Param1 /> <UpdateOption>OverwriteIfOlder</UpdateOption> <LocalFileName>..\mediaportal\PowerSchedulerClientPlugin\PowerScheduler.gif</LocalFileName> - <ZipFileName>Installer{CopyFile}\{e45bd37f-259b-4280-af2b-7c5e718f7113}-PowerScheduler.gif</ZipFileName> + <ZipFileName>Installer{CopyFile}\{96bf1893-e96e-4fa9-b665-7f67ac844249}-PowerScheduler.gif</ZipFileName> <DestinationFilename /> </FileItem> </Items> Modified: trunk/plugins/PowerScheduler++/Stable/1.2.2.1/MPEI/update.xml =================================================================== --- trunk/plugins/PowerScheduler++/Stable/1.2.2.1/MPEI/update.xml 2012-02-09 17:03:58 UTC (rev 4446) +++ trunk/plugins/PowerScheduler++/Stable/1.2.2.1/MPEI/update.xml 2012-02-09 17:07:29 UTC (rev 4447) @@ -40,11 +40,11 @@ <MaxVersion> <Major>1</Major> <Minor>2</Minor> - <Build>1</Build> + <Build>4</Build> <Revision>0</Revision> </MaxVersion> <WarnOnly>true</WarnOnly> - <Message>For MediaPortal release 1.2.1 FINAL (not compatible with 1.1.x releases)</Message> + <Message>For MediaPortal release 1.2.x (not compatible with 1.1.x releases)</Message> <Name>MediaPortal</Name> </DependencyItem> <DependencyItem> @@ -63,7 +63,7 @@ <Revision>27644</Revision> </MaxVersion> <WarnOnly>false</WarnOnly> - <Message>For MediaPortal release 1.2.1 FINAL (not compatible with 1.1.x releases)</Message> + <Message>For MediaPortal release 1.2.x (not compatible with 1.1.x releases)</Message> <Name>MediaPortal</Name> </DependencyItem> </Items> @@ -92,172 +92,26 @@ <Id>9b9bc24e-69ca-4abc-8810-f8f95bd4bbe6</Id> <Author>michael_t (based on PowerScheduler by micheloe)</Author> <HomePage>http://www.team-mediaportal.com/extensions/other/powerscheduler</HomePage> - <ForumPage>http://forum.team-mediaportal.com/tv-server-plugins-294/powerscheduler-1-2-1-0-stable-version-mediaportal-1-2-1-final-95463/#post733512/</ForumPage> + <ForumPage>http://forum.team-mediaportal.com/tv-server-plugins-294/powerscheduler-1-2-1-2-stable-version-mediaportal-1-2-1-final-95463/#post733512/</ForumPage> <UpdateUrl>http://www.team-mediaportal.com/index.php?option=com_mtree&task=att_download&link_id=87&cf_id=52</UpdateUrl> <Version> <Major>1</Major> <Minor>2</Minor> - <Build>1</Build> - <Revision>0</Revision> - </Version> - <ExtensionDescription>The PowerScheduler++ plugin is a replacement for the PowerScheduler plugin that comes as part of MediaPortal. Compared to the original PowerScheduler it provides additional features (easy configuration, shares monitoring, reboot option, ...) and is supporting "away mode" for Vista and Win 7 systems.</ExtensionDescription> - <VersionDescription>Version [Version] - [DevelopmentStatus] version for MP 1.2.1 FINAL</VersionDescription> - <DevelopmentStatus>Stable</DevelopmentStatus> - <OnlineLocation>http://www.team-mediaportal.com/index.php?option=com_mtree&task=att_download&link_id=87&cf_id=24</OnlineLocation> - <ReleaseDate>2011-10-01T16:03:54</ReleaseDate> - <Tags>tv server plugins, automation</Tags> - <Location>..\MPEI\[Name] [Version].mpe1</Location> - <Params> - <Items> - <SectionParam Name="Online Icon"> - <Value>http://www.team-mediaportal.com/components/com_mtree/img/listings/m/471.gif</Value> - <ValueType>String</ValueType> - <Description>The icon file of the package stored online (jpg,png,bmp)</Description> - </SectionParam> - <SectionParam Name="Configuration file"> - <Value /> - <ValueType>Template</ValueType> - <Description>The file used to configure the extension. - If have .exe extension the will be executed - If have .dll extension used like MP plugin configuration</Description> - </SectionParam> - <SectionParam Name="Online Screenshots"> - <Value>http://www.team-mediaportal.com/components/com_mtree/img/listings/m/480.jpg; -http://www.team-mediaportal.com/components/com_mtree/img/listings/m/481.jpg; -http://www.team-mediaportal.com/components/com_mtree/img/listings/m/482.jpg; -http://www.team-mediaportal.com/components/com_mtree/img/listings/m/483.jpg; -http://www.team-mediaportal.com/components/com_mtree/img/listings/m/484.jpg; -http://www.team-mediaportal.com/components/com_mtree/img/listings/m/485.jpg; -http://www.team-mediaportal.com/components/com_mtree/img/listings/m/486.jpg; -http://www.team-mediaportal.com/components/com_mtree/img/listings/m/487.jpg</Value> - <ValueType>String</ValueType> - <Description>Online stored screenshot urls separated by ; </Description> - </SectionParam> - <SectionParam Name="Force to uninstall on update"> - <Value>YES</Value> - <ValueType>Bool</ValueType> - <Description>Show dialog and force to uninstall previous version when updating an extension. Should only be disabled if you are using an NSIS/MSI installer.</Description> - </SectionParam> - </Items> - </Params> - </GeneralInfo> - <UniqueFileList> - <Items /> - </UniqueFileList> - <ProjectSettings> - <FolderGroups /> - </ProjectSettings> - <IsSkin>false</IsSkin> - </PackageClass> - <PackageClass> - <Version>2.0</Version> - <Groups> - <Items> - <GroupItem Name="Server files"> - <DisplayName>Server files</DisplayName> - <DefaulChecked>true</DefaulChecked> - <Description>Server files</Description> - <Files> - <Items /> - </Files> - </GroupItem> - <GroupItem Name="Client files"> - <DisplayName>Client files</DisplayName> - <DefaulChecked>true</DefaulChecked> - <Description>Client files</Description> - <Files> - <Items /> - </Files> - </GroupItem> - </Items> - </Groups> - <Sections> - <Items /> - </Sections> - <Dependencies> - <Items> - <DependencyItem> - <Type>Installer</Type> - <Id /> - <MinVersion> - <Major>1</Major> - <Minor>1</Minor> - <Build>6</Build> - <Revision>27644</Revision> - </MinVersion> - <MaxVersion> - <Major>1</Major> - <Minor>2</Minor> - <Build>1</Build> - <Revision>0</Revision> - </MaxVersion> - <WarnOnly>true</WarnOnly> - <Message>For MediaPortal release 1.2.1 FINAL (not compatible with 1.1.x releases)</Message> - <Name>MediaPortal</Name> - </DependencyItem> - <DependencyItem> - <Type>MediaPortal</Type> - <Id /> - <MinVersion> - <Major>1</Major> - <Minor>1</Minor> - <Build>6</Build> - <Revision>27644</Revision> - </MinVersion> - <MaxVersion> - <Major>1</Major> - <Minor>1</Minor> - <Build>6</Build> - <Revision>27644</Revision> - </MaxVersion> - <WarnOnly>false</WarnOnly> - <Message>For MediaPortal release 1.2.1 FINAL (not compatible with 1.1.x releases)</Message> - <Name>MediaPortal</Name> - </DependencyItem> - </Items> - </Dependencies> - <PluginDependencies> - <Items> - <PluginDependencyItem AssemblyName="PowerSchedulerClientPlugin.dll"> - <CompatibleVersion> - <Items> - <CompatibleVersionItem> - <MinRequiredVersion>1.1.6.27644</MinRequiredVersion> - <DesignedForVersion>1.2.1.0</DesignedForVersion> - </CompatibleVersionItem> - </Items> - </CompatibleVersion> - <SubSystemsUsed> - <Items> - <SubSystemItem Name="MP" /> - </Items> - </SubSystemsUsed> - </PluginDependencyItem> - </Items> - </PluginDependencies> - <GeneralInfo> - <Name>PowerScheduler++</Name> - <Id>9b9bc24e-69ca-4abc-8810-f8f95bd4bbe6</Id> - <Author>michael_t (based on PowerScheduler by micheloe)</Author> - <HomePage>http://www.team-mediaportal.com/extensions/other/powerscheduler</HomePage> - <ForumPage>http://forum.team-mediaportal.com/tv-server-plugins-294/powerscheduler-1-2-1-0-stable-version-mediaportal-1-2-1-final-95463/#post733512/</ForumPage> - <UpdateUrl>http://www.team-mediaportal.com/index.php?option=com_mtree&task=att_download&link_id=87&cf_id=52</UpdateUrl> - <Version> - <Major>1</Major> - <Minor>2</Minor> - <Build>1</Build> + <Build>2</Build> <Revision>1</Revision> </Version> <ExtensionDescription>The PowerScheduler++ plugin is a replacement for the PowerScheduler plugin that comes as part of MediaPortal. Compared to the original PowerScheduler it provides additional features (easy configuration, shares monitoring, reboot option, ...) and is supporting "away mode" for Vista and Win 7 systems.</ExtensionDescription> - <VersionDescription>Version 1.2.1.1 - Stable version for MP 1.2.1 FINAL + <VersionDescription>Version 1.2.2.1 - Stable version for MP 1.2.x Release Notes: -Version 1.2.1.1 -Bugfix: Changes to NetworkMonitor minimum transfer rate had no effect +Version 1.2.2.1 - Updated file versions, fixed bug in uninstall +Version 1.2.2.0 - Changed version check in MPEI for MP 1.2.2 +Version 1.2.1.2 - Fixed periodic 100% CPU load on Windows XP +Version 1.2.1.1 - Changes to NetworkMonitor minimum transfer rate had no effect Version 1.2.1.0 - Initial version</VersionDescription> <DevelopmentStatus>Stable</DevelopmentStatus> <OnlineLocation>http://www.team-mediaportal.com/index.php?option=com_mtree&task=att_download&link_id=87&cf_id=24</OnlineLocation> - <ReleaseDate>2011-10-01T16:03:54</ReleaseDate> + <ReleaseDate>2012-01-08T16:03:54</ReleaseDate> <Tags>tv server plugins, automation</Tags> <Location>..\MPEI\[Name] [Version].mpe1</Location> <Params> @@ -302,158 +156,5 @@ </ProjectSettings> <IsSkin>false</IsSkin> </PackageClass> - <PackageClass> - <Version>2.0</Version> - <Groups> - <Items> - <GroupItem Name="Server files"> - <DisplayName>Server files</DisplayName> - <DefaulChecked>true</DefaulChecked> - <Description>Server files</Description> - <Files> - <Items /> - </Files> - </GroupItem> - <GroupItem Name="Client files"> - <DisplayName>Client files</DisplayName> - <DefaulChecked>true</DefaulChecked> - <Description>Client files</Description> - <Files> - <Items /> - </Files> - </GroupItem> - </Items> - </Groups> - <Sections> - <Items /> - </Sections> - <Dependencies> - <Items> - <DependencyItem> - <Type>Installer</Type> - <Id /> - <MinVersion> - <Major>1</Major> - <Minor>1</Minor> - <Build>6</Build> - <Revision>27644</Revision> - </MinVersion> - <MaxVersion> - <Major>1</Major> - <Minor>2</Minor> - <Build>1</Build> - <Revision>0</Revision> - </MaxVersion> - <WarnOnly>true</WarnOnly> - <Message>For MediaPortal release 1.2.1 FINAL (not compatible with 1.1.x releases)</Message> - <Name>MediaPortal</Name> - </DependencyItem> - <DependencyItem> - <Type>MediaPortal</Type> - <Id /> - <MinVersion> - <Major>1</Major> - <Minor>1</Minor> - <Build>6</Build> - <Revision>27644</Revision> - </MinVersion> - <MaxVersion> - <Major>1</Major> - <Minor>1</Minor> - <Build>6</Build> - <Revision>27644</Revision> - </MaxVersion> - <WarnOnly>false</WarnOnly> - <Message>For MediaPortal release 1.2.1 FINAL (not compatible with 1.1.x releases)</Message> - <Name>MediaPortal</Name> - </DependencyItem> - </Items> - </Dependencies> - <PluginDependencies> - <Items> - <PluginDependencyItem AssemblyName="PowerSchedulerClientPlugin.dll"> - <CompatibleVersion> - <Items> - <CompatibleVersionItem> - <MinRequiredVersion>1.1.6.27644</MinRequiredVersion> - <DesignedForVersion>1.2.1.0</DesignedForVersion> - </CompatibleVersionItem> - </Items> - </CompatibleVersion> - <SubSystemsUsed> - <Items> - <SubSystemItem Name="MP" /> - </Items> - </SubSystemsUsed> - </PluginDependencyItem> - </Items> - </PluginDependencies> - <GeneralInfo> - <Name>PowerScheduler++</Name> - <Id>9b9bc24e-69ca-4abc-8810-f8f95bd4bbe6</Id> - <Author>michael_t (based on PowerScheduler by micheloe)</Author> - <HomePage>http://www.team-mediaportal.com/extensions/other/powerscheduler</HomePage> - <ForumPage>http://forum.team-mediaportal.com/tv-server-plugins-294/powerscheduler-1-2-1-2-stable-version-mediaportal-1-2-1-final-95463/#post733512/</ForumPage> - <UpdateUrl>http://www.team-mediaportal.com/index.php?option=com_mtree&task=att_download&link_id=87&cf_id=52</UpdateUrl> - <Version> - <Major>1</Major> - <Minor>2</Minor> - <Build>1</Build> - <Revision>2</Revision> - </Version> - <ExtensionDescription>The PowerScheduler++ plugin is a replacement for the PowerScheduler plugin that comes as part of MediaPortal. Compared to the original PowerScheduler it provides additional features (easy configuration, shares monitoring, reboot option, ...) and is supporting "away mode" for Vista and Win 7 systems.</ExtensionDescription> - <VersionDescription>Version 1.2.1.2 - Stable version for MP 1.2.1 FINAL - -Release Notes: -Version 1.2.1.2 - Bugfix: Fixed periodic 100% CPU load on Windows XP (thx to daniel_1980 and umlaut) -Version 1.2.1.1 - Bugfix: Changes to NetworkMonitor minimum transfer rate had no effect -Version 1.2.1.0 - Initial version</VersionDescription> - <DevelopmentStatus>Stable</DevelopmentStatus> - <OnlineLocation>http://www.team-mediaportal.com/index.php?option=com_mtree&task=att_download&link_id=87&cf_id=24</OnlineLocation> - <ReleaseDate>2011-11-01T16:03:54</ReleaseDate> - <Tags>tv server plugins, automation</Tags> - <Location>..\MPEI\[Name] [Version].mpe1</Location> - <Params> - <Items> - <SectionParam Name="Online Icon"> - <Value>http://www.team-mediaportal.com/components/com_mtree/img/listings/m/471.gif</Value> - <ValueType>String</ValueType> - <Description>The icon file of the package stored online (jpg,png,bmp)</Description> - </SectionParam> - <SectionParam Name="Configuration file"> - <Value /> - <ValueType>Template</ValueType> - <Description>The file used to configure the extension. - If have .exe extension the will be executed - If have .dll extension used like MP plugin configuration</Description> - </SectionParam> - <SectionParam Name="Online Screenshots"> - <Value>http://www.team-mediaportal.com/components/com_mtree/img/listings/m/480.jpg; -http://www.team-mediaportal.com/components/com_mtree/img/listings/m/481.jpg; -http://www.team-mediaportal.com/components/com_mtree/img/listings/m/482.jpg; -http://www.team-mediaportal.com/components/com_mtree/img/listings/m/483.jpg; -http://www.team-mediaportal.com/components/com_mtree/img/listings/m/484.jpg; -http://www.team-mediaportal.com/components/com_mtree/img/listings/m/485.jpg; -http://www.team-mediaportal.com/components/com_mtree/img/listings/m/486.jpg; -http://www.team-mediaportal.com/components/com_mtree/img/listings/m/487.jpg</Value> - <ValueType>String</ValueType> - <Description>Online stored screenshot urls separated by ; </Description> - </SectionParam> - <SectionParam Name="Force to uninstall on update"> - <Value>YES</Value> - <ValueType>Bool</ValueType> - <Description>Show dialog and force to uninstall previous version when updating an extension. Should only be disabled if you are using an NSIS/MSI installer.</Description> - </SectionParam> - </Items> - </Params> - </GeneralInfo> - <UniqueFileList> - <Items /> - </UniqueFileList> - <ProjectSettings> - <FolderGroups /> - </ProjectSettings> - <IsSkin>false</IsSkin> - </PackageClass> </Items> </ExtensionCollection> \ No newline at end of file Modified: trunk/plugins/PowerScheduler++/Stable/1.2.2.1/TvEngine3/TVLibrary/Plugins/PowerScheduler/PowerScheduler.cs =================================================================== --- trunk/plugins/PowerScheduler++/Stable/1.2.2.1/TvEngine3/TVLibrary/Plugins/PowerScheduler/PowerScheduler.cs 2012-02-09 17:03:58 UTC (rev 4446) +++ trunk/plugins/PowerScheduler++/Stable/1.2.2.1/TvEngine3/TVLibrary/Plugins/PowerScheduler/PowerScheduler.cs 2012-02-09 17:07:29 UTC (rev 4447) @@ -603,7 +603,7 @@ if (when > _lastUserTime) { - LogVerbose("PowerScheduler: User activity on local client detected recently: {0}", _lastUserTime); + LogVerbose("PowerScheduler: User activity on local client detected recently: {0}", when); _lastUserTime = when; // Prevent system from being suspended by resetting the system idle time Modified: trunk/plugins/PowerScheduler++/Stable/1.2.2.1/VersionInfo.cs =================================================================== --- trunk/plugins/PowerScheduler++/Stable/1.2.2.1/VersionInfo.cs 2012-02-09 17:03:58 UTC (rev 4446) +++ trunk/plugins/PowerScheduler++/Stable/1.2.2.1/VersionInfo.cs 2012-02-09 17:07:29 UTC (rev 4447) @@ -47,9 +47,9 @@ // // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("1.2.1.2")] -[assembly: AssemblyFileVersion("1.2.1.2")] -[assembly: AssemblyInformationalVersion("1.2.1.2 for MP 1.2.1")] +[assembly: AssemblyVersion("1.2.2.1")] +[assembly: AssemblyFileVersion("1.2.2.1")] +[assembly: AssemblyInformationalVersion("1.2.2.1 for MP 1.2.x")] This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mic...@us...> - 2012-02-09 17:04:04
|
Revision: 4446 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=4446&view=rev Author: michael-t Date: 2012-02-09 17:03:58 +0000 (Thu, 09 Feb 2012) Log Message: ----------- Removed Paths: ------------- trunk/plugins/PowerScheduler++/Test/test/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mic...@us...> - 2012-02-09 17:01:26
|
Revision: 4445 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=4445&view=rev Author: michael-t Date: 2012-02-09 17:01:19 +0000 (Thu, 09 Feb 2012) Log Message: ----------- Added Paths: ----------- trunk/plugins/PowerScheduler++/Stable/1.2.2.1/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mic...@us...> - 2012-02-09 16:59:04
|
Revision: 4444 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=4444&view=rev Author: michael-t Date: 2012-02-09 16:58:50 +0000 (Thu, 09 Feb 2012) Log Message: ----------- Version 1.2.5.12 Modified Paths: -------------- trunk/plugins/PowerScheduler++/Test/1.2.5.12/Binaries/Common.Utils.dll trunk/plugins/PowerScheduler++/Test/1.2.5.12/Binaries/Core.dll trunk/plugins/PowerScheduler++/Test/1.2.5.12/Binaries/PluginBase.dll trunk/plugins/PowerScheduler++/Test/1.2.5.12/Binaries/SetupControls.dll trunk/plugins/PowerScheduler++/Test/1.2.5.12/Binaries/TVDatabase.dll trunk/plugins/PowerScheduler++/Test/1.2.5.12/Binaries/TVLibrary.dll trunk/plugins/PowerScheduler++/Test/1.2.5.12/Binaries/TvBusinessLayer.dll trunk/plugins/PowerScheduler++/Test/1.2.5.12/Binaries/TvControl.dll trunk/plugins/PowerScheduler++/Test/1.2.5.12/Binaries/TvLibrary.Interfaces.dll trunk/plugins/PowerScheduler++/Test/1.2.5.12/Binaries/TvService.exe trunk/plugins/PowerScheduler++/Test/1.2.5.12/Binaries/Utils.dll trunk/plugins/PowerScheduler++/Test/1.2.5.12/Common-MP-TVE3/PowerScheduler.Interfaces/Interfaces/IEpgHandler.cs trunk/plugins/PowerScheduler++/Test/1.2.5.12/Common-MP-TVE3/PowerScheduler.Interfaces/Interfaces/IPowerScheduler.cs trunk/plugins/PowerScheduler++/Test/1.2.5.12/Common-MP-TVE3/PowerScheduler.Interfaces/Interfaces/IPowerSettings.cs trunk/plugins/PowerScheduler++/Test/1.2.5.12/Common-MP-TVE3/PowerScheduler.Interfaces/Interfaces/IStandbyHandler.cs trunk/plugins/PowerScheduler++/Test/1.2.5.12/Common-MP-TVE3/PowerScheduler.Interfaces/PowerManager.cs trunk/plugins/PowerScheduler++/Test/1.2.5.12/Common-MP-TVE3/PowerScheduler.Interfaces/PowerScheduler.Interfaces.csproj trunk/plugins/PowerScheduler++/Test/1.2.5.12/Common-MP-TVE3/PowerScheduler.Interfaces/PowerSettings.cs trunk/plugins/PowerScheduler++/Test/1.2.5.12/Common-MP-TVE3/PowerScheduler.Interfaces/WaitableTimer.cs trunk/plugins/PowerScheduler++/Test/1.2.5.12/MPEI/PowerScheduler++.xmp2 trunk/plugins/PowerScheduler++/Test/1.2.5.12/PowerScheduler++.sln trunk/plugins/PowerScheduler++/Test/1.2.5.12/TvEngine3/TVLibrary/Plugins/PowerScheduler/Handlers/RemoteClientStandbyHandler.cs trunk/plugins/PowerScheduler++/Test/1.2.5.12/TvEngine3/TVLibrary/Plugins/PowerScheduler/Handlers/XmlTvImportWakeupHandler.cs trunk/plugins/PowerScheduler++/Test/1.2.5.12/TvEngine3/TVLibrary/Plugins/PowerScheduler/PowerScheduler.cs trunk/plugins/PowerScheduler++/Test/1.2.5.12/TvEngine3/TVLibrary/Plugins/PowerScheduler/PowerScheduler.csproj trunk/plugins/PowerScheduler++/Test/1.2.5.12/TvEngine3/TVLibrary/Plugins/PowerScheduler/PowerSchedulerFactory.cs trunk/plugins/PowerScheduler++/Test/1.2.5.12/TvEngine3/TVLibrary/Plugins/PowerScheduler/PowerSchedulerPlugin.cs trunk/plugins/PowerScheduler++/Test/1.2.5.12/TvEngine3/TVLibrary/Plugins/PowerScheduler/WindowsController.cs trunk/plugins/PowerScheduler++/Test/1.2.5.12/VersionInfo.cs trunk/plugins/PowerScheduler++/Test/1.2.5.12/mediaportal/PowerSchedulerClientPlugin/Handlers/WakeableStandbyHandler.cs trunk/plugins/PowerScheduler++/Test/1.2.5.12/mediaportal/PowerSchedulerClientPlugin/Handlers/WakeableWakeupHandler.cs trunk/plugins/PowerScheduler++/Test/1.2.5.12/mediaportal/PowerSchedulerClientPlugin/PowerScheduler.cs trunk/plugins/PowerScheduler++/Test/1.2.5.12/mediaportal/PowerSchedulerClientPlugin/PowerSchedulerClientPlugin.cs trunk/plugins/PowerScheduler++/Test/1.2.5.12/mediaportal/PowerSchedulerClientPlugin/PowerSchedulerClientPlugin.csproj trunk/plugins/PowerScheduler++/Test/1.2.5.12/mediaportal/PowerSchedulerClientPlugin/UnattendedWindow.cs Added Paths: ----------- trunk/plugins/PowerScheduler++/Test/1.2.5.12/Binaries/PowerScheduler.Interfaces.dll trunk/plugins/PowerScheduler++/Test/1.2.5.12/Binaries/PowerScheduler.dll trunk/plugins/PowerScheduler++/Test/1.2.5.12/Binaries/PowerSchedulerClientPlugin.dll trunk/plugins/PowerScheduler++/Test/1.2.5.12/MPEI/PowerScheduler++ 1.2.5.12.mpe1 trunk/plugins/PowerScheduler++/Test/1.2.5.12/MPEI/update.xml trunk/plugins/PowerScheduler++/Test/1.2.5.12/TvEngine3/TVLibrary/Plugins/PowerScheduler/Handlers/ActiveNetworkStandbyHandler.cs trunk/plugins/PowerScheduler++/Test/1.2.5.12/TvEngine3/TVLibrary/Plugins/PowerScheduler/Handlers/ActiveSharesStandbyHandler.cs trunk/plugins/PowerScheduler++/Test/1.2.5.12/TvEngine3/TVLibrary/Plugins/PowerScheduler/Handlers/ActiveStreamsStandbyHandler.cs trunk/plugins/PowerScheduler++/Test/1.2.5.12/TvEngine3/TVLibrary/Plugins/PowerScheduler/Handlers/ControllerActiveStandbyHandler.cs trunk/plugins/PowerScheduler++/Test/1.2.5.12/TvEngine3/TVLibrary/Plugins/PowerScheduler/Handlers/EpgGrabbingStandbyWakeupHandler.cs trunk/plugins/PowerScheduler++/Test/1.2.5.12/TvEngine3/TVLibrary/Plugins/PowerScheduler/Handlers/LocalClientStandbyHandler.cs trunk/plugins/PowerScheduler++/Test/1.2.5.12/TvEngine3/TVLibrary/Plugins/PowerScheduler/Handlers/LocalClientWakeupHandler.cs trunk/plugins/PowerScheduler++/Test/1.2.5.12/TvEngine3/TVLibrary/Plugins/PowerScheduler/Handlers/PowerControllerStandbyHandler.cs trunk/plugins/PowerScheduler++/Test/1.2.5.12/TvEngine3/TVLibrary/Plugins/PowerScheduler/Handlers/PowerControllerWakeupHandler.cs trunk/plugins/PowerScheduler++/Test/1.2.5.12/TvEngine3/TVLibrary/Plugins/PowerScheduler/Handlers/ProcessActiveStandbyHandler.cs trunk/plugins/PowerScheduler++/Test/1.2.5.12/TvEngine3/TVLibrary/Plugins/PowerScheduler/Handlers/RebootWakeupHandler.cs trunk/plugins/PowerScheduler++/Test/1.2.5.12/TvEngine3/TVLibrary/Plugins/PowerScheduler/Handlers/ScheduledRecordingsWakeupHandler.cs trunk/plugins/PowerScheduler++/Test/1.2.5.12/TvEngine3/TVLibrary/Plugins/PowerScheduler/Setup/ trunk/plugins/PowerScheduler++/Test/1.2.5.12/mediaportal/PowerSchedulerClientPlugin/Handlers/ActiveNetworkStandbyHandler.cs trunk/plugins/PowerScheduler++/Test/1.2.5.12/mediaportal/PowerSchedulerClientPlugin/Handlers/ActiveSharesStandbyHandler.cs trunk/plugins/PowerScheduler++/Test/1.2.5.12/mediaportal/PowerSchedulerClientPlugin/Handlers/ProcessActiveStandbyHandler.cs trunk/plugins/PowerScheduler++/Test/1.2.5.12/mediaportal/PowerSchedulerClientPlugin/Handlers/RebootWakeupHandler.cs trunk/plugins/PowerScheduler++/Test/1.2.5.12/mediaportal/PowerSchedulerClientPlugin/MasterVolume.cs trunk/plugins/PowerScheduler++/Test/1.2.5.12/mediaportal/PowerSchedulerClientPlugin/PowerSchedulerFactory.cs trunk/plugins/PowerScheduler++/Test/1.2.5.12/mediaportal/PowerSchedulerClientPlugin/Setup/ Removed Paths: ------------- trunk/plugins/PowerScheduler++/Test/1.2.5.12/Common-MP-TVE3/PowerScheduler.Interfaces/bin/ trunk/plugins/PowerScheduler++/Test/1.2.5.12/Common-MP-TVE3/PowerScheduler.Interfaces/obj/ trunk/plugins/PowerScheduler++/Test/1.2.5.12/MPEI/PowerScheduler++ 1.1.7.1.mpe1 trunk/plugins/PowerScheduler++/Test/1.2.5.12/TvEngine3/TVLibrary/Plugins/PowerScheduler/Handlers/ActiveNetworkHandler.cs trunk/plugins/PowerScheduler++/Test/1.2.5.12/TvEngine3/TVLibrary/Plugins/PowerScheduler/Handlers/ActiveSharesHandler.cs trunk/plugins/PowerScheduler++/Test/1.2.5.12/TvEngine3/TVLibrary/Plugins/PowerScheduler/Handlers/ActiveStreamsHandler.cs trunk/plugins/PowerScheduler++/Test/1.2.5.12/TvEngine3/TVLibrary/Plugins/PowerScheduler/Handlers/ControllerActiveHandler.cs trunk/plugins/PowerScheduler++/Test/1.2.5.12/TvEngine3/TVLibrary/Plugins/PowerScheduler/Handlers/EpgGrabbingHandler.cs trunk/plugins/PowerScheduler++/Test/1.2.5.12/TvEngine3/TVLibrary/Plugins/PowerScheduler/Handlers/GenericStandbyHandler.cs trunk/plugins/PowerScheduler++/Test/1.2.5.12/TvEngine3/TVLibrary/Plugins/PowerScheduler/Handlers/GenericWakeupHandler.cs trunk/plugins/PowerScheduler++/Test/1.2.5.12/TvEngine3/TVLibrary/Plugins/PowerScheduler/Handlers/ProcessActiveHandler.cs trunk/plugins/PowerScheduler++/Test/1.2.5.12/TvEngine3/TVLibrary/Plugins/PowerScheduler/Handlers/RebootHandler.cs trunk/plugins/PowerScheduler++/Test/1.2.5.12/TvEngine3/TVLibrary/Plugins/PowerScheduler/Handlers/RemoteStandbyHandler.cs trunk/plugins/PowerScheduler++/Test/1.2.5.12/TvEngine3/TVLibrary/Plugins/PowerScheduler/Handlers/RemoteWakeupHandler.cs trunk/plugins/PowerScheduler++/Test/1.2.5.12/TvEngine3/TVLibrary/Plugins/PowerScheduler/Handlers/ScheduledRecordingsHandler.cs trunk/plugins/PowerScheduler++/Test/1.2.5.12/TvEngine3/TVLibrary/Plugins/PowerScheduler/PowerSchedulerMasterSetup.Designer.cs trunk/plugins/PowerScheduler++/Test/1.2.5.12/TvEngine3/TVLibrary/Plugins/PowerScheduler/PowerSchedulerMasterSetup.cs trunk/plugins/PowerScheduler++/Test/1.2.5.12/TvEngine3/TVLibrary/Plugins/PowerScheduler/PowerSchedulerMasterSetup.resx trunk/plugins/PowerScheduler++/Test/1.2.5.12/TvEngine3/TVLibrary/Plugins/PowerScheduler/SelectProcessForm.cs trunk/plugins/PowerScheduler++/Test/1.2.5.12/TvEngine3/TVLibrary/Plugins/PowerScheduler/SelectProcessForm.designer.cs trunk/plugins/PowerScheduler++/Test/1.2.5.12/TvEngine3/TVLibrary/Plugins/PowerScheduler/SelectProcessForm.resx trunk/plugins/PowerScheduler++/Test/1.2.5.12/TvEngine3/TVLibrary/Plugins/PowerScheduler/SelectShareForm.cs trunk/plugins/PowerScheduler++/Test/1.2.5.12/TvEngine3/TVLibrary/Plugins/PowerScheduler/SelectShareForm.designer.cs trunk/plugins/PowerScheduler++/Test/1.2.5.12/TvEngine3/TVLibrary/Plugins/PowerScheduler/SelectShareForm.resx trunk/plugins/PowerScheduler++/Test/1.2.5.12/TvEngine3/TVLibrary/Plugins/PowerScheduler/bin/ trunk/plugins/PowerScheduler++/Test/1.2.5.12/TvEngine3/TVLibrary/Plugins/PowerScheduler/obj/ trunk/plugins/PowerScheduler++/Test/1.2.5.12/mediaportal/PowerSchedulerClientPlugin/PowerSchedulerClientSetup.cs trunk/plugins/PowerScheduler++/Test/1.2.5.12/mediaportal/PowerSchedulerClientPlugin/PowerSchedulerClientSetup.designer.cs trunk/plugins/PowerScheduler++/Test/1.2.5.12/mediaportal/PowerSchedulerClientPlugin/PowerSchedulerClientSetup.resx trunk/plugins/PowerScheduler++/Test/1.2.5.12/mediaportal/PowerSchedulerClientPlugin/bin/ trunk/plugins/PowerScheduler++/Test/1.2.5.12/mediaportal/PowerSchedulerClientPlugin/obj/ Modified: trunk/plugins/PowerScheduler++/Test/1.2.5.12/Binaries/Common.Utils.dll =================================================================== (Binary files differ) Modified: trunk/plugins/PowerScheduler++/Test/1.2.5.12/Binaries/Core.dll =================================================================== (Binary files differ) Modified: trunk/plugins/PowerScheduler++/Test/1.2.5.12/Binaries/PluginBase.dll =================================================================== (Binary files differ) Copied: trunk/plugins/PowerScheduler++/Test/1.2.5.12/Binaries/PowerScheduler.Interfaces.dll (from rev 4442, trunk/plugins/PowerScheduler++/Test/test/Binaries/PowerScheduler.Interfaces.dll) =================================================================== (Binary files differ) Copied: trunk/plugins/PowerScheduler++/Test/1.2.5.12/Binaries/PowerScheduler.dll (from rev 4442, trunk/plugins/PowerScheduler++/Test/test/Binaries/PowerScheduler.dll) =================================================================== (Binary files differ) Copied: trunk/plugins/PowerScheduler++/Test/1.2.5.12/Binaries/PowerSchedulerClientPlugin.dll (from rev 4442, trunk/plugins/PowerScheduler++/Test/test/Binaries/PowerSchedulerClientPlugin.dll) =================================================================== (Binary files differ) Modified: trunk/plugins/PowerScheduler++/Test/1.2.5.12/Binaries/SetupControls.dll =================================================================== (Binary files differ) Modified: trunk/plugins/PowerScheduler++/Test/1.2.5.12/Binaries/TVDatabase.dll =================================================================== (Binary files differ) Modified: trunk/plugins/PowerScheduler++/Test/1.2.5.12/Binaries/TVLibrary.dll =================================================================== (Binary files differ) Modified: trunk/plugins/PowerScheduler++/Test/1.2.5.12/Binaries/TvBusinessLayer.dll =================================================================== (Binary files differ) Modified: trunk/plugins/PowerScheduler++/Test/1.2.5.12/Binaries/TvControl.dll =================================================================== (Binary files differ) Modified: trunk/plugins/PowerScheduler++/Test/1.2.5.12/Binaries/TvLibrary.Interfaces.dll =================================================================== (Binary files differ) Modified: trunk/plugins/PowerScheduler++/Test/1.2.5.12/Binaries/TvService.exe =================================================================== (Binary files differ) Modified: trunk/plugins/PowerScheduler++/Test/1.2.5.12/Binaries/Utils.dll =================================================================== (Binary files differ) Modified: trunk/plugins/PowerScheduler++/Test/1.2.5.12/Common-MP-TVE3/PowerScheduler.Interfaces/Interfaces/IEpgHandler.cs =================================================================== --- trunk/plugins/PowerScheduler++/Test/1.2.5.12/Common-MP-TVE3/PowerScheduler.Interfaces/Interfaces/IEpgHandler.cs 2012-02-09 16:58:34 UTC (rev 4443) +++ trunk/plugins/PowerScheduler++/Test/1.2.5.12/Common-MP-TVE3/PowerScheduler.Interfaces/Interfaces/IEpgHandler.cs 2012-02-09 16:58:50 UTC (rev 4444) @@ -29,7 +29,8 @@ public delegate void EPGScheduleHandler(); /// <summary> - /// Provides access to PowerScheduler's EPG interface for EPG plugins. + /// Provides access to PowerScheduler's EPG interface for + /// EPG plugins. /// </summary> public interface IEpgHandler { Modified: trunk/plugins/PowerScheduler++/Test/1.2.5.12/Common-MP-TVE3/PowerScheduler.Interfaces/Interfaces/IPowerScheduler.cs =================================================================== --- trunk/plugins/PowerScheduler++/Test/1.2.5.12/Common-MP-TVE3/PowerScheduler.Interfaces/Interfaces/IPowerScheduler.cs 2012-02-09 16:58:34 UTC (rev 4443) +++ trunk/plugins/PowerScheduler++/Test/1.2.5.12/Common-MP-TVE3/PowerScheduler.Interfaces/Interfaces/IPowerScheduler.cs 2012-02-09 16:58:50 UTC (rev 4444) @@ -27,7 +27,7 @@ namespace TvEngine.PowerScheduler.Interfaces { /// <summary> - /// EventHandler delegate for PowerScheduler events + /// EvenHandler delegate for PowerScheduler events /// </summary> /// <param name="args"></param> public delegate void PowerSchedulerEventHandler(PowerSchedulerEventArgs args); @@ -114,6 +114,7 @@ void GetCurrentState(bool refresh, out bool unattended, out bool disAllowShutdown, out String disAllowShutdownHandler, out DateTime nextWakeupTime, out String nextWakeupHandler); + /// <summary> /// Checks if a suspend request is in progress /// </summary> Modified: trunk/plugins/PowerScheduler++/Test/1.2.5.12/Common-MP-TVE3/PowerScheduler.Interfaces/Interfaces/IPowerSettings.cs =================================================================== --- trunk/plugins/PowerScheduler++/Test/1.2.5.12/Common-MP-TVE3/PowerScheduler.Interfaces/Interfaces/IPowerSettings.cs 2012-02-09 16:58:34 UTC (rev 4443) +++ trunk/plugins/PowerScheduler++/Test/1.2.5.12/Common-MP-TVE3/PowerScheduler.Interfaces/Interfaces/IPowerSettings.cs 2012-02-09 16:58:50 UTC (rev 4444) @@ -25,27 +25,6 @@ namespace TvEngine.PowerScheduler.Interfaces { /// <summary> - /// PowerScheduler shutdown mode enumeration - /// </summary> - public enum ShutdownMode - { - Sleep, - Hibernate, - StayOn, - ShutDown - } - - /// <summary> - /// PowerScheduler++ standby mode enumeration - /// </summary> - public enum StandbyMode - { - StandbyAllowed, - StandbyPrevented, - AwayModeRequested - } - - /// <summary> /// Provides access to PowerScheduler's settings /// </summary> public interface IPowerSettings @@ -83,20 +62,14 @@ int PreWakeupTime { get; } /// <summary> - /// If WakeupEnabled, the time (in seconds) the system is not allowed to - /// go to shutdown before the next wakeup time - /// </summary> - int PreNoShutdownTime { get; } - - /// <summary> /// Controls the granularity of the standby/wakeup checks in seconds /// </summary> int CheckInterval { get; } /// <summary> - /// <summary> - /// How should put the system into standby? suspend/hibernate/stayon/shutdown - /// suspend uses S3, hibernate uses S4, stayon doesn't do anyting, shutdown uses S5 (soft power off) + /// How should put the system into standby? suspend/hibernate/stayon + /// suspend uses S3, hibernate uses S4, stayon is for debugging purposes and + /// doesn't put the system into standby at all /// </summary> ShutdownMode ShutdownMode { get; } } Modified: trunk/plugins/PowerScheduler++/Test/1.2.5.12/Common-MP-TVE3/PowerScheduler.Interfaces/Interfaces/IStandbyHandler.cs =================================================================== --- trunk/plugins/PowerScheduler++/Test/1.2.5.12/Common-MP-TVE3/PowerScheduler.Interfaces/Interfaces/IStandbyHandler.cs 2012-02-09 16:58:34 UTC (rev 4443) +++ trunk/plugins/PowerScheduler++/Test/1.2.5.12/Common-MP-TVE3/PowerScheduler.Interfaces/Interfaces/IStandbyHandler.cs 2012-02-09 16:58:50 UTC (rev 4444) @@ -46,6 +46,16 @@ } /// <summary> + /// PowerScheduler++ standby mode enumeration + /// </summary> + public enum StandbyMode + { + StandbyAllowed, + StandbyPrevented, + AwayModeRequested + } + + /// <summary> /// Extension to the IStandbyHandler interface for PowerScheduler++ /// </summary> public interface IStandbyHandlerEx : IStandbyHandler Modified: trunk/plugins/PowerScheduler++/Test/1.2.5.12/Common-MP-TVE3/PowerScheduler.Interfaces/PowerManager.cs =================================================================== --- trunk/plugins/PowerScheduler++/Test/1.2.5.12/Common-MP-TVE3/PowerScheduler.Interfaces/PowerManager.cs 2012-02-09 16:58:34 UTC (rev 4443) +++ trunk/plugins/PowerScheduler++/Test/1.2.5.12/Common-MP-TVE3/PowerScheduler.Interfaces/PowerManager.cs 2012-02-09 16:58:50 UTC (rev 4444) @@ -33,13 +33,22 @@ /// </summary> public static class PowerManager { - #region System power constants and enumerations + #region Variables /// <summary> + /// Handle to unregister for power setting change notification + /// </summary> + private static IntPtr _hAwayMode = (IntPtr)null; + + #endregion + + #region System power structures and enumerations + + /// <summary> /// The thread's execution requirements /// </summary> [Flags] - private enum ExecutionState : uint + enum ExecutionState : uint { /// <summary> /// Some error. @@ -76,8 +85,8 @@ /// <summary> /// Flags to register for power setting change notification /// </summary> - private const int DEVICE_NOTIFY_WINDOW_HANDLE = 0x00000000; - private const int DEVICE_NOTIFY_SERVICE_HANDLE = 0x00000001; + const int DEVICE_NOTIFY_WINDOW_HANDLE = 0x00000000; + const int DEVICE_NOTIFY_SERVICE_HANDLE = 0x00000001; /// <summary> /// Constants for power notifications @@ -105,11 +114,6 @@ } /// <summary> - /// Handle to unregister for power setting change notification - /// </summary> - private static IntPtr _hAwayMode = (IntPtr)null; - - /// <summary> /// Guid to register for power setting change notification /// </summary> public static Guid GUID_SYSTEM_AWAYMODE = new Guid("98a7f580-01f7-48aa-9c0f-44352c29e5C0"); @@ -117,88 +121,329 @@ /// <summary> /// System power setting guids /// </summary> - private static Guid NO_SUBGROUP_GUID = new Guid("fea3413e-7e05-4911-9a71-700331f1c294"); - private static Guid GUID_LOCK_CONSOLE_ON_WAKE = new Guid("0e796bdb-100d-47d6-a2d5-f7d2daa51f51"); - private static Guid GUID_SUB_SLEEP = new Guid("238c9fa8-0aad-41ed-83f4-97be242c8f20"); - private static Guid GUID_ALLOW_AWAY_MODE = new Guid("25dfa149-5dd1-4736-b5ab-e8a37b5b8187"); - private static Guid GUID_SLEEP_AFTER = new Guid("29f6c1db-86da-48c5-9fdb-f2b67b1f44da"); - private static Guid GUID_ALLOW_HYBRID_SLEEP = new Guid("94ac6d29-73ce-41a6-809f-6363ba21b47e"); - private static Guid GUID_HIBERNATE_AFTER = new Guid("9d7815a6-7ee4-497e-8888-515a05f02364"); - private static Guid GUID_ALLOW_RTC_WAKE = new Guid("bd3b718a-0680-4d9d-8ab2-e1d2b4ac806d"); - private static Guid GUID_SUB_POWER_BUTTONS_AND_LID = new Guid("4f971e89-eebd-4455-a8de-9e59040e7347"); - private static Guid GUID_LID_CLOSE_ACTION = new Guid("5ca83367-6e45-459f-a27b-476b1d01c936"); - private static Guid GUID_POWER_BUTTON_ACTION = new Guid("7648efa3-dd9c-4e3e-b566-50f929386280"); - private static Guid GUID_SLEEP_BUTTON_ACTION = new Guid("96996bc0-ad50-47ec-923b-6f41874dd9eb"); - private static Guid GUID_SUB_MULTIMEDIA = new Guid("9596fb26-9850-41fd-ac3e-f7c3c00afd4b"); - private static Guid GUID_WHEN_SHARING_MEDIA = new Guid("03680956-93bc-4294-bba6-4e0f09bb717f"); + static Guid NO_SUBGROUP_GUID = new Guid("fea3413e-7e05-4911-9a71-700331f1c294"); + static Guid GUID_LOCK_CONSOLE_ON_WAKE = new Guid("0e796bdb-100d-47d6-a2d5-f7d2daa51f51"); + static Guid GUID_SUB_SLEEP = new Guid("238c9fa8-0aad-41ed-83f4-97be242c8f20"); + static Guid GUID_ALLOW_AWAY_MODE = new Guid("25dfa149-5dd1-4736-b5ab-e8a37b5b8187"); + static Guid GUID_SLEEP_AFTER = new Guid("29f6c1db-86da-48c5-9fdb-f2b67b1f44da"); + static Guid GUID_ALLOW_HYBRID_SLEEP = new Guid("94ac6d29-73ce-41a6-809f-6363ba21b47e"); + static Guid GUID_HIBERNATE_AFTER = new Guid("9d7815a6-7ee4-497e-8888-515a05f02364"); + static Guid GUID_ALLOW_RTC_WAKE = new Guid("bd3b718a-0680-4d9d-8ab2-e1d2b4ac806d"); + static Guid GUID_SUB_POWER_BUTTONS_AND_LID = new Guid("4f971e89-eebd-4455-a8de-9e59040e7347"); + static Guid GUID_LID_CLOSE_ACTION = new Guid("5ca83367-6e45-459f-a27b-476b1d01c936"); + static Guid GUID_POWER_BUTTON_ACTION = new Guid("7648efa3-dd9c-4e3e-b566-50f929386280"); + static Guid GUID_SLEEP_BUTTON_ACTION = new Guid("96996bc0-ad50-47ec-923b-6f41874dd9eb"); + static Guid GUID_SUB_MULTIMEDIA = new Guid("9596fb26-9850-41fd-ac3e-f7c3c00afd4b"); + static Guid GUID_WHEN_SHARING_MEDIA = new Guid("03680956-93bc-4294-bba6-4e0f09bb717f"); /// <summary> - /// System power setting structure + /// Contains information about the power capabilities of the system. /// </summary> - private struct SystemPowerSetting + [StructLayout(LayoutKind.Sequential)] + struct SYSTEM_POWER_CAPABILITIES { - public Guid settingGuid; - public Guid subgroupGuid; + [MarshalAs(UnmanagedType.I1)] + public bool PowerButtonPresent; + [MarshalAs(UnmanagedType.I1)] + public bool SleepButtonPresent; + [MarshalAs(UnmanagedType.I1)] + public bool LidPresent; + [MarshalAs(UnmanagedType.I1)] + public bool SystemS1; + [MarshalAs(UnmanagedType.I1)] + public bool SystemS2; + [MarshalAs(UnmanagedType.I1)] + public bool SystemS3; + [MarshalAs(UnmanagedType.I1)] + public bool SystemS4; + [MarshalAs(UnmanagedType.I1)] + public bool SystemS5; + [MarshalAs(UnmanagedType.I1)] + public bool HiberFilePresent; + [MarshalAs(UnmanagedType.I1)] + public bool FullWake; + [MarshalAs(UnmanagedType.I1)] + public bool VideoDimPresent; + [MarshalAs(UnmanagedType.I1)] + public bool ApmPresent; + [MarshalAs(UnmanagedType.I1)] + public bool UpsPresent; + [MarshalAs(UnmanagedType.I1)] + public bool ThermalControl; + [MarshalAs(UnmanagedType.I1)] + public bool ProcessorThrottle; + public byte ProcessorMinimumThrottle; + public byte ProcessorMaximumThrottle; + [MarshalAs(UnmanagedType.I1)] + public bool FastSystemS4; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)] + public byte[] spare2; + [MarshalAs(UnmanagedType.I1)] + public bool DiskSpinDown; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] + public byte[] spare3; + [MarshalAs(UnmanagedType.I1)] + public bool SystemBatteriesPresent; + [MarshalAs(UnmanagedType.I1)] + public bool BatteriesAreShortTerm; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)] + public BATTERY_REPORTING_SCALE[] BatteryScale; + public SYSTEM_POWER_STATE AcOnlineWake; + public SYSTEM_POWER_STATE SoftLidWake; + public SYSTEM_POWER_STATE RtcWake; + public SYSTEM_POWER_STATE MinimumDeviceWakeState; + public SYSTEM_POWER_STATE DefaultLowLatencyWake; } /// <summary> - /// Array of system power settings (index is SystemPowerSettingsType) + /// Contains the granularity of the battery capacity that is reported by IOCTL_BATTERY_QUERY_STATUS. /// </summary> - static SystemPowerSetting[] SystemPowerSettings = new SystemPowerSetting[] + [StructLayout(LayoutKind.Sequential)] + struct BATTERY_REPORTING_SCALE { - new SystemPowerSetting // LOCK_CONSOLE_ON_WAKE - { - settingGuid = GUID_LOCK_CONSOLE_ON_WAKE, - subgroupGuid = NO_SUBGROUP_GUID, - }, - new SystemPowerSetting // ALLOW_AWAY_MODE - { - settingGuid = GUID_ALLOW_AWAY_MODE, - subgroupGuid = GUID_SUB_SLEEP, - }, - new SystemPowerSetting // SLEEP_AFTER - { - settingGuid = GUID_SLEEP_AFTER, - subgroupGuid = GUID_SUB_SLEEP, - }, - new SystemPowerSetting // ALLOW_HYBRID_SLEEP - { - settingGuid = GUID_ALLOW_HYBRID_SLEEP, - subgroupGuid = GUID_SUB_SLEEP, - }, - new SystemPowerSetting // HIBERNATE_AFTER - { - settingGuid = GUID_HIBERNATE_AFTER, - subgroupGuid = GUID_SUB_SLEEP, - }, - new SystemPowerSetting // ALLOW_RTC_WAKE - { - settingGuid = GUID_ALLOW_RTC_WAKE, - subgroupGuid = GUID_SUB_SLEEP, - }, - new SystemPowerSetting // LID_CLOSE_ACTION - { - settingGuid = GUID_LID_CLOSE_ACTION, - subgroupGuid = GUID_SUB_POWER_BUTTONS_AND_LID, - }, - new SystemPowerSetting // POWER_BUTTON_ACTION - { - settingGuid = GUID_POWER_BUTTON_ACTION, - subgroupGuid = GUID_SUB_POWER_BUTTONS_AND_LID, - }, - new SystemPowerSetting // SLEEP_BUTTON_ACTION - { - settingGuid = GUID_SLEEP_BUTTON_ACTION, - subgroupGuid = GUID_SUB_POWER_BUTTONS_AND_LID, - }, - new SystemPowerSetting // WHEN_SHARING_MEDIA - { - settingGuid = GUID_WHEN_SHARING_MEDIA, - subgroupGuid = GUID_SUB_MULTIMEDIA, - }, - }; + public UInt32 Granularity; + public UInt32 Capacity; + } /// <summary> + /// Contains information about the power status of the system. + /// </summary> + struct SYSTEM_POWER_STATUS + { + public ACLineStatus ACLineStatus; + public BatteryFlag BatteryFlag; + public Byte BatteryLifePercent; + public Byte Reserved1; + public Int32 BatteryLifeTime; + public Int32 BatteryFullLifeTime; + } + + /// <summary> + /// The AC power status. + /// </summary> + enum ACLineStatus : byte + { + Offline = 0, + Online = 1, + Unknown = 255 + } + + /// <summary> + /// The battery charge status. + /// </summary> + enum BatteryFlag : byte + { + High = 1, + Low = 2, + Critical = 4, + Charging = 8, + NoSystemBattery = 128, + Unknown = 255 + } + + /// <summary> + /// Contains information used to set the system power state. + /// </summary> + [StructLayout(LayoutKind.Sequential, Pack=1)] + struct POWER_ACTION_POLICY + { + public POWER_ACTION Action; + public PowerActionFlags Flags; + public PowerActionEventCode EventCode; + } + + /// <summary> + /// Defines values that are used to specify system power action types. + /// </summary> + enum POWER_ACTION : uint + { + PowerActionNone = 0, // No system power action. + PowerActionReserved, // Reserved; do not use. + PowerActionSleep, // Sleep. + PowerActionHibernate, // Hibernate. + PowerActionShutdown, // Shutdown. + PowerActionShutdownReset, // Shutdown and reset. + PowerActionShutdownOff, // Shutdown and power off. + PowerActionWarmEject, // Warm eject. + } + + /// <summary> + /// + /// </summary> + [Flags] + enum PowerActionFlags : uint + { + POWER_ACTION_QUERY_ALLOWED = 0x00000001, // Broadcasts a PBT_APMQUERYSUSPEND event to each application to request permission to suspend operation. + POWER_ACTION_UI_ALLOWED = 0x00000002, // Applications can prompt the user for directions on how to prepare for suspension. Sets bit 0 in the Flags parameter passed in the lParam parameter of WM_POWERBROADCAST. + POWER_ACTION_OVERRIDE_APPS = 0x00000004, // Ignores applications that do not respond to the PBT_APMQUERYSUSPEND event broadcast in the WM_POWERBROADCAST message. + POWER_ACTION_LIGHTEST_FIRST = 0x10000000, // Uses the first lightest available sleep state. + POWER_ACTION_LOCK_CONSOLE = 0x20000000, // Requires entry of the system password upon resume from one of the system standby states. + POWER_ACTION_DISABLE_WAKES = 0x40000000, // Disables all wake events. + POWER_ACTION_CRITICAL = 0x80000000, // Forces a critical suspension. + } + + [Flags] + enum PowerActionEventCode : uint + { + POWER_LEVEL_USER_NOTIFY_TEXT = 0x00000001, // User notified using the UI. + POWER_LEVEL_USER_NOTIFY_SOUND = 0x00000002, // User notified using sound. + POWER_LEVEL_USER_NOTIFY_EXEC = 0x00000004, // Specifies a program to be executed. + POWER_USER_NOTIFY_BUTTON = 0x00000008, // Indicates that the power action is in response to a user power button press. + POWER_USER_NOTIFY_SHUTDOWN = 0x00000010, // Indicates a power action of shutdown/off. + POWER_FORCE_TRIGGER_RESET = 0x80000000, // Clears a user power button press. + } + + /// <summary> + /// The global flags constants are used to enable or disable user power policy options + /// </summary> + [Flags] + enum GlobalFlags : uint + { + EnableMultiBatteryDisplay = 0x02, // Enables or disables multiple battery display in the system Power Meter. + EnablePasswordLogon = 0x04, // Enables or disables requiring password logon when the system resumes from standby or hibernate. + EnableSysTrayBatteryMeter = 0x01, // Enables or disables the battery meter icon in the system tray. When this flag is cleared, the battery meter icon is not displayed. + EnableVideoDimDisplay = 0x10, // Enables or disables support for dimming the video display when the system changes from running on AC power to running on battery power. + EnableWakeOnRing = 0x08, // Enables or disables wake on ring support. + } + + /// <summary> + /// Contains power policy settings that are unique to each power scheme. + /// </summary> + struct POWER_POLICY + { + public USER_POWER_POLICY user; + public MACHINE_POWER_POLICY mach; + } + + /// <summary> + /// Contains power policy settings that are unique to each power scheme for a user. + /// </summary> + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)] + struct USER_POWER_POLICY { + public uint Revision; + public POWER_ACTION_POLICY IdleAc; + public POWER_ACTION_POLICY IdleDc; + public uint IdleTimeoutAc; + public uint IdleTimeoutDc; + public byte IdleSensitivityAc; + public byte IdleSensitivityDc; + public byte ThrottlePolicyAc; + public byte ThrottlePolicyDc; + public SYSTEM_POWER_STATE MaxSleepAc; + public SYSTEM_POWER_STATE MaxSleepDc; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)] + public uint[] Reserved; + public uint VideoTimeoutAc; + public uint VideoTimeoutDc; + public uint SpindownTimeoutAc; + public uint SpindownTimeoutDc; + [MarshalAs(UnmanagedType.I1)] + public bool OptimizeForPowerAc; + [MarshalAs(UnmanagedType.I1)] + public bool OptimizeForPowerDc; + public byte FanThrottleToleranceAc; + public byte FanThrottleToleranceDc; + public byte ForcedThrottleAc; + public byte ForcedThrottleDc; + } + + /// <summary> + /// Contains computer power policy settings that are unique to each power scheme on the computer. + /// </summary> + struct MACHINE_POWER_POLICY { + public uint Revision; + public SYSTEM_POWER_STATE MinSleepAc; + public SYSTEM_POWER_STATE MinSleepDc; + public SYSTEM_POWER_STATE ReducedLatencySleepAc; + public SYSTEM_POWER_STATE ReducedLatencySleepDc; + public uint DozeTimeoutAc; + public uint DozeTimeoutDc; + public uint DozeS4TimeoutAc; + public uint DozeS4TimeoutDc; + public byte MinThrottleAc; + public byte MinThrottleDc; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)] + public byte[] pad1; + public POWER_ACTION_POLICY OverThrottledAc; + public POWER_ACTION_POLICY OverThrottledDc; + } + + /// <summary> + /// Contains global power policy settings that apply to all power schemes. + /// </summary> + [StructLayout(LayoutKind.Sequential, Pack = 1)] + struct GLOBAL_POWER_POLICY + { + public GLOBAL_USER_POWER_POLICY user; + public GLOBAL_MACHINE_POWER_POLICY mach; + } + + /// <summary> + /// Contains global user power policy settings that apply to all power schemes for a user. + /// </summary> + [StructLayout(LayoutKind.Sequential, Pack = 1)] + struct GLOBAL_USER_POWER_POLICY + { + public const int NUM_DISCHARGE_POLICIES = 4; + + public uint Revision; + public POWER_ACTION_POLICY PowerButtonAc; + public POWER_ACTION_POLICY PowerButtonDc; + public POWER_ACTION_POLICY SleepButtonAc; + public POWER_ACTION_POLICY SleepButtonDc; + public POWER_ACTION_POLICY LidCloseAc; + public POWER_ACTION_POLICY LidCloseDc; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = NUM_DISCHARGE_POLICIES)] + public SYSTEM_POWER_LEVEL[] DischargePolicy; + public GlobalFlags GlobalFlags; + } + + /// <summary> + /// Contains information about system battery drain policy settings. + /// </summary> + [StructLayout(LayoutKind.Sequential, Pack = 1)] + struct SYSTEM_POWER_LEVEL + { + public bool Enable; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)] + public byte[] Spare; + public uint BatteryLevel; + public POWER_ACTION_POLICY PowerPolicy; + public SYSTEM_POWER_STATE MinSystemState; + } + + /// <summary> + /// Contains global computer power policy settings that apply to all power schemes for all users. + /// </summary> + [StructLayout(LayoutKind.Sequential, Pack = 1)] + struct GLOBAL_MACHINE_POWER_POLICY + { + public uint Revision; + public SYSTEM_POWER_STATE LidOpenWakeAc; + public SYSTEM_POWER_STATE LidOpenWakeDc; + public uint BroadcastCapacityResolution; + } + + /// <summary> + /// Defines values that are used to specify system power states. + /// </summary> + enum SYSTEM_POWER_STATE + { + PowerSystemUnspecified = 0, + PowerSystemWorking = 1, + PowerSystemSleeping1 = 2, + PowerSystemSleeping2 = 3, + PowerSystemSleeping3 = 4, + PowerSystemHibernate = 5, + PowerSystemShutdown = 6, + PowerSystemMaximum = 7 + } + + #endregion + + #region Public methods + + /// <summary> /// Power setting type (index to PowerSettings) /// </summary> public enum SystemPowerSettingType @@ -214,15 +459,10 @@ SLEEP_BUTTON_ACTION, WHEN_SHARING_MEDIA } - - #endregion - - #region Public power management methods - + /// <summary> /// Reset the system idle timeout to prevent standby /// </summary> - /// <returns>bool indicating whether or not standby is prevented</returns> public static void ResetIdleTimer() { // ES_SYSTEM_REQUIRED without ES_CONTINUOS resets the idle timeout @@ -273,65 +513,44 @@ } /// <summary> - /// Retrieves guid of active power scheme + /// Get power setting value for active power status (OS independent) /// </summary> - /// <returns>Active power scheme guid</returns> - public static Guid GetActivePowerScheme() + /// <param name="settingType"></param> + /// <returns>Returns value of power setting requested. Returns 0 on errors.</returns> + public static int GetActivePowerSetting(SystemPowerSettingType settingType) { - try - { - IntPtr ptr = IntPtr.Zero; - PowerGetActiveScheme(IntPtr.Zero, ref ptr); - Guid activePowerScheme = (Guid)Marshal.PtrToStructure(ptr, typeof(Guid)); - return activePowerScheme; - } - catch (Exception) { } - - return Guid.Empty; + if (Environment.OSVersion.Version.Major >= 6) + return GetSystemPowerSetting(settingType, ACPowerPluggedIn); + else + return GetPowerPolicySetting(settingType, ACPowerPluggedIn); } /// <summary> - /// Get system power setting + /// Get power setting value for indicated power status (OS independent) /// </summary> - /// <param name="scheme"></param> /// <param name="settingType"></param> - /// <returns>System power setting AC value</returns> - public static UInt32 GetSystemPowerSetting(Guid scheme, SystemPowerSettingType settingType) + /// <param name="AC"></param> + /// <returns>Returns value of power setting requested. Returns 0 on errors.</returns> + public static int GetPowerSetting(SystemPowerSettingType settingType, bool AC) { - UInt32 systemPowerSetting = 0; - - try - { - SystemPowerSetting ps = SystemPowerSettings[(int)settingType]; - systemPowerSetting = ReadACPowerValueIndex(scheme, ps.subgroupGuid, ps.settingGuid); - } - catch (Exception) { } - - return systemPowerSetting; + if (Environment.OSVersion.Version.Major >= 6) + return GetSystemPowerSetting(settingType, AC); + else + return GetPowerPolicySetting(settingType, AC); } /// <summary> - /// Set system power setting AC and DC value + /// Set power setting value (OS independent) /// </summary> - /// <param name="scheme"></param> /// <param name="settingType"></param> + /// <param name="AC"></param> /// <param name="value"></param> - public static void SetSystemPowerSetting(Guid scheme, SystemPowerSettingType settingType, UInt32 value) + public static void SetPowerSetting(SystemPowerSettingType settingType, bool AC, uint value) { - UInt32 systemPowerSetting; - - try - { - SystemPowerSetting ps = SystemPowerSettings[(int)settingType]; - systemPowerSetting = ReadACPowerValueIndex(scheme, ps.subgroupGuid, ps.settingGuid); - if (systemPowerSetting != value) - WriteACPowerValueIndex(scheme, ps.subgroupGuid, ps.settingGuid, value); - systemPowerSetting = ReadDCPowerValueIndex(scheme, ps.subgroupGuid, ps.settingGuid); - if (systemPowerSetting != value) - WriteDCPowerValueIndex(scheme, ps.subgroupGuid, ps.settingGuid, value); - } - catch (Exception) { } - + if (Environment.OSVersion.Version.Major >= 6) + SetSystemPowerSetting(settingType, AC, value); + else + SetPowerPolicySetting(settingType, AC, value); } /// <summary> @@ -357,6 +576,94 @@ #endregion + #region Public properties + + /// <summary> + /// Check if running on AC Power + /// </summary> + /// <returns>Returns true if running on AC Power</returns> + public static bool RunningOnAC + { + get + { + SYSTEM_POWER_STATUS sps = new SYSTEM_POWER_STATUS(); + try + { + GetSystemPowerStatus(ref sps); + return (sps.ACLineStatus != ACLineStatus.Offline); + } + catch (Exception) + { + return true; // Fallback: running on AC power + } + } + } + + /// <summary> + /// Check DC Power source + /// </summary> + /// <returns>Returns true if there is a DC Power source</returns> + public static bool HasDCPowerSource + { + get + { + SYSTEM_POWER_STATUS sps = new SYSTEM_POWER_STATUS(); + try + { + GetSystemPowerStatus(ref sps); + return (((byte)sps.BatteryFlag & (byte)BatteryFlag.NoSystemBattery) == 0); + } + catch (Exception) + { + return false; // Fallback: no DC power source + } + } + } + + /// <summary> + /// Check system lid + /// </summary> + /// <returns>Returns true if lid is present</returns> + public static bool HasLid + { + get + { + SYSTEM_POWER_CAPABILITIES spc = new SYSTEM_POWER_CAPABILITIES(); + try + { + GetPwrCapabilities(ref spc); + return (spc.LidPresent); + } + catch (Exception) + { + return false; // Fallback: No lid + } + } + } + + /// <summary> + /// Check if system can hibernate + /// </summary> + /// <returns>Returns true if lid is present</returns> + public static bool CanHibernate + { + get + { + SYSTEM_POWER_CAPABILITIES spc = new SYSTEM_POWER_CAPABILITIES(); + try + { + GetPwrCapabilities(ref spc); + return (spc.SystemS4 && spc.HiberFilePresent); + } + catch (Exception) + { + return false; // Fallback: Cannot hibernate + } + } + } + + #endregion + #region System power management functions imports /// <summary> @@ -391,10 +698,26 @@ private static extern bool UnregisterPowerSettingNotification(IntPtr handle); /// <summary> + /// Retrieves the power status of the system. + /// </summary> + /// <param name="__out LPSYSTEM_POWER_STATUS lpSystemPowerStatus">A pointer to a SYSTEM_POWER_STATUS structure that receives status information.</param> + /// <returns></returns> + [DllImport("kernel32.dll", SetLastError = true)] + private static extern bool GetSystemPowerStatus(ref SYSTEM_POWER_STATUS lpSystemPowerStatus); + + /// <summary> + /// Retrieves information about the system power capabilities. + /// </summary> + /// <param name="__out PSYSTEM_POWER_CAPABILITIES lpSystemPowerCapabilities"></param> + /// <returns></returns> + [DllImport("powrprof.dll", SetLastError = true)] + static extern bool GetPwrCapabilities(ref SYSTEM_POWER_CAPABILITIES lpSystemPowerCapabilities); + + /// <summary> /// Retrieves the active power scheme and returns a GUID that identifies the scheme. /// </summary> - /// <param name="userRootPowerKey"></param> - /// <param name="activePolicyGuid"></param> + /// <param name="__in_opt HKEY UserRootPowerKey">This parameter is reserved for future use and must be set to NULL.</param> + /// <param name="__out GUID **ActivePolicyGuid">A pointer that receives a pointer to a GUID structure. Use the LocalFree function to free this memory.</param> /// <returns></returns> [DllImport("powrprof.dll", SetLastError = true)] private static extern UInt32 PowerGetActiveScheme(IntPtr RootPowerKey, ref IntPtr activePolicyGuid); @@ -441,91 +764,505 @@ /// <summary> /// Writes the DC index of the specified power setting. /// </summary> - /// <param name="rootPowerKey"></param> - /// <param name="schemeGuid"></param> - /// <param name="subgroupOfPowerSettingsGuid"></param> - /// <param name="powerSettingGuid"></param> - /// <param name="valueIndex"></param> + /// <param name="__in_opt HKEY RootPowerKey"></param> + /// <param name="__in const GUID *SchemeGuid"></param> + /// <param name="__in_opt const GUID *SubGroupOfPowerSettingsGuid"></param> + /// <param name="__in_opt const GUID *PowerSettingGuid"></param> + /// <param name="__in DWORD DcValueIndex"></param> /// <returns></returns> [DllImport("powrprof.dll", SetLastError = true)] private static extern UInt32 PowerWriteDCValueIndex(IntPtr RootPowerKey, ref Guid SchemeGuid, ref Guid SubGroupOfPowerSettingsGuid, ref Guid PowerSettingGuid, UInt32 DcValueIndex); + [DllImport("powrprof.dll", SetLastError = true)] + private static extern bool GetCurrentPowerPolicies(ref GLOBAL_POWER_POLICY pGlobalPowerPolicy, ref POWER_POLICY pPowerPolicy); + + [DllImport("powrprof.dll", SetLastError = true)] + private static extern bool GetActivePwrScheme(ref UInt32 puiID); + + [DllImport("powrprof.dll", SetLastError = true)] + private static extern bool SetActivePwrScheme(uint uiID, ref GLOBAL_POWER_POLICY lpGlobalPowerPolicy, ref POWER_POLICY lpPowerPolicy); + #endregion - #region Private power management wrapper methods + #region Private power management helper methods /// <summary> - /// Wrapper for PowerReadACValueIndex + /// System power setting structure /// </summary> - /// <param name="schemeGuid"></param> - /// <param name="subgroupGuid"></param> - /// <param name="settingGuid"></param> - /// <returns></returns> - private static UInt32 ReadACPowerValueIndex(Guid schemeGuid, Guid subgroupGuid, Guid settingGuid) + struct SystemPowerSetting { - UInt32 value = 0; + public Guid settingGuid; + public Guid subgroupGuid; + } + + /// <summary> + /// Array of system power settings (index is SystemPowerSettingsType) + /// </summary> + static SystemPowerSetting[] SystemPowerSettings = new SystemPowerSetting[] + { + new SystemPowerSetting // LOCK_CONSOLE_ON_WAKE + { + settingGuid = GUID_LOCK_CONSOLE_ON_WAKE, + subgroupGuid = NO_SUBGROUP_GUID, + }, + new SystemPowerSetting // ALLOW_AWAY_MODE + { + settingGuid = GUID_ALLOW_AWAY_MODE, + subgroupGuid = GUID_SUB_SLEEP, + }, + new SystemPowerSetting // SLEEP_AFTER + { + settingGuid = GUID_SLEEP_AFTER, + subgroupGuid = GUID_SUB_SLEEP, + }, + new SystemPowerSetting // ALLOW_HYBRID_SLEEP + { + settingGuid = GUID_ALLOW_HYBRID_SLEEP, + subgroupGuid = GUID_SUB_SLEEP, + }, + new SystemPowerSetting // HIBERNATE_AFTER + { + settingGuid = GUID_HIBERNATE_AFTER, + subgroupGuid = GUID_SUB_SLEEP, + }, + new SystemPowerSetting // ALLOW_RTC_WAKE + { + settingGuid = GUID_ALLOW_RTC_WAKE, + subgroupGuid = GUID_SUB_SLEEP, + }, + new SystemPowerSetting // LID_CLOSE_ACTION + { + settingGuid = GUID_LID_CLOSE_ACTION, + subgroupGuid = GUID_SUB_POWER_BUTTONS_AND_LID, + }, + new SystemPowerSetting // POWER_BUTTON_ACTION + { + settingGuid = GUID_POWER_BUTTON_ACTION, + subgroupGuid = GUID_SUB_POWER_BUTTONS_AND_LID, + }, + new SystemPowerSetting // SLEEP_BUTTON_ACTION + { + settingGuid = GUID_SLEEP_BUTTON_ACTION, + subgroupGuid = GUID_SUB_POWER_BUTTONS_AND_LID, + }, + new SystemPowerSetting // WHEN_SHARING_MEDIA + { + settingGuid = GUID_WHEN_SHARING_MEDIA, + subgroupGuid = GUID_SUB_MULTIMEDIA, + }, + }; + + /// <summary> + /// Check AC power status + /// </summary> + /// <returns>Returns true if AC power is plugged in</returns> + private static bool ACPowerPluggedIn + { + get + { + SYSTEM_POWER_STATUS sps = new SYSTEM_POWER_STATUS(); + try + { + GetSystemPowerStatus(ref sps); + return (sps.ACLineStatus == ACLineStatus.Online); + } + catch (Exception) + { + return true; // Fallback: AC power is plugged in + } + } + } + + /// <summary> + /// Get system power setting for indicated power status (Vista / Windows 7) + /// </summary> + /// <param name="settingType"></param> + /// <returns>Returns value of power setting requested. Returns -1 on errors.</returns> + private static int GetSystemPowerSetting(SystemPowerSettingType settingType, bool AC) + { try { - PowerReadACValueIndex(IntPtr.Zero, ref schemeGuid, ref subgroupGuid, ref settingGuid, ref value); + IntPtr ptr = IntPtr.Zero; + Guid scheme; + UInt32 value = 0; + UInt32 success; + + PowerGetActiveScheme(IntPtr.Zero, ref ptr); + scheme = (Guid)Marshal.PtrToStructure(ptr, typeof(Guid)); + SystemPowerSetting ps = SystemPowerSettings[(int)settingType]; + if (AC) + success = PowerReadACValueIndex(IntPtr.Zero, ref scheme, ref ps.subgroupGuid, ref ps.settingGuid, ref value); + else + success = PowerReadDCValueIndex(IntPtr.Zero, ref scheme, ref ps.subgroupGuid, ref ps.settingGuid, ref value); + if (success == 0) + return (int)value; + return -1; } - catch (Exception) { } - - return value; + catch (Exception) + { + return -1; + } } /// <summary> - /// Wrapper for PowerWriteACValueIndex + /// Set system power setting value for indicated power status /// </summary> - /// <param name="schemeGuid"></param> - /// <param name="subgroupGuid"></param> - /// <param name="settingGuid"></param> + /// <param name="settingType"></param> + /// <param name="AC"></param> /// <param name="value"></param> - private static void WriteACPowerValueIndex(Guid schemeGuid, Guid subgroupGuid, Guid settingGuid, UInt32 value) + private static void SetSystemPowerSetting(SystemPowerSettingType settingType, bool AC, uint value) { try { - PowerWriteACValueIndex(IntPtr.Zero, ref schemeGuid, ref subgroupGuid, ref settingGuid, value); + IntPtr ptr = IntPtr.Zero; + PowerGetActiveScheme(IntPtr.Zero, ref ptr); + Guid scheme = (Guid)Marshal.PtrToStructure(ptr, typeof(Guid)); + + SystemPowerSetting ps = SystemPowerSettings[(int)settingType]; + if (AC) + PowerWriteACValueIndex(IntPtr.Zero, ref scheme, ref ps.subgroupGuid, ref ps.settingGuid, value); + else + PowerWriteDCValueIndex(IntPtr.Zero, ref scheme, ref ps.subgroupGuid, ref ps.settingGuid, value); } catch (Exception) { } } /// <summary> - /// Wrapper for PowerReadDCValueIndex + /// Get power policy setting for indicated power status (Windows XP) /// </summary> - /// <param name="schemeGuid"></param> - /// <param name="subgroupGuid"></param> - /// <param name="settingGuid"></param> + /// <param name="settingType">Returns value of power setting requested. Returns -1 on errors.</param> /// <returns></returns> - private static UInt32 ReadDCPowerValueIndex(Guid schemeGuid, Guid subgroupGuid, Guid settingGuid) + private static int GetPowerPolicySetting(SystemPowerSettingType settingType, bool AC) { - UInt32 value = 0; try { - PowerReadDCValueIndex(IntPtr.Zero, ref schemeGuid, ref subgroupGuid, ref settingGuid, ref value); + GLOBAL_POWER_POLICY gpp = new GLOBAL_POWER_POLICY(); + POWER_POLICY pp = new POWER_POLICY(); + POWER_ACTION action; + PowerActionEventCode eventCode; + + if (!GetCurrentPowerPolicies(ref gpp, ref pp)) + { + return -1; + } + + switch (settingType) + { + case SystemPowerSettingType.STANDBYIDLE: + if (AC) + { + if (pp.user.IdleAc.Action == POWER_ACTION.PowerActionSleep) + return (int)pp.user.IdleTimeoutAc; + } + else + { + if (pp.user.IdleDc.Action == POWER_ACTION.PowerActionSleep) + return (int)pp.user.IdleTimeoutDc; + } + return 0; + + case SystemPowerSettingType.HIBERNATE_AFTER: + if (AC) + { + if (pp.user.IdleAc.Action == POWER_ACTION.PowerActionHibernate) + return (int)pp.user.IdleTimeoutAc; + if (pp.mach.DozeS4TimeoutAc != 0) + return (int)(pp.mach.DozeS4TimeoutAc + pp.user.IdleTimeoutAc); + } + else + { + if (pp.user.IdleDc.Action == POWER_ACTION.PowerActionHibernate) + return (int)pp.user.IdleTimeoutDc; + if (pp.mach.DozeS4TimeoutDc != 0) + return (int)(pp.mach.DozeS4TimeoutDc + pp.user.IdleTimeoutDc); + } + return 0; + + case SystemPowerSettingType.LID_CLOSE_ACTION: + if (AC) + { + action = gpp.user.LidCloseAc.Action; + eventCode = gpp.user.LidCloseAc.EventCode; + } + else + { + action = gpp.user.LidCloseDc.Action; + eventCode = gpp.user.LidCloseDc.EventCode; + } + switch (action) + { + case POWER_ACTION.PowerActionSleep: + return 1; // Sleep + case POWER_ACTION.PowerActionHibernate: + return 2; // Hibernate + default: + if ((eventCode & PowerActionEventCode.POWER_USER_NOTIFY_SHUTDOWN) != 0) + return 3; // Shutdown + if ((eventCode & PowerActionEventCode.POWER_USER_NOTIFY_BUTTON) != 0) + return 4; // Ask User + return 0; //Do nothing + } + + case SystemPowerSettingType.POWER_BUTTON_ACTION: + if (AC) + { + action = gpp.user.PowerButtonAc.Action; + eventCode = gpp.user.PowerButtonAc.EventCode; + } + else + { + action = gpp.user.PowerButtonDc.Action; + eventCode = gpp.user.PowerButtonDc.EventCode; + } + switch (action) + { + case POWER_ACTION.PowerActionSleep: + return 1; // Sleep + case POWER_ACTION.PowerActionHibernate: + return 2; // Hibernate + default: + if ((eventCode & PowerActionEventCode.POWER_USER_NOTIFY_SHUTDOWN) != 0) + return 3; // Shutdown + if ((eventCode & PowerActionEventCode.POWER_USER_NOTIFY_BUTTON) != 0) + return 4; // Ask User + return 0; //Do nothing + } + + case SystemPowerSettingType.SLEEP_BUTTON_ACTION: + if (AC) + { + action = gpp.user.SleepButtonAc.Action; + eventCode = gpp.user.SleepButtonAc.EventCode; + } + else + { + action = gpp.user.SleepButtonDc.Action; + eventCode = gpp.user.SleepButtonDc.EventCode; + } + switch (action) + { + case POWER_ACTION.PowerActionSleep: + return 1; // Sleep + case POWER_ACTION.PowerActionHibernate: + return 2; // Hibernate + default: + if ((eventCode & PowerActionEventCode.POWER_USER_NOTIFY_SHUTDOWN) != 0) + return 3; // Shutdown + if ((eventCode & PowerActionEventCode.POWER_USER_NOTIFY_BUTTON) != 0) + return 4; // Ask User + return 0; //Do nothing + } + + default: + return 0; + } } - catch (Exception) { } - - return value; + catch (Exception) + { + return -1; + } } /// <summary> - /// Wrapper for PowerWriteDCValueIndex + /// Set power policy setting value for indicated power status (Windows XP) /// </summary> - /// <param name="schemeGuid"></param> - /// <param name="subgroupGuid"></param> - /// <param name="settingGuid"></param> + /// <param name="settingType"></param> + /// <param name="AC"></param> /// <param name="value"></param> - private static void WriteDCPowerValueIndex(Guid schemeGuid, Guid subgroupGuid, Guid settingGuid, UInt32 value) + private static void SetPowerPolicySetting(SystemPowerSettingType settingType, bool AC, uint value) { try { - PowerWriteDCValueIndex(IntPtr.Zero, ref schemeGuid, ref subgroupGuid, ref settingGuid, value); + GLOBAL_POWER_POLICY gpp = new GLOBAL_POWER_POLICY(); + POWER_POLICY pp = new POWER_POLICY(); + UInt32 index = 0; + POWER_ACTION action; + PowerActionEventCode eventCode; + + if (!GetCurrentPowerPolicies(ref gpp, ref pp)) + return; + + GetActivePwrScheme(ref index); + + switch (settingType) + { + case SystemPowerSettingType.STANDBYIDLE: + if (AC) + { + pp.user.IdleTimeoutAc = value; + if (value == 0 && pp.mach.DozeS4TimeoutAc != 0) + pp.user.IdleAc.Action = POWER_ACTION.PowerActionHibernate; + else + pp.user.IdleAc.Action = POWER_ACTION.PowerActionSleep; + } + else + { + pp.user.IdleTimeoutDc = value; + if (value == 0 && pp.mach.DozeS4TimeoutDc != 0) + pp.user.IdleDc.Action = POWER_ACTION.PowerActionHibernate; + else + pp.user.IdleDc.Action = POWER_ACTION.PowerActionSleep; + } + break; + + case SystemPowerSettingType.HIBERNATE_AFTER: + if (AC) + { + if (pp.user.IdleTimeoutAc == 0) + { + pp.user.IdleTimeoutAc = value; + pp.mach.DozeS4TimeoutAc = 0; + pp.user.IdleAc.Action = POWER_ACTION.PowerActionHibernate; + } + else + { + if (value > pp.user.IdleTimeoutAc) + pp.mach.DozeS4TimeoutAc = value - pp.user.IdleTimeoutAc; + else + pp.mach.DozeS4TimeoutAc = value; + pp.user.IdleAc.Action = POWER_ACTION.PowerActionSleep; + } + } + else + { + if (pp.user.IdleTimeoutDc == 0) + { + pp.user.IdleTimeoutDc = value; + pp.mach.DozeS4TimeoutDc = 0; + pp.user.IdleDc.Action = POWER_ACTION.PowerActionHibernate; + } + else + { + if (value > pp.user.IdleTimeoutDc) + pp.mach.DozeS4TimeoutDc = value - pp.user.IdleTimeoutDc; + else + pp.mach.DozeS4TimeoutDc = value; + pp.user.IdleDc.Action = POWER_ACTION.PowerActionSleep; + } + } + break; + + case SystemPowerSettingType.LID_CLOSE_ACTION: + eventCode = 0; + switch (value) + { + case 0: // Do nothing + action = POWER_ACTION.PowerActionNone; + eventCode = PowerActionEventCode.POWER_FORCE_TRIGGER_RESET; + break; + case 1: // Sleep + action = POWER_ACTION.PowerActionSleep; + break; + case 2: // Hibernate + action = POWER_ACTION.PowerActionHibernate; + break; + case 3: // Shutdown + action = POWER_ACTION.PowerActionNone; + eventCode = PowerActionEventCode.POWER_USER_NOTIFY_SHUTDOWN; + break; + case 4: // Ask User + action = POWER_ACTION.PowerActionNone; + eventCode = PowerActionEventCode.POWER_USER_NOTIFY_BUTTON; + break; + default: + return; + } + if (AC) + { + gpp.user.LidCloseAc.Action = action; + gpp.user.LidCloseAc.EventCode = eventCode; + } + else + { + gpp.user.LidCloseDc.Action = action; + gpp.user.LidCloseDc.EventCode = eventCo... [truncated message content] |
From: <mic...@us...> - 2012-02-09 16:58:44
|
Revision: 4443 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=4443&view=rev Author: michael-t Date: 2012-02-09 16:58:34 +0000 (Thu, 09 Feb 2012) Log Message: ----------- Added Paths: ----------- trunk/plugins/PowerScheduler++/Stable/test/ trunk/plugins/PowerScheduler++/Stable/test/Binaries/ trunk/plugins/PowerScheduler++/Stable/test/Binaries/Common.Utils.dll trunk/plugins/PowerScheduler++/Stable/test/Binaries/Core.dll trunk/plugins/PowerScheduler++/Stable/test/Binaries/Gentle.Common.dll trunk/plugins/PowerScheduler++/Stable/test/Binaries/Gentle.Framework.dll trunk/plugins/PowerScheduler++/Stable/test/Binaries/PluginBase.dll trunk/plugins/PowerScheduler++/Stable/test/Binaries/SetupControls.dll trunk/plugins/PowerScheduler++/Stable/test/Binaries/TVDatabase.dll trunk/plugins/PowerScheduler++/Stable/test/Binaries/TVLibrary.dll trunk/plugins/PowerScheduler++/Stable/test/Binaries/TvBusinessLayer.dll trunk/plugins/PowerScheduler++/Stable/test/Binaries/TvControl.dll trunk/plugins/PowerScheduler++/Stable/test/Binaries/TvLibrary.Interfaces.dll trunk/plugins/PowerScheduler++/Stable/test/Binaries/TvService.exe trunk/plugins/PowerScheduler++/Stable/test/Binaries/Utils.dll trunk/plugins/PowerScheduler++/Stable/test/CleanupFiles.bat trunk/plugins/PowerScheduler++/Stable/test/Common-MP-TVE3/ trunk/plugins/PowerScheduler++/Stable/test/Common-MP-TVE3/PowerScheduler.Interfaces/ trunk/plugins/PowerScheduler++/Stable/test/Common-MP-TVE3/PowerScheduler.Interfaces/EPGWakeupConfig.cs trunk/plugins/PowerScheduler++/Stable/test/Common-MP-TVE3/PowerScheduler.Interfaces/Interfaces/ trunk/plugins/PowerScheduler++/Stable/test/Common-MP-TVE3/PowerScheduler.Interfaces/Interfaces/IEpgHandler.cs trunk/plugins/PowerScheduler++/Stable/test/Common-MP-TVE3/PowerScheduler.Interfaces/Interfaces/IPowerController.cs trunk/plugins/PowerScheduler++/Stable/test/Common-MP-TVE3/PowerScheduler.Interfaces/Interfaces/IPowerScheduler.cs trunk/plugins/PowerScheduler++/Stable/test/Common-MP-TVE3/PowerScheduler.Interfaces/Interfaces/IPowerSettings.cs trunk/plugins/PowerScheduler++/Stable/test/Common-MP-TVE3/PowerScheduler.Interfaces/Interfaces/IStandbyHandler.cs trunk/plugins/PowerScheduler++/Stable/test/Common-MP-TVE3/PowerScheduler.Interfaces/Interfaces/IWakeupHandler.cs trunk/plugins/PowerScheduler++/Stable/test/Common-MP-TVE3/PowerScheduler.Interfaces/PowerManager.cs trunk/plugins/PowerScheduler++/Stable/test/Common-MP-TVE3/PowerScheduler.Interfaces/PowerScheduler.Interfaces.csproj trunk/plugins/PowerScheduler++/Stable/test/Common-MP-TVE3/PowerScheduler.Interfaces/PowerSchedulerEventArgs.cs trunk/plugins/PowerScheduler++/Stable/test/Common-MP-TVE3/PowerScheduler.Interfaces/PowerSettings.cs trunk/plugins/PowerScheduler++/Stable/test/Common-MP-TVE3/PowerScheduler.Interfaces/Properties/ trunk/plugins/PowerScheduler++/Stable/test/Common-MP-TVE3/PowerScheduler.Interfaces/Properties/AssemblyInfo.cs trunk/plugins/PowerScheduler++/Stable/test/Common-MP-TVE3/PowerScheduler.Interfaces/RemotePowerControl.cs trunk/plugins/PowerScheduler++/Stable/test/Common-MP-TVE3/PowerScheduler.Interfaces/TimerException.cs trunk/plugins/PowerScheduler++/Stable/test/Common-MP-TVE3/PowerScheduler.Interfaces/WaitableTimer.cs trunk/plugins/PowerScheduler++/Stable/test/Common-MP-TVE3/PowerScheduler.Interfaces/WakeOnLanManager.cs trunk/plugins/PowerScheduler++/Stable/test/CopyFiles.bat trunk/plugins/PowerScheduler++/Stable/test/MPEI/ trunk/plugins/PowerScheduler++/Stable/test/MPEI/PowerScheduler++ 1.2.2.1.mpe1 trunk/plugins/PowerScheduler++/Stable/test/MPEI/PowerScheduler++.xmp2 trunk/plugins/PowerScheduler++/Stable/test/MPEI/PowerScheduler_high.png trunk/plugins/PowerScheduler++/Stable/test/MPEI/Screenshot01.jpg trunk/plugins/PowerScheduler++/Stable/test/MPEI/Screenshot02.jpg trunk/plugins/PowerScheduler++/Stable/test/MPEI/Screenshot03.jpg trunk/plugins/PowerScheduler++/Stable/test/MPEI/Screenshot04.jpg trunk/plugins/PowerScheduler++/Stable/test/MPEI/Screenshot05.jpg trunk/plugins/PowerScheduler++/Stable/test/MPEI/Screenshot06.jpg trunk/plugins/PowerScheduler++/Stable/test/MPEI/Screenshot07.jpg trunk/plugins/PowerScheduler++/Stable/test/MPEI/Screenshot08.jpg trunk/plugins/PowerScheduler++/Stable/test/MPEI/update.xml trunk/plugins/PowerScheduler++/Stable/test/PowerScheduler++.sln trunk/plugins/PowerScheduler++/Stable/test/RestoreFiles.bat trunk/plugins/PowerScheduler++/Stable/test/TvEngine3/ trunk/plugins/PowerScheduler++/Stable/test/TvEngine3/TVLibrary/ trunk/plugins/PowerScheduler++/Stable/test/TvEngine3/TVLibrary/Plugins/ trunk/plugins/PowerScheduler++/Stable/test/TvEngine3/TVLibrary/Plugins/PowerScheduler/ trunk/plugins/PowerScheduler++/Stable/test/TvEngine3/TVLibrary/Plugins/PowerScheduler/Handlers/ trunk/plugins/PowerScheduler++/Stable/test/TvEngine3/TVLibrary/Plugins/PowerScheduler/Handlers/ActiveNetworkHandler.cs trunk/plugins/PowerScheduler++/Stable/test/TvEngine3/TVLibrary/Plugins/PowerScheduler/Handlers/ActiveSharesHandler.cs trunk/plugins/PowerScheduler++/Stable/test/TvEngine3/TVLibrary/Plugins/PowerScheduler/Handlers/ActiveStreamsHandler.cs trunk/plugins/PowerScheduler++/Stable/test/TvEngine3/TVLibrary/Plugins/PowerScheduler/Handlers/ControllerActiveHandler.cs trunk/plugins/PowerScheduler++/Stable/test/TvEngine3/TVLibrary/Plugins/PowerScheduler/Handlers/EpgGrabbingHandler.cs trunk/plugins/PowerScheduler++/Stable/test/TvEngine3/TVLibrary/Plugins/PowerScheduler/Handlers/GenericStandbyHandler.cs trunk/plugins/PowerScheduler++/Stable/test/TvEngine3/TVLibrary/Plugins/PowerScheduler/Handlers/GenericWakeupHandler.cs trunk/plugins/PowerScheduler++/Stable/test/TvEngine3/TVLibrary/Plugins/PowerScheduler/Handlers/ProcessActiveHandler.cs trunk/plugins/PowerScheduler++/Stable/test/TvEngine3/TVLibrary/Plugins/PowerScheduler/Handlers/RebootHandler.cs trunk/plugins/PowerScheduler++/Stable/test/TvEngine3/TVLibrary/Plugins/PowerScheduler/Handlers/RemoteClientStandbyHandler.cs trunk/plugins/PowerScheduler++/Stable/test/TvEngine3/TVLibrary/Plugins/PowerScheduler/Handlers/RemoteStandbyHandler.cs trunk/plugins/PowerScheduler++/Stable/test/TvEngine3/TVLibrary/Plugins/PowerScheduler/Handlers/RemoteWakeupHandler.cs trunk/plugins/PowerScheduler++/Stable/test/TvEngine3/TVLibrary/Plugins/PowerScheduler/Handlers/ScheduledRecordingsHandler.cs trunk/plugins/PowerScheduler++/Stable/test/TvEngine3/TVLibrary/Plugins/PowerScheduler/Handlers/XmlTvImportWakeupHandler.cs trunk/plugins/PowerScheduler++/Stable/test/TvEngine3/TVLibrary/Plugins/PowerScheduler/PowerScheduler.cs trunk/plugins/PowerScheduler++/Stable/test/TvEngine3/TVLibrary/Plugins/PowerScheduler/PowerScheduler.csproj trunk/plugins/PowerScheduler++/Stable/test/TvEngine3/TVLibrary/Plugins/PowerScheduler/PowerSchedulerFactory.cs trunk/plugins/PowerScheduler++/Stable/test/TvEngine3/TVLibrary/Plugins/PowerScheduler/PowerSchedulerMasterSetup.Designer.cs trunk/plugins/PowerScheduler++/Stable/test/TvEngine3/TVLibrary/Plugins/PowerScheduler/PowerSchedulerMasterSetup.cs trunk/plugins/PowerScheduler++/Stable/test/TvEngine3/TVLibrary/Plugins/PowerScheduler/PowerSchedulerMasterSetup.resx trunk/plugins/PowerScheduler++/Stable/test/TvEngine3/TVLibrary/Plugins/PowerScheduler/PowerSchedulerPlugin.cs trunk/plugins/PowerScheduler++/Stable/test/TvEngine3/TVLibrary/Plugins/PowerScheduler/Properties/ trunk/plugins/PowerScheduler++/Stable/test/TvEngine3/TVLibrary/Plugins/PowerScheduler/Properties/AssemblyInfo.cs trunk/plugins/PowerScheduler++/Stable/test/TvEngine3/TVLibrary/Plugins/PowerScheduler/SelectProcessForm.cs trunk/plugins/PowerScheduler++/Stable/test/TvEngine3/TVLibrary/Plugins/PowerScheduler/SelectProcessForm.designer.cs trunk/plugins/PowerScheduler++/Stable/test/TvEngine3/TVLibrary/Plugins/PowerScheduler/SelectProcessForm.resx trunk/plugins/PowerScheduler++/Stable/test/TvEngine3/TVLibrary/Plugins/PowerScheduler/SelectShareForm.cs trunk/plugins/PowerScheduler++/Stable/test/TvEngine3/TVLibrary/Plugins/PowerScheduler/SelectShareForm.designer.cs trunk/plugins/PowerScheduler++/Stable/test/TvEngine3/TVLibrary/Plugins/PowerScheduler/SelectShareForm.resx trunk/plugins/PowerScheduler++/Stable/test/TvEngine3/TVLibrary/Plugins/PowerScheduler/TheAlgorithm.txt trunk/plugins/PowerScheduler++/Stable/test/TvEngine3/TVLibrary/Plugins/PowerScheduler/WindowsController.cs trunk/plugins/PowerScheduler++/Stable/test/VersionInfo.cs trunk/plugins/PowerScheduler++/Stable/test/mediaportal/ trunk/plugins/PowerScheduler++/Stable/test/mediaportal/PowerSchedulerClientPlugin/ trunk/plugins/PowerScheduler++/Stable/test/mediaportal/PowerSchedulerClientPlugin/Handlers/ trunk/plugins/PowerScheduler++/Stable/test/mediaportal/PowerSchedulerClientPlugin/Handlers/WakeableStandbyHandler.cs trunk/plugins/PowerScheduler++/Stable/test/mediaportal/PowerSchedulerClientPlugin/Handlers/WakeableWakeupHandler.cs trunk/plugins/PowerScheduler++/Stable/test/mediaportal/PowerSchedulerClientPlugin/PowerScheduler.cs trunk/plugins/PowerScheduler++/Stable/test/mediaportal/PowerSchedulerClientPlugin/PowerScheduler.gif trunk/plugins/PowerScheduler++/Stable/test/mediaportal/PowerSchedulerClientPlugin/PowerSchedulerClientPlugin.cs trunk/plugins/PowerScheduler++/Stable/test/mediaportal/PowerSchedulerClientPlugin/PowerSchedulerClientPlugin.csproj trunk/plugins/PowerScheduler++/Stable/test/mediaportal/PowerSchedulerClientPlugin/PowerSchedulerClientSetup.cs trunk/plugins/PowerScheduler++/Stable/test/mediaportal/PowerSchedulerClientPlugin/PowerSchedulerClientSetup.designer.cs trunk/plugins/PowerScheduler++/Stable/test/mediaportal/PowerSchedulerClientPlugin/PowerSchedulerClientSetup.resx trunk/plugins/PowerScheduler++/Stable/test/mediaportal/PowerSchedulerClientPlugin/PowerScheduler_disabled.gif trunk/plugins/PowerScheduler++/Stable/test/mediaportal/PowerSchedulerClientPlugin/Properties/ trunk/plugins/PowerScheduler++/Stable/test/mediaportal/PowerSchedulerClientPlugin/Properties/AssemblyInfo.cs trunk/plugins/PowerScheduler++/Stable/test/mediaportal/PowerSchedulerClientPlugin/UnattendedWindow.cs Added: trunk/plugins/PowerScheduler++/Stable/test/Binaries/Common.Utils.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/PowerScheduler++/Stable/test/Binaries/Common.Utils.dll ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/PowerScheduler++/Stable/test/Binaries/Core.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/PowerScheduler++/Stable/test/Binaries/Core.dll ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/PowerScheduler++/Stable/test/Binaries/Gentle.Common.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/PowerScheduler++/Stable/test/Binaries/Gentle.Common.dll ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/PowerScheduler++/Stable/test/Binaries/Gentle.Framework.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/PowerScheduler++/Stable/test/Binaries/Gentle.Framework.dll ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/PowerScheduler++/Stable/test/Binaries/PluginBase.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/PowerScheduler++/Stable/test/Binaries/PluginBase.dll ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/PowerScheduler++/Stable/test/Binaries/SetupControls.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/PowerScheduler++/Stable/test/Binaries/SetupControls.dll ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/PowerScheduler++/Stable/test/Binaries/TVDatabase.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/PowerScheduler++/Stable/test/Binaries/TVDatabase.dll ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/PowerScheduler++/Stable/test/Binaries/TVLibrary.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/PowerScheduler++/Stable/test/Binaries/TVLibrary.dll ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/PowerScheduler++/Stable/test/Binaries/TvBusinessLayer.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/PowerScheduler++/Stable/test/Binaries/TvBusinessLayer.dll ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/PowerScheduler++/Stable/test/Binaries/TvControl.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/PowerScheduler++/Stable/test/Binaries/TvControl.dll ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/PowerScheduler++/Stable/test/Binaries/TvLibrary.Interfaces.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/PowerScheduler++/Stable/test/Binaries/TvLibrary.Interfaces.dll ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/PowerScheduler++/Stable/test/Binaries/TvService.exe =================================================================== (Binary files differ) Property changes on: trunk/plugins/PowerScheduler++/Stable/test/Binaries/TvService.exe ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/PowerScheduler++/Stable/test/Binaries/Utils.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/PowerScheduler++/Stable/test/Binaries/Utils.dll ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/PowerScheduler++/Stable/test/CleanupFiles.bat =================================================================== --- trunk/plugins/PowerScheduler++/Stable/test/CleanupFiles.bat (rev 0) +++ trunk/plugins/PowerScheduler++/Stable/test/CleanupFiles.bat 2012-02-09 16:58:34 UTC (rev 4443) @@ -0,0 +1,75 @@ +@echo off +set PROJECTPATH=%~dp0 +if "%ProgramFiles(x86)%" == "" goto 32bit +set SERVERPATH=%ProgramFiles(x86)%\Team MediaPortal\MediaPortal TV Server +set CLIENTPATH=%ProgramFiles(x86)%\Team MediaPortal\MediaPortal +goto data +:32bit +set SERVERPATH=%ProgramFiles%\Team MediaPortal\MediaPortal TV Server +set CLIENTPATH=%ProgramFiles%\Team MediaPortal\MediaPortal +:data +if "%ProgramData%" == "" goto winXP +set SERVERLOGPATH=%ProgramData%\Team MediaPortal\MediaPortal TV Server\log +goto count +:winXP +set SERVERLOGPATH=%ALLUSERSPROFILE%\Application Data\Team MediaPortal\MediaPortal TV Server\log + +:count +set COUNT=1 + +echo Stopping TV Server +echo --------------------- +:stop +echo trying... +net stop tvservice > nul 2>nul +tasklist | find /i "tvservice" >nul 2>nul +if not %ERRORLEVEL% == 1 ( + ping localhost >nul 2>nul + set /a COUNT=%COUNT%+1 + if %COUNT% GTR 5 goto end + goto stop +) +echo. + +echo MediaPortal TV Server +echo --------------------- +for %%f in (Plugins\PowerScheduler.dll) do ( + echo %%f + if exist "%SERVERPATH%\%%f.org" ( + del "%SERVERPATH%\%%f" + move /Y "%SERVERPATH%\%%f.org" "%SERVERPATH%\%%f" + ) 2>nul +) +echo. +echo MediaPortal Common Library +echo ---------------------------------- +for %%f in (PowerScheduler.Interfaces.dll) do ( + echo %%f + if exist "%SERVERPATH%\%%f.org" ( + del "%SERVERPATH%\%%f" + move /Y "%SERVERPATH%\%%f.org" "%SERVERPATH%\%%f" + ) 2>nul + if exist "%CLIENTPATH%\%%f.org" ( + del "%CLIENTPATH%\%%f" + move /Y "%CLIENTPATH%\%%f.org" "%CLIENTPATH%\%%f" + ) 2>nul +) +echo. +echo MediaPortal Client +echo ------------------ +for %%f in (plugins\process\PowerSchedulerClientPlugin.dll) do ( + echo %%f + if exist "%CLIENTPATH%\%%f.org" ( + del "%CLIENTPATH%\%%f" + move /Y "%CLIENTPATH%\%%f.org" "%CLIENTPATH%\%%f" + ) 2>nul +) +echo. +echo Cleanup +echo ------------------ +move /Y "%SERVERLOGPATH%\tv.log" "%SERVERLOGPATH%\tv_old.log" +net start tvservice +echo. +:end +pause +exit \ No newline at end of file Added: trunk/plugins/PowerScheduler++/Stable/test/Common-MP-TVE3/PowerScheduler.Interfaces/EPGWakeupConfig.cs =================================================================== --- trunk/plugins/PowerScheduler++/Stable/test/Common-MP-TVE3/PowerScheduler.Interfaces/EPGWakeupConfig.cs (rev 0) +++ trunk/plugins/PowerScheduler++/Stable/test/Common-MP-TVE3/PowerScheduler.Interfaces/EPGWakeupConfig.cs 2012-02-09 16:58:34 UTC (rev 4443) @@ -0,0 +1,125 @@ +#region Copyright (C) 2005-2011 Team MediaPortal + +// Copyright (C) 2005-2011 Team MediaPortal +// http://www.team-mediaportal.com +// +// MediaPortal 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 of the License, or +// (at your option) any later version. +// +// MediaPortal 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 MediaPortal. If not, see <http://www.gnu.org/licenses/>. + +#endregion + +#region Usings + +using System; +using System.Collections.Generic; +using System.IO; +using System.Runtime.Serialization.Formatters.Binary; + +#endregion + +namespace TvEngine.PowerScheduler +{ + + #region Enums + + public enum EPGGrabDays + { + Monday, + Tuesday, + Wednesday, + Thursday, + Friday, + Saturday, + Sunday + } + + #endregion + + [Serializable] + public class EPGWakeupConfig + { + public DateTime LastRun = DateTime.MinValue; + public List<EPGGrabDays> Days = new List<EPGGrabDays>(); + public int Hour; + public int Minutes; + + public EPGWakeupConfig() {} + + public EPGWakeupConfig(string serializedConfig) + { + EPGWakeupConfig cfg = new EPGWakeupConfig(); + try + { + BinaryFormatter formatter = new BinaryFormatter(); + byte[] buffer = Convert.FromBase64String(serializedConfig); + using (MemoryStream stream = new MemoryStream(buffer, 0, buffer.Length)) + { + cfg = (EPGWakeupConfig)formatter.Deserialize(stream); + } + } + catch (Exception) {} + Hour = cfg.Hour; + Minutes = cfg.Minutes; + Days = cfg.Days; + LastRun = cfg.LastRun; + } + + public string SerializeAsString() + { + BinaryFormatter formatter = new BinaryFormatter(); + string result; + using (MemoryStream stream = new MemoryStream()) + { + formatter.Serialize(stream, this); + stream.Flush(); + stream.Seek(0, SeekOrigin.Begin); + byte[] buffer = new byte[stream.Length]; + int bytesRead = stream.Read(buffer, 0, buffer.Length); + result = Convert.ToBase64String(buffer, 0, bytesRead); + } + return result; + } + + public override bool Equals(object obj) + { + if (obj is EPGWakeupConfig) + { + EPGWakeupConfig cfg = (EPGWakeupConfig)obj; + if (cfg.Hour == Hour && cfg.Minutes == Minutes) + { + foreach (EPGGrabDays day in cfg.Days) + { + if (!Days.Contains(day)) + { + return false; + } + } + foreach (EPGGrabDays day in Days) + { + if (!cfg.Days.Contains(day)) + { + return false; + } + } + return true; + } + } + return false; + } + + public override int GetHashCode() + { + return base.GetHashCode(); + } + } +} \ No newline at end of file Added: trunk/plugins/PowerScheduler++/Stable/test/Common-MP-TVE3/PowerScheduler.Interfaces/Interfaces/IEpgHandler.cs =================================================================== --- trunk/plugins/PowerScheduler++/Stable/test/Common-MP-TVE3/PowerScheduler.Interfaces/Interfaces/IEpgHandler.cs (rev 0) +++ trunk/plugins/PowerScheduler++/Stable/test/Common-MP-TVE3/PowerScheduler.Interfaces/Interfaces/IEpgHandler.cs 2012-02-09 16:58:34 UTC (rev 4443) @@ -0,0 +1,65 @@ +#region Copyright (C) 2005-2011 Team MediaPortal + +// Copyright (C) 2005-2011 Team MediaPortal +// http://www.team-mediaportal.com +// +// MediaPortal 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 of the License, or +// (at your option) any later version. +// +// MediaPortal 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 MediaPortal. If not, see <http://www.gnu.org/licenses/>. + +#endregion + +#region Usings + +using System; + +#endregion + +namespace TvEngine.PowerScheduler.Interfaces +{ + public delegate void EPGScheduleHandler(); + + /// <summary> + /// Provides access to PowerScheduler's EPG interface for + /// EPG plugins. + /// </summary> + public interface IEpgHandler + { + /// <summary> + /// Allows an external EPG source to prevent standby when it's + /// grabbing EPG + /// </summary> + /// <param name="source">the source preventing standby</param> + /// <param name="allowed">is standby allowed?</param> + void SetStandbyAllowed(object source, bool allowed, int timeout); + + /// <summary> + /// Allows an external EPG source to set a preferred next wakeup time + /// </summary> + /// <param name="source">the source that wants to wakeup the system for EPG grabbing</param> + /// <param name="time">the desired time to wakeup the system</param> + void SetNextEPGWakeupTime(object source, DateTime time); + + /// <summary> + /// Allows an external EPG source to retrieve the next wakeup time + /// for EPG grabbing. This time can be used to start an actual EPG + /// grabbing process. + /// </summary> + /// <returns>next EPG grab wakeup time</returns> + DateTime GetNextEPGWakeupTime(); + + /// <summary> + /// Event which gets fired when the configured EPG wakeup schedule is due. + /// </summary> + event EPGScheduleHandler EPGScheduleDue; + } +} \ No newline at end of file Added: trunk/plugins/PowerScheduler++/Stable/test/Common-MP-TVE3/PowerScheduler.Interfaces/Interfaces/IPowerController.cs =================================================================== --- trunk/plugins/PowerScheduler++/Stable/test/Common-MP-TVE3/PowerScheduler.Interfaces/Interfaces/IPowerController.cs (rev 0) +++ trunk/plugins/PowerScheduler++/Stable/test/Common-MP-TVE3/PowerScheduler.Interfaces/Interfaces/IPowerController.cs 2012-02-09 16:58:34 UTC (rev 4443) @@ -0,0 +1,108 @@ +#region Copyright (C) 2005-2011 Team MediaPortal + +// Copyright (C) 2005-2011 Team MediaPortal +// http://www.team-mediaportal.com +// +// MediaPortal 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 of the License, or +// (at your option) any later version. +// +// MediaPortal 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 MediaPortal. If not, see <http://www.gnu.org/licenses/>. + +#endregion + +#region Usings + +using System; + +#endregion + +namespace TvEngine.PowerScheduler.Interfaces +{ + /// <summary> + /// Public interface to PowerScheduler power control + /// Intented to be used by singleseat setups + /// </summary> + public interface IPowerController + { + /// <summary> + /// Requests suspension of the system. Uses default action. + /// </summary> + /// <param name="source">description of who wants to suspend the system</param> + /// <param name="force">force the system to suspend (not recommended)</param> + void SuspendSystem(string source, bool force); + + /// <summary> + /// Requests suspension of the system. + /// </summary> + /// <param name="source"></param> + /// <param name="how">How to suspend, see MediaPortal.Util.RestartOptions</param> + /// <param name="force"></param> + void SuspendSystem(string source, int how, bool force); + + /// <summary> + /// Enables clients on singleseat setups to indicate whether or not the system + /// is allowed to enter standby + /// </summary> + /// <param name="standbyAllowed">is standby allowed?</param> + /// <param name="handlerName">client handlername which prevents standby</param> + void SetStandbyAllowed(bool standbyAllowed, string handlerName); + + /// <summary> + /// Enables clients on singleseat setups to indicate when the next + /// earliest wakeup time is due + /// </summary> + /// <param name="nextWakeupTime">DateTime when to wakeup the system</param> + /// <param name="handlerName">client handlername which is responsible for this wakeup time</param> + void SetNextWakeupTime(DateTime nextWakeupTime, string handlerName); + + /// <summary> + /// Resets the idle timer of the PowerScheduler. When enough time has passed (IdleTimeout), the system + /// is suspended as soon as possible (no handler disallows shutdown). + /// Note that the idle timer is automatically reset to now when the user moves the mouse or touchs the keyboard. + /// </summary> + void UserActivityDetected(DateTime when); + + /// <summary> + /// Register remote handlers. If an empty string or null is passed, no handler is registered for + /// that type. It returns a tag used to unregister the later. The returned tag is always not 0. + /// </summary> + /// <param name="standbyHandlerURI"></param> + /// <param name="wakeupHandlerURI"></param> + int RegisterRemote(String standbyHandlerURI, String wakeupHandlerURI); + + /// <summary> + /// Unregister remote handlers. + /// </summary> + void UnregisterRemote(int tag); + + /// <summary> + /// Indicates whether or not we're connected to the PowerScheduler power control interfaces + /// </summary> + bool IsConnected { get; } + + /// <summary> + /// Get the current state. If refresh is true, the state is the most current state, otherwise the state could be some seconds old. + /// Special case: If shutdown is not allowed because an event is almost due, the handler name is "EVENT-DUE". + /// </summary> + /// <param name="refresh"></param> + /// <param name="disAllowShutdown"></param> + /// <param name="disAllowShutdownHandler"></param> + /// <param name="nextWakeupTime"></param> + /// <param name="nextWakeupHandler"></param> + void GetCurrentState(bool refresh, out bool unattended, out bool disAllowShutdown, + out String disAllowShutdownHandler, out DateTime nextWakeupTime, out String nextWakeupHandler); + + /// <summary> + /// Provides access to PowerScheduler's settings + /// </summary> + IPowerSettings PowerSettings { get; } + } +} \ No newline at end of file Added: trunk/plugins/PowerScheduler++/Stable/test/Common-MP-TVE3/PowerScheduler.Interfaces/Interfaces/IPowerScheduler.cs =================================================================== --- trunk/plugins/PowerScheduler++/Stable/test/Common-MP-TVE3/PowerScheduler.Interfaces/Interfaces/IPowerScheduler.cs (rev 0) +++ trunk/plugins/PowerScheduler++/Stable/test/Common-MP-TVE3/PowerScheduler.Interfaces/Interfaces/IPowerScheduler.cs 2012-02-09 16:58:34 UTC (rev 4443) @@ -0,0 +1,129 @@ +#region Copyright (C) 2005-2011 Team MediaPortal + +// Copyright (C) 2005-2011 Team MediaPortal +// http://www.team-mediaportal.com +// +// MediaPortal 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 of the License, or +// (at your option) any later version. +// +// MediaPortal 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 MediaPortal. If not, see <http://www.gnu.org/licenses/>. + +#endregion + +#region Usings + +using System; + +#endregion + +namespace TvEngine.PowerScheduler.Interfaces +{ + /// <summary> + /// EvenHandler delegate for PowerScheduler events + /// </summary> + /// <param name="args"></param> + public delegate void PowerSchedulerEventHandler(PowerSchedulerEventArgs args); + + /// <summary> + /// Interface to PowerScheduler + /// </summary> + public interface IPowerScheduler + { + /// <summary> + /// Register to this event to receive status changes from the PowerScheduler + /// </summary> + event PowerSchedulerEventHandler OnPowerSchedulerEvent; + + /// <summary> + /// Registers an IStandbyHandler implementation + /// </summary> + /// <param name="handler">implementation to register for handling standby requests</param> + void Register(IStandbyHandler handler); + + /// <summary> + /// Registers an IWakeupHandler implementation + /// </summary> + /// <param name="handler">implementation to register for handling system resume time</param> + void Register(IWakeupHandler handler); + + /// <summary> + /// Unregisters an IStandbyHandler implementation + /// </summary> + /// <param name="handler">implementation to unregister for handling standby requests</param> + void Unregister(IStandbyHandler handler); + + /// <summary> + /// Registers an IWakeupHandler implementation + /// </summary> + /// <param name="handler">implementation to register for handling system resume time</param> + void Unregister(IWakeupHandler handler); + + /// <summary> + /// Checks if the given IStandbyHandler is registered + /// </summary> + /// <param name="handler">IStandbyHandler to check</param> + /// <returns>is the given handler registered?</returns> + bool IsRegistered(IStandbyHandler handler); + + /// <summary> + /// Checks if the given IWakeupHandler is registered + /// </summary> + /// <param name="handler">IWakeupHandler to check</param> + /// <returns>is the given handler registered?</returns> + bool IsRegistered(IWakeupHandler handler); + + /// <summary> + /// Requests suspension of the system + /// </summary> + /// <param name="source">description of who wants to suspend the system</param> + /// <param name="force">force the system to suspend (not recommended)</param> + void SuspendSystem(string source, bool force); + + /// <summary> + /// Requests suspension of the system. + /// </summary> + /// <param name="source"></param> + /// <param name="how">How to suspend, see MediaPortal.Util.RestartOptions</param> + /// <param name="force"></param> + void SuspendSystem(string source, int how, bool force); + + /// <summary> + /// Resets the idle timer of the PowerScheduler. When enough time has passed (IdleTimeout), the system + /// is suspended as soon as possible (no handler disallows shutdown). + /// Note that the idle timer is automatically reset to now when the user moves the mouse or touchs the keyboard. + /// </summary> + void UserActivityDetected(DateTime when); + + /// <summary> + /// Get the current state. If refresh is true, the state is the most current state, otherwise the state could be some seconds old. + /// Special case: If shutdown is not allowed because an event is almost due, the handler name is "EVENT-DUE". + /// </summary> + /// <param name="refresh"></param> + /// <param name="disAllowShutdown"></param> + /// <param name="disAllowShutdownHandler"></param> + /// <param name="nextWakeupTime"></param> + /// <param name="nextWakeupHandler"></param> + void GetCurrentState(bool refresh, out bool unattended, out bool disAllowShutdown, + out String disAllowShutdownHandler, out DateTime nextWakeupTime, out String nextWakeupHandler); + + + /// <summary> + /// Checks if a suspend request is in progress + /// </summary> + /// <returns>is the system currently trying to suspend?</returns> + bool IsSuspendInProgress(); + + /// <summary> + /// Provides access to PowerScheduler's settings + /// </summary> + PowerSettings Settings { get; } + } +} \ No newline at end of file Added: trunk/plugins/PowerScheduler++/Stable/test/Common-MP-TVE3/PowerScheduler.Interfaces/Interfaces/IPowerSettings.cs =================================================================== --- trunk/plugins/PowerScheduler++/Stable/test/Common-MP-TVE3/PowerScheduler.Interfaces/Interfaces/IPowerSettings.cs (rev 0) +++ trunk/plugins/PowerScheduler++/Stable/test/Common-MP-TVE3/PowerScheduler.Interfaces/Interfaces/IPowerSettings.cs 2012-02-09 16:58:34 UTC (rev 4443) @@ -0,0 +1,82 @@ +#region Copyright (C) 2005-2011 Team MediaPortal + +// Copyright (C) 2005-2011 Team MediaPortal +// http://www.team-mediaportal.com +// +// MediaPortal 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 of the License, or +// (at your option) any later version. +// +// MediaPortal 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 MediaPortal. If not, see <http://www.gnu.org/licenses/>. + +#endregion + +#region Usings + +#endregion + +namespace TvEngine.PowerScheduler.Interfaces +{ + /// <summary> + /// Provides access to PowerScheduler's settings + /// </summary> + public interface IPowerSettings + { + /// <summary> + /// Should PowerScheduler actively try to put the system into standby? + /// </summary> + bool ShutdownEnabled { get; } + + /// <summary> + /// Should PowerScheduler check when any plugin wants to wakeup the system? + /// </summary> + bool WakeupEnabled { get; } + + /// <summary> + /// Should the shutdown attemps be forced? + /// </summary> + bool ForceShutdown { get; } + + /// <summary> + /// Should PowerScheduler be verbose when logging? + /// </summary> + bool ExtensiveLogging { get; } + + /// <summary> + /// If ShutdownEnabled, how long (in minutes) to wait before putting the + /// system into standby + /// </summary> + int IdleTimeout { get; } + + /// <summary> + /// if WakeupEnabled, the time (in seconds) to wakeup the system earlier than + /// the actual wakeup time + /// </summary> + int PreWakeupTime { get; } + + /// <summary> + /// If WakeupEnabled, the time (in seconds) the system is not allowed to + /// go to shutdown before the next wakeup time + /// </summary> + int PreNoShutdownTime { get; } + + /// <summary> + /// Controls the granularity of the standby/wakeup checks in seconds + /// </summary> + int CheckInterval { get; } + + /// <summary> + /// How should put the system into standby? suspend/hibernate/stayon + /// suspend uses S3, hibernate uses S4, stayon is for debugging purposes and + /// doesn't put the system into standby at all + /// </summary> + ShutdownMode ShutdownMode { get; } + } +} \ No newline at end of file Added: trunk/plugins/PowerScheduler++/Stable/test/Common-MP-TVE3/PowerScheduler.Interfaces/Interfaces/IStandbyHandler.cs =================================================================== --- trunk/plugins/PowerScheduler++/Stable/test/Common-MP-TVE3/PowerScheduler.Interfaces/Interfaces/IStandbyHandler.cs (rev 0) +++ trunk/plugins/PowerScheduler++/Stable/test/Common-MP-TVE3/PowerScheduler.Interfaces/Interfaces/IStandbyHandler.cs 2012-02-09 16:58:34 UTC (rev 4443) @@ -0,0 +1,56 @@ +#region Copyright (C) 2005-2011 Team MediaPortal + +// Copyright (C) 2005-2011 Team MediaPortal +// http://www.team-mediaportal.com +// +// MediaPortal 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 of the License, or +// (at your option) any later version. +// +// MediaPortal 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 MediaPortal. If not, see <http://www.gnu.org/licenses/>. + +#endregion + +#region Usings + +#endregion + +namespace TvEngine.PowerScheduler.Interfaces +{ + public interface IStandbyHandler + { + /// <summary> + /// Indicator whether or not to allow suspension/hibernation of the system + /// </summary> + bool DisAllowShutdown { get; } + + /// <summary> + /// Called when the user turns away from the system. + /// </summary> + void UserShutdownNow(); + + /// <summary> + /// Description of the source that allows / disallows shutdown + /// </summary> + string HandlerName { get; } + } + + /// <summary> + /// Extension to the IStandbyHandler interface for away mode + /// </summary> + public interface IStandbyHandlerEx : IStandbyHandler + { + /// <summary> + /// Indicator whether away mode is required by standby handler or not + /// </summary> + bool RequireAwayMode { get; } + } + +} \ No newline at end of file Added: trunk/plugins/PowerScheduler++/Stable/test/Common-MP-TVE3/PowerScheduler.Interfaces/Interfaces/IWakeupHandler.cs =================================================================== --- trunk/plugins/PowerScheduler++/Stable/test/Common-MP-TVE3/PowerScheduler.Interfaces/Interfaces/IWakeupHandler.cs (rev 0) +++ trunk/plugins/PowerScheduler++/Stable/test/Common-MP-TVE3/PowerScheduler.Interfaces/Interfaces/IWakeupHandler.cs 2012-02-09 16:58:34 UTC (rev 4443) @@ -0,0 +1,46 @@ +#region Copyright (C) 2005-2011 Team MediaPortal + +// Copyright (C) 2005-2011 Team MediaPortal +// http://www.team-mediaportal.com +// +// MediaPortal 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 of the License, or +// (at your option) any later version. +// +// MediaPortal 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 MediaPortal. If not, see <http://www.gnu.org/licenses/>. + +#endregion + +#region Usings + +using System; + +#endregion + +namespace TvEngine.PowerScheduler.Interfaces +{ + /// <summary> + /// To be implemented by classes who want to control system resume + /// </summary> + public interface IWakeupHandler + { + /// <summary> + /// Should return the earliest time the implementation desires to wake up the system. + /// </summary> + /// <param name="earliestWakeupTime">indicates the earliest valid wake up time that is considered valid by the PowerScheduler</param> + /// <returns>earliest time the implementation wants to wake up the system</returns> + DateTime GetNextWakeupTime(DateTime earliestWakeupTime); + + /// <summary> + /// Description of the source that want to wake up the system at the given time + /// </summary> + string HandlerName { get; } + } +} \ No newline at end of file Added: trunk/plugins/PowerScheduler++/Stable/test/Common-MP-TVE3/PowerScheduler.Interfaces/PowerManager.cs =================================================================== --- trunk/plugins/PowerScheduler++/Stable/test/Common-MP-TVE3/PowerScheduler.Interfaces/PowerManager.cs (rev 0) +++ trunk/plugins/PowerScheduler++/Stable/test/Common-MP-TVE3/PowerScheduler.Interfaces/PowerManager.cs 2012-02-09 16:58:34 UTC (rev 4443) @@ -0,0 +1,283 @@ +#region Copyright (C) 2005-2011 Team MediaPortal + +// Copyright (C) 2005-2011 Team MediaPortal +// http://www.team-mediaportal.com +// +// MediaPortal 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 of the License, or +// (at your option) any later version. +// +// MediaPortal 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 MediaPortal. If not, see <http://www.gnu.org/licenses/>. + +#endregion + +#region Usings + +using System; +using System.Runtime.InteropServices; +using System.Threading; + +#endregion + +namespace TvEngine.PowerScheduler.Interfaces +{ + /// <summary> + /// Provides methods for handling system power events + /// </summary> + public class PowerManager + { + #region Variables + + /// <summary> + /// Enable / disable away mode + /// </summary> + private bool _awayMode; + + /// <summary> + /// Thread for calling SetThreadExecutionState() + /// </summary> + private Thread _awayModeThread; + + #endregion + + #region Constructor/Destructor + + /// <summary> + /// Constructor starts the thread for away mode and inits PowerSettings array + /// </summary> + unsafe public PowerManager() + { + if (Environment.OSVersion.Version.Major >= 6) + { + // Start the thread to enable/disable away mode + _awayModeThread = new Thread(AwayModeThread); + _awayModeThread.Name = "ExecutionStateThread"; + _awayModeThread.IsBackground = true; + _awayModeThread.Start(); + } + } + + ~PowerManager() + { + if (_awayModeThread != null) + { + _awayModeThread.Abort(); + _awayModeThread.Join(100); + _awayModeThread = null; + } + } + + #endregion + + #region External power management methods and enumerations + + /// <summary> + /// The thread's execution requirements + /// </summary> + [Flags] + private enum ExecutionState : uint + { + /// <summary> + /// Some error. + /// </summary> + Error = 0, + + /// <summary> + /// System is required, do not hibernate. + /// </summary> + ES_SYSTEM_REQUIRED = 0x00000001, + + /// <summary> + /// Display is required, do not hibernate. + /// </summary> + ES_DISPLAY_REQUIRED = 0x00000002, + + /// <summary> + /// User is active, do not hibernate. + /// </summary> + ES_USER_PRESENT = 0x00000004, + + /// <summary> + /// Enables away mode. + /// </summary> + ES_AWAYMODE_REQUIRED = 0x00000040, + + /// <summary> + /// Use together with the above options to report a + /// state until explicitly changed. + /// </summary> + ES_CONTINUOUS = 0x80000000 + } + + /// <summary> + /// Enables an application to inform the system that it is in use, thereby preventing the system + /// from entering sleep or turning off the display while the application is running. + /// </summary> + /// <param name="esFlags">The thread's execution requirements + /// /// </param> + /// <returns> + /// If the function succeeds, the return value is the previous thread execution state. + /// If the function fails, the return value is NULL. + /// </returns> + [DllImport("kernel32.dll", SetLastError = true, EntryPoint = "SetThreadExecutionState")] + private static extern ExecutionState SetThreadExecutionState(ExecutionState esFlags); + + #endregion + + #region Power management wrapper methods + + /// <summary> + /// Set the PowerManager to allow standby + /// </summary> + /// <returns>bool indicating whether or not standby is allowed</returns> + public bool AllowStandby() + { + return true; + } + + /// <summary> + /// Set the PowerManager to prevent standby + /// </summary> + /// <returns>bool indicating whether or not standby is prevented</returns> + public bool PreventStandby() + { + lock (this) + { + ExecutionState result = SetThreadExecutionState(ExecutionState.ES_SYSTEM_REQUIRED); + //Log.Debug("PowerManager.PreventStandBy: SetThreadExecutionState() returned: {0}", result.ToString()); + if (result == ExecutionState.Error) + { + return false; + } + return true; + } + } + + /// <summary> + /// Sets AwayModeRequired execution state; triggers AwayModeThread to do the real work + /// </summary> + /// <param name="awayModeRequired">Enable/disable away mode</param> + public void SetAwayModeRequired(bool awayModeRequired) + { + if (Environment.OSVersion.Version.Major >= 6) + { + Monitor.Enter(_awayModeThread); + _awayMode = awayModeRequired; + Monitor.Pulse(_awayModeThread); + Monitor.Exit(_awayModeThread); + } + } + + /// <summary> + /// Gets triggered by SetAwayMode and sets the execution state to the desired value + /// /// </summary> + private void AwayModeThread() + { + while (true) + { + Monitor.Enter(_awayModeThread); + Monitor.Wait(_awayModeThread); + if (_awayMode) + SetThreadExecutionState(ExecutionState.ES_AWAYMODE_REQUIRED | ExecutionState.ES_CONTINUOUS); + else + SetThreadExecutionState(ExecutionState.ES_CONTINUOUS); + Monitor.Exit(_awayModeThread); + } + } + + #endregion + + #region External power setting change notification methods and enumerations + + /// <summary> + /// Flags to register for power setting change notification + /// </summary> + private const int DEVICE_NOTIFY_WINDOW_HANDLE = 0x00000000; + private const int DEVICE_NOTIFY_SERVICE_HANDLE = 0x00000001; + + /// <summary> + /// Handle to unregister for power setting change notification + /// </summary> + private IntPtr hAwayMode; + + /// <summary> + /// Constants for power notifications + /// </summary> + public const int WM_POWERBROADCAST = 0x0218; + public const int PBT_APMQUERYSUSPEND = 0x0000; + public const int PBT_APMQUERYSUSPENDFAILED = 0x0002; + public const int PBT_APMSUSPEND = 0x0004; + public const int PBT_APMRESUMECRITICAL = 0x0006; + public const int PBT_APMRESUMESUSPEND = 0x0007; + public const int PBT_APMRESUMEAUTOMATIC = 0x0012; + public const int PBT_POWERSETTINGCHANGE = 0x8013; + public const int BROADCAST_QUERY_DENY = 0x424D5144; + + /// <summary> + /// This structure is sent when the PBT_POWERSETTINGSCHANGE message is sent. + /// It describes the power setting that has changed and contains data about the change + /// </summary> + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public struct POWERBROADCAST_SETTING + { + public Guid PowerSetting; + public uint DataLength; + public byte Data; + } + + /// <summary> + /// Guid to register for power setting change notification + /// </summary> + public static Guid GUID_SYSTEM_AWAYMODE = new Guid("98a7f580-01f7-48aa-9c0f-44352c29e5C0"); + + /// <summary> + /// + /// </summary> + /// <param name="hRecipient"></param> + /// <param name="PowerSettingGuid"></param> + /// <param name="Flags"></param> + /// <returns></returns> + [DllImport(@"User32", SetLastError = true, EntryPoint = "RegisterPowerSettingNotification", CallingConvention = CallingConvention.StdCall)] + private static extern IntPtr RegisterPowerSettingNotification(IntPtr hRecipient, ref Guid PowerSettingGuid, Int32 Flags); + + /// <summary> + /// + /// </summary> + /// <param name="handle"></param> + /// <returns></returns> + [DllImport(@"User32", SetLastError = true, EntryPoint = "UnregisterPowerSettingNotification", CallingConvention = CallingConvention.StdCall)] + private static extern bool UnregisterPowerSettingNotification(IntPtr handle); + + #endregion + + #region Power setting change notification wrapper methods + + /// <summary> + /// Register for away mode notifications + /// </summary> + /// <param name="hRecipient">Window handle (e.g. GUIGraphicsContext.ActiveForm)</param> + public void RegisterAwayModeNotification(IntPtr hRecipient) + { + if (Environment.OSVersion.Version.Major >= 6) + hAwayMode = RegisterPowerSettingNotification(hRecipient, ref GUID_SYSTEM_AWAYMODE, DEVICE_NOTIFY_WINDOW_HANDLE); + } + + /// <summary> + /// Unregister for away mode notifications + /// </summary> + public void UnregisterAwayModeNotification() + { + if (Environment.OSVersion.Version.Major >= 6) + UnregisterPowerSettingNotification(hAwayMode); + } + + #endregion + } +} \ No newline at end of file Added: trunk/plugins/PowerScheduler++/Stable/test/Common-MP-TVE3/PowerScheduler.Interfaces/PowerScheduler.Interfaces.csproj =================================================================== --- trunk/plugins/PowerScheduler++/Stable/test/Common-MP-TVE3/PowerScheduler.Interfaces/PowerScheduler.Interfaces.csproj (rev 0) +++ trunk/plugins/PowerScheduler++/Stable/test/Common-MP-TVE3/PowerScheduler.Interfaces/PowerScheduler.Interfaces.csproj 2012-02-09 16:58:34 UTC (rev 4443) @@ -0,0 +1,96 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0"> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProductVersion>9.0.30729</ProductVersion> + <SchemaVersion>2.0</SchemaVersion> + <ProjectGuid>{7701AA79-18D4-4A18-BB52-16774FB7943D}</ProjectGuid> + <OutputType>Library</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>TvEngine.PowerScheduler.Interfaces</RootNamespace> + <AssemblyName>PowerScheduler.Interfaces</AssemblyName> + <StartupObject> + </StartupObject> + <FileUpgradeFlags> + </FileUpgradeFlags> + <OldToolsVersion>3.5</OldToolsVersion> + <UpgradeBackupLocation> + </UpgradeBackupLocation> + <TargetFrameworkVersion>v3.5</TargetFrameworkVersion> + </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> + <AllowUnsafeBlocks>true</AllowUnsafeBlocks> + </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> + <AllowUnsafeBlocks>true</AllowUnsafeBlocks> + <PlatformTarget>x86</PlatformTarget> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> + <DebugSymbols>true</DebugSymbols> + <OutputPath>bin\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <AllowUnsafeBlocks>true</AllowUnsafeBlocks> + <DebugType>full</DebugType> + <PlatformTarget>x86</PlatformTarget> + <ErrorReport>prompt</ErrorReport> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' "> + <OutputPath>bin\Release\</OutputPath> + <DefineConstants>TRACE</DefineConstants> + <AllowUnsafeBlocks>true</AllowUnsafeBlocks> + <Optimize>true</Optimize> + <DebugType>pdbonly</DebugType> + <PlatformTarget>x86</PlatformTarget> + <ErrorReport>prompt</ErrorReport> + </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="..\..\VersionInfo.cs"> + <Link>VersionInfo.cs</Link> + </Compile> + <Compile Include="EPGWakeupConfig.cs" /> + <Compile Include="Interfaces\IEpgHandler.cs" /> + <Compile Include="Interfaces\IPowerController.cs" /> + <Compile Include="Interfaces\IPowerScheduler.cs" /> + <Compile Include="Interfaces\IPowerSettings.cs" /> + <Compile Include="Interfaces\IStandbyHandler.cs" /> + <Compile Include="Interfaces\IWakeupHandler.cs" /> + <Compile Include="PowerManager.cs" /> + <Compile Include="PowerSchedulerEventArgs.cs" /> + <Compile Include="PowerSettings.cs" /> + <Compile Include="Properties\AssemblyInfo.cs" /> + <Compile Include="RemotePowerControl.cs" /> + <Compile Include="TimerException.cs" /> + <Compile Include="WaitableTimer.cs" /> + <Compile Include="WakeOnLanManager.cs" /> + </ItemGroup> + <ItemGroup> + <Reference Include="System" /> + <Reference Include="System.Core"> + <RequiredTargetFramework>3.5</RequiredTargetFramework> + </Reference> + <Reference Include="System.Data" /> + <Reference Include="System.Xml" /> + </ItemGroup> +</Project> \ No newline at end of file Added: trunk/plugins/PowerScheduler++/Stable/test/Common-MP-TVE3/PowerScheduler.Interfaces/PowerSchedulerEventArgs.cs =================================================================== --- trunk/plugins/PowerScheduler++/Stable/test/Common-MP-TVE3/PowerScheduler.Interfaces/PowerSchedulerEventArgs.cs (rev 0) +++ trunk/plugins/PowerScheduler++/Stable/test/Common-MP-TVE3/PowerScheduler.Interfaces/PowerSchedulerEventArgs.cs 2012-02-09 16:58:34 UTC (rev 4443) @@ -0,0 +1,127 @@ +#region Copyright (C) 2005-2011 Team MediaPortal + +// Copyright (C) 2005-2011 Team MediaPortal +// http://www.team-mediaportal.com +// +// MediaPortal 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 of the License, or +// (at your option) any later version. +// +// MediaPortal 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 MediaPortal. If not, see <http://www.gnu.org/licenses/>. + +#endregion + +#region Usings + +using System; + +#endregion + +namespace TvEngine.PowerScheduler.Interfaces +{ + + #region Enums + + /// <summary> + /// All possible event types sent by PowerScheduler + /// </summary> + public enum PowerSchedulerEventType + { + /// <summary> + /// Sent when PowerScheduler is started + /// </summary> + Started, + /// <summary> + /// Sent when PowerScheduler is stopped + /// </summary> + Stopped, + /// <summary> + /// Sent when Powerscheduler settings have changed + /// </summary> + SettingsChanged, + /// <summary> + /// Sent when PowerScheduler detects the system state changed from idle to busy + /// </summary> + SystemBusy, + /// <summary> + /// Sent when PowerScheduler detects the system state changed from busy to idle + /// </summary> + SystemIdle, + /// <summary> + /// Sent when PowerScheduler is about to put the system into standby or when + /// powerscheduler detects the system is put into standby + /// </summary> + EnteringStandby, + /// <summary> + /// Sent when PowerScheduler detects the system resumed from standby + /// </summary> + ResumedFromStandby, + /// <summary> + /// Sent when PowerScheduler's check interval is due again + /// (so, sent every PowerSettings.CheckInterval seconds) + /// </summary> + Elapsed + } + + #endregion + + /// <summary> + /// PowerSchedulerEventArgs are sent by PowerScheduler when the status of PowerScheduler changes. + /// To find out the exact event type inspect the EventType property + /// </summary> + public class PowerSchedulerEventArgs : EventArgs + { + #region Variables + + private PowerSchedulerEventType _eventType; + private object _data; + private Type _dataType; + + #endregion + + #region Constructor + + public PowerSchedulerEventArgs(PowerSchedulerEventType eventType) + { + _eventType = eventType; + } + + #endregion + + #region Public methods + + public void SetData<T>(object o) + { + _dataType = typeof (T); + _data = o; + } + + public T GetData<T>() + { + Type dataType = typeof (T); + if (_dataType == dataType) + { + return (T)_data; + } + return default(T); + } + + #endregion + + #region Properties + + public PowerSchedulerEventType EventType + { + get { return _eventType; } + } + + #endregion + } +} \ No newline at end of file Added: trunk/plugins/PowerScheduler++/Stable/test/Common-MP-TVE3/PowerScheduler.Interfaces/PowerSettings.cs =================================================================== --- trunk/plugins/PowerScheduler++/Stable/test/Common-MP-TVE3/PowerScheduler.Interfaces/PowerSettings.cs (rev 0) +++ trunk/plugins/PowerScheduler++/Stable/test/Common-MP-TVE3/PowerScheduler.Interfaces/PowerSe... [truncated message content] |
From: <mic...@us...> - 2012-02-09 16:47:40
|
Revision: 4442 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=4442&view=rev Author: michael-t Date: 2012-02-09 16:47:29 +0000 (Thu, 09 Feb 2012) Log Message: ----------- Removed Paths: ------------- trunk/plugins/PowerScheduler++/Test/CleanupFiles.bat trunk/plugins/PowerScheduler++/Test/CopyFiles.bat trunk/plugins/PowerScheduler++/Test/RestoreFiles.bat Deleted: trunk/plugins/PowerScheduler++/Test/CleanupFiles.bat =================================================================== --- trunk/plugins/PowerScheduler++/Test/CleanupFiles.bat 2012-02-09 16:46:42 UTC (rev 4441) +++ trunk/plugins/PowerScheduler++/Test/CleanupFiles.bat 2012-02-09 16:47:29 UTC (rev 4442) @@ -1,75 +0,0 @@ -@echo off -set PROJECTPATH=%~dp0 -if "%ProgramFiles(x86)%" == "" goto 32bit -set SERVERPATH=%ProgramFiles(x86)%\Team MediaPortal\MediaPortal TV Server -set CLIENTPATH=%ProgramFiles(x86)%\Team MediaPortal\MediaPortal -goto data -:32bit -set SERVERPATH=%ProgramFiles%\Team MediaPortal\MediaPortal TV Server -set CLIENTPATH=%ProgramFiles%\Team MediaPortal\MediaPortal -:data -if "%ProgramData%" == "" goto winXP -set SERVERLOGPATH=%ProgramData%\Team MediaPortal\MediaPortal TV Server\log -goto count -:winXP -set SERVERLOGPATH=%ALLUSERSPROFILE%\Application Data\Team MediaPortal\MediaPortal TV Server\log - -:count -set COUNT=1 - -echo Stopping TV Server -echo --------------------- -:stop -echo trying... -net stop tvservice > nul 2>nul -tasklist | find /i "tvservice" >nul 2>nul -if not %ERRORLEVEL% == 1 ( - ping localhost >nul 2>nul - set /a COUNT=%COUNT%+1 - if %COUNT% GTR 5 goto end - goto stop -) -echo. - -echo MediaPortal TV Server -echo --------------------- -for %%f in (Plugins\PowerScheduler.dll) do ( - echo %%f - if exist "%SERVERPATH%\%%f.org" ( - del "%SERVERPATH%\%%f" - move /Y "%SERVERPATH%\%%f.org" "%SERVERPATH%\%%f" - ) 2>nul -) -echo. -echo MediaPortal Common Library -echo ---------------------------------- -for %%f in (PowerScheduler.Interfaces.dll) do ( - echo %%f - if exist "%SERVERPATH%\%%f.org" ( - del "%SERVERPATH%\%%f" - move /Y "%SERVERPATH%\%%f.org" "%SERVERPATH%\%%f" - ) 2>nul - if exist "%CLIENTPATH%\%%f.org" ( - del "%CLIENTPATH%\%%f" - move /Y "%CLIENTPATH%\%%f.org" "%CLIENTPATH%\%%f" - ) 2>nul -) -echo. -echo MediaPortal Client -echo ------------------ -for %%f in (plugins\process\PowerSchedulerClientPlugin.dll) do ( - echo %%f - if exist "%CLIENTPATH%\%%f.org" ( - del "%CLIENTPATH%\%%f" - move /Y "%CLIENTPATH%\%%f.org" "%CLIENTPATH%\%%f" - ) 2>nul -) -echo. -echo Cleanup -echo ------------------ -move /Y "%SERVERLOGPATH%\tv.log" "%SERVERLOGPATH%\tv_old.log" -net start tvservice -echo. -:end -pause -exit \ No newline at end of file Deleted: trunk/plugins/PowerScheduler++/Test/CopyFiles.bat =================================================================== --- trunk/plugins/PowerScheduler++/Test/CopyFiles.bat 2012-02-09 16:46:42 UTC (rev 4441) +++ trunk/plugins/PowerScheduler++/Test/CopyFiles.bat 2012-02-09 16:47:29 UTC (rev 4442) @@ -1,74 +0,0 @@ -@echo off -set PROJECTPATH=%~dp0 -if "%ProgramFiles(x86)%" == "" goto 32bit -set SERVERPATH=%ProgramFiles(x86)%\Team MediaPortal\MediaPortal TV Server -set CLIENTPATH=%ProgramFiles(x86)%\Team MediaPortal\MediaPortal -goto data -:32bit -set SERVERPATH=%ProgramFiles%\Team MediaPortal\MediaPortal TV Server -set CLIENTPATH=%ProgramFiles%\Team MediaPortal\MediaPortal -:data -if "%ProgramData%" == "" goto winXP -set SERVERLOGPATH=%ProgramData%\Team MediaPortal\MediaPortal TV Server\log -goto count -:winXP -set SERVERLOGPATH=%ALLUSERSPROFILE%\Application Data\Team MediaPortal\MediaPortal TV Server\log - -:count -set COUNT=1 - -echo Stopping TV Server -echo --------------------- -:stop -echo trying... -net stop tvservice > nul 2>nul -tasklist | find /i "tvservice" >nul 2>nul -if not %ERRORLEVEL% == 1 ( - ping localhost >nul 2>nul - set /a COUNT=%COUNT%+1 - if %COUNT% GTR 5 goto end - goto stop -) -echo. -echo MediaPortal TV Server -echo --------------------- -for %%f in (Plugins\PowerScheduler.dll) do ( - echo %%f - if not exist "%SERVERPATH%\%%f.org" ( - ren "%SERVERPATH%\%%f" "%%~nxf.org" - ) 2>nul - copy "%PROJECTPATH%\TvEngine3\TVLibrary\Plugins\%%~nf\bin\Debug\%%~nxf" "%SERVERPATH%\%%~f" -) -echo. -echo MediaPortal Common Library -echo ---------------------------------- -for %%f in (PowerScheduler.Interfaces.dll) do ( - echo %%f - if not exist "%SERVERPATH%\%%f.org" ( - ren "%SERVERPATH%\%%f" "%%~nxf.org" - ) 2>nul - copy "%PROJECTPATH%\Common-MP-TVE3\%%~nf\bin\Debug\%%~nxf" "%SERVERPATH%\%%~f" - if not exist "%CLIENTPATH%\%%f.org" ( - ren "%CLIENTPATH%\%%f" "%%~nxf.org" - ) 2>nul - copy "%PROJECTPATH%\Common-MP-TVE3\%%~nf\bin\Debug\%%~nxf" "%CLIENTPATH%\%%~f" -) -echo. -echo MediaPortal Client -echo ------------------ -for %%f in (plugins\process\PowerSchedulerClientPlugin.dll) do ( - echo %%f - if not exist "%CLIENTPATH%\%%f.org" ( - ren "%CLIENTPATH%\%%f" "%%~nxf.org" - ) 2>nul - copy "%PROJECTPATH%\mediaportal\%%~nf\bin\Debug\%%~nxf" "%CLIENTPATH%\%%~f" -) -echo. -echo Cleanup -echo ------------------ -move /Y "%SERVERLOGPATH%\tv.log" "%SERVERLOGPATH%\tv_old.log" -move /Y "%SERVERLOGPATH%\error.log" "%SERVERLOGPATH%\error_old.log" -net start tvservice -echo. -:end -exit \ No newline at end of file Deleted: trunk/plugins/PowerScheduler++/Test/RestoreFiles.bat =================================================================== --- trunk/plugins/PowerScheduler++/Test/RestoreFiles.bat 2012-02-09 16:46:42 UTC (rev 4441) +++ trunk/plugins/PowerScheduler++/Test/RestoreFiles.bat 2012-02-09 16:47:29 UTC (rev 4442) @@ -1,74 +0,0 @@ -@echo off -set PROJECTPATH=%~dp0 -if "%ProgramFiles(x86)%" == "" goto 32bit -set SERVERPATH=%ProgramFiles(x86)%\Team MediaPortal\MediaPortal TV Server -set CLIENTPATH=%ProgramFiles(x86)%\Team MediaPortal\MediaPortal -goto data -:32bit -set SERVERPATH=%ProgramFiles%\Team MediaPortal\MediaPortal TV Server -set CLIENTPATH=%ProgramFiles%\Team MediaPortal\MediaPortal -:data -if "%ProgramData%" == "" goto winXP -set SERVERLOGPATH=%ProgramData%\Team MediaPortal\MediaPortal TV Server\log -goto count -:winXP -set SERVERLOGPATH=%ALLUSERSPROFILE%\Application Data\Team MediaPortal\MediaPortal TV Server\log - -:count -set COUNT=1 - -echo Stopping TV Server -echo --------------------- -:stop -echo trying... -net stop tvservice > nul 2>nul -tasklist | find /i "tvservice" >nul 2>nul -if not %ERRORLEVEL% == 1 ( - ping localhost >nul 2>nul - set /a COUNT=%COUNT%+1 - if %COUNT% GTR 5 goto end - goto stop -) -echo. -echo MediaPortal TV Server -echo --------------------- -for %%f in (Plugins\PowerScheduler.dll) do ( - echo %%f - if exist "%SERVERPATH%\%%f.org" ( - del "%SERVERPATH%\%%f" - copy "%SERVERPATH%\%%f.org" "%SERVERPATH%\%%f" - ) 2>nul -) -echo. -echo MediaPortal Common Library -echo ---------------------------------- -for %%f in (PowerScheduler.Interfaces.dll) do ( - echo %%f - if exist "%SERVERPATH%\%%f.org" ( - del "%SERVERPATH%\%%f" - copy "%SERVERPATH%\%%f.org" "%SERVERPATH%\%%f" - ) 2>nul - if exist "%CLIENTPATH%\%%f.org" ( - del "%CLIENTPATH%\%%f" - copy "%CLIENTPATH%\%%f.org" "%CLIENTPATH%\%%f" - ) 2>nul -) -echo. -echo MediaPortal Client -echo ------------------ -for %%f in (plugins\process\PowerSchedulerClientPlugin.dll) do ( - echo %%f - if exist "%CLIENTPATH%\%%f.org" ( - del "%CLIENTPATH%\%%f" - copy "%CLIENTPATH%\%%f.org" "%CLIENTPATH%\%%f" - ) 2>nul -) -echo. -echo Cleanup -echo ------------------ -move /Y "%SERVERLOGPATH%\tv.log" "%SERVERLOGPATH%\tv_old.log" -net start tvservice -echo. -:end -pause -exit \ 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: <mic...@us...> - 2012-02-09 16:46:49
|
Revision: 4441 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=4441&view=rev Author: michael-t Date: 2012-02-09 16:46:42 +0000 (Thu, 09 Feb 2012) Log Message: ----------- Added Paths: ----------- trunk/plugins/PowerScheduler++/Test/test/Binaries/ trunk/plugins/PowerScheduler++/Test/test/Common-MP-TVE3/ trunk/plugins/PowerScheduler++/Test/test/MPEI/ trunk/plugins/PowerScheduler++/Test/test/PowerScheduler++.sln trunk/plugins/PowerScheduler++/Test/test/TvEngine3/ trunk/plugins/PowerScheduler++/Test/test/VersionInfo.cs trunk/plugins/PowerScheduler++/Test/test/mediaportal/ Removed Paths: ------------- trunk/plugins/PowerScheduler++/Test/Binaries/ trunk/plugins/PowerScheduler++/Test/Common-MP-TVE3/ trunk/plugins/PowerScheduler++/Test/MPEI/ trunk/plugins/PowerScheduler++/Test/PowerScheduler++.sln trunk/plugins/PowerScheduler++/Test/TvEngine3/ trunk/plugins/PowerScheduler++/Test/VersionInfo.cs trunk/plugins/PowerScheduler++/Test/mediaportal/ Deleted: trunk/plugins/PowerScheduler++/Test/PowerScheduler++.sln =================================================================== --- trunk/plugins/PowerScheduler++/Test/PowerScheduler++.sln 2012-02-09 16:44:42 UTC (rev 4440) +++ trunk/plugins/PowerScheduler++/Test/PowerScheduler++.sln 2012-02-09 16:46:42 UTC (rev 4441) @@ -1,60 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual C# Express 2010 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PowerScheduler.Interfaces", "Common-MP-TVE3\PowerScheduler.Interfaces\PowerScheduler.Interfaces.csproj", "{7701AA79-18D4-4A18-BB52-16774FB7943D}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PowerSchedulerClientPlugin", "mediaportal\PowerSchedulerClientPlugin\PowerSchedulerClientPlugin.csproj", "{CC77F438-DBD3-4D9C-80B1-C86BA50CF635}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PowerScheduler", "TvEngine3\TVLibrary\Plugins\PowerScheduler\PowerScheduler.csproj", "{3F8F1617-A987-4516-BF37-E01D04D2686F}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Debug|Mixed Platforms = Debug|Mixed Platforms - Debug|x86 = Debug|x86 - Release|Any CPU = Release|Any CPU - Release|Mixed Platforms = Release|Mixed Platforms - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {7701AA79-18D4-4A18-BB52-16774FB7943D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7701AA79-18D4-4A18-BB52-16774FB7943D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7701AA79-18D4-4A18-BB52-16774FB7943D}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 - {7701AA79-18D4-4A18-BB52-16774FB7943D}.Debug|Mixed Platforms.Build.0 = Debug|x86 - {7701AA79-18D4-4A18-BB52-16774FB7943D}.Debug|x86.ActiveCfg = Debug|x86 - {7701AA79-18D4-4A18-BB52-16774FB7943D}.Debug|x86.Build.0 = Debug|x86 - {7701AA79-18D4-4A18-BB52-16774FB7943D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7701AA79-18D4-4A18-BB52-16774FB7943D}.Release|Any CPU.Build.0 = Release|Any CPU - {7701AA79-18D4-4A18-BB52-16774FB7943D}.Release|Mixed Platforms.ActiveCfg = Release|x86 - {7701AA79-18D4-4A18-BB52-16774FB7943D}.Release|Mixed Platforms.Build.0 = Release|x86 - {7701AA79-18D4-4A18-BB52-16774FB7943D}.Release|x86.ActiveCfg = Release|x86 - {7701AA79-18D4-4A18-BB52-16774FB7943D}.Release|x86.Build.0 = Release|x86 - {CC77F438-DBD3-4D9C-80B1-C86BA50CF635}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {CC77F438-DBD3-4D9C-80B1-C86BA50CF635}.Debug|Any CPU.Build.0 = Debug|Any CPU - {CC77F438-DBD3-4D9C-80B1-C86BA50CF635}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 - {CC77F438-DBD3-4D9C-80B1-C86BA50CF635}.Debug|Mixed Platforms.Build.0 = Debug|x86 - {CC77F438-DBD3-4D9C-80B1-C86BA50CF635}.Debug|x86.ActiveCfg = Debug|x86 - {CC77F438-DBD3-4D9C-80B1-C86BA50CF635}.Debug|x86.Build.0 = Debug|x86 - {CC77F438-DBD3-4D9C-80B1-C86BA50CF635}.Release|Any CPU.ActiveCfg = Release|Any CPU - {CC77F438-DBD3-4D9C-80B1-C86BA50CF635}.Release|Any CPU.Build.0 = Release|Any CPU - {CC77F438-DBD3-4D9C-80B1-C86BA50CF635}.Release|Mixed Platforms.ActiveCfg = Release|x86 - {CC77F438-DBD3-4D9C-80B1-C86BA50CF635}.Release|Mixed Platforms.Build.0 = Release|x86 - {CC77F438-DBD3-4D9C-80B1-C86BA50CF635}.Release|x86.ActiveCfg = Release|x86 - {CC77F438-DBD3-4D9C-80B1-C86BA50CF635}.Release|x86.Build.0 = Release|x86 - {3F8F1617-A987-4516-BF37-E01D04D2686F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3F8F1617-A987-4516-BF37-E01D04D2686F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3F8F1617-A987-4516-BF37-E01D04D2686F}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 - {3F8F1617-A987-4516-BF37-E01D04D2686F}.Debug|Mixed Platforms.Build.0 = Debug|x86 - {3F8F1617-A987-4516-BF37-E01D04D2686F}.Debug|x86.ActiveCfg = Debug|x86 - {3F8F1617-A987-4516-BF37-E01D04D2686F}.Debug|x86.Build.0 = Debug|x86 - {3F8F1617-A987-4516-BF37-E01D04D2686F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3F8F1617-A987-4516-BF37-E01D04D2686F}.Release|Any CPU.Build.0 = Release|Any CPU - {3F8F1617-A987-4516-BF37-E01D04D2686F}.Release|Mixed Platforms.ActiveCfg = Release|x86 - {3F8F1617-A987-4516-BF37-E01D04D2686F}.Release|Mixed Platforms.Build.0 = Release|x86 - {3F8F1617-A987-4516-BF37-E01D04D2686F}.Release|x86.ActiveCfg = Release|x86 - {3F8F1617-A987-4516-BF37-E01D04D2686F}.Release|x86.Build.0 = Release|x86 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal Deleted: trunk/plugins/PowerScheduler++/Test/VersionInfo.cs =================================================================== --- trunk/plugins/PowerScheduler++/Test/VersionInfo.cs 2012-02-09 16:44:42 UTC (rev 4440) +++ trunk/plugins/PowerScheduler++/Test/VersionInfo.cs 2012-02-09 16:46:42 UTC (rev 4441) @@ -1,56 +0,0 @@ -#region Copyright (C) 2005-2011 Team MediaPortal - -// Copyright (C) 2005-2011 Team MediaPortal -// http://www.team-mediaportal.com -// -// MediaPortal 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 of the License, or -// (at your option) any later version. -// -// MediaPortal 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 MediaPortal. If not, see <http://www.gnu.org/licenses/>. - -#endregion - -using System.Reflection; -using System.Runtime.InteropServices; - - -// Allgemeine Informationen \xFCber eine Assembly werden \xFCber die folgenden -// Attribute gesteuert. \xC4ndern Sie diese Attributwerte, um die Informationen zu \xE4ndern, -// die mit einer Assembly verkn\xFCpft sind. - -#if DEBUG -[assembly: AssemblyConfiguration("Debug version")] -#else -[assembly: AssemblyConfiguration("")] -#endif - -[assembly: AssemblyCompany("Team MediaPortal")] -[assembly: AssemblyProduct("PowerScheduler++")] -[assembly: AssemblyCopyright("Copyright \xA9 2005-2011 Team MediaPortal")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: -[assembly: AssemblyVersion("1.2.5.12")] -[assembly: AssemblyFileVersion("1.2.5.12")] -[assembly: AssemblyInformationalVersion("1.2.5.12 alpha version for MP 1.2.x")] - - - - Copied: trunk/plugins/PowerScheduler++/Test/test/PowerScheduler++.sln (from rev 4440, trunk/plugins/PowerScheduler++/Test/PowerScheduler++.sln) =================================================================== --- trunk/plugins/PowerScheduler++/Test/test/PowerScheduler++.sln (rev 0) +++ trunk/plugins/PowerScheduler++/Test/test/PowerScheduler++.sln 2012-02-09 16:46:42 UTC (rev 4441) @@ -0,0 +1,60 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual C# Express 2010 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PowerScheduler.Interfaces", "Common-MP-TVE3\PowerScheduler.Interfaces\PowerScheduler.Interfaces.csproj", "{7701AA79-18D4-4A18-BB52-16774FB7943D}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PowerSchedulerClientPlugin", "mediaportal\PowerSchedulerClientPlugin\PowerSchedulerClientPlugin.csproj", "{CC77F438-DBD3-4D9C-80B1-C86BA50CF635}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PowerScheduler", "TvEngine3\TVLibrary\Plugins\PowerScheduler\PowerScheduler.csproj", "{3F8F1617-A987-4516-BF37-E01D04D2686F}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|Mixed Platforms = Debug|Mixed Platforms + Debug|x86 = Debug|x86 + Release|Any CPU = Release|Any CPU + Release|Mixed Platforms = Release|Mixed Platforms + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {7701AA79-18D4-4A18-BB52-16774FB7943D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7701AA79-18D4-4A18-BB52-16774FB7943D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7701AA79-18D4-4A18-BB52-16774FB7943D}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 + {7701AA79-18D4-4A18-BB52-16774FB7943D}.Debug|Mixed Platforms.Build.0 = Debug|x86 + {7701AA79-18D4-4A18-BB52-16774FB7943D}.Debug|x86.ActiveCfg = Debug|x86 + {7701AA79-18D4-4A18-BB52-16774FB7943D}.Debug|x86.Build.0 = Debug|x86 + {7701AA79-18D4-4A18-BB52-16774FB7943D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7701AA79-18D4-4A18-BB52-16774FB7943D}.Release|Any CPU.Build.0 = Release|Any CPU + {7701AA79-18D4-4A18-BB52-16774FB7943D}.Release|Mixed Platforms.ActiveCfg = Release|x86 + {7701AA79-18D4-4A18-BB52-16774FB7943D}.Release|Mixed Platforms.Build.0 = Release|x86 + {7701AA79-18D4-4A18-BB52-16774FB7943D}.Release|x86.ActiveCfg = Release|x86 + {7701AA79-18D4-4A18-BB52-16774FB7943D}.Release|x86.Build.0 = Release|x86 + {CC77F438-DBD3-4D9C-80B1-C86BA50CF635}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CC77F438-DBD3-4D9C-80B1-C86BA50CF635}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CC77F438-DBD3-4D9C-80B1-C86BA50CF635}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 + {CC77F438-DBD3-4D9C-80B1-C86BA50CF635}.Debug|Mixed Platforms.Build.0 = Debug|x86 + {CC77F438-DBD3-4D9C-80B1-C86BA50CF635}.Debug|x86.ActiveCfg = Debug|x86 + {CC77F438-DBD3-4D9C-80B1-C86BA50CF635}.Debug|x86.Build.0 = Debug|x86 + {CC77F438-DBD3-4D9C-80B1-C86BA50CF635}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CC77F438-DBD3-4D9C-80B1-C86BA50CF635}.Release|Any CPU.Build.0 = Release|Any CPU + {CC77F438-DBD3-4D9C-80B1-C86BA50CF635}.Release|Mixed Platforms.ActiveCfg = Release|x86 + {CC77F438-DBD3-4D9C-80B1-C86BA50CF635}.Release|Mixed Platforms.Build.0 = Release|x86 + {CC77F438-DBD3-4D9C-80B1-C86BA50CF635}.Release|x86.ActiveCfg = Release|x86 + {CC77F438-DBD3-4D9C-80B1-C86BA50CF635}.Release|x86.Build.0 = Release|x86 + {3F8F1617-A987-4516-BF37-E01D04D2686F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3F8F1617-A987-4516-BF37-E01D04D2686F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3F8F1617-A987-4516-BF37-E01D04D2686F}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 + {3F8F1617-A987-4516-BF37-E01D04D2686F}.Debug|Mixed Platforms.Build.0 = Debug|x86 + {3F8F1617-A987-4516-BF37-E01D04D2686F}.Debug|x86.ActiveCfg = Debug|x86 + {3F8F1617-A987-4516-BF37-E01D04D2686F}.Debug|x86.Build.0 = Debug|x86 + {3F8F1617-A987-4516-BF37-E01D04D2686F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3F8F1617-A987-4516-BF37-E01D04D2686F}.Release|Any CPU.Build.0 = Release|Any CPU + {3F8F1617-A987-4516-BF37-E01D04D2686F}.Release|Mixed Platforms.ActiveCfg = Release|x86 + {3F8F1617-A987-4516-BF37-E01D04D2686F}.Release|Mixed Platforms.Build.0 = Release|x86 + {3F8F1617-A987-4516-BF37-E01D04D2686F}.Release|x86.ActiveCfg = Release|x86 + {3F8F1617-A987-4516-BF37-E01D04D2686F}.Release|x86.Build.0 = Release|x86 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal Copied: trunk/plugins/PowerScheduler++/Test/test/VersionInfo.cs (from rev 4440, trunk/plugins/PowerScheduler++/Test/VersionInfo.cs) =================================================================== --- trunk/plugins/PowerScheduler++/Test/test/VersionInfo.cs (rev 0) +++ trunk/plugins/PowerScheduler++/Test/test/VersionInfo.cs 2012-02-09 16:46:42 UTC (rev 4441) @@ -0,0 +1,56 @@ +#region Copyright (C) 2005-2011 Team MediaPortal + +// Copyright (C) 2005-2011 Team MediaPortal +// http://www.team-mediaportal.com +// +// MediaPortal 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 of the License, or +// (at your option) any later version. +// +// MediaPortal 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 MediaPortal. If not, see <http://www.gnu.org/licenses/>. + +#endregion + +using System.Reflection; +using System.Runtime.InteropServices; + + +// Allgemeine Informationen \xFCber eine Assembly werden \xFCber die folgenden +// Attribute gesteuert. \xC4ndern Sie diese Attributwerte, um die Informationen zu \xE4ndern, +// die mit einer Assembly verkn\xFCpft sind. + +#if DEBUG +[assembly: AssemblyConfiguration("Debug version")] +#else +[assembly: AssemblyConfiguration("")] +#endif + +[assembly: AssemblyCompany("Team MediaPortal")] +[assembly: AssemblyProduct("PowerScheduler++")] +[assembly: AssemblyCopyright("Copyright \xA9 2005-2011 Team MediaPortal")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: +[assembly: AssemblyVersion("1.2.5.12")] +[assembly: AssemblyFileVersion("1.2.5.12")] +[assembly: AssemblyInformationalVersion("1.2.5.12 alpha version for MP 1.2.x")] + + + + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mic...@us...> - 2012-02-09 16:44:53
|
Revision: 4440 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=4440&view=rev Author: michael-t Date: 2012-02-09 16:44:42 +0000 (Thu, 09 Feb 2012) Log Message: ----------- Added Paths: ----------- trunk/plugins/PowerScheduler++/Test/test/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |