From: <che...@us...> - 2007-06-20 17:57:19
|
Revision: 575 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=575&view=rev Author: chef_koch Date: 2007-06-20 10:57:17 -0700 (Wed, 20 Jun 2007) Log Message: ----------- CurrentView is now called CurrentLayout ActualView is now called CurrentView 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:44:21 UTC (rev 574) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/GUIPrograms.cs 2007-06-20 17:57:17 UTC (rev 575) @@ -55,9 +55,6 @@ /// public class GUIPrograms : GUIWindow, ISetupForm, IShowPlugin { - static int startWindow = (int)GUIWindow.Window.WINDOW_FILES; - static string view = ""; - #region defaultOverrides /// <summary> /// If the plugin should have its own button on the main menu of Mediaportal then it @@ -220,19 +217,19 @@ public void SwitchToNextView() { - switch ((View)ViewAs) + switch ((Layout)ViewAs) { - case View.List: - ViewAs = (int)View.Icons; + case Layout.List: + ViewAs = (int)Layout.Icons; break; - case View.Icons: - ViewAs = (int)View.LargeIcons; + case Layout.Icons: + ViewAs = (int)Layout.LargeIcons; break; - case View.LargeIcons: - ViewAs = (int)View.FilmStrip; + case Layout.LargeIcons: + ViewAs = (int)Layout.FilmStrip; break; - case View.FilmStrip: - ViewAs = (int)View.List; + case Layout.FilmStrip: + ViewAs = (int)Layout.List; break; } } @@ -240,18 +237,18 @@ string GetViewAsText() { string result = ""; - switch ((View)ViewAs) + switch ((Layout)ViewAs) { - case View.List: + case Layout.List: result = GUILocalizeStrings.Get(101); break; - case View.Icons: + case Layout.Icons: result = GUILocalizeStrings.Get(100); break; - case View.LargeIcons: + case Layout.LargeIcons: result = GUILocalizeStrings.Get(417); break; - case View.FilmStrip: + case Layout.FilmStrip: result = GUILocalizeStrings.Get(733); break; } @@ -264,18 +261,18 @@ { using (Settings xmlwriter = new Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) { - switch ((View)mapSettings.ViewAs) + switch ((Layout)mapSettings.ViewAs) { - case View.List: + case Layout.List: xmlwriter.SetValue("myprograms", "viewby", "list"); break; - case View.Icons: + case Layout.Icons: xmlwriter.SetValue("myprograms", "viewby", "icons"); break; - case View.LargeIcons: + case Layout.LargeIcons: xmlwriter.SetValue("myprograms", "viewby", "largeicons"); break; - case View.FilmStrip: + case Layout.FilmStrip: xmlwriter.SetValue("myprograms", "viewby", "filmstrip"); break; } @@ -303,7 +300,7 @@ } xmlwriter.SetValue("myprograms", "startWindow", StartWindow.ToString()); - xmlwriter.SetValue("myprograms", "startview", ActualView); + xmlwriter.SetValue("myprograms", "startview", CurrentView); } } @@ -320,15 +317,15 @@ string curText = ""; curText = xmlreader.GetValueAsString("myprograms", "viewby", "list"); if (curText == "list") - mapSettings.ViewAs = (int)View.List; + mapSettings.ViewAs = (int)Layout.List; else if (curText == "icons") - mapSettings.ViewAs = (int)View.Icons; + mapSettings.ViewAs = (int)Layout.Icons; else if (curText == "largeicons") - mapSettings.ViewAs = (int)View.LargeIcons; + mapSettings.ViewAs = (int)Layout.LargeIcons; else if (curText == "filmstrip") - mapSettings.ViewAs = (int)View.FilmStrip; + mapSettings.ViewAs = (int)Layout.FilmStrip; else - mapSettings.ViewAs = (int)View.List; + mapSettings.ViewAs = (int)Layout.List; mapSettings.LastAppID = xmlreader.GetValueAsInt("myprograms", "lastAppID", -1); mapSettings.LastViewLevel = xmlreader.GetValueAsInt("myprograms", "lastViewLevel", -1); @@ -337,7 +334,7 @@ mapSettings.OverviewVisible = xmlreader.GetValueAsBool("myprograms", "sortasc", true); StartWindow = xmlreader.GetValueAsInt("myprograms", "startWindow", GetID); - ActualView = xmlreader.GetValueAsString("myprograms", "startview", String.Empty); + CurrentView = xmlreader.GetValueAsString("myprograms", "startview", String.Empty); } } @@ -377,7 +374,7 @@ #region SkinControls - enum View + enum Layout { List = 0, Icons = 1, @@ -470,6 +467,8 @@ #region Base & Content Variables + static int startWindow = (int)GUIWindow.Window.WINDOW_FILES; + static ApplicationItemList applicationList = DatabaseHandler.ApplicationItemList; MapSettings mapSettings = new MapSettings(); DirectoryHistory itemHistory = new DirectoryHistory(); @@ -481,7 +480,8 @@ bool skipInit = false; - View[,] views; + static string currentView = ""; + Layout[,] layout; bool[,] sortasc; ProgramSort.SortMethod[,] sortby; @@ -513,22 +513,37 @@ set { startWindow = value; } } - public string ActualView + public string CurrentView { - get { return view; } - set { view = value; } + get + { + return currentView; + } + set + { + if (value == null || value == "") + { + currentView = ""; + DatabaseSettings.viewHandler.CurrentView = null; + } + else + { + currentView = value; + DatabaseSettings.viewHandler.CurrentView = value; + } + } } - View CurrentView + Layout CurrentLayout {//maybe we can remove this property, not sure if we would need it get { if (DatabaseSettings.viewHandler.View == null) - return View.List; + return Layout.List; - if (views == null) + if (layout == null) { - views = new View[DatabaseSettings.viewHandler.Views.Count, 50]; + layout = new Layout[DatabaseSettings.viewHandler.Views.Count, 50]; List<String> viewStrings = new List<String>(); viewStrings.Add("List"); @@ -544,18 +559,18 @@ int defaultView = viewStrings.IndexOf(def.DefaultView); if (defaultView != -1) - views[i, j] = (View)defaultView; + layout[i, j] = (Layout)defaultView; else - views[i, j] = View.List; + layout[i, j] = Layout.List; } } } - return views[DatabaseSettings.viewHandler.Views.IndexOf(DatabaseSettings.viewHandler.View), DatabaseSettings.viewHandler.CurrentLevel]; + return layout[DatabaseSettings.viewHandler.Views.IndexOf(DatabaseSettings.viewHandler.View), DatabaseSettings.viewHandler.CurrentLevel]; } set { - views[DatabaseSettings.viewHandler.Views.IndexOf(DatabaseSettings.viewHandler.View), DatabaseSettings.viewHandler.CurrentLevel] = value; + layout[DatabaseSettings.viewHandler.Views.IndexOf(DatabaseSettings.viewHandler.View), DatabaseSettings.viewHandler.CurrentLevel] = value; } } @@ -697,8 +712,6 @@ protected override void OnPageLoad() { - string view = ActualView; - DatabaseSettings.viewHandler.CurrentView = view; base.OnPageLoad(); InitMyPrograms(); } @@ -894,21 +907,21 @@ { int itemIndex = facadeView.SelectedListItemIndex; - switch ((View)mapSettings.ViewAs) + switch ((Layout)mapSettings.ViewAs) { - case View.List: + case Layout.List: facadeView.View = GUIFacadeControl.ViewMode.List; screenShotImage.Visible = true; break; - case View.Icons: + case Layout.Icons: facadeView.View = GUIFacadeControl.ViewMode.SmallIcons; screenShotImage.Visible = false; break; - case View.LargeIcons: + case Layout.LargeIcons: facadeView.View = GUIFacadeControl.ViewMode.LargeIcons; screenShotImage.Visible = false; break; - case View.FilmStrip: + case Layout.FilmStrip: facadeView.View = GUIFacadeControl.ViewMode.Filmstrip; screenShotImage.Visible = false; break; @@ -1396,8 +1409,7 @@ { int nNewWindow = (int)Window.WINDOW_FILES; StartWindow = nNewWindow; - ActualView = ""; - DatabaseSettings.viewHandler.CurrentView = null; + CurrentView = ""; if (nNewWindow != GetID) { GUIWindowManager.ReplaceWindow(nNewWindow); @@ -1406,8 +1418,7 @@ else { ViewDefinition selectedView = (ViewDefinition)DatabaseSettings.viewHandler.Views[dlg.SelectedLabel - 1]; - DatabaseSettings.viewHandler.CurrentView = selectedView.Name; - ActualView = selectedView.Name; + CurrentView = selectedView.Name; int nNewWindow = (int)Window.WINDOW_FILES; if (GetID != nNewWindow) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |