From: <hap...@us...> - 2007-03-31 12:18:18
|
Revision: 267 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=267&view=rev Author: happytalk Date: 2007-03-31 05:18:16 -0700 (Sat, 31 Mar 2007) Log Message: ----------- fixed "{"There is no row at position -1."} exception Modified Paths: -------------- trunk/plugins/MyFilms/MesFilms.cs Modified: trunk/plugins/MyFilms/MesFilms.cs =================================================================== --- trunk/plugins/MyFilms/MesFilms.cs 2007-03-31 11:14:14 UTC (rev 266) +++ trunk/plugins/MyFilms/MesFilms.cs 2007-03-31 12:18:16 UTC (rev 267) @@ -134,7 +134,6 @@ public string WStrSortSens = null; public bool boolreturn = false; public bool boolstorage = false; - public bool choice_menu = false; string StrDfltSelect = null; string CurrentSortMethod = null; decimal w_rating = 0; @@ -257,15 +256,6 @@ { if (GetPrevFilmList() || (actionType.wID != Action.ActionType.ACTION_PREVIOUS_MENU)) return; } - //if (actionType.wID == Action.ActionType.ACTION_PREVIOUS_MENU) - //{ - // if (choice_menu) - // base.OnPreviousWindow(); - //// using (MediaPortal.Profile.Settings xmlwriter = new MediaPortal.Profile.Settings("MyFilms.xml")) - //// { - //// xmlwriter.SetValue("MyFilms", "Current_Config", ""); - //// } - //} base.OnAction(actionType); } //--------------------------------------------------------------------------------------- @@ -312,16 +302,27 @@ if (CurrentConfig == "") CurrentConfig = xmlreader.GetValueAsString("MyFilms", "Current_Config", ""); if (CurrentConfig == "") - CurrentConfig = Choice_Config(); - Load_Config(CurrentConfig,true); - Fin_Charge_Init(true); + { + CurrentConfig = Choice_Config(); // "" => user esc's dialog on plugin startup so exit plugin unchanged + } + + if (CurrentConfig == "") //continuing here with CurrentConfig = "" will cause exception in GuiWindowManager.cs so exit plugin + { + base.OnMessage(messageType); + GUIWindowManager.ShowPreviousWindow(); + } + else + { + Load_Config(CurrentConfig, true); + Fin_Charge_Init(true); + } } } } return true; case GUIMessage.MessageType.GUI_MSG_WINDOW_DEINIT: //called when exiting plugin either by prev menu or pressing home button - save_config_values(); + if (CurrentConfig != "") save_config_values(); mydivx.Clear(); mydivx.Dispose(); return true; // fall through to call base class? @@ -912,8 +913,6 @@ //----------------------------------------------------------------------------------------- private bool ControlFichierDonn\xE9es() { - if (StrFileXml == "") - return false; if (File.Exists(StrFileXml)) return true; else @@ -1111,6 +1110,7 @@ } } } + private void Load_Config(string CurrentConfig,bool create_temp) { //----------------------------------------------------------------------------------------------- @@ -1133,7 +1133,6 @@ StrViewText2 = xmlreader.GetValueAsString(CurrentConfig, "AntViewText2", ""); StrFileXml = xmlreader.GetValueAsString(CurrentConfig, "AntCatalog", ""); StrFileType = xmlreader.GetValueAsString(CurrentConfig, "CatalogType", "0"); - StrPathImg = xmlreader.GetValueAsString(CurrentConfig, "AntPicture", ""); switch (StrFileType) { case "0": @@ -1141,25 +1140,21 @@ case "1": if (create_temp) { - string WStrPathImg; - if (StrPathImg.Substring(StrPathImg.Length - 1) == "\\") - WStrPathImg = StrPathImg.Substring(0, StrPathImg.LastIndexOf(@"\")); - else - WStrPathImg = StrPathImg; - string destFile = WStrPathImg + "\\" + StrFileXml.Substring(StrFileXml.LastIndexOf(@"\") + 1, StrFileXml.Length - StrFileXml.LastIndexOf(@"\") - 5) + "_tmp.xml"; + string destFile = StrFileXml.Substring(0, StrFileXml.Length - 4) + "_tmp.xml"; if ((System.IO.File.Exists(destFile) && (System.IO.File.GetLastWriteTime(destFile) > System.IO.File.GetLastWriteTime(StrFileXml)))) { StrFileXml = destFile; break; } CatalogConverter cv = new CatalogConverter(); - StrFileXml = cv.ConvertProfiler(StrFileXml,StrPathImg); + StrFileXml = cv.ConvertProfiler(StrFileXml); } else StrFileXml = xmlreader.GetValueAsString(CurrentConfig, "AntCatalogTemp", ""); break; } + StrPathImg = xmlreader.GetValueAsString(CurrentConfig, "AntPicture", ""); StrSelect = xmlreader.GetValueAsString(CurrentConfig, "StrSelect", ""); StrActors = xmlreader.GetValueAsString(CurrentConfig, "StrActors", ""); StrDfltSelect = xmlreader.GetValueAsString(CurrentConfig, "StrDfltSelect", ""); @@ -1183,12 +1178,11 @@ //-------------------------------------------------------------------------------------------- private string Choice_Config() { - choice_menu = true; GUIDialogMenu dlg = (GUIDialogMenu)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_MENU); if (dlg == null) { StrFileXml = ""; - return CurrentConfig; + return ""; } dlg.Reset(); dlg.SetHeading(924); // menu @@ -1204,7 +1198,7 @@ if (dlg.SelectedLabel == -1) { StrFileXml = ""; - return CurrentConfig; + return ""; } using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings("MyFilms.xml")) { @@ -1299,6 +1293,7 @@ GetFilmList(l_index); } + } } @@ -1392,11 +1387,16 @@ } if (choice_view == "Config") { - //Change "Config": - save_config_values(); - mydivx.Clear(); - Load_Config(Choice_Config(),true); - Fin_Charge_Init(true); + string oldConfig = CurrentConfig; + string newView = Choice_Config(); + if (newView != "" && newView != oldConfig) // if user escapes dialog or bad value leave system unchanged + { + //Change "Config": + save_config_values(); + mydivx.Clear(); + Load_Config(newView, true); + Fin_Charge_Init(true); + } return; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hap...@us...> - 2007-03-31 12:31:20
|
Revision: 268 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=268&view=rev Author: happytalk Date: 2007-03-31 05:31:05 -0700 (Sat, 31 Mar 2007) Log Message: ----------- put AntPicture code back Modified Paths: -------------- trunk/plugins/MyFilms/MesFilms.cs Modified: trunk/plugins/MyFilms/MesFilms.cs =================================================================== --- trunk/plugins/MyFilms/MesFilms.cs 2007-03-31 12:18:16 UTC (rev 267) +++ trunk/plugins/MyFilms/MesFilms.cs 2007-03-31 12:31:05 UTC (rev 268) @@ -1133,6 +1133,7 @@ StrViewText2 = xmlreader.GetValueAsString(CurrentConfig, "AntViewText2", ""); StrFileXml = xmlreader.GetValueAsString(CurrentConfig, "AntCatalog", ""); StrFileType = xmlreader.GetValueAsString(CurrentConfig, "CatalogType", "0"); + StrPathImg = xmlreader.GetValueAsString(CurrentConfig, "AntPicture", ""); switch (StrFileType) { case "0": @@ -1140,21 +1141,25 @@ case "1": if (create_temp) { - string destFile = StrFileXml.Substring(0, StrFileXml.Length - 4) + "_tmp.xml"; + string WStrPathImg; + if (StrPathImg.Substring(StrPathImg.Length - 1) == "\\") + WStrPathImg = StrPathImg.Substring(0, StrPathImg.LastIndexOf(@"\")); + else + WStrPathImg = StrPathImg; + string destFile = WStrPathImg + "\\" + StrFileXml.Substring(StrFileXml.LastIndexOf(@"\") + 1, StrFileXml.Length - StrFileXml.LastIndexOf(@"\") - 5) + "_tmp.xml"; if ((System.IO.File.Exists(destFile) && (System.IO.File.GetLastWriteTime(destFile) > System.IO.File.GetLastWriteTime(StrFileXml)))) { StrFileXml = destFile; break; } CatalogConverter cv = new CatalogConverter(); - StrFileXml = cv.ConvertProfiler(StrFileXml); + StrFileXml = cv.ConvertProfiler(StrFileXml, StrPathImg); } else StrFileXml = xmlreader.GetValueAsString(CurrentConfig, "AntCatalogTemp", ""); break; } - StrPathImg = xmlreader.GetValueAsString(CurrentConfig, "AntPicture", ""); StrSelect = xmlreader.GetValueAsString(CurrentConfig, "StrSelect", ""); StrActors = xmlreader.GetValueAsString(CurrentConfig, "StrActors", ""); StrDfltSelect = xmlreader.GetValueAsString(CurrentConfig, "StrDfltSelect", ""); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hap...@us...> - 2007-03-31 13:43:29
|
Revision: 269 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=269&view=rev Author: happytalk Date: 2007-03-31 06:43:25 -0700 (Sat, 31 Mar 2007) Log Message: ----------- quit Fin_Charge_Init if file no exist Modified Paths: -------------- trunk/plugins/MyFilms/MesFilms.cs Modified: trunk/plugins/MyFilms/MesFilms.cs =================================================================== --- trunk/plugins/MyFilms/MesFilms.cs 2007-03-31 12:31:05 UTC (rev 268) +++ trunk/plugins/MyFilms/MesFilms.cs 2007-03-31 13:43:25 UTC (rev 269) @@ -308,7 +308,6 @@ if (CurrentConfig == "") //continuing here with CurrentConfig = "" will cause exception in GuiWindowManager.cs so exit plugin { - base.OnMessage(messageType); GUIWindowManager.ShowPreviousWindow(); } else @@ -1220,7 +1219,10 @@ if (LoadDfltSlct) boolselect = false; if (!ControlFichierDonn\xE9es()) + { base.OnPreviousWindow(); + return; // need to return here as xml file doesn't exist so no point trying to load it + } try { mydivx.ReadXml(StrFileXml); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hap...@us...> - 2007-04-02 10:08:47
|
Revision: 275 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=275&view=rev Author: happytalk Date: 2007-04-02 03:08:23 -0700 (Mon, 02 Apr 2007) Log Message: ----------- fixed various bugs concerning position memory. Remembers exact position across user_config/view changes/restart Modified Paths: -------------- trunk/plugins/MyFilms/MesFilms.cs Modified: trunk/plugins/MyFilms/MesFilms.cs =================================================================== --- trunk/plugins/MyFilms/MesFilms.cs 2007-04-01 16:38:52 UTC (rev 274) +++ trunk/plugins/MyFilms/MesFilms.cs 2007-04-02 10:08:23 UTC (rev 275) @@ -720,7 +720,6 @@ l_index = 0; GUIControl.SelectItemControl(GetID, (int)Controls.CTRL_List, (int)l_index); GUIPropertyManager.SetProperty("#nbobjects", lsCtlFilm.Count.ToString() + " " + GUILocalizeStrings.Get(127)); - l_index = 0; return !(lsCtlFilm.Count == 1 && item.IsFolder); //ret false if single folder found } @@ -1090,7 +1089,7 @@ xmlwriter.SetValue(CurrentConfig, "StrSort", StrSort.ToString()); xmlwriter.SetValue(CurrentConfig, "CurrentSortMethod", CurrentSortMethod.ToString()); xmlwriter.SetValue(CurrentConfig, "StrSortSens", StrSortSens.ToString()); - xmlwriter.SetValue(CurrentConfig, "Selection", TxtSelect.Label.ToString()); + xmlwriter.SetValue(CurrentConfig, "Selection", StrTxtSelect); xmlwriter.SetValue(CurrentConfig, "IndexItem", (lsCtlFilm.SelectedListItemIndex > -1) ? lsCtlFilm.SelectedListItem.ItemId.ToString() : "-1"); //may need to check if there is no item selected and so save -1 xmlwriter.SetValueAsBool(CurrentConfig, "boolselect", boolselect); xmlwriter.SetValue(CurrentConfig, "WStrSort", WStrSort); @@ -1157,20 +1156,21 @@ } StrSelect = xmlreader.GetValueAsString(CurrentConfig, "StrSelect", ""); StrActors = xmlreader.GetValueAsString(CurrentConfig, "StrActors", ""); + StrTitleSelect = xmlreader.GetValueAsString(CurrentConfig, "StrTitleSelect", ""); + StrFilmSelect = xmlreader.GetValueAsString(CurrentConfig, "StrFilmSelect", ""); StrDfltSelect = xmlreader.GetValueAsString(CurrentConfig, "StrDfltSelect", ""); - StrTitleSelect = xmlreader.GetValueAsString(CurrentConfig, "StrTitleSelect", ""); StrSort = xmlreader.GetValueAsString(CurrentConfig, "StrSort", ""); CurrentSortMethod = xmlreader.GetValueAsString(CurrentConfig, "CurrentSortMethod", ""); - TxtSelect.Label = xmlreader.GetValueAsString(CurrentConfig, "Selection", ""); StrSortSens = xmlreader.GetValueAsString(CurrentConfig, "StrSortSens", ""); + StrTxtSelect = xmlreader.GetValueAsString(CurrentConfig, "Selection", ""); l_index = xmlreader.GetValueAsInt(CurrentConfig, "IndexItem", -1); - StrViewDfltItem = xmlreader.GetValueAsString(CurrentConfig, "ViewDfltItem", ""); - StrViewDfltText = xmlreader.GetValueAsString(CurrentConfig, "ViewDfltText", ""); - TitleDelim = xmlreader.GetValueAsString(CurrentConfig, "TitleDelim", "."); boolselect = xmlreader.GetValueAsBool(CurrentConfig, "boolselect", false); WStrSort = xmlreader.GetValueAsString(CurrentConfig, "WStrSort", ""); Wstar = xmlreader.GetValueAsString(CurrentConfig, "Wstar", ""); LastID = xmlreader.GetValueAsInt(CurrentConfig, "LastID", -1); + StrViewDfltItem = xmlreader.GetValueAsString(CurrentConfig, "ViewDfltItem", ""); + StrViewDfltText = xmlreader.GetValueAsString(CurrentConfig, "ViewDfltText", ""); + TitleDelim = xmlreader.GetValueAsString(CurrentConfig, "TitleDelim", "."); } } //-------------------------------------------------------------------------------------------- @@ -1178,6 +1178,8 @@ //-------------------------------------------------------------------------------------------- private string Choice_Config() { + string newConfig = ""; + GUIDialogMenu dlg = (GUIDialogMenu)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_MENU); if (dlg == null) { @@ -1202,9 +1204,9 @@ } using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings("MyFilms.xml")) { - CurrentConfig = xmlreader.GetValueAsString("MyFilms", "ConfigName" + dlg.SelectedLabel, ""); + newConfig = xmlreader.GetValueAsString("MyFilms", "ConfigName" + dlg.SelectedLabel, ""); } - return CurrentConfig; + return newConfig; } //-------------------------------------------------------------------------------------------- // Initial Windows load. If LoadDfltSlct = true => load default select if any @@ -1394,15 +1396,15 @@ } if (choice_view == "Config") { - string oldConfig = CurrentConfig; - string newView = Choice_Config(); - if (newView != "" && newView != oldConfig) // if user escapes dialog or bad value leave system unchanged + string newConfig = Choice_Config(); + if (newConfig != "" && newConfig != CurrentConfig) // if user escapes dialog or bad value leave system unchanged { //Change "Config": save_config_values(); mydivx.Clear(); - Load_Config(newView, true); - Fin_Charge_Init(true); + CurrentConfig = newConfig; + Load_Config(newConfig, true); + Fin_Charge_Init(false); //need to load current selection as reloaded from myfilms.xml file to remember position } return; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hap...@us...> - 2007-04-02 15:31:02
|
Revision: 278 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=278&view=rev Author: happytalk Date: 2007-04-02 08:30:59 -0700 (Mon, 02 Apr 2007) Log Message: ----------- Now also remembers position when displaying genres/years/search results etc. Modified Paths: -------------- trunk/plugins/MyFilms/MesFilms.cs Modified: trunk/plugins/MyFilms/MesFilms.cs =================================================================== --- trunk/plugins/MyFilms/MesFilms.cs 2007-04-02 14:22:48 UTC (rev 277) +++ trunk/plugins/MyFilms/MesFilms.cs 2007-04-02 15:30:59 UTC (rev 278) @@ -419,7 +419,7 @@ WStrSortSens = " ASC"; BtnSrtBy.IsAscending = true; StrActors = keyboard.Text; - getSelectFromDivx("Actors like '*" + keyboard.Text + "*'", WStrSort, WStrSortSens, keyboard.Text, ""); + getSelectFromDivx("Actors like '*" + keyboard.Text + "*'", WStrSort, WStrSortSens, keyboard.Text, true, ""); } else return false; @@ -473,7 +473,7 @@ if (!boolselect) GetFilmList(); else - getSelectFromDivx(StrTitle1.ToString() + " not like ''", StrSort, StrSortSens, "*", ""); + getSelectFromDivx(StrTitle1.ToString() + " not like ''", StrSort, StrSortSens, "*", true, ""); return true; } if (iControl == (int)Controls.CTRL_BtnViewAs) @@ -556,15 +556,15 @@ { StrSelect = "Actors like '*" + StrActors + "*'"; StrTxtSelect = "Selection"; - getSelectFromDivx("Actors like '*" + StrActors + "*'", WStrSort, WStrSortSens, StrActors, ""); + getSelectFromDivx("Actors like '*" + StrActors + "*'", WStrSort, WStrSortSens, StrActors, true, ""); } else { SelItem = NewString.StripChars(@"[]", StrTxtSelect); if (WStrSort == "DateAdded") - getSelectFromDivx(StrTitle1.ToString() + " not like ''", "Date", " DESC", "*", SelItem); + getSelectFromDivx(StrTitle1.ToString() + " not like ''", "Date", " DESC", "*", true, SelItem); else - getSelectFromDivx(StrTitle1.ToString() + " not like ''", WStrSort, WStrSortSens, "*", SelItem); + getSelectFromDivx(StrTitle1.ToString() + " not like ''", WStrSort, WStrSortSens, "*", true, SelItem); StrSelect = ""; } } @@ -872,7 +872,7 @@ if (!boolselect) GetFilmList(); else - getSelectFromDivx(StrTitle1.ToString() + " not like ''", WStrSort, StrSortSens, "*", ""); + getSelectFromDivx(StrTitle1.ToString() + " not like ''", WStrSort, StrSortSens, "*", true, ""); return; } private void affich_overlay() @@ -986,8 +986,9 @@ /// <param name="WStrSortSens">Asc/Desc. Ascending or descending sort order</param> /// <param name="NewWstar">Entries must contain this string to be included</param> /// <param name="p">Position in string to begin search/replacing from</param> + /// <param name="ClearIndex">Reset Selected Item Index</param> /// <param name="SelItem">Select entry matching this string if not empty</param> - private void getSelectFromDivx(string WstrSelect, string WStrSort, string WStrSortSens, string NewWstar, string SelItem) + private void getSelectFromDivx(string WstrSelect, string WStrSort, string WStrSortSens, string NewWstar, bool ClearIndex, string SelItem) { GUIListItem item = new GUIListItem(); string champselect = ""; @@ -1002,7 +1003,7 @@ BtnSrtBy.Label = GUILocalizeStrings.Get(103); boolselect = true; boolreturn = true; - l_index = 0; + if (ClearIndex) l_index = 0; lsCtlFilm.Clear(); foreach (DataRow enr in LectureDonn\xE9es(WstrSelect, WStrSort, WStrSortSens)) @@ -1045,7 +1046,7 @@ item.Label = champselect.ToString(); item.Label2 = Wnb_enr.ToString(); lsCtlFilm.Add(item); - if (item.Label == SelItem) l_index = lsCtlFilm.Count - 1; //test if this item is one to select + if (SelItem != "" && item.Label == SelItem) l_index = lsCtlFilm.Count - 1; //test if this item is one to select } else Wnb_enr = 0; @@ -1059,6 +1060,9 @@ StrSelect = WstrSelect; StrFilmSelect = ""; + if ((l_index > lsCtlFilm.Count - 1) || (l_index < 0)) //check index within bounds, will be unless xml file heavily edited + l_index = 0; + GUIControl.SelectItemControl(GetID, (int)Controls.CTRL_List, (int)l_index); GUIPropertyManager.SetProperty("#nbobjects", lsCtlFilm.Count.ToString() + " " + GUILocalizeStrings.Get(127)); } @@ -1090,7 +1094,7 @@ xmlwriter.SetValue(CurrentConfig, "CurrentSortMethod", CurrentSortMethod.ToString()); xmlwriter.SetValue(CurrentConfig, "StrSortSens", StrSortSens.ToString()); xmlwriter.SetValue(CurrentConfig, "Selection", StrTxtSelect); - xmlwriter.SetValue(CurrentConfig, "IndexItem", (lsCtlFilm.SelectedListItemIndex > -1) ? lsCtlFilm.SelectedListItem.ItemId.ToString() : "-1"); //may need to check if there is no item selected and so save -1 + xmlwriter.SetValue(CurrentConfig, "IndexItem", (lsCtlFilm.SelectedListItemIndex > -1) ? ((boolselect) ? lsCtlFilm.SelectedListItemIndex.ToString() : lsCtlFilm.SelectedListItem.ItemId.ToString()) : "-1"); //may need to check if there is no item selected and so save -1 xmlwriter.SetValueAsBool(CurrentConfig, "boolselect", boolselect); xmlwriter.SetValue(CurrentConfig, "WStrSort", WStrSort); xmlwriter.SetValue(CurrentConfig, "Wstar", Wstar); @@ -1252,12 +1256,12 @@ // TxtSelect.HorizontalAlignment = MediaPortal.Drawing.HorizontalAlignment.Right; BtnSrtBy.SortChanged += new SortEventHandler(SortChanged); if (boolselect) - getSelectFromDivx(StrSelect, WStrSort, " ASC", Wstar, ""); + getSelectFromDivx(StrSelect, WStrSort, " ASC", Wstar, false, ""); // preserve index from last time else if (!(LoadDfltSlct)) GetFilmList(l_index); else - { + { if ((StrViewDfltItem.Length == 0) || (StrViewDfltItem == "(none)")) { StrSelect = StrTitle1.ToString() + " not like ''"; @@ -1333,7 +1337,7 @@ WStrSortSens = " DESC"; BtnSrtBy.IsAscending = false; boolreturn = true; - getSelectFromDivx(StrTitle1.ToString() + " not like ''", WStrSort, WStrSortSens, "*", ""); + getSelectFromDivx(StrTitle1.ToString() + " not like ''", WStrSort, WStrSortSens, "*", true, ""); return; } if (choice_view == "Category") @@ -1342,7 +1346,7 @@ WStrSort = "CATEGORY"; WStrSortSens = " ASC"; BtnSrtBy.IsAscending = true; - getSelectFromDivx(StrTitle1.ToString() + " not like ''", WStrSort, WStrSortSens, "*", ""); + getSelectFromDivx(StrTitle1.ToString() + " not like ''", WStrSort, WStrSortSens, "*", true, ""); return; } if (choice_view == "Country") @@ -1351,7 +1355,7 @@ WStrSort = "COUNTRY"; WStrSortSens = " ASC"; BtnSrtBy.IsAscending = true; - getSelectFromDivx(StrTitle1.ToString() + " not like ''", WStrSort, WStrSortSens, "*", ""); + getSelectFromDivx(StrTitle1.ToString() + " not like ''", WStrSort, WStrSortSens, "*", true, ""); return; } if (choice_view == "Storage") @@ -1377,9 +1381,9 @@ WStrSortSens = " ASC"; BtnSrtBy.IsAscending = true; if (WStrSort == "DateAdded") - getSelectFromDivx(StrTitle1.ToString() + " not like ''", "Date", " DESC", "*", ""); + getSelectFromDivx(StrTitle1.ToString() + " not like ''", "Date", " DESC", "*", true, ""); else - getSelectFromDivx(StrTitle1.ToString() + " not like ''", WStrSort, WStrSortSens, "*", ""); + getSelectFromDivx(StrTitle1.ToString() + " not like ''", WStrSort, WStrSortSens, "*", true, ""); return; } if (choice_view == "View2") @@ -1389,9 +1393,9 @@ WStrSortSens = " ASC"; BtnSrtBy.IsAscending = true; if (WStrSort == "DateAdded") - getSelectFromDivx(StrTitle1.ToString() + " not like ''", "Date", " DESC", "*", ""); + getSelectFromDivx(StrTitle1.ToString() + " not like ''", "Date", " DESC", "*", true, ""); else - getSelectFromDivx(StrTitle1.ToString() + " not like ''", WStrSort, WStrSortSens, "*", ""); + getSelectFromDivx(StrTitle1.ToString() + " not like ''", WStrSort, WStrSortSens, "*", true, ""); return; } if (choice_view == "Config") This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ze...@us...> - 2007-04-29 17:16:04
|
Revision: 356 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=356&view=rev Author: zebons Date: 2007-04-29 10:15:59 -0700 (Sun, 29 Apr 2007) Log Message: ----------- Mode List during search by actors Modified Paths: -------------- trunk/plugins/MyFilms/MesFilms.cs Modified: trunk/plugins/MyFilms/MesFilms.cs =================================================================== --- trunk/plugins/MyFilms/MesFilms.cs 2007-04-29 08:03:56 UTC (rev 355) +++ trunk/plugins/MyFilms/MesFilms.cs 2007-04-29 17:15:59 UTC (rev 356) @@ -263,9 +263,16 @@ //--------------------------------------------------------------------------------------- public override void OnAction(Action actionType) { - if ((actionType.wID == Action.ActionType.ACTION_PREVIOUS_MENU) || (actionType.wID == Action.ActionType.ACTION_PARENT_DIR)) + //if ((actionType.wID == Action.ActionType.ACTION_PREVIOUS_MENU) || (actionType.wID == Action.ActionType.ACTION_PARENT_DIR)) + //{ + // if (GetPrevFilmList() || (actionType.wID != Action.ActionType.ACTION_PREVIOUS_MENU)) return; + //} + if (actionType.wID == Action.ActionType.ACTION_PARENT_DIR) + if (GetPrevFilmList()) return; + if ((actionType.wID == Action.ActionType.ACTION_PREVIOUS_MENU) && (boolselect)) { - if (GetPrevFilmList() || (actionType.wID != Action.ActionType.ACTION_PREVIOUS_MENU)) return; + Change_LayOut(Layout); + if (GetPrevFilmList()) return; } base.OnAction(actionType); } @@ -433,6 +440,7 @@ { if (control_searchText(keyboard.Text)) { + Change_LayOut(0); WStrSort = "ACTORS"; WStrSortSens = " ASC"; BtnSrtBy.IsAscending = true; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ze...@us...> - 2007-10-28 23:01:43
|
Revision: 1011 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1011&view=rev Author: zebons Date: 2007-10-28 16:01:41 -0700 (Sun, 28 Oct 2007) Log Message: ----------- Some view corrections Modified Paths: -------------- trunk/plugins/MyFilms/MesFilms.cs Modified: trunk/plugins/MyFilms/MesFilms.cs =================================================================== --- trunk/plugins/MyFilms/MesFilms.cs 2007-10-28 18:07:26 UTC (rev 1010) +++ trunk/plugins/MyFilms/MesFilms.cs 2007-10-28 23:01:41 UTC (rev 1011) @@ -969,7 +969,7 @@ string[] arSplit; int Wnb_enr = 0; int wi = 0; - string[] Sep = new string[] { ",", "(", ")" }; + string[] Sep = new string[] { ",", ")" }; conf.Wstar = NewWstar; BtnSrtBy.Label = GUILocalizeStrings.Get(103); @@ -986,15 +986,18 @@ if ((WStrSort == "Date") || (WStrSort == "DateAdded")) champselect = string.Format("{0:yyyy/MM/dd}", enr["DateAdded"]); else - { champselect = enr[WStrSort].ToString(); - } - arSplit = champselect.Split(Sep, StringSplitOptions.None);//will add "" entries also, //StringSplitOptions.RemoveEmptyEntries + arSplit = champselect.Split(Sep,StringSplitOptions.None); // remove entries empty // StringSplitOptions.None);//will add "" entries also + string wzone = ""; for (wi = 0; wi < arSplit.Length; wi++) + { if (arSplit[wi].IndexOf("(") > 0) - w_tableau.Add(arSplit[wi].Substring(0, arSplit[wi].IndexOf("(")).Trim()); + wzone = arSplit[wi].Substring(0, arSplit[wi].IndexOf("(")).Trim(); else - w_tableau.Add(arSplit[wi].Trim()); + wzone = arSplit[wi].Trim(); + if (wzone.Length > 0) + w_tableau.Add(wzone); + } } if (WStrSortSens == " ASC") w_tableau.Sort(0, w_tableau.Count, null); @@ -1003,30 +1006,31 @@ IComparer myComparer = new myReverserClass(); w_tableau.Sort(0, w_tableau.Count, myComparer); } - + item = new GUIListItem(); for (wi = 0; wi != w_tableau.Count; wi++) { champselect = w_tableau[wi].ToString(); - if ((Wnb_enr > 0) && (string.Compare(champselect.ToString(), wchampselect.ToString(), true) == 0)) - { +// if ((Wnb_enr > 0) && (string.Compare(champselect.ToString(), wchampselect.ToString(), true) == 0)) + if (string.Compare(champselect.ToString(), wchampselect.ToString(), true) == 0) Wnb_enr++; - item.Label2 = Wnb_enr.ToString(); - } else { - if (conf.Wstar == "*" || champselect.ToUpper().Contains(conf.Wstar.ToUpper())) + if (conf.Wstar == "*" || champselect.ToUpper().Contains(conf.Wstar.ToUpper())) { + if (Wnb_enr > 0) + { + item = new GUIListItem(); + item.Label = wchampselect.ToString(); + item.Label2 = Wnb_enr.ToString(); + facadeView.Add(item); + if (SelItem != "" && item.Label == SelItem) conf.StrIndex = facadeView.Count - 1; //test if this item is one to select + } Wnb_enr = 1; - item = new GUIListItem(); - item.Label = champselect.ToString(); - item.Label2 = Wnb_enr.ToString(); - facadeView.Add(item); - if (SelItem != "" && item.Label == SelItem) conf.StrIndex = facadeView.Count - 1; //test if this item is one to select + wchampselect = champselect.ToString(); } - else - Wnb_enr = 0; + - wchampselect = champselect.ToString(); + } } conf.StrTxtSelect = "Selection"; @@ -1073,7 +1077,7 @@ { //chargement des films BaseMesFilms.LoadFilm(conf.StrFileXml); - conf = new Configuration(Configuration.CurrentConfig, false); +// conf = new Configuration(Configuration.CurrentConfig, false); } Layout = conf.StrLayOut; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ze...@us...> - 2007-05-01 12:34:26
|
Revision: 366 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=366&view=rev Author: zebons Date: 2007-05-01 05:34:23 -0700 (Tue, 01 May 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/MyFilms/MesFilms.cs Modified: trunk/plugins/MyFilms/MesFilms.cs =================================================================== --- trunk/plugins/MyFilms/MesFilms.cs 2007-04-30 21:00:23 UTC (rev 365) +++ trunk/plugins/MyFilms/MesFilms.cs 2007-05-01 12:34:23 UTC (rev 366) @@ -263,10 +263,6 @@ //--------------------------------------------------------------------------------------- public override void OnAction(Action actionType) { - //if ((actionType.wID == Action.ActionType.ACTION_PREVIOUS_MENU) || (actionType.wID == Action.ActionType.ACTION_PARENT_DIR)) - //{ - // if (GetPrevFilmList() || (actionType.wID != Action.ActionType.ACTION_PREVIOUS_MENU)) return; - //} if (actionType.wID == Action.ActionType.ACTION_PARENT_DIR) if (GetPrevFilmList()) return; if ((actionType.wID == Action.ActionType.ACTION_PREVIOUS_MENU) && (boolselect)) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ze...@us...> - 2007-05-12 08:37:26
|
Revision: 399 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=399&view=rev Author: zebons Date: 2007-05-12 01:37:06 -0700 (Sat, 12 May 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/MyFilms/MesFilms.cs Modified: trunk/plugins/MyFilms/MesFilms.cs =================================================================== --- trunk/plugins/MyFilms/MesFilms.cs 2007-05-11 22:08:49 UTC (rev 398) +++ trunk/plugins/MyFilms/MesFilms.cs 2007-05-12 08:37:06 UTC (rev 399) @@ -121,7 +121,7 @@ string StrTitleSelect = null; string StrFilmSelect = ""; string StrSort = null; - string StrActors = null; + string StrActors = ""; string StrTxtSelect = ""; string StrStorage = null; string StrIdentItem = null; @@ -139,12 +139,12 @@ string StrPathImg = null; string StrSortSens = null; int StrLayOut = 0; - public string WStrSort = null; + public string WStrSort = ""; public string WStrSelect = null; public string WStrSortSens = null; public bool boolreturn = false; public bool boolstorage = false; - string wselectedlabel = null; + string wselectedlabel = ""; string StrDfltSelect = null; string CurrentSortMethod = null; decimal w_rating = 0; @@ -450,6 +450,7 @@ { Change_LayOut(0); WStrSort = "ACTORS"; + wselectedlabel = ""; WStrSortSens = " ASC"; BtnSrtBy.IsAscending = true; StrActors = keyboard.Text; @@ -558,7 +559,8 @@ { wselectedlabel = facadeView.SelectedListItem.Label; Change_LayOut(Layout); - boolreturn = true; + if (!facadeView.SelectedListItem.IsFolder) + boolreturn = true; do { if (StrTitleSelect != "") StrTitleSelect += TitleDelim; @@ -1082,6 +1084,8 @@ Wstar = NewWstar; BtnSrtBy.Label = GUILocalizeStrings.Get(103); boolselect = true; + wselectedlabel = ""; + StrActors = ""; // boolreturn = true; if (ClearIndex) l_index = 0; facadeView.Clear(); @@ -1177,6 +1181,7 @@ xmlwriter.SetValue(CurrentConfig, "IndexItem", (facadeView.SelectedListItemIndex > -1) ? ((boolselect) ? facadeView.SelectedListItemIndex.ToString() : facadeView.SelectedListItem.ItemId.ToString()) : "-1"); //may need to check if there is no item selected and so save -1 xmlwriter.SetValueAsBool(CurrentConfig, "boolselect", boolselect); xmlwriter.SetValueAsBool(CurrentConfig, "boolreturn", boolreturn); + xmlwriter.SetValue(CurrentConfig, "WSelectedLabel", wselectedlabel); xmlwriter.SetValue(CurrentConfig, "WStrSort", WStrSort); xmlwriter.SetValue(CurrentConfig, "Wstar", Wstar); xmlwriter.SetValue(CurrentConfig, "WLayOut", Layout); @@ -1255,12 +1260,18 @@ boolselect = xmlreader.GetValueAsBool(CurrentConfig, "boolselect", false); boolreturn = xmlreader.GetValueAsBool(CurrentConfig, "boolreturn", false); WStrSort = xmlreader.GetValueAsString(CurrentConfig, "WStrSort", ""); + wselectedlabel = xmlreader.GetValueAsString(CurrentConfig, "WSelectedLabel", ""); Wstar = xmlreader.GetValueAsString(CurrentConfig, "Wstar", ""); LastID = xmlreader.GetValueAsInt(CurrentConfig, "LastID", -1); StrViewDfltItem = xmlreader.GetValueAsString(CurrentConfig, "ViewDfltItem", ""); StrViewDfltText = xmlreader.GetValueAsString(CurrentConfig, "ViewDfltText", ""); TitleDelim = xmlreader.GetValueAsString(CurrentConfig, "TitleDelim", "."); } + if ((boolreturn) && (wselectedlabel == "")) + { + boolselect = true; + boolreturn = false; + } } //-------------------------------------------------------------------------------------------- // Choice Configuration @@ -1378,7 +1389,10 @@ // TxtSelect.HorizontalAlignment = MediaPortal.Drawing.HorizontalAlignment.Right; BtnSrtBy.SortChanged += new SortEventHandler(SortChanged); if (boolselect) + { + Change_LayOut(0); getSelectFromDivx(StrSelect, WStrSort, " ASC", Wstar, false, ""); // preserve index from last time + } else if (!(LoadDfltSlct)) GetFilmList(l_index); @@ -1414,6 +1428,7 @@ boolselect = false; boolreturn = true; WStrSort = StrViewDfltItem; + wselectedlabel = ""; if (StrViewDfltItem == "DateAdded") StrSelect = "Date" + " like '" + DateTime.Parse(StrViewDfltText).ToShortDateString() + "'"; else @@ -1471,6 +1486,7 @@ { // Change View All Films StrSelect = StrTitleSelect = StrTxtSelect = ""; //clear all selects + WStrSort = ""; boolselect = false; boolreturn = false; GetFilmList(); @@ -1514,6 +1530,7 @@ TxtSelect.Label = StrTxtSelect; boolselect = false; boolreturn = false; + WStrSort = ""; BtnSrtBy.Label = CurrentSortMethod; if (StrSortSens == " ASC") BtnSrtBy.IsAscending = true; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ze...@us...> - 2007-10-28 18:07:29
|
Revision: 1010 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1010&view=rev Author: zebons Date: 2007-10-28 11:07:26 -0700 (Sun, 28 Oct 2007) Log Message: ----------- Corrected Actors search Modified Paths: -------------- trunk/plugins/MyFilms/MesFilms.cs Modified: trunk/plugins/MyFilms/MesFilms.cs =================================================================== --- trunk/plugins/MyFilms/MesFilms.cs 2007-10-28 13:09:21 UTC (rev 1009) +++ trunk/plugins/MyFilms/MesFilms.cs 2007-10-28 18:07:26 UTC (rev 1010) @@ -235,6 +235,11 @@ if ((actionType.wID == Action.ActionType.ACTION_PREVIOUS_MENU) && (conf.Boolreturn)) { conf.Boolreturn = false; + if (conf.WStrSort.ToString() == "ACTORS") + if (GetPrevFilmList()) + return; + else + base.OnAction(actionType); Change_view(conf.WStrSort); return; } @@ -522,7 +527,7 @@ { conf.StrSelect = "Actors like '*" + conf.StrActors + "*'"; conf.StrTxtSelect = "Selection"; - getSelectFromDivx("Actors like '*" + conf.StrActors + "*'", conf.WStrSort, conf.WStrSortSens, conf.StrActors, true, ""); + getSelectFromDivx(conf.StrSelect, conf.WStrSort, conf.WStrSortSens, conf.StrActors, true, ""); } else { @@ -619,18 +624,30 @@ { if (conf.Boolreturn)//in case of selection by view verify if value correspond excatly to the searched string { - string[] split; - if (conf.WStrSort == "DateAdded") - split = string.Format("{0:yyyy/MM/dd}", r[conf.WStrSort]).Split(new Char[] { ',' }); - else - split = r[conf.WStrSort].ToString().Split(new Char[] { ',' }); - foreach (string s in split) - { - if (s.Trim().ToLower() == conf.Wselectedlabel.Trim().ToLower()) - goto suite; - } - goto fin; - } + //string[] split; + //if (conf.WStrSort == "DateAdded") + // split = string.Format("{0:yyyy/MM/dd}", r[conf.WStrSort]).Split(new Char[] { ',' }); + //else + // split = r[conf.WStrSort].ToString().Split(new Char[] { ',','(',')',}); + //foreach (string s in split) + //{ + // if (s.Trim().ToLower() == conf.Wselectedlabel.Trim().ToLower()) + // goto suite; + //} + //goto fin; + //string[] split; + //if (conf.WStrSort == "DateAdded") + // split = string.Format("{0:yyyy/MM/dd}", r[conf.WStrSort]).Split(new Char[] { ',' }); + //else + // split = r[conf.WStrSort].ToString().Split(new Char[] { ',','(',')',}); + //foreach (string s in split) + //{ + // if (s.Trim().ToLower() == conf.Wselectedlabel.Trim().ToLower()) + // goto suite; + //} + if (r[conf.WStrSort].ToString().IndexOfAny (conf.Wselectedlabel.Trim().ToCharArray ()) >=0) + goto suite; + goto fin; } suite: string wthumb = item.ThumbnailImage; @@ -952,13 +969,13 @@ string[] arSplit; int Wnb_enr = 0; int wi = 0; - string[] Sep = new string[] { "," }; + string[] Sep = new string[] { ",", "(", ")" }; conf.Wstar = NewWstar; BtnSrtBy.Label = GUILocalizeStrings.Get(103); conf.Boolselect = true; conf.Wselectedlabel = ""; - conf.StrActors = ""; + //conf.StrActors = ""; // boolreturn = true; if (ClearIndex) conf.StrIndex = 0; facadeView.Clear(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ze...@us...> - 2007-11-23 22:44:34
|
Revision: 1087 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1087&view=rev Author: zebons Date: 2007-11-23 14:44:32 -0800 (Fri, 23 Nov 2007) Log Message: ----------- Layout forced at List when selecting (year, category, search by actors or movies...) Modified Paths: -------------- trunk/plugins/MyFilms/MesFilms.cs Modified: trunk/plugins/MyFilms/MesFilms.cs =================================================================== --- trunk/plugins/MyFilms/MesFilms.cs 2007-11-23 18:58:09 UTC (rev 1086) +++ trunk/plugins/MyFilms/MesFilms.cs 2007-11-23 22:44:32 UTC (rev 1087) @@ -251,7 +251,7 @@ if (Configuration.CurrentConfig.Length == 0) GUIWindowManager.ShowPreviousWindow(); - if (conf.AlwaysDefaultView) + if ((conf.AlwaysDefaultView) && (PreviousWindowId != ID_MesFilmsDetail)) Fin_Charge_Init(true); else Fin_Charge_Init(false); @@ -339,7 +339,7 @@ { if (control_searchText(keyboard.Text)) { - Change_LayOut(0); + //Change_LayOut(0); conf.WStrSort = "ACTORS"; conf.Wselectedlabel = ""; conf.WStrSortSens = " ASC"; @@ -977,6 +977,7 @@ if ((conf.StrIndex > facadeView.Count - 1) || (conf.StrIndex < 0)) //check index within bounds, will be unless xml file heavily edited conf.StrIndex = 0; GUIControl.ShowControl(GetID, 34); + Change_LayOut(0); GUIPropertyManager.SetProperty("#nbobjects", facadeView.Count.ToString() + " " + GUILocalizeStrings.Get(127)); GUIControl.SelectItemControl(GetID, (int)Controls.CTRL_List, (int)conf.StrIndex); } @@ -1030,7 +1031,7 @@ BtnSrtBy.SortChanged += new SortEventHandler(SortChanged); if (conf.Boolselect) { - Change_LayOut(0); + //Change_LayOut(0); getSelectFromDivx(conf.StrSelect, conf.WStrSort, conf.StrSortSens, conf.Wstar, false, ""); // preserve index from last time } else @@ -1135,7 +1136,7 @@ if (choice_view.ToLower() == "year") { // Change View by Year - Change_LayOut(0); + //Change_LayOut(0); conf.WStrSort = "YEAR"; conf.WStrSortSens = " DESC"; BtnSrtBy.IsAscending = false; @@ -1145,7 +1146,7 @@ if (choice_view.ToLower() == "category") { // Change View by "Category": - Change_LayOut(0); + //Change_LayOut(0); conf.WStrSort = "CATEGORY"; conf.WStrSortSens = " ASC"; BtnSrtBy.IsAscending = true; @@ -1155,7 +1156,7 @@ if (choice_view.ToLower() == "country") { // Change View by "Country": - Change_LayOut(0); + //Change_LayOut(0); conf.WStrSort = "COUNTRY"; conf.WStrSortSens = " ASC"; BtnSrtBy.IsAscending = true; @@ -1182,7 +1183,7 @@ if ((choice_view.ToLower() == "view1") || (choice_view.ToLower() == conf.StrViewItem1.ToLower())) { // Change View by "View1": - Change_LayOut(0); + //Change_LayOut(0); conf.WStrSort = conf.StrViewItem1; // specific user View1 conf.WStrSortSens = " ASC"; BtnSrtBy.IsAscending = true; @@ -1195,7 +1196,7 @@ if ((choice_view.ToLower() == "view2") || (choice_view.ToLower() == conf.StrViewItem2.ToLower())) { // Change View by "View2": - Change_LayOut(0); + //Change_LayOut(0); conf.WStrSort = conf.StrViewItem2; conf.WStrSortSens = " ASC"; BtnSrtBy.IsAscending = true; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ze...@us...> - 2008-01-04 22:57:24
|
Revision: 1204 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1204&view=rev Author: zebons Date: 2008-01-04 14:57:22 -0800 (Fri, 04 Jan 2008) Log Message: ----------- Modified Paths: -------------- trunk/plugins/MyFilms/MesFilms.cs Modified: trunk/plugins/MyFilms/MesFilms.cs =================================================================== --- trunk/plugins/MyFilms/MesFilms.cs 2008-01-03 19:25:03 UTC (rev 1203) +++ trunk/plugins/MyFilms/MesFilms.cs 2008-01-04 22:57:22 UTC (rev 1204) @@ -627,7 +627,7 @@ item.Label2 = r[conf.StrSort1].ToString(); break; } - if (r["Picture"].ToString().IndexOf(":\\") == -1) + if ((r["Picture"].ToString().IndexOf(":\\") == -1) && (r["Picture"].ToString().Substring(0,2) != "\\\\")) conf.FileImage = conf.StrPathImg + "\\" + r["Picture"].ToString(); else conf.FileImage = r["Picture"].ToString(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |