Permalink
Browse files

Optimized code, now only main section screen history cleanup for all …

…subsection screens
  • Loading branch information...
1 parent 119f771 commit 91ce9ca07a24c043e4333c1951462c9107a71d9f @dedahr dedahr committed Jan 4, 2013
@@ -4,7 +4,7 @@
<defaultcontrol>2</defaultcontrol>
<allowoverlay>no</allowoverlay>
<define>#header.label:897</define>
- <rememberLastFocusedControl>yes</rememberLastFocusedControl>
+ <rememberLastFocusedControl>no</rememberLastFocusedControl>
<controls>
<import>settings_General.xml</import>
<import>common.settings.xml</import>
@@ -171,31 +171,7 @@ protected override void OnPageLoad()
protected override void OnPageDestroy(int new_windowId)
{
SaveSettings();
-
- if (MediaPortal.GUI.Settings.GUISettings.SettingsChanged && !MediaPortal.Util.Utils.IsGUISettingsWindow(new_windowId))
- {
- MediaPortal.GUI.Settings.GUISettings.OnRestartMP(GetID);
- }
-
base.OnPageDestroy(new_windowId);
-
- // Window history cleanup for back to Settings window
- if (MediaPortal.Util.Utils.IsGUISettingsWindow(new_windowId))
- {
- GUIWindowManager.RemoveWindowFromHistory(GetID);
- }
- else
- {
- // Exit to Home or to a nonGuiSettingsWindow
- List<int> guiWindows = GUIWindowManager.GetWindowHistory();
- foreach (int guiWindow in guiWindows)
- {
- if (MediaPortal.Util.Utils.IsGUISettingsWindow(guiWindow))
- {
- GUIWindowManager.RemoveWindowFromHistory(guiWindow);
- }
- }
- }
}
protected override void OnClicked(int controlId, GUIControl control, Action.ActionType actionType)
@@ -347,31 +347,7 @@ protected override void OnPageLoad()
protected override void OnPageDestroy(int new_windowId)
{
SaveSettings();
-
- if (MediaPortal.GUI.Settings.GUISettings.SettingsChanged && !MediaPortal.Util.Utils.IsGUISettingsWindow(new_windowId))
- {
- MediaPortal.GUI.Settings.GUISettings.OnRestartMP(GetID);
- }
-
base.OnPageDestroy(new_windowId);
-
- // Window history cleanup for back to Settings window
- if (MediaPortal.Util.Utils.IsGUISettingsWindow(new_windowId))
- {
- GUIWindowManager.RemoveWindowFromHistory(GetID);
- }
- else
- {
- // Exit to Home or to a nonGuiSettingsWindow
- List<int> guiWindows = GUIWindowManager.GetWindowHistory();
- foreach (int guiWindow in guiWindows)
- {
- if (MediaPortal.Util.Utils.IsGUISettingsWindow(guiWindow))
- {
- GUIWindowManager.RemoveWindowFromHistory(guiWindow);
- }
- }
- }
}
public override void OnAction(Action action)
@@ -169,31 +169,7 @@ protected override void OnPageLoad()
protected override void OnPageDestroy(int new_windowId)
{
SaveSettings();
-
- if (GUISettings.SettingsChanged && !Util.Utils.IsGUISettingsWindow(new_windowId))
- {
- GUISettings.OnRestartMP(GetID);
- }
-
base.OnPageDestroy(new_windowId);
-
- // Window history cleanup for back to Settings window
- if (MediaPortal.Util.Utils.IsGUISettingsWindow(new_windowId))
- {
- GUIWindowManager.RemoveWindowFromHistory(GetID);
- }
- else
- {
- // Exit to Home or to a nonGuiSettingsWindow
- List<int> guiWindows = GUIWindowManager.GetWindowHistory();
- foreach (int guiWindow in guiWindows)
- {
- if (MediaPortal.Util.Utils.IsGUISettingsWindow(guiWindow))
- {
- GUIWindowManager.RemoveWindowFromHistory(guiWindow);
- }
- }
- }
}
public override void OnAction(Action action)
@@ -142,31 +142,7 @@ protected override void OnPageLoad()
protected override void OnPageDestroy(int new_windowId)
{
SaveSettings();
-
- if (GUISettings.SettingsChanged && !Util.Utils.IsGUISettingsWindow(new_windowId))
- {
- GUISettings.OnRestartMP(GetID);
- }
-
base.OnPageDestroy(new_windowId);
-
- // Window history cleanup for back to Settings window
- if (MediaPortal.Util.Utils.IsGUISettingsWindow(new_windowId))
- {
- GUIWindowManager.RemoveWindowFromHistory(GetID);
- }
- else
- {
- // Exit to Home or to a nonGuiSettingsWindow
- List<int> guiWindows = GUIWindowManager.GetWindowHistory();
- foreach (int guiWindow in guiWindows)
- {
- if (MediaPortal.Util.Utils.IsGUISettingsWindow(guiWindow))
- {
- GUIWindowManager.RemoveWindowFromHistory(guiWindow);
- }
- }
- }
}
public override void OnAction(Action action)
@@ -273,32 +273,7 @@ protected override void OnPageLoad()
protected override void OnPageDestroy(int new_windowId)
{
SaveSettings();
-
- if (MediaPortal.GUI.Settings.GUISettings.SettingsChanged &&
- !MediaPortal.Util.Utils.IsGUISettingsWindow(new_windowId))
- {
- MediaPortal.GUI.Settings.GUISettings.OnRestartMP(GetID);
- }
-
base.OnPageDestroy(new_windowId);
-
- // Window history cleanup for back to Settings window
- if (MediaPortal.Util.Utils.IsGUISettingsWindow(new_windowId))
- {
- GUIWindowManager.RemoveWindowFromHistory(GetID);
- }
- else
- {
- // Exit to Home or to a nonGuiSettingsWindow
- List<int> guiWindows = GUIWindowManager.GetWindowHistory();
- foreach (int guiWindow in guiWindows)
- {
- if (MediaPortal.Util.Utils.IsGUISettingsWindow(guiWindow))
- {
- GUIWindowManager.RemoveWindowFromHistory(guiWindow);
- }
- }
- }
}
public override void OnAction(Action action)

0 comments on commit 91ce9ca

Please sign in to comment.