[Mp-plugins-svn] SF.net SVN: mp-plugins: [892]
trunk/plugins/SkinChanger/SkinChanger/ SkinChanger.cs
From: <gib...@us...> - 2007-09-04 08:54:32
|
Revision: 892 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=892&view=rev Author: gibman_dk Date: 2007-09-04 01:54:30 -0700 (Tue, 04 Sep 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/SkinChanger/SkinChanger/SkinChanger.cs Modified: trunk/plugins/SkinChanger/SkinChanger/SkinChanger.cs =================================================================== --- trunk/plugins/SkinChanger/SkinChanger/SkinChanger.cs 2007-09-04 07:32:31 UTC (rev 891) +++ trunk/plugins/SkinChanger/SkinChanger/SkinChanger.cs 2007-09-04 08:54:30 UTC (rev 892) @@ -4,6 +4,7 @@ using MediaPortal.GUI.Library; using MediaPortal.Configuration; using System.Windows.Forms; +using MediaPortal.Player; namespace MediaPortal.GUI.SkinChanger { @@ -180,8 +181,14 @@ { newSkin = (string)_skins[_activeSkinIndex + 1]; _activeSkinIndex++; - } - + } + /* + if (GUIGraphicsContext.Skin == newSkin) + { + _activeSkinIndex++; + newSkin = (string)_skins[_activeSkinIndex]; + } + */ SwitchToSkin(newSkin); } @@ -205,6 +212,13 @@ newSkin = (string)_skins[_activeSkinIndex - 1]; _activeSkinIndex--; } + /* + if (GUIGraphicsContext.Skin == newSkin) + { + _activeSkinIndex--; + newSkin = (string)_skins[_activeSkinIndex]; + } + */ SwitchToSkin(newSkin); } @@ -212,6 +226,11 @@ private void SwitchToSkin(string newSkin) { + //we have to pause the gplayer, otherwise we might hang the app. + if (g_Player.IsVideo || g_Player.IsTV && !g_Player.Paused) + { + g_Player.Pause(); + } // Set the skin to the selected skin and reload GUI GUIGraphicsContext.Skin = newSkin; @@ -229,7 +248,16 @@ if (autosize && !GUIGraphicsContext.Fullscreen) Form.ActiveForm.Size = new System.Drawing.Size(GUIGraphicsContext.SkinSize.Width, GUIGraphicsContext.SkinSize.Height); } - GUIWindowManager.OnResize(); + GUIWindowManager.OnResize(); + + // we need to refresh the current active screen, otherwise we will see some unwanted stuff. + GUIMessage msg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_WINDOW_INIT, GUIWindowManager.ActiveWindow, 0, 0, 0, 0, null); + GUIWindowManager.SendThreadMessage(msg); + + if (g_Player.Paused) + { + g_Player.Pause(); + } } #endregion This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
[Mp-plugins-svn] SF.net SVN: mp-plugins: [934]
trunk/plugins/SkinChanger/SkinChanger/ SkinChanger.cs
From: <gib...@us...> - 2007-09-16 18:09:09
|
Revision: 934 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=934&view=rev Author: gibman_dk Date: 2007-09-16 11:08:48 -0700 (Sun, 16 Sep 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/SkinChanger/SkinChanger/SkinChanger.cs Modified: trunk/plugins/SkinChanger/SkinChanger/SkinChanger.cs =================================================================== --- trunk/plugins/SkinChanger/SkinChanger/SkinChanger.cs 2007-09-16 16:58:47 UTC (rev 933) +++ trunk/plugins/SkinChanger/SkinChanger/SkinChanger.cs 2007-09-16 18:08:48 UTC (rev 934) @@ -241,19 +241,40 @@ GUIFontManager.InitializeDeviceObjects(); GUIControlFactory.ClearReferences(); GUIControlFactory.LoadReferences(GUIGraphicsContext.Skin + @"\references.xml"); + bool startWithBasicHome = false; using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) { + startWithBasicHome = xmlreader.GetValueAsBool("general", "startbasichome", false); xmlreader.SetValue("general", "skinobsoletecount", 0); bool autosize = xmlreader.GetValueAsBool("general", "autosize", true); if (autosize && !GUIGraphicsContext.Fullscreen) Form.ActiveForm.Size = new System.Drawing.Size(GUIGraphicsContext.SkinSize.Width, GUIGraphicsContext.SkinSize.Height); } - GUIWindowManager.OnResize(); + // we need to refresh the current active screen, otherwise we will see some unwanted stuff. GUIMessage msg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_WINDOW_INIT, GUIWindowManager.ActiveWindow, 0, 0, 0, 0, null); GUIWindowManager.SendThreadMessage(msg); + //we also need to refresh the home screen, if we change skin in another module and return to homescreen, the result is that the homescreen is still using the old skin + + if (GUIWindowManager.ActiveWindow != (int)GUIWindow.Window.WINDOW_HOME && GUIWindowManager.ActiveWindow != (int)GUIWindow.Window.WINDOW_SECOND_HOME) + { + GUIMessage homeMsg = null; + if (startWithBasicHome) + { + homeMsg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_WINDOW_INIT, (int)GUIWindow.Window.WINDOW_HOME, 0, 0, 0, 0, null); + } + else + { + homeMsg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_WINDOW_INIT, (int)GUIWindow.Window.WINDOW_SECOND_HOME, 0, 0, 0, 0, null); + } + + GUIWindowManager.SendThreadMessage(homeMsg); + } + + GUIWindowManager.OnResize(); + if (g_Player.Paused) { g_Player.Pause(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |