Skip to content

Commit

Permalink
MP1-2538 : When_selected_skin_is_incompatible,_no_warning_is_given
Browse files Browse the repository at this point in the history
  • Loading branch information
regeszter committed Oct 22, 2014
1 parent e35a13e commit e3bef33
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 20 deletions.
6 changes: 4 additions & 2 deletions mediaportal/Dialogs/Dialogs/GUIDialogOldSkin.cs
Expand Up @@ -153,13 +153,15 @@ public void RevertSkin()
GUIGraphicsContext.Skin = _userSkin;
GUITextureManager.Clear();
GUITextureManager.Init();
GUIFontManager.LoadFonts(GUIGraphicsContext.Skin + @"\fonts.xml");
SkinSettings.Load();
GUIFontManager.LoadFonts(GUIGraphicsContext.GetThemedSkinFile(@"\fonts.xml"));
GUIFontManager.InitializeDeviceObjects();
GUIExpressionManager.ClearExpressionCache();
GUIControlFactory.ClearReferences();
GUIControlFactory.LoadReferences(GUIGraphicsContext.Skin + @"\references.xml");
GUIControlFactory.LoadReferences(GUIGraphicsContext.GetThemedSkinFile(@"\references.xml"));
GUIWindowManager.OnResize();
//GUIWindowManager.ActivateWindow(ActiveWindowID);

using (Settings xmlreader = new MPSettings())
{
xmlreader.SetValue("general", "skinobsoletecount", 0);
Expand Down
4 changes: 2 additions & 2 deletions mediaportal/MediaPortal.Application/D3D.cs
Expand Up @@ -2087,8 +2087,8 @@ protected override void OnPaint(PaintEventArgs e)
{
Thread.Sleep(20);
} while (!SplashScreen.IsStopped());
SplashScreen = null;

SplashScreen = null;
MediaPortalApp.ShowStartupWarningDialogs();
}

if (MinimizeOnStartup && _firstTimeWindowDisplayed)
Expand Down
21 changes: 5 additions & 16 deletions mediaportal/MediaPortal.Application/MediaPortal.cs
Expand Up @@ -111,7 +111,7 @@ public class MediaPortalApp : D3D, IRender
private static string _alternateConfig;
private static string _safePluginsList;
private string _dateFormat;
private string _outdatedSkinName;
private static string _outdatedSkinName;
private static DateTime _lastOnresume;
private DateTime _updateTimer;
private DateTime _lastContextMenuAction;
Expand Down Expand Up @@ -2669,10 +2669,6 @@ protected override void OnStartup()
Log.Error("MediaPortalApp: Error setting date and time properties - {0}", ex.Message);
}

if (_outdatedSkinName != null || PluginManager.IncompatiblePluginAssemblies.Count > 0 || PluginManager.IncompatiblePlugins.Count > 0)
{
GUIWindowManager.SendThreadCallback(ShowStartupWarningDialogs, 0, 0, null);
}
Log.Debug("Main: Auto play start listening");
AutoPlay.StartListening();

Expand Down Expand Up @@ -2737,15 +2733,7 @@ private void RegisterForDeviceNotifications()
}
}


/// <summary>
///
/// </summary>
/// <param name="param1"></param>
/// <param name="param2"></param>
/// <param name="data"></param>
/// <returns></returns>
private int ShowStartupWarningDialogs(int param1, int param2, object data)
public static void ShowStartupWarningDialogs()
{
// If skin is outdated it may not have a skin file for this dialog but user may choose to use it anyway
// So show incompatible plugins dialog first (possibly using default skin)
Expand All @@ -2758,14 +2746,15 @@ private int ShowStartupWarningDialogs(int param1, int param2, object data)
if (_outdatedSkinName != null)
{
var dlg = (GUIDialogOldSkin)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_OLD_SKIN);

dlg.UserSkin = _outdatedSkinName;
_outdatedSkinName = null;
dlg.DoModal(GUIWindowManager.ActiveWindow);
}

return 0;
return;
}


/// <summary>
/// Load string_xx.xml based on config
/// </summary>
Expand Down

0 comments on commit e3bef33

Please sign in to comment.