From: <ze...@us...> - 2007-05-11 21:08:49
|
Revision: 396 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=396&view=rev Author: zebons Date: 2007-05-11 14:08:46 -0700 (Fri, 11 May 2007) Log Message: ----------- enhance 'selection by' invoiding some movies to be displayed on many views correct ESC key press after selection. Now returns on Selection Menu Modified Paths: -------------- trunk/plugins/MyFilms/MesFilms.cs trunk/plugins/MyFilms/MesFilmsSetup.Designer.cs Modified: trunk/plugins/MyFilms/MesFilms.cs =================================================================== --- trunk/plugins/MyFilms/MesFilms.cs 2007-05-11 04:37:46 UTC (rev 395) +++ trunk/plugins/MyFilms/MesFilms.cs 2007-05-11 21:08:46 UTC (rev 396) @@ -270,6 +270,12 @@ Change_LayOut(Layout); if (GetPrevFilmList()) return; } + if ((actionType.wID == Action.ActionType.ACTION_PREVIOUS_MENU) && (boolreturn)) + { + boolreturn = false; + Change_view(WStrSort); + return; + } base.OnAction(actionType); } //--------------------------------------------------------------------------------------- @@ -552,6 +558,7 @@ { wselectedlabel = facadeView.SelectedListItem.Label; Change_LayOut(Layout); + boolreturn = true; do { if (StrTitleSelect != "") StrTitleSelect += TitleDelim; @@ -689,6 +696,17 @@ // Load the DataSet. foreach (DataRow r in LectureDonn\xE9es(StrFilmSelect, StrSort, StrSortSens)) { + if (boolreturn)//in case of selection by view verify if value correspond excatly to the searched string + { + string[] split = r[WStrSort].ToString().Split(new Char[] { ',' }); + foreach (string s in split) + { + if (s.Trim().ToLower() == wselectedlabel.Trim().ToLower()) + goto suite; + } + goto fin; + } + suite: sFullTitle = sTitle = r[StrTitle1].ToString(); DelimCnt2 = NewString.PosCount(TitleDelim, sTitle, false); if (DelimCnt <= DelimCnt2) @@ -757,6 +775,7 @@ if ((int)(r["Number"]) == iSelItem) l_index = facadeView.Count - 1; //test if this item is one to select } sPrevTitle = sTitle; + fin: ; } if ((l_index > facadeView.Count - 1) || (l_index < 0)) l_index = 0; @@ -1063,7 +1082,7 @@ Wstar = NewWstar; BtnSrtBy.Label = GUILocalizeStrings.Get(103); boolselect = true; - boolreturn = true; +// boolreturn = true; if (ClearIndex) l_index = 0; facadeView.Clear(); @@ -1157,6 +1176,7 @@ xmlwriter.SetValue(CurrentConfig, "Selection", StrTxtSelect); 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, "WStrSort", WStrSort); xmlwriter.SetValue(CurrentConfig, "Wstar", Wstar); xmlwriter.SetValue(CurrentConfig, "WLayOut", Layout); @@ -1233,6 +1253,7 @@ StrTxtSelect = xmlreader.GetValueAsString(CurrentConfig, "Selection", ""); l_index = xmlreader.GetValueAsInt(CurrentConfig, "IndexItem", -1); boolselect = xmlreader.GetValueAsBool(CurrentConfig, "boolselect", false); + boolreturn = xmlreader.GetValueAsBool(CurrentConfig, "boolreturn", false); WStrSort = xmlreader.GetValueAsString(CurrentConfig, "WStrSort", ""); Wstar = xmlreader.GetValueAsString(CurrentConfig, "Wstar", ""); LastID = xmlreader.GetValueAsInt(CurrentConfig, "LastID", -1); @@ -1446,26 +1467,26 @@ private void Change_view(string choice_view) { boolstorage = false; - if (choice_view == "All") + if (choice_view.ToLower() == "all") { // Change View All Films StrSelect = StrTitleSelect = StrTxtSelect = ""; //clear all selects boolselect = false; + boolreturn = false; GetFilmList(); return; } - if (choice_view == "Year") + if (choice_view.ToLower() == "year") { // Change View by Year Change_LayOut(0); WStrSort = "YEAR"; WStrSortSens = " DESC"; BtnSrtBy.IsAscending = false; - boolreturn = true; getSelectFromDivx(StrTitle1.ToString() + " not like ''", WStrSort, WStrSortSens, "*", true, ""); return; } - if (choice_view == "Category") + if (choice_view.ToLower() == "category") { // Change View by "Category": Change_LayOut(0); @@ -1475,7 +1496,7 @@ getSelectFromDivx(StrTitle1.ToString() + " not like ''", WStrSort, WStrSortSens, "*", true, ""); return; } - if (choice_view == "Country") + if (choice_view.ToLower() == "country") { // Change View by "Country": Change_LayOut(0); @@ -1485,7 +1506,7 @@ getSelectFromDivx(StrTitle1.ToString() + " not like ''", WStrSort, WStrSortSens, "*", true, ""); return; } - if (choice_view == "Storage") + if (choice_view.ToLower() == "storage") { // Change View by "Storage": StrSelect = "((" + StrTitle1.ToString() + " not like '') and (" + StrStorage.ToString() + " not like ''))"; @@ -1501,7 +1522,7 @@ GetFilmList(); return; } - if (choice_view == "View1") + if (choice_view.ToLower() == "view1") { // Change View by "View1": Change_LayOut(0); @@ -1514,7 +1535,7 @@ getSelectFromDivx(StrTitle1.ToString() + " not like ''", WStrSort, WStrSortSens, "*", true, ""); return; } - if (choice_view == "View2") + if (choice_view.ToLower() == "view2") { // Change View by "View2": Change_LayOut(0); @@ -1527,7 +1548,7 @@ getSelectFromDivx(StrTitle1.ToString() + " not like ''", WStrSort, WStrSortSens, "*", true, ""); return; } - if (choice_view == "Config") + if (choice_view.ToLower() == "config") { string newConfig = Choice_Config(); newConfig = Control_Access_Config(newConfig); Modified: trunk/plugins/MyFilms/MesFilmsSetup.Designer.cs =================================================================== --- trunk/plugins/MyFilms/MesFilmsSetup.Designer.cs 2007-05-11 04:37:46 UTC (rev 395) +++ trunk/plugins/MyFilms/MesFilmsSetup.Designer.cs 2007-05-11 21:08:46 UTC (rev 396) @@ -709,7 +709,7 @@ this.label10.Name = "label10"; this.label10.Size = new System.Drawing.Size(69, 13); this.label10.TabIndex = 34; - this.label10.Text = "Version 4.2.3"; + this.label10.Text = "Version 4.2.4"; // // textBox1 // This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |