From: <che...@us...> - 2007-06-20 17:44:22
|
Revision: 574 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=574&view=rev Author: chef_koch Date: 2007-06-20 10:44:21 -0700 (Wed, 20 Jun 2007) Log Message: ----------- cleanup for LoadSettings() Modified Paths: -------------- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/GUIPrograms.cs Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/GUIPrograms.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/GUIPrograms.cs 2007-06-20 17:16:03 UTC (rev 573) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/GUIPrograms.cs 2007-06-20 17:44:21 UTC (rev 574) @@ -318,45 +318,26 @@ using (Settings xmlreader = new Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) { string curText = ""; - curText = xmlreader.GetValue("myprograms", "viewby"); - if (curText != null) - { - if (curText == "list") - mapSettings.ViewAs = (int)View.List; - else if (curText == "icons") - mapSettings.ViewAs = (int)View.Icons; - else if (curText == "largeicons") - mapSettings.ViewAs = (int)View.LargeIcons; - else if (curText == "filmstrip") - mapSettings.ViewAs = (int)View.FilmStrip; - } + curText = xmlreader.GetValueAsString("myprograms", "viewby", "list"); + if (curText == "list") + mapSettings.ViewAs = (int)View.List; + else if (curText == "icons") + mapSettings.ViewAs = (int)View.Icons; + else if (curText == "largeicons") + mapSettings.ViewAs = (int)View.LargeIcons; + else if (curText == "filmstrip") + mapSettings.ViewAs = (int)View.FilmStrip; + else + mapSettings.ViewAs = (int)View.List; mapSettings.LastAppID = xmlreader.GetValueAsInt("myprograms", "lastAppID", -1); mapSettings.LastViewLevel = xmlreader.GetValueAsInt("myprograms", "lastViewLevel", -1); mapSettings.SortBy = xmlreader.GetValueAsInt("myprograms", "sortby", 0); - curText = xmlreader.GetValue("myprograms", "sortasc"); - if (curText != null) - { - mapSettings.SortAscending = (curText.ToLower() == "yes"); - } - else - { - mapSettings.SortAscending = true; - } + mapSettings.SortAscending = xmlreader.GetValueAsBool("myprograms", "sortasc", true); + mapSettings.OverviewVisible = xmlreader.GetValueAsBool("myprograms", "sortasc", true); - curText = xmlreader.GetValue("myprograms", "overviewvisible"); - if (curText != null) - { - mapSettings.OverviewVisible = (curText.ToLower() == "yes"); - } - else - { - mapSettings.OverviewVisible = true; - } - StartWindow = xmlreader.GetValueAsInt("myprograms", "startWindow", GetID); ActualView = xmlreader.GetValueAsString("myprograms", "startview", String.Empty); - } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |