From: <che...@us...> - 2007-06-20 12:18:18
|
Revision: 571 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=571&view=rev Author: chef_koch Date: 2007-06-20 05:18:15 -0700 (Wed, 20 Jun 2007) Log Message: ----------- move 4 methods to region "Helper Routines" minor code cleanup Modified Paths: -------------- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/GUIPrograms.cs Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/GUIPrograms.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/GUIPrograms.cs 2007-06-20 12:09:31 UTC (rev 570) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/GUIPrograms.cs 2007-06-20 12:18:15 UTC (rev 571) @@ -671,6 +671,41 @@ } } + + bool RefreshButtonVisible() + { + if (lastApp == null) + { + return false; + } + else + { + return (lastApp.RefreshButtonVisible() && lastApp.GUIRefreshPossible && lastApp.EnableGUIRefresh); + } + } + + bool ThereAreAppsToDisplay() + { + if (lastApp == null) + { + return true; // root has globalApplicationList + } + else + { + return lastApp.SubItemsAllowed(); // grouper items for example + } + } + + bool ThereAreFilesOrLinksToDisplay() + { + return (lastApp != null); // all globalApplicationList can have files except the root + } + + bool IsBackButtonNecessary() + { + return (lastApp != null); // always show back button except for root + } + #endregion #region Overrides @@ -1112,64 +1147,21 @@ slideTime = (DateTime.Now.Ticks / 10000); // reset timer! } - bool RefreshButtonVisible() - { - if (lastApp == null) - { - return false; - } - else - { - return (lastApp.RefreshButtonVisible() && lastApp.GUIRefreshPossible && lastApp.EnableGUIRefresh); - } - } - - bool ThereAreAppsToDisplay() - { - if (lastApp == null) - { - return true; // root has globalApplicationList - } - else - { - return lastApp.SubItemsAllowed(); // grouper items for example - } - } - - bool ThereAreFilesOrLinksToDisplay() - { - return (lastApp != null); // all globalApplicationList can have files except the root - } - - bool IsBackButtonNecessary() - { - return (lastApp != null); // always show back button except for root - } - void UpdateListControl() { - int TotalItems = 0; GUIControl.ClearControl(GetID, facadeView.GetID); if (IsBackButtonNecessary()) - { ProgramUtils.AddBackButton(facadeView); - } + int TotalItems = 0; if (ThereAreAppsToDisplay()) - { - TotalItems = TotalItems + DisplayApps(); - } - + TotalItems += DisplayApps(); if (ThereAreFilesOrLinksToDisplay()) - { - TotalItems = TotalItems + DisplayFiles(); - } + TotalItems += DisplayFiles(); if (lastApp != null) - { facadeView.Sort(new ProgramSort(CurrentSortMethod, CurrentSortAsc)); - } - + string itemCountText = String.Format("{0} {1}", TotalItems, GUILocalizeStrings.Get(632)); GUIPropertyManager.SetProperty("#itemcount", itemCountText); @@ -1179,15 +1171,11 @@ } } - int DisplayFiles() { - int totalFiles = 0; - if (lastApp == null) - { - return totalFiles; - } - totalFiles = lastApp.DisplayFiles(this.lastFilepath, facadeView); + if (lastApp == null) return 0; + + int totalFiles = lastApp.DisplayFiles(this.lastFilepath, facadeView); return (totalFiles); } @@ -1255,7 +1243,6 @@ } } - #endregion #region EventHandlers @@ -1417,7 +1404,6 @@ } } - void OnItemSelected(GUIListItem item, GUIControl parent) { ThumbnailPath = ""; @@ -1436,7 +1422,6 @@ } } - void OnClick() { GUIListItem item = GetSelectedItem(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |