|
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.
|