add some UI feedback for invalid zip installs and dependencies not met
authorJonathan Marshall <jmarshall@never.you.mind>
Fri, 11 Mar 2011 00:33:14 +0000 (13:33 +1300)
committerJonathan Marshall <jmarshall@never.you.mind>
Wed, 16 Mar 2011 20:25:37 +0000 (09:25 +1300)
language/English/strings.xml
xbmc/addons/AddonInstaller.cpp

index 6698976..8404739 100644 (file)
   <string id="24041">Install from zip file</string>
   <string id="24042">Downloading %i%%</string>
   <string id="24043">Available Updates</string>
+  <string id="24044">Dependencies not met</string>
+  <string id="24045">Add-on does not have the correct structure</string>
 
   <string id="24050">Available Add-ons</string>
   <string id="24051">Version:</string>
index 3f97cde..e4172e1 100644 (file)
@@ -181,7 +181,10 @@ bool CAddonInstaller::DoInstall(const AddonPtr &addon, const CStdString &hash, b
   //       it may be better to install the dependencies first to minimise the chance of an addon becoming orphaned due to
   //       missing deps.
   if (!CheckDependencies(addon))
+  {
+    g_application.m_guiDialogKaiToast.QueueNotification(addon->Icon(), addon->Name(), g_localizeStrings.Get(24044), TOAST_DISPLAY_TIME, false);
     return false;
+  }
 
   if (background)
   {
@@ -212,7 +215,10 @@ bool CAddonInstaller::InstallFromZip(const CStdString &path)
   CStdString zipDir;
   URIUtils::CreateArchivePath(zipDir, "zip", path, "");
   if (!CDirectory::GetDirectory(zipDir, items) || items.Size() != 1 || !items[0]->m_bIsFolder)
+  {
+    g_application.m_guiDialogKaiToast.QueueNotification("", path, g_localizeStrings.Get(24045), TOAST_DISPLAY_TIME, false);
     return false;
+  }
 
   // TODO: possibly add support for github generated zips here?
   CStdString archive = URIUtils::AddFileToFolder(items[0]->m_strPath, "addon.xml");
@@ -227,6 +233,7 @@ bool CAddonInstaller::InstallFromZip(const CStdString &path)
     // install the addon
     return DoInstall(addon);
   }
+  g_application.m_guiDialogKaiToast.QueueNotification("", path, g_localizeStrings.Get(24045), TOAST_DISPLAY_TIME, false);
   return false;
 }