From 00bd2aa2280cca547ba59a94fd1b3537e208f4ad Mon Sep 17 00:00:00 2001
From: Smeulf <smeulf@team-mediaportal.com>
Date: Tue, 23 Oct 2012 20:30:54 +0200
Subject: [PATCH] Fix multiple screen issues, and add an extra option to
 select startup screen

---
 .../Core/MediaPortal.Common/ApplicationCore.cs     |  16 ++-
 .../Core/MediaPortal.UI/MediaPortal.UI.csproj      |   1 +
 .../MediaPortal.UI/Settings/StartupSettings.cs     |  51 ++++++++++
 .../MediaPortal.Utilities/Screens/SplashScreen.cs  |  32 +++++-
 .../Main/MediaPortal.Client/ApplicationLauncher.cs |  20 ++--
 MediaPortal/Source/UI/SkinEngine/GUI/MainForm.cs   |  40 ++++++--
 .../Source/UI/SkinEngine/Language/strings_en.xml   |   3 +
 .../Source/UI/SkinEngine/Settings/AppSettings.cs   |  13 ---
 .../Configuration/Appearance/StartupScreen.cs      | 109 +++++++++++++++++++++
 MediaPortal/Source/UI/SkinEngine/SkinEngine.csproj |   1 +
 MediaPortal/Source/UI/SkinEngine/plugin.xml        |   5 +
 11 files changed, 257 insertions(+), 34 deletions(-)
 create mode 100644 MediaPortal/Source/Core/MediaPortal.UI/Settings/StartupSettings.cs
 create mode 100644 MediaPortal/Source/UI/SkinEngine/Settings/Configuration/Appearance/StartupScreen.cs

diff --git a/MediaPortal/Source/Core/MediaPortal.Common/ApplicationCore.cs b/MediaPortal/Source/Core/MediaPortal.Common/ApplicationCore.cs
index a2b92f8..131cdf8 100644
--- a/MediaPortal/Source/Core/MediaPortal.Common/ApplicationCore.cs
+++ b/MediaPortal/Source/Core/MediaPortal.Common/ApplicationCore.cs
@@ -57,7 +57,8 @@ namespace MediaPortal.Common
     /// be used to startup the application using a custom directory for data storage.
     /// </summary>
     /// <param name="dataDirectory">Path to custom data directory</param>
-    public static void RegisterCoreServices(string dataDirectory = null)
+
+    public static void RegisterVitalCoreServices(string dataDirectory = null)
     {
       // Insert a dummy while loading the path manager to break circular dependency of logger and path manager. This should not
       // be considered as a hack - simply the logger needs a path managed by the path manager and I don't want to remove log
@@ -72,10 +73,20 @@ namespace MediaPortal.Common
       ServiceRegistration.Set<IPathManager>(pathManager);
 
       ILogger logger = new Log4NetLogger(pathManager.GetPath(@"<LOG>")); 
+
       logger.Info("ApplicationCore: Launching in AppDomain {0}...", AppDomain.CurrentDomain.FriendlyName);
 
       logger.Debug("ApplicationCore: Registering ILogger service");
       ServiceRegistration.Set<ILogger>(logger);
+      
+      logger.Debug("ApplicationCore: Registering ISettingsManager service");
+      ServiceRegistration.Set<ISettingsManager>(new SettingsManager());
+    }
+    
+    public static void RegisterCoreServices()
+    {
+
+      ILogger logger = ServiceRegistration.Get<ILogger>();
 
       logger.Debug("ApplicationCore: Registering IRegistry service");
       ServiceRegistration.Set<IRegistry>(new Services.Registry.Registry());
@@ -89,9 +100,6 @@ namespace MediaPortal.Common
       logger.Debug("ApplicationCore: Registering IPluginManager service");
       ServiceRegistration.Set<IPluginManager>(new Services.PluginManager.PluginManager());
 
-      logger.Debug("ApplicationCore: Registering ISettingsManager service");
-      ServiceRegistration.Set<ISettingsManager>(new SettingsManager());
-
       logger.Debug("ApplicationCore: Registering ILocalization service");
       ServiceRegistration.Set<ILocalization>(new StringManager());
 
diff --git a/MediaPortal/Source/Core/MediaPortal.UI/MediaPortal.UI.csproj b/MediaPortal/Source/Core/MediaPortal.UI/MediaPortal.UI.csproj
index 5a77505..2e5fabc 100644
--- a/MediaPortal/Source/Core/MediaPortal.UI/MediaPortal.UI.csproj
+++ b/MediaPortal/Source/Core/MediaPortal.UI/MediaPortal.UI.csproj
@@ -187,6 +187,7 @@
     <Compile Include="Presentation\UiNotifications\DefaultNotification.cs" />
     <Compile Include="Services\UiNotifications\NotificationService.cs" />
     <Compile Include="Services\Workflow\WorkflowStateBuilder.cs" />
+    <Compile Include="Settings\StartupSettings.cs" />
     <Compile Include="Shares\SharesMessaging.cs" />
     <Compile Include="Services\Shares\Settings\SharesSettings.cs" />
     <Compile Include="Services\SystemResolver\SystemResolver.cs" />
diff --git a/MediaPortal/Source/Core/MediaPortal.UI/Settings/StartupSettings.cs b/MediaPortal/Source/Core/MediaPortal.UI/Settings/StartupSettings.cs
new file mode 100644
index 0000000..6504024
--- /dev/null
+++ b/MediaPortal/Source/Core/MediaPortal.UI/Settings/StartupSettings.cs
@@ -0,0 +1,51 @@
+#region Copyright (C) 2007-2013 Team MediaPortal
+
+/*
+    Copyright (C) 2007-2013 Team MediaPortal
+    http://www.team-mediaportal.com
+
+    This file is part of MediaPortal 2
+
+    MediaPortal 2 is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    MediaPortal 2 is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with MediaPortal 2. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#endregion
+
+using MediaPortal.Common.Runtime;
+using MediaPortal.Common.Settings;
+
+namespace MediaPortal.UI.Settings
+{
+  public class StartupSettings
+  {
+    #region Consts
+
+    protected const int STARTUP_SCREEN_NUM = -1;
+
+    #endregion
+
+    protected int _startupScreenNum = STARTUP_SCREEN_NUM;
+
+    /// <summary>
+    /// Gets or sets the number of the screen where the application is displayed in fullscreen.
+    /// The value is an index in the array <see cref="System.Windows.Forms.Screen.AllScreens"/>.
+    /// </summary>
+    [Setting(SettingScope.User, STARTUP_SCREEN_NUM)]
+    public int StartupScreenNum
+    {
+      get { return _startupScreenNum; }
+      set { _startupScreenNum = value; }
+    }
+  }
+}
diff --git a/MediaPortal/Source/Core/MediaPortal.Utilities/Screens/SplashScreen.cs b/MediaPortal/Source/Core/MediaPortal.Utilities/Screens/SplashScreen.cs
index 1f7f650..f83ff7e 100644
--- a/MediaPortal/Source/Core/MediaPortal.Utilities/Screens/SplashScreen.cs
+++ b/MediaPortal/Source/Core/MediaPortal.Utilities/Screens/SplashScreen.cs
@@ -61,7 +61,9 @@ namespace MediaPortal.Utilities.Screens
     private Label _programInfoLabel;
     private Label _statusLabel;
     private Timer _splashTimer;
-    private IContainer _components;
+    private IContainer _components;
+
+    private int _stratupScreen;
 
     #region Public Properties & Methods
 
@@ -189,6 +191,16 @@ namespace MediaPortal.Utilities.Screens
         FadeInDuration = TimeSpan.Zero;
         FadeOutDuration = TimeSpan.Zero;
       }
+    }
+
+    /// <summary
+    /// Set the screen to display the spashscreen
+    /// </summary>
+
+    public int StartupScreen
+    {
+      get { return _stratupScreen; }
+      set { _stratupScreen = value; }
     }
 
     public void PositionStatusLabel(Point location, int width, int height)
@@ -249,7 +261,23 @@ namespace MediaPortal.Utilities.Screens
     {
       if (backgroundImage == null)
         return;
-      Size screen = Screen.PrimaryScreen.Bounds.Size;
+      Size screen;
+      if (StartupScreen > -1 && StartupScreen < Screen.AllScreens.Length)
+      {
+        // Force the splashscreen to be displayed on a specific screen
+        screen = Screen.AllScreens[StartupScreen].Bounds.Size;
+        
+        Top = Screen.AllScreens[StartupScreen].WorkingArea.Top;
+        Left = Screen.AllScreens[StartupScreen].WorkingArea.Left;
+        StartPosition = FormStartPosition.Manual;
+      }
+      else
+      {
+        //Use the default windows screen to display the splashscreen
+        Form f = new Form(); //Temporary form to gain access on the current screen properties
+        screen = Screen.FromControl(f).Bounds.Size;
+        f.Dispose(); //Temporary form not needed anymore
+      }
       if (ScaleToFullscreen && (screen.Width != backgroundImage.Width || screen.Height != backgroundImage.Height))
         backgroundImage = ImageUtilities.ResizeImageExact(backgroundImage, screen.Width, screen.Height);
 
diff --git a/MediaPortal/Source/Main/MediaPortal.Client/ApplicationLauncher.cs b/MediaPortal/Source/Main/MediaPortal.Client/ApplicationLauncher.cs
index 2ad5f22..831edd2 100644
--- a/MediaPortal/Source/Main/MediaPortal.Client/ApplicationLauncher.cs
+++ b/MediaPortal/Source/Main/MediaPortal.Client/ApplicationLauncher.cs
@@ -39,6 +39,7 @@ using System.Drawing;
 using System.IO;
 using MediaPortal.Utilities.Screens;
 using MediaPortal.Common.PathManager;
+using MediaPortal.Common.Settings;
 #endif
 using MediaPortal.UI.Shares;
 using CommandLine;
@@ -56,10 +57,11 @@ namespace MediaPortal.Client
   internal static class ApplicationLauncher
   {
 #if !DEBUG
-    private static SplashScreen CreateSplashScreen()
+    private static SplashScreen CreateSplashScreen(int startupScreen)
     {
       SplashScreen result = new SplashScreen
           {
+            StartupScreen = startupScreen,
             ScaleToFullscreen = true,
             FadeInDuration = TimeSpan.FromMilliseconds(300),
             FadeOutDuration = TimeSpan.FromMilliseconds(200),
@@ -76,12 +78,10 @@ namespace MediaPortal.Client
     private static void Main(params string[] args)
     {
       Thread.CurrentThread.Name = "Main";
-
 #if !DEBUG
-      SplashScreen splashScreen = CreateSplashScreen();
-      splashScreen.ShowSplashScreen();
+      //Don't we may have a null reference exeption ?
+      SplashScreen splashScreen = null;
 #endif
-
       // Parse Command Line options
       CommandLineOptions mpArgs = new CommandLineOptions();
       ICommandLineParser parser = new CommandLineParser(new CommandLineParserSettings(Console.Error));
@@ -102,7 +102,15 @@ namespace MediaPortal.Client
         try
         {
           // Check if user wants to override the default Application Data location.
-          ApplicationCore.RegisterCoreServices(mpArgs.DataDirectory);
+          ApplicationCore.RegisterVitalCoreServices(mpArgs.DataDirectory);
+
+#if !DEBUG
+      splashScreen = CreateSplashScreen(ServiceRegistration.Get<MediaPortal.Common.Settings.ISettingsManager>().Load<MediaPortal.UI.Settings.StartupSettings>().StartupScreenNum);
+      splashScreen.ShowSplashScreen();
+#endif
+
+          
+          ApplicationCore.RegisterCoreServices();
 
           logger = ServiceRegistration.Get<ILogger>();
 
diff --git a/MediaPortal/Source/UI/SkinEngine/GUI/MainForm.cs b/MediaPortal/Source/UI/SkinEngine/GUI/MainForm.cs
index 9da46c9..98af99d 100644
--- a/MediaPortal/Source/UI/SkinEngine/GUI/MainForm.cs
+++ b/MediaPortal/Source/UI/SkinEngine/GUI/MainForm.cs
@@ -32,6 +32,7 @@ using MediaPortal.UI.Control.InputManager;
 using MediaPortal.Common.Logging;
 using MediaPortal.UI.General;
 using MediaPortal.Common.Settings;
+using MediaPortal.UI.Settings;
 using MediaPortal.UI.Presentation.Players;
 using MediaPortal.UI.Presentation.Screens;
 using MediaPortal.UI.Services.Players.VideoPlayerSynchronizationStrategies;
@@ -105,18 +106,41 @@ namespace MediaPortal.UI.SkinEngine.GUI
       InitializeComponent();
       CheckForIllegalCrossThreadCalls = false;
 
-      AppSettings settings = ServiceRegistration.Get<ISettingsManager>().Load<AppSettings>();
+      StartupSettings startupSettings = ServiceRegistration.Get<ISettingsManager>().Load<StartupSettings>();
+      AppSettings appSettings = ServiceRegistration.Get<ISettingsManager>().Load<AppSettings>();
 
       _previousMousePosition = new Point(-1, -1);
 
       Size desiredWindowedSize = new Size(SkinContext.SkinResources.SkinWidth, SkinContext.SkinResources.SkinHeight);
 
+      // Get the number of screens on the computer, startup screen must be lover or equals to this number
+      // if not, it means the screen doesn't exists anymore
+      // if the screen doeans't exists, fallback to "unselected startup screen" mode
+      // 
+      // TODO :  Maybe we could display a message on MP2 client if the startup screen is incorrect
+     
+      int numberOfScreens = System.Windows.Forms.Screen.AllScreens.Length;
+
+      //Force a first location for the form
+      if (startupSettings.StartupScreenNum > -1 && startupSettings.StartupScreenNum < numberOfScreens)
+      {
+        Location = new Point(System.Windows.Forms.Screen.AllScreens[startupSettings.StartupScreenNum].WorkingArea.X, System.Windows.Forms.Screen.AllScreens[startupSettings.StartupScreenNum].WorkingArea.Y);
+        StartPosition = FormStartPosition.Manual;
+      }
+      else
+        Location = new Point(System.Windows.Forms.Screen.GetWorkingArea(this).X, System.Windows.Forms.Screen.GetWorkingArea(this).Y);
+       
       _previousWindowLocation = Location;
       _previousWindowClientSize = desiredWindowedSize;
       _previousWindowState = FormWindowState.Normal;
 
-      if (settings.FullScreen)
-        SwitchToFullscreen(settings.FSScreenNum);
+      if (appSettings.FullScreen)
+      {
+        if (startupSettings.StartupScreenNum > -1 && startupSettings.StartupScreenNum < numberOfScreens)
+          SwitchToFullscreen(startupSettings.StartupScreenNum);
+        else
+        SwitchToFullscreen(GetScreenNum()); // Warning : Runnning in debug will always display the MainForm on the primary screen
+      }
       else
         SwitchToWindowedSize(Location, desiredWindowedSize, false);
 
@@ -127,10 +151,10 @@ namespace MediaPortal.UI.SkinEngine.GUI
       GraphicsDevice.Initialize_MainThread(this);
 
       // Read and apply ScreenSaver settings
-      _screenSaverTimeOut = TimeSpan.FromMinutes(settings.ScreenSaverTimeoutMin);
-      _isScreenSaverEnabled = settings.ScreenSaverEnabled;
+      _screenSaverTimeOut = TimeSpan.FromMinutes(appSettings.ScreenSaverTimeoutMin);
+      _isScreenSaverEnabled = appSettings.ScreenSaverEnabled;
 
-      _applicationSuspendLevel = settings.SuspendLevel;
+      _applicationSuspendLevel = appSettings.SuspendLevel;
       UpdateSystemSuspendLevel_MainThread(); // Don't use UpdateSystemSuspendLevel() here because the window handle was not created yet
 
       Application.Idle += OnApplicationIdle;
@@ -437,8 +461,6 @@ namespace MediaPortal.UI.SkinEngine.GUI
       if (mode == _mode)
         return;
 
-      int screenNum = GetScreenNum();
-      settings.FSScreenNum = screenNum;
       settings.FullScreen = newFullscreen;
       ServiceRegistration.Get<ISettingsManager>().Save(settings);
 
@@ -451,7 +473,7 @@ namespace MediaPortal.UI.SkinEngine.GUI
         if (newFullscreen)
         {
           StoreClientBounds();
-          SwitchToFullscreen(screenNum);
+          SwitchToFullscreen(GetScreenNum());
         }
         else
           SwitchToWindowedSize(_previousWindowLocation, _previousWindowClientSize, _previousWindowState == FormWindowState.Maximized);
diff --git a/MediaPortal/Source/UI/SkinEngine/Language/strings_en.xml b/MediaPortal/Source/UI/SkinEngine/Language/strings_en.xml
index d673be1..072e7ee 100644
--- a/MediaPortal/Source/UI/SkinEngine/Language/strings_en.xml
+++ b/MediaPortal/Source/UI/SkinEngine/Language/strings_en.xml
@@ -3,6 +3,9 @@
   <string name="Settings.Appearance.System">System</string>
   <string name="Settings.Appearance.System.Fullscreen">Fullscreen</string>
   <string name="Settings.Appearance.System.Fullscreen.Help">Show MediaPortal in fullscreen mode</string>
+  <string name="Settings.Appearance.System.StartupScreen">Startup Screen</string>
+  <string name="Settings.Appearance.System.StartupScreen.Help">Select Startup Screen</string>
+  <string name="Settings.Appearance.System.StartupScreen.DoNotUseSelection">Do not use screen selection</string>
   <string name="Settings.Appearance.System.CellPhoneInputStyle">Cell phone input style</string>
   <string name="Settings.Appearance.System.CellPhoneInputStyle.Help">Use cell phone/SMS input style</string>
   <string name="Settings.Appearance.System.ScreenSaverEnabled">Enable screen saver</string>    <string name="Settings.Appearance.System.ScreenSaverEnabled.Help">Configure if the screen saver should be displayed</string>
diff --git a/MediaPortal/Source/UI/SkinEngine/Settings/AppSettings.cs b/MediaPortal/Source/UI/SkinEngine/Settings/AppSettings.cs
index 30edb2c..108c647 100644
--- a/MediaPortal/Source/UI/SkinEngine/Settings/AppSettings.cs
+++ b/MediaPortal/Source/UI/SkinEngine/Settings/AppSettings.cs
@@ -33,7 +33,6 @@ namespace MediaPortal.UI.SkinEngine.Settings
     #region Consts
 
     protected const bool DEFAULT_FULL_SCREEN = true;
-    protected const int DEFAULT_FS_SCREEN_NUM = -1;
     protected const bool DEFAULT_CELL_PHONE_INPUT_STYLE = false;
     protected const bool DEFAULT_SCREEN_SAVER_ENABLED = true;
     protected const double DEFAULT_SCREEN_SAVER_TIMEOUT_MIN = 5;
@@ -42,7 +41,6 @@ namespace MediaPortal.UI.SkinEngine.Settings
 
     #endregion
 
-    protected int _fsScreenNum = DEFAULT_FS_SCREEN_NUM;
     protected bool _fullScreen = DEFAULT_FULL_SCREEN;
     protected bool _cellPhoneInputStyle = DEFAULT_CELL_PHONE_INPUT_STYLE;
     protected bool _screenSaverEnabled = DEFAULT_SCREEN_SAVER_ENABLED;
@@ -64,17 +62,6 @@ namespace MediaPortal.UI.SkinEngine.Settings
       set { _fullScreen = value; }
     }
 
-    /// <summary>
-    /// Gets or sets the number of the screen where the application is displayed in fullscreen.
-    /// The value is an index in the array <see cref="System.Windows.Forms.Screen.AllScreens"/>.
-    /// </summary>
-    [Setting(SettingScope.User, DEFAULT_FS_SCREEN_NUM)]
-    public int FSScreenNum
-    {
-      get { return _fsScreenNum; }
-      set { _fsScreenNum = value; }
-    }
-
     [Setting(SettingScope.User, DEFAULT_CELL_PHONE_INPUT_STYLE)]
     public bool CellPhoneInputStyle
     {
diff --git a/MediaPortal/Source/UI/SkinEngine/Settings/Configuration/Appearance/StartupScreen.cs b/MediaPortal/Source/UI/SkinEngine/Settings/Configuration/Appearance/StartupScreen.cs
new file mode 100644
index 0000000..a3a042c
--- /dev/null
+++ b/MediaPortal/Source/UI/SkinEngine/Settings/Configuration/Appearance/StartupScreen.cs
@@ -0,0 +1,109 @@
+﻿#region Copyright (C) 2007-2013 Team MediaPortal
+
+/*
+    Copyright (C) 2007-2013 Team MediaPortal
+    http://www.team-mediaportal.com
+
+    This file is part of MediaPortal 2
+
+    MediaPortal 2 is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    MediaPortal 2 is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with MediaPortal 2. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#endregion
+
+using System;
+using System.Collections.Generic;
+using System.Windows.Forms;
+using System.Runtime.InteropServices;
+using System.Linq;
+using MediaPortal.UI.Settings;
+using MediaPortal.Common.Localization;
+using MediaPortal.Common.Configuration.ConfigurationClasses;
+
+
+namespace MediaPortal.UI.SkinEngine.Settings.Configuration.Appearance
+{
+
+  public class StartupScreen : SingleSelectionList
+  {
+    [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
+    public class DISPLAY_DEVICE
+    {
+      public int cb = 0;
+      [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)]
+      public string DeviceName = new String(' ', 32);
+      [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)]
+      public string DeviceString = new String(' ', 128);
+      public int StateFlags = 0;
+      [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)]
+      public string DeviceID = new String(' ', 128);
+      [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)]
+      public string DeviceKey = new String(' ', 128);
+    }
+
+    [DllImport("user32.dll")]
+    public static extern bool EnumDisplayDevices(string lpDevice, int iDevNum, [In, Out] DISPLAY_DEVICE lpDisplayDevice, int dwFlags);
+
+    #region Protected fields
+
+    protected IList<Screen> _Screens;
+
+    #endregion
+
+    #region Base overrides
+
+    public override void Load()
+    {
+      _Screens = new List<Screen>(Screen.AllScreens);
+      
+      IList<String> Screens = new List<String>();
+      Screens.Add("[Settings.Appearance.System.StartupScreen.DoNotUseSelection]");
+
+      foreach (Screen screen in Screen.AllScreens)
+      {
+        int dwf = 0;
+        DISPLAY_DEVICE info = new DISPLAY_DEVICE();
+        string monitorname = null;
+        info.cb = Marshal.SizeOf(info);
+        if (EnumDisplayDevices(screen.DeviceName, 0, info, dwf))
+        {
+          monitorname = info.DeviceString;
+        }
+        if (monitorname == null)
+        {
+          monitorname = "";
+        }
+        Screens.Add(string.Format("{0} ({1}x{2})",monitorname, screen.Bounds.Width, screen.Bounds.Height));
+      }
+      
+      int startupScreenNum = SettingsManager.Load<StartupSettings>().StartupScreenNum;
+
+      if (startupScreenNum < Screen.AllScreens.Length)
+        Selected = SettingsManager.Load<StartupSettings>().StartupScreenNum + 1;
+      else
+        Selected = 0;
+
+      _items = Screens.Select(s => LocalizationHelper.CreateResourceString(s)).ToList();
+    }
+
+    public override void Save()
+    {
+      StartupSettings settings = SettingsManager.Load<StartupSettings>();
+      settings.StartupScreenNum = Selected - 1;
+      SettingsManager.Save(settings);
+    }
+
+    #endregion
+  }
+}
diff --git a/MediaPortal/Source/UI/SkinEngine/SkinEngine.csproj b/MediaPortal/Source/UI/SkinEngine/SkinEngine.csproj
index 7313724..921840e 100644
--- a/MediaPortal/Source/UI/SkinEngine/SkinEngine.csproj
+++ b/MediaPortal/Source/UI/SkinEngine/SkinEngine.csproj
@@ -267,6 +267,7 @@
     <Compile Include="ScreenManagement\ScreenManagerMessaging.cs" />
     <Compile Include="Controls\Visuals\VirtualKeyboardControl.cs" />
     <Compile Include="ScreenManagement\SuperLayerManager.cs" />
+    <Compile Include="Settings\Configuration\Appearance\StartupScreen.cs" />
     <Compile Include="Settings\Configuration\General\ApplicationSuspendLevel.cs" />
     <Compile Include="Utils\MediaItemsHelper.cs" />
     <Compile Include="Utils\UIResourcesHelper.cs" />
diff --git a/MediaPortal/Source/UI/SkinEngine/plugin.xml b/MediaPortal/Source/UI/SkinEngine/plugin.xml
index 63ea316..c07f8a3 100644
--- a/MediaPortal/Source/UI/SkinEngine/plugin.xml
+++ b/MediaPortal/Source/UI/SkinEngine/plugin.xml
@@ -82,6 +82,11 @@
         HelpText="[Settings.Appearance.System.Fullscreen.Help]"
         ClassName="MediaPortal.UI.SkinEngine.Settings.Configuration.Appearance.Fullscreen"/>
     <ConfigSetting
+        Id="StartupScreen"
+        Text="[Settings.Appearance.System.StartupScreen]"
+        HelpText="[Settings.Appearance.System.StartupScreen.Help]"
+        ClassName="MediaPortal.UI.SkinEngine.Settings.Configuration.Appearance.StartupScreen"/>
+    <ConfigSetting
         Id="CellPhoneInputStyle"
         Text="[Settings.Appearance.System.CellPhoneInputStyle]"
         HelpText="[Settings.Appearance.System.CellPhoneInputStyle.Help]"
-- 
1.7.11.msysgit.1

