From: <che...@us...> - 2007-06-09 17:57:10
|
Revision: 498 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=498&view=rev Author: chef_koch Date: 2007-06-09 10:57:08 -0700 (Sat, 09 Jun 2007) Log Message: ----------- changed View enumerator, like we have in music/videos Modified Paths: -------------- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/GUIPrograms.cs Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/GUIPrograms.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/GUIPrograms.cs 2007-06-09 17:38:49 UTC (rev 497) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/GUIPrograms.cs 2007-06-09 17:57:08 UTC (rev 498) @@ -221,17 +221,17 @@ { switch ((View)ViewAs) { - case View.VIEW_AS_LIST: - ViewAs = (int)View.VIEW_AS_ICONS; + case View.List: + ViewAs = (int)View.Icons; break; - case View.VIEW_AS_ICONS: - ViewAs = (int)View.VIEW_AS_LARGEICONS; + case View.Icons: + ViewAs = (int)View.LargeIcons; break; - case View.VIEW_AS_LARGEICONS: - ViewAs = (int)View.VIEW_AS_FILMSTRIP; + case View.LargeIcons: + ViewAs = (int)View.FilmStrip; break; - case View.VIEW_AS_FILMSTRIP: - ViewAs = (int)View.VIEW_AS_LIST; + case View.FilmStrip: + ViewAs = (int)View.List; break; } } @@ -241,16 +241,16 @@ string result = ""; switch ((View)ViewAs) { - case View.VIEW_AS_LIST: + case View.List: result = GUILocalizeStrings.Get(101); break; - case View.VIEW_AS_ICONS: + case View.Icons: result = GUILocalizeStrings.Get(100); break; - case View.VIEW_AS_LARGEICONS: + case View.LargeIcons: result = GUILocalizeStrings.Get(417); break; - case View.VIEW_AS_FILMSTRIP: + case View.FilmStrip: result = GUILocalizeStrings.Get(733); break; } @@ -265,16 +265,16 @@ { switch ((View)mapSettings.ViewAs) { - case View.VIEW_AS_LIST: + case View.List: xmlwriter.SetValue("myprograms", "viewby", "list"); break; - case View.VIEW_AS_ICONS: + case View.Icons: xmlwriter.SetValue("myprograms", "viewby", "icons"); break; - case View.VIEW_AS_LARGEICONS: + case View.LargeIcons: xmlwriter.SetValue("myprograms", "viewby", "largeicons"); break; - case View.VIEW_AS_FILMSTRIP: + case View.FilmStrip: xmlwriter.SetValue("myprograms", "viewby", "filmstrip"); break; } @@ -321,13 +321,13 @@ if (curText != null) { if (curText == "list") - mapSettings.ViewAs = (int)View.VIEW_AS_LIST; + mapSettings.ViewAs = (int)View.List; else if (curText == "icons") - mapSettings.ViewAs = (int)View.VIEW_AS_ICONS; + mapSettings.ViewAs = (int)View.Icons; else if (curText == "largeicons") - mapSettings.ViewAs = (int)View.VIEW_AS_LARGEICONS; + mapSettings.ViewAs = (int)View.LargeIcons; else if (curText == "filmstrip") - mapSettings.ViewAs = (int)View.VIEW_AS_FILMSTRIP; + mapSettings.ViewAs = (int)View.FilmStrip; } mapSettings.LastAppID = xmlreader.GetValueAsInt("myprograms", "lastAppID", -1); @@ -397,13 +397,12 @@ enum View { - VIEW_AS_LIST = 0, - VIEW_AS_ICONS = 1, - VIEW_AS_LARGEICONS = 2, - VIEW_AS_FILMSTRIP = 3, + List = 0, + Icons = 1, + LargeIcons = 2, + FilmStrip = 3, } - // Buttons [SkinControl(2)] protected GUIButtonControl btnViewAs = null; @@ -544,7 +543,6 @@ } } - public int StartWindow { get { return startWindow; } @@ -938,22 +936,22 @@ { int itemIndex = facadeView.SelectedListItemIndex; - if (mapSettings.ViewAs == (int)View.VIEW_AS_LIST) + if (mapSettings.ViewAs == (int)View.List) { facadeView.View = GUIFacadeControl.ViewMode.List; screenShotImage.Visible = true; } - else if (mapSettings.ViewAs == (int)View.VIEW_AS_ICONS) + else if (mapSettings.ViewAs == (int)View.Icons) { facadeView.View = GUIFacadeControl.ViewMode.SmallIcons; screenShotImage.Visible = false; } - else if (mapSettings.ViewAs == (int)View.VIEW_AS_LARGEICONS) + else if (mapSettings.ViewAs == (int)View.LargeIcons) { facadeView.View = GUIFacadeControl.ViewMode.LargeIcons; screenShotImage.Visible = false; } - else if (mapSettings.ViewAs == (int)View.VIEW_AS_FILMSTRIP) + else if (mapSettings.ViewAs == (int)View.FilmStrip) { facadeView.View = GUIFacadeControl.ViewMode.Filmstrip; screenShotImage.Visible = false; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <che...@us...> - 2007-06-17 19:11:06
|
Revision: 566 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=566&view=rev Author: chef_koch Date: 2007-06-17 12:11:03 -0700 (Sun, 17 Jun 2007) Log Message: ----------- yet another small cleanup Modified Paths: -------------- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/GUIPrograms.cs Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/GUIPrograms.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/GUIPrograms.cs 2007-06-17 15:37:03 UTC (rev 565) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/GUIPrograms.cs 2007-06-17 19:11:03 UTC (rev 566) @@ -964,7 +964,6 @@ } } - public override bool OnMessage(GUIMessage message) { switch (message.Message) @@ -985,31 +984,26 @@ return base.OnMessage(message); } - public override void OnAction(Action action) { - if (action.wID == Action.ActionType.ACTION_PARENT_DIR || action.wID == Action.ActionType.ACTION_PREVIOUS_MENU) + switch (action.wID) { - // <U> keypress - BackItemClicked(); - UpdateButtons(); - return; + case action.wID == Action.ActionType.ACTION_PARENT_DIR: + case action.wID == Action.ActionType.ACTION_PREVIOUS_MENU: + // <U> keypress + BackItemClicked(); + UpdateButtons(); + break; + case Action.ActionType.ACTION_CLOSE_DIALOG: + SaveFolderSettings(""); + GUIWindowManager.ShowPreviousWindow(); + break; + case Action.ActionType.ACTION_SHOW_INFO: + OnInfo(); + break; + default: + base.OnAction(action); } - - // if (action.wID == Action.ActionType.ACTION_CLOSE_DIALOG || action.wID == Action.ActionType.ACTION_PREVIOUS_MENU) - if (action.wID == Action.ActionType.ACTION_CLOSE_DIALOG) - { - SaveFolderSettings(""); - GUIWindowManager.ShowPreviousWindow(); - return; - } - - if (action.wID == Action.ActionType.ACTION_SHOW_INFO) - { - OnInfo(); - return; - } - base.OnAction(action); } #endregion @@ -1121,9 +1115,6 @@ slideTime = (DateTime.Now.Ticks / 10000); // reset timer! } - - - bool RefreshButtonVisible() { if (lastApp == null) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <che...@us...> - 2007-06-17 19:18:01
|
Revision: 567 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=567&view=rev Author: chef_koch Date: 2007-06-17 12:17:57 -0700 (Sun, 17 Jun 2007) Log Message: ----------- fixed my cleanup sorry ;) Modified Paths: -------------- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/GUIPrograms.cs Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/GUIPrograms.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/GUIPrograms.cs 2007-06-17 19:11:03 UTC (rev 566) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/GUIPrograms.cs 2007-06-17 19:17:57 UTC (rev 567) @@ -988,8 +988,8 @@ { switch (action.wID) { - case action.wID == Action.ActionType.ACTION_PARENT_DIR: - case action.wID == Action.ActionType.ACTION_PREVIOUS_MENU: + case Action.ActionType.ACTION_PARENT_DIR: + case Action.ActionType.ACTION_PREVIOUS_MENU: // <U> keypress BackItemClicked(); UpdateButtons(); @@ -1003,6 +1003,7 @@ break; default: base.OnAction(action); + break; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
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. |
From: <che...@us...> - 2007-06-20 12:27:59
|
Revision: 572 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=572&view=rev Author: chef_koch Date: 2007-06-20 05:27:51 -0700 (Wed, 20 Jun 2007) Log Message: ----------- 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:18:15 UTC (rev 571) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/GUIPrograms.cs 2007-06-20 12:27:51 UTC (rev 572) @@ -1081,27 +1081,26 @@ void ShowThumbPanel() { int itemIndex = facadeView.SelectedListItemIndex; - - if (mapSettings.ViewAs == (int)View.List) + + switch ((View)mapSettings.ViewAs) { - facadeView.View = GUIFacadeControl.ViewMode.List; - screenShotImage.Visible = true; + case View.List: + facadeView.View = GUIFacadeControl.ViewMode.List; + screenShotImage.Visible = true; + break; + case View.Icons: + facadeView.View = GUIFacadeControl.ViewMode.SmallIcons; + screenShotImage.Visible = false; + break; + case View.LargeIcons: + facadeView.View = GUIFacadeControl.ViewMode.LargeIcons; + screenShotImage.Visible = false; + break; + case View.FilmStrip: + facadeView.View = GUIFacadeControl.ViewMode.Filmstrip; + screenShotImage.Visible = false; + break; } - else if (mapSettings.ViewAs == (int)View.Icons) - { - facadeView.View = GUIFacadeControl.ViewMode.SmallIcons; - screenShotImage.Visible = false; - } - else if (mapSettings.ViewAs == (int)View.LargeIcons) - { - facadeView.View = GUIFacadeControl.ViewMode.LargeIcons; - screenShotImage.Visible = false; - } - else if (mapSettings.ViewAs == (int)View.FilmStrip) - { - facadeView.View = GUIFacadeControl.ViewMode.Filmstrip; - screenShotImage.Visible = false; - } facadeView.SelectedListItemIndex = itemIndex; UpdateButtons(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <che...@us...> - 2007-06-20 17:16:11
|
Revision: 573 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=573&view=rev Author: chef_koch Date: 2007-06-20 10:16:03 -0700 (Wed, 20 Jun 2007) Log Message: ----------- no code change, just a reorder of the some methods 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:27:51 UTC (rev 572) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/GUIPrograms.cs 2007-06-20 17:16:03 UTC (rev 573) @@ -526,28 +526,6 @@ } } - GUIListItem GetSelectedItem() - { - return facadeView.SelectedListItem; - } - - int GetSelectedItemNo() - { - return facadeView.SelectedListItemIndex; - } - - int GetCurrentFatherID() - { - if (lastApp != null) - { - return lastApp.AppID; - } - else - { - return -1; // root - } - } - public int StartWindow { get { return startWindow; } @@ -671,7 +649,28 @@ } } + GUIListItem GetSelectedItem() + { + return facadeView.SelectedListItem; + } + int GetSelectedItemNo() + { + return facadeView.SelectedListItemIndex; + } + + int GetCurrentFatherID() + { + if (lastApp != null) + { + return lastApp.AppID; + } + else + { + return -1; // root + } + } + bool RefreshButtonVisible() { if (lastApp == null) @@ -729,158 +728,83 @@ base.OnPageDestroy(newWindowId); } - public override void Render(float timePassed) + public override void OnAction(Action action) { - base.Render(timePassed); - - if (ThumbnailPath != _lastThumbnailPath) + switch (action.wID) { - screenShotImage.FileName = ThumbnailPath; - facadeView.FilmstripView.InfoImageFileName = ThumbnailPath; - facadeView.FilmstripView.NeedRefresh(); - - _lastThumbnailPath = ThumbnailPath; + case Action.ActionType.ACTION_PARENT_DIR: + case Action.ActionType.ACTION_PREVIOUS_MENU: + // <U> keypress + BackItemClicked(); + UpdateButtons(); + break; + case Action.ActionType.ACTION_CLOSE_DIALOG: + SaveFolderSettings(""); + GUIWindowManager.ShowPreviousWindow(); + break; + case Action.ActionType.ACTION_SHOW_INFO: + OnInfo(); + break; + default: + base.OnAction(action); + break; } - - RenderThumbnail(timePassed); } - /* public override void AllocResources() - { - base.AllocResources(); - if (screenShotImage != null) screenShotImage.AllocResources(); - } - public override void FreeResources() - { - base.FreeResources(); - if (screenShotImage != null) screenShotImage.FreeResources(); - }*/ - - /* public override void Render(float timePassed) - { - base.Render(timePassed); - RenderFilmStrip(); - RenderScreenShot(timePassed); - } - */ - void OnInfo() + public override bool OnMessage(GUIMessage message) { - // <F3> keypress - if (null != lastApp) + switch (message.Message) { - selectedItemIndex = GetSelectedItemNo(); - GUIListItem item = GetSelectedItem(); - - FileItem curFile = null; - - if (!item.Label.Equals(ProgramUtils.cBackLabel) && (!item.IsFolder)) - { - if ((item.MusicTag != null) && (item.MusicTag is FileItem)) + case GUIMessage.MessageType.GUI_MSG_ITEM_FOCUS_CHANGED: { - curFile = (FileItem)item.MusicTag; - } - // show file info but only if the selected item is not the back button - bool ovVisible = mapSettings.OverviewVisible; - ProgramInfoAction modalResult = ProgramInfoAction.LookupFileInfo; - int selectedFileID = -1; - lastApp.OnInfo(item, ref ovVisible, ref modalResult, ref selectedFileID); - if ((null != curFile) && (modalResult == ProgramInfoAction.LookupFileInfo)) - { - FileItem scrapeFile = lastApp.Files.GetFileItemByID(selectedFileID); - if (null != scrapeFile) + int iControl = message.SenderControlId; + if (iControl == facadeView.GetID) { - int scrapeIndex = lastApp.Files.IndexOf(scrapeFile); - if (-1 != scrapeIndex) + if (lastApp != null) { - GUIControl.SelectItemControl(GetID, facadeView.GetID, scrapeIndex + 1); + lastApp.ResetThumbs(); } - ScrapeFileInfo(scrapeFile); } } - mapSettings.OverviewVisible = ovVisible; - UpdateListControl(); - } + break; } + return base.OnMessage(message); } - void ScrapeFileInfo(FileItem curFile) + protected override void OnClicked(int controlId, GUIControl control, Action.ActionType actionType) { - int minRelevance = 30; - bool bSuccess = false; - ScraperSaveType saveType = ScraperSaveType.DataAndImages; - GUIDialogOK dlgOk = (GUIDialogOK)GUIWindowManager.GetWindow((int)Window.WINDOW_DIALOG_OK); - GUIDialogProgress dlgProgress = (GUIDialogProgress)GUIWindowManager.GetWindow((int)Window.WINDOW_DIALOG_PROGRESS); - dlgProgress.ShowWaitCursor = false; - dlgProgress.ShowProgressBar(false); - dlgProgress.SetHeading("Lookup Gameinfo"); - dlgProgress.SetLine(1, curFile.Title); - dlgProgress.SetLine(2, curFile.System_); - dlgProgress.SetLine(3, ""); - dlgProgress.StartModal(GetID); - // dlgProgress.SetPercentage(60); - dlgProgress.Progress(); - bSuccess = curFile.FindFileInfo(ScraperType.ALLGAME); - if ((bSuccess && curFile.FileInfoList.Count > 0) && ((FileItemInfo)(curFile.FileInfoList[0])).RelevanceNorm >= minRelevance) + base.OnClicked(controlId, control, actionType); + if (control == btnViewAs) { - GUIDialogSelect pDlg = (GUIDialogSelect)GUIWindowManager.GetWindow((int)Window.WINDOW_DIALOG_SELECT); - if (null != pDlg) - { - pDlg.Reset(); - pDlg.SetHeading("Select Title"); - foreach (FileItemInfo item in curFile.FileInfoList) - { - if (item.RelevanceNorm >= minRelevance) - { - pDlg.Add(String.Format("{0} ({1})", item.Title, item.Platform)); - } - } - pDlg.DoModal(GetID); + mapSettings.SwitchToNextView(); + ShowThumbPanel(); - // and wait till user selects one - int iSelectedGame = pDlg.SelectedLabel; - if (iSelectedGame < 0) return; - - dlgProgress.StartModal(GetID); - dlgProgress.Progress(); - dlgProgress.ShowProgressBar(false); - curFile.FileInfoFavourite = (FileItemInfo)curFile.FileInfoList[iSelectedGame]; - - curFile.FindFileInfoDetail(lastApp, curFile.FileInfoFavourite, ScraperType.ALLGAME, saveType); - if ((saveType == ScraperSaveType.DataAndImages) || (saveType == ScraperSaveType.Data)) - { - // dlgProgress.SetPercentage(60); - dlgProgress.Progress(); - curFile.SaveFromFileInfoFavourite(); - } - // dlgProgress.SetPercentage(100); - dlgProgress.Progress(); - dlgProgress.Close(); - dlgProgress = null; - } - OnInfo(); } - else + else if (control == btnRefresh) { - string strMsg = ""; - if (!bSuccess) + if (lastApp != null) { - strMsg = "Connection failed"; - Log.Info("myPrograms: RefreshData failed"); + lastApp.Refresh(true); + lastFilepath = lastApp.DefaultFilepath(); + // todo: reset viewHandler + UpdateButtons(); + UpdateListControl(); } - else + } + else if (control == btnViews) + { + OnShowViews(); + } + else if (control == facadeView) + { + // application or file-item was clicked.... + if (actionType == Action.ActionType.ACTION_SELECT_ITEM) { - strMsg = String.Format("No match for '{0}'", curFile.Title); - Log.Info("myPrograms: No data found for '{0}'", curFile.Title); + OnClick(); } - if (null != dlgOk) - { - dlgOk.SetHeading(187); - dlgOk.SetLine(1, strMsg); - dlgOk.SetLine(2, String.Empty); - dlgOk.DoModal(GetID); - } } } + protected override void OnShowContextMenu() { GUIListItem item = facadeView.SelectedListItem; @@ -910,137 +834,44 @@ } } - protected void OnShowViews() + public override void Render(float timePassed) { - GUIDialogMenu dlg = (GUIDialogMenu)GUIWindowManager.GetWindow((int)Window.WINDOW_DIALOG_MENU); - if (dlg == null) return; - dlg.Reset(); - dlg.SetHeading(499); // Actions - dlg.Add(GUILocalizeStrings.Get(100000 + GetID)); // Files - foreach (ViewDefinition view in DatabaseSettings.viewHandler.Views) + base.Render(timePassed); + + if (ThumbnailPath != _lastThumbnailPath) { - dlg.Add(view.LocalizedName); + screenShotImage.FileName = ThumbnailPath; + facadeView.FilmstripView.InfoImageFileName = ThumbnailPath; + facadeView.FilmstripView.NeedRefresh(); + + _lastThumbnailPath = ThumbnailPath; } - dlg.DoModal(GetID); - if (dlg.SelectedLabel == -1) return; - if (dlg.SelectedLabel == 0) - { - int nNewWindow = (int)Window.WINDOW_FILES; - StartWindow = nNewWindow; - ActualView = ""; - DatabaseSettings.viewHandler.CurrentView = null; - if (nNewWindow != GetID) - { - GUIWindowManager.ReplaceWindow(nNewWindow); - } - } - else - { - ViewDefinition selectedView = (ViewDefinition)DatabaseSettings.viewHandler.Views[dlg.SelectedLabel - 1]; - DatabaseSettings.viewHandler.CurrentView = selectedView.Name; - ActualView = selectedView.Name; - int nNewWindow = (int)Window.WINDOW_FILES; - if (GetID != nNewWindow) - { - StartWindow = nNewWindow; - if (nNewWindow != GetID) - { - GUIWindowManager.ReplaceWindow(nNewWindow); - } - } - else - { - if (facadeView.Count <= 0) - { - GUIControl.FocusControl(GetID, btnViewAs.GetID); - } - } - } - if (lastApp != null) - { - lastApp.LoadFiles(); - } - UpdateButtons(); - UpdateListControl(); + + RenderThumbnail(timePassed); } - - protected override void OnClicked(int controlId, GUIControl control, Action.ActionType actionType) + #region old (maybe obsolete) code: AllocResources() / FreeResources() / Render(float timePassed) + /* + public override void AllocResources() { - base.OnClicked(controlId, control, actionType); - if (control == btnViewAs) - { - mapSettings.SwitchToNextView(); - ShowThumbPanel(); - - } - else if (control == btnRefresh) - { - if (lastApp != null) - { - lastApp.Refresh(true); - lastFilepath = lastApp.DefaultFilepath(); - // todo: reset viewHandler - UpdateButtons(); - UpdateListControl(); - } - } - else if (control == btnViews) - { - OnShowViews(); - } - else if (control == facadeView) - { - // application or file-item was clicked.... - if (actionType == Action.ActionType.ACTION_SELECT_ITEM) - { - OnClick(); - } - } + base.AllocResources(); + if (screenShotImage != null) screenShotImage.AllocResources(); } - public override bool OnMessage(GUIMessage message) + public override void FreeResources() { - switch (message.Message) - { - case GUIMessage.MessageType.GUI_MSG_ITEM_FOCUS_CHANGED: - { - int iControl = message.SenderControlId; - if (iControl == facadeView.GetID) - { - if (lastApp != null) - { - lastApp.ResetThumbs(); - } - } - } - break; - } - return base.OnMessage(message); + base.FreeResources(); + if (screenShotImage != null) screenShotImage.FreeResources(); } - public override void OnAction(Action action) + public override void Render(float timePassed) { - switch (action.wID) - { - case Action.ActionType.ACTION_PARENT_DIR: - case Action.ActionType.ACTION_PREVIOUS_MENU: - // <U> keypress - BackItemClicked(); - UpdateButtons(); - break; - case Action.ActionType.ACTION_CLOSE_DIALOG: - SaveFolderSettings(""); - GUIWindowManager.ShowPreviousWindow(); - break; - case Action.ActionType.ACTION_SHOW_INFO: - OnInfo(); - break; - default: - base.OnAction(action); - break; - } + base.Render(timePassed); + RenderFilmStrip(); + RenderScreenShot(timePassed); } + */ + #endregion #endregion @@ -1081,7 +912,7 @@ void ShowThumbPanel() { int itemIndex = facadeView.SelectedListItemIndex; - + switch ((View)mapSettings.ViewAs) { case View.List: @@ -1160,7 +991,7 @@ if (lastApp != null) facadeView.Sort(new ProgramSort(CurrentSortMethod, CurrentSortAsc)); - + string itemCountText = String.Format("{0} {1}", TotalItems, GUILocalizeStrings.Get(632)); GUIPropertyManager.SetProperty("#itemcount", itemCountText); @@ -1246,66 +1077,6 @@ #region EventHandlers - void FileItemClicked(GUIListItem item) - { - // file item was clicked => launch it! - if (lastApp != null) - { - mapSettings.LastAppID = lastApp.AppID; - lastFilepath = lastApp.DefaultFilepath(); - lastApp.LaunchFile(item); - } - } - - void FolderItemClicked(GUIListItem item) - { - if (item.MusicTag != null) - { - if (item.MusicTag is ApplicationItem) - { - - ApplicationItem candidate = (ApplicationItem)item.MusicTag; - - - SaveItemIndex(GetSelectedItemNo().ToString(), lastApp, lastFilepath); - lastApp = candidate; - mapSettings.LastAppID = lastApp.AppID; - lastFilepath = lastApp.DefaultFilepath(); - DatabaseSettings.viewHandler.CurrentLevel = 0; - - } - else if (item.MusicTag is FileItem) - { - SaveItemIndex(GetSelectedItemNo().ToString(), lastApp, lastFilepath); - // example: subfolder in directory-cache mode - // => set filepath which will be a search criteria for sql / browse - if (lastFilepath == "") - { - // first subfolder - lastFilepath = lastApp.FileDirectory + "\\" + item.Label; - } - else - { - // subsequent subfolder - lastFilepath = lastFilepath + "\\" + item.Label; - } - } - else if (item.MusicTag is ProgramFilterItem) - { - AddNextFilter(item); - } - UpdateListControl(); - } - else - { - // tag is null - // example: subfolder in directory-browse mode - SaveItemIndex(GetSelectedItemNo().ToString(), lastApp, lastFilepath); - lastFilepath = item.Path; - UpdateListControl(); - } - } - void BackItemClicked() { if (lastApp != null) @@ -1374,6 +1145,66 @@ } + void FileItemClicked(GUIListItem item) + { + // file item was clicked => launch it! + if (lastApp != null) + { + mapSettings.LastAppID = lastApp.AppID; + lastFilepath = lastApp.DefaultFilepath(); + lastApp.LaunchFile(item); + } + } + + void FolderItemClicked(GUIListItem item) + { + if (item.MusicTag != null) + { + if (item.MusicTag is ApplicationItem) + { + + ApplicationItem candidate = (ApplicationItem)item.MusicTag; + + + SaveItemIndex(GetSelectedItemNo().ToString(), lastApp, lastFilepath); + lastApp = candidate; + mapSettings.LastAppID = lastApp.AppID; + lastFilepath = lastApp.DefaultFilepath(); + DatabaseSettings.viewHandler.CurrentLevel = 0; + + } + else if (item.MusicTag is FileItem) + { + SaveItemIndex(GetSelectedItemNo().ToString(), lastApp, lastFilepath); + // example: subfolder in directory-cache mode + // => set filepath which will be a search criteria for sql / browse + if (lastFilepath == "") + { + // first subfolder + lastFilepath = lastApp.FileDirectory + "\\" + item.Label; + } + else + { + // subsequent subfolder + lastFilepath = lastFilepath + "\\" + item.Label; + } + } + else if (item.MusicTag is ProgramFilterItem) + { + AddNextFilter(item); + } + UpdateListControl(); + } + else + { + // tag is null + // example: subfolder in directory-browse mode + SaveItemIndex(GetSelectedItemNo().ToString(), lastApp, lastFilepath); + lastFilepath = item.Path; + UpdateListControl(); + } + } + void AddNextFilter(GUIListItem item) { ProgramFilterItem curFilter; @@ -1403,6 +1234,85 @@ } } + void ScrapeFileInfo(FileItem curFile) + { + int minRelevance = 30; + bool bSuccess = false; + ScraperSaveType saveType = ScraperSaveType.DataAndImages; + GUIDialogOK dlgOk = (GUIDialogOK)GUIWindowManager.GetWindow((int)Window.WINDOW_DIALOG_OK); + GUIDialogProgress dlgProgress = (GUIDialogProgress)GUIWindowManager.GetWindow((int)Window.WINDOW_DIALOG_PROGRESS); + dlgProgress.ShowWaitCursor = false; + dlgProgress.ShowProgressBar(false); + dlgProgress.SetHeading("Lookup Gameinfo"); + dlgProgress.SetLine(1, curFile.Title); + dlgProgress.SetLine(2, curFile.System_); + dlgProgress.SetLine(3, ""); + dlgProgress.StartModal(GetID); + // dlgProgress.SetPercentage(60); + dlgProgress.Progress(); + bSuccess = curFile.FindFileInfo(ScraperType.ALLGAME); + if ((bSuccess && curFile.FileInfoList.Count > 0) && ((FileItemInfo)(curFile.FileInfoList[0])).RelevanceNorm >= minRelevance) + { + GUIDialogSelect pDlg = (GUIDialogSelect)GUIWindowManager.GetWindow((int)Window.WINDOW_DIALOG_SELECT); + if (null != pDlg) + { + pDlg.Reset(); + pDlg.SetHeading("Select Title"); + foreach (FileItemInfo item in curFile.FileInfoList) + { + if (item.RelevanceNorm >= minRelevance) + { + pDlg.Add(String.Format("{0} ({1})", item.Title, item.Platform)); + } + } + pDlg.DoModal(GetID); + + // and wait till user selects one + int iSelectedGame = pDlg.SelectedLabel; + if (iSelectedGame < 0) return; + + dlgProgress.StartModal(GetID); + dlgProgress.Progress(); + dlgProgress.ShowProgressBar(false); + curFile.FileInfoFavourite = (FileItemInfo)curFile.FileInfoList[iSelectedGame]; + + curFile.FindFileInfoDetail(lastApp, curFile.FileInfoFavourite, ScraperType.ALLGAME, saveType); + if ((saveType == ScraperSaveType.DataAndImages) || (saveType == ScraperSaveType.Data)) + { + // dlgProgress.SetPercentage(60); + dlgProgress.Progress(); + curFile.SaveFromFileInfoFavourite(); + } + // dlgProgress.SetPercentage(100); + dlgProgress.Progress(); + dlgProgress.Close(); + dlgProgress = null; + } + OnInfo(); + } + else + { + string strMsg = ""; + if (!bSuccess) + { + strMsg = "Connection failed"; + Log.Info("myPrograms: RefreshData failed"); + } + else + { + strMsg = String.Format("No match for '{0}'", curFile.Title); + Log.Info("myPrograms: No data found for '{0}'", curFile.Title); + } + if (null != dlgOk) + { + dlgOk.SetHeading(187); + dlgOk.SetLine(1, strMsg); + dlgOk.SetLine(2, String.Empty); + dlgOk.DoModal(GetID); + } + } + } + void OnItemSelected(GUIListItem item, GUIControl parent) { ThumbnailPath = ""; @@ -1448,6 +1358,100 @@ } } + void OnInfo() + { + // <F3> keypress + if (null != lastApp) + { + selectedItemIndex = GetSelectedItemNo(); + GUIListItem item = GetSelectedItem(); + + FileItem curFile = null; + + if (!item.Label.Equals(ProgramUtils.cBackLabel) && (!item.IsFolder)) + { + if ((item.MusicTag != null) && (item.MusicTag is FileItem)) + { + curFile = (FileItem)item.MusicTag; + } + // show file info but only if the selected item is not the back button + bool ovVisible = mapSettings.OverviewVisible; + ProgramInfoAction modalResult = ProgramInfoAction.LookupFileInfo; + int selectedFileID = -1; + lastApp.OnInfo(item, ref ovVisible, ref modalResult, ref selectedFileID); + if ((null != curFile) && (modalResult == ProgramInfoAction.LookupFileInfo)) + { + FileItem scrapeFile = lastApp.Files.GetFileItemByID(selectedFileID); + if (null != scrapeFile) + { + int scrapeIndex = lastApp.Files.IndexOf(scrapeFile); + if (-1 != scrapeIndex) + { + GUIControl.SelectItemControl(GetID, facadeView.GetID, scrapeIndex + 1); + } + ScrapeFileInfo(scrapeFile); + } + } + mapSettings.OverviewVisible = ovVisible; + UpdateListControl(); + } + } + } + + void OnShowViews() + { + GUIDialogMenu dlg = (GUIDialogMenu)GUIWindowManager.GetWindow((int)Window.WINDOW_DIALOG_MENU); + if (dlg == null) return; + dlg.Reset(); + dlg.SetHeading(499); // Actions + dlg.Add(GUILocalizeStrings.Get(100000 + GetID)); // Files + foreach (ViewDefinition view in DatabaseSettings.viewHandler.Views) + { + dlg.Add(view.LocalizedName); + } + dlg.DoModal(GetID); + if (dlg.SelectedLabel == -1) return; + if (dlg.SelectedLabel == 0) + { + int nNewWindow = (int)Window.WINDOW_FILES; + StartWindow = nNewWindow; + ActualView = ""; + DatabaseSettings.viewHandler.CurrentView = null; + if (nNewWindow != GetID) + { + GUIWindowManager.ReplaceWindow(nNewWindow); + } + } + else + { + ViewDefinition selectedView = (ViewDefinition)DatabaseSettings.viewHandler.Views[dlg.SelectedLabel - 1]; + DatabaseSettings.viewHandler.CurrentView = selectedView.Name; + ActualView = selectedView.Name; + int nNewWindow = (int)Window.WINDOW_FILES; + if (GetID != nNewWindow) + { + StartWindow = nNewWindow; + if (nNewWindow != GetID) + { + GUIWindowManager.ReplaceWindow(nNewWindow); + } + } + else + { + if (facadeView.Count <= 0) + { + GUIControl.FocusControl(GetID, btnViewAs.GetID); + } + } + } + if (lastApp != null) + { + lastApp.LoadFiles(); + } + UpdateButtons(); + UpdateListControl(); + } + #endregion } } \ 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: <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. |
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. |
From: <che...@us...> - 2007-06-20 20:11:20
|
Revision: 582 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=582&view=rev Author: chef_koch Date: 2007-06-20 13:11:19 -0700 (Wed, 20 Jun 2007) Log Message: ----------- reverted the Properties CurrentView back to revision 574 -> setting the programviewhandler.CurrentView in CurrentView of GUIPrograms throws an exception in config tool Revision Links: -------------- http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=574&view=rev Modified Paths: -------------- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/GUIPrograms.cs Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/GUIPrograms.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/GUIPrograms.cs 2007-06-20 19:56:40 UTC (rev 581) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/GUIPrograms.cs 2007-06-20 20:11:19 UTC (rev 582) @@ -515,15 +515,8 @@ public string CurrentView { - get - { - return currentView; - } - set - { - currentView = value; - DatabaseSettings.viewHandler.CurrentView = value; - } + get { return currentView; } + set { currentView = value; } } Layout CurrentLayout @@ -704,6 +697,8 @@ protected override void OnPageLoad() { + string view = CurrentView; + DatabaseSettings.viewHandler.CurrentView = view; base.OnPageLoad(); InitMyPrograms(); } @@ -1409,6 +1404,7 @@ int nNewWindow = (int)Window.WINDOW_FILES; StartWindow = nNewWindow; CurrentView = ""; + DatabaseSettings.viewHandler.CurrentView = null; if (nNewWindow != GetID) { GUIWindowManager.ReplaceWindow(nNewWindow); @@ -1418,6 +1414,7 @@ { ViewDefinition selectedView = (ViewDefinition)DatabaseSettings.viewHandler.Views[dlg.SelectedLabel - 1]; CurrentView = selectedView.Name; + DatabaseSettings.viewHandler.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. |
From: <che...@us...> - 2007-06-28 17:50:57
|
Revision: 648 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=648&view=rev Author: chef_koch Date: 2007-06-28 10:50:10 -0700 (Thu, 28 Jun 2007) Log Message: ----------- If a listControl contains only 1 item, the itemcount shows now '1 Object' instead of '1 Objects' needs latest svn Modified Paths: -------------- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/GUIPrograms.cs Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/GUIPrograms.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/GUIPrograms.cs 2007-06-27 22:28:10 UTC (rev 647) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/GUIPrograms.cs 2007-06-28 17:50:10 UTC (rev 648) @@ -973,8 +973,8 @@ if (lastApp != null) facadeView.Sort(new ProgramSort(CurrentSortMethod, CurrentSortAsc)); - string itemCountText = String.Format("{0} {1}", TotalItems, GUILocalizeStrings.Get(632)); - GUIPropertyManager.SetProperty("#itemcount", itemCountText); + //set object count label + GUIPropertyManager.SetProperty("#itemcount", Utils.GetObjectCountLabel(TotalItems)); if (selectedItemIndex >= 0) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |