Skip to content
Browse files

Merge pull request #1094 from pieh/cond_includes_home

home.xml existence testing
  • Loading branch information...
2 parents 4e6a1d8 + 40bb7a5 commit 5096f9c4e17d4d12ed5bd1e1dd0680d47dc80541 @pieh pieh committed Jul 2, 2012
Showing with 23 additions and 14 deletions.
  1. +9 −1 language/English/strings.po
  2. +14 −13 xbmc/Application.cpp
View
10 language/English/strings.po
@@ -8725,7 +8725,15 @@ msgctxt "#24101"
msgid "Would you like to download this Add-on?"
msgstr ""
-#empty strings from id 24102 to 24999
+msgctxt "#24102"
+msgid "Unable to load skin"
+msgstr ""
+
+msgctxt "#24103"
+msgid "Skin is missing some files"
+msgstr ""
+
+#empty strings from id 24104 to 24999
msgctxt "#25000"
msgid "Notifications"
View
27 xbmc/Application.cpp
@@ -1746,6 +1746,20 @@ void CApplication::LoadSkin(const SkinPtr& skin)
return ;
}
+ if (!skin->HasSkinFile("Home.xml"))
+ {
+ // failed to find home.xml
+ // fallback to default skin
+ if (strcmpi(skin->ID().c_str(), DEFAULT_SKIN) != 0)
+ {
+ CLog::Log(LOGERROR, "home.xml doesn't exist in skin: %s, fallback to \"%s\" skin", skin->ID().c_str(), DEFAULT_SKIN);
+ g_guiSettings.SetString("lookandfeel.skin", DEFAULT_SKIN);
+ LoadSkin(DEFAULT_SKIN);
+ CGUIDialogKaiToast::QueueNotification(CGUIDialogKaiToast::Error, g_localizeStrings.Get(24102), g_localizeStrings.Get(24103));
+ return ;
+ }
+ }
+
bool bPreviousPlayingState=false;
bool bPreviousRenderingState=false;
if (g_application.m_pPlayer && g_application.IsPlayingVideo())
@@ -1811,19 +1825,6 @@ void CApplication::LoadSkin(const SkinPtr& skin)
start = CurrentHostCounter();
CLog::Log(LOGINFO, " load new skin...");
- CGUIWindowHome *pHome = (CGUIWindowHome *)g_windowManager.GetWindow(WINDOW_HOME);
- if (!pHome || !pHome->Load("Home.xml"))
- {
- // failed to load home.xml
- // fallback to default skin
- if ( strcmpi(skin->ID().c_str(), DEFAULT_SKIN) != 0)
- {
- CLog::Log(LOGERROR, "failed to load home.xml for skin: %s, fallback to \"%s\" skin", skin->ID().c_str(), DEFAULT_SKIN);
- g_guiSettings.SetString("lookandfeel.skin", DEFAULT_SKIN);
- LoadSkin(DEFAULT_SKIN);
- return ;
- }
- }
// Load the user windows
LoadUserWindows();

0 comments on commit 5096f9c

Please sign in to comment.
Something went wrong with that request. Please try again.