Merge pull request #2022 from ronie/skin-startup
authorArne Morten Kvarving <spiff@xbmc.org>
Sat, 6 Apr 2013 11:11:08 +0000 (04:11 -0700)
committerArne Morten Kvarving <spiff@xbmc.org>
Sat, 6 Apr 2013 11:11:08 +0000 (04:11 -0700)
Always load Startup.xml

addons/skin.confluence/720p/Startup.xml
xbmc/GUIInfoManager.cpp
xbmc/GUIInfoManager.h
xbmc/addons/Skin.cpp
xbmc/addons/Skin.h

index 4061610..4bf415d 100644 (file)
@@ -4,7 +4,7 @@
        <controls>
                <control type="button" id="10">
                        <description>trigger</description>
-                       <onfocus>ReplaceWindow(Home)</onfocus>
+                       <onfocus>ReplaceWindow($INFO[System.StartupWindow])</onfocus>
                        <texturenofocus>-</texturenofocus>
                        <texturefocus>-</texturefocus>
                        <visible>!Skin.HasSetting(Use_Startup_Playlist)</visible>
                <control type="button" id="10">
                        <description>trigger with startup Playlist</description>
                        <onfocus>XBMC.PlayMedia($INFO[Skin.String(Startup_Playlist_Path)])</onfocus>
-                       <onfocus>ReplaceWindow(Home)</onfocus>
+                       <onfocus>ReplaceWindow($INFO[System.StartupWindow])</onfocus>
                        <texturenofocus>-</texturenofocus>
                        <texturefocus>-</texturefocus>
                        <visible>Skin.HasSetting(Use_Startup_Playlist)</visible>
                </control>
                <include>CommonBackground</include>
        </controls>
-</window>
\ No newline at end of file
+</window>
index f6f4646..a87586e 100644 (file)
@@ -275,7 +275,8 @@ const infomap system_labels[] =  {{ "hasnetwork",       SYSTEM_ETHERNET_LINK_ACT
                                   { "alarmpos",         SYSTEM_ALARM_POS },
                                   { "isinhibit",        SYSTEM_ISINHIBIT },
                                   { "hasshutdown",      SYSTEM_HAS_SHUTDOWN },
-                                  { "haspvr",           SYSTEM_HAS_PVR }};
+                                  { "haspvr",           SYSTEM_HAS_PVR },
+                                  { "startupwindow",    SYSTEM_STARTUP_WINDOW }};
 
 const infomap system_param[] =   {{ "hasalarm",         SYSTEM_HAS_ALARM },
                                   { "hascoreid",        SYSTEM_HAS_CORE_ID },
@@ -1646,6 +1647,9 @@ CStdString CGUIInfoManager::GetLabel(int info, int contextWindow, CStdString *fa
   case SYSTEM_CURRENT_WINDOW:
     return g_localizeStrings.Get(g_windowManager.GetFocusedWindow());
     break;
+  case SYSTEM_STARTUP_WINDOW:
+    strLabel.Format("%i", g_guiSettings.GetInt("lookandfeel.startupwindow"));
+    break;
   case SYSTEM_CURRENT_CONTROL:
     {
       CGUIWindow *window = g_windowManager.GetWindow(g_windowManager.GetFocusedWindow());
index 2defeb5..8f01a45 100644 (file)
@@ -169,6 +169,7 @@ namespace INFO
 #define SYSTEM_ISINHIBIT            184
 #define SYSTEM_HAS_SHUTDOWN         185
 #define SYSTEM_HAS_PVR              186
+#define SYSTEM_STARTUP_WINDOW       187
 
 #define NETWORK_IP_ADDRESS          190
 #define NETWORK_MAC_ADDRESS         191
index 1ca4350..a6beb4a 100644 (file)
@@ -91,7 +91,6 @@ CSkinInfo::CSkinInfo(const cp_extension_t *ext)
   str = CAddonMgr::Get().GetExtValue(ext->configuration, "@debugging");
   m_debugging = !strcmp(str.c_str(), "true");
 
-  m_onlyAnimateToHome = true;
   LoadStartupWindows(ext);
   m_Version = 2.11;
 }
@@ -221,7 +220,6 @@ bool CSkinInfo::LoadStartupWindows(const cp_extension_t *ext)
   m_startupWindows.push_back(CStartupWindow(WINDOW_FILES, "7"));
   m_startupWindows.push_back(CStartupWindow(WINDOW_SETTINGS_MENU, "5"));
   m_startupWindows.push_back(CStartupWindow(WINDOW_WEATHER, "8"));
-  m_onlyAnimateToHome = true;
   return true;
 }
 
@@ -257,7 +255,7 @@ bool CSkinInfo::TranslateResolution(const CStdString &name, RESOLUTION_INFO &res
 int CSkinInfo::GetFirstWindow() const
 {
   int startWindow = GetStartWindow();
-  if (HasSkinFile("Startup.xml") && (!m_onlyAnimateToHome || startWindow == WINDOW_HOME))
+  if (HasSkinFile("Startup.xml"))
     startWindow = WINDOW_STARTUP_ANIM;
   return startWindow;
 }
index 8d9bf11..6666346 100644 (file)
@@ -137,7 +137,6 @@ protected:
   CStdString m_currentAspect;
 
   std::vector<CStartupWindow> m_startupWindows;
-  bool m_onlyAnimateToHome;
   bool m_debugging;
 };