Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

POC: prompt before updating current skin

  • Loading branch information...
commit cdd734adb7f9edc27e74a2a47d3aa686a90e9682 1 parent 55b4038
Jonathan Marshall authored
Showing with 10 additions and 6 deletions.
  1. +9 −5 xbmc/addons/AddonInstaller.cpp
  2. +1 −1  xbmc/addons/AddonInstaller.h
View
14 xbmc/addons/AddonInstaller.cpp
@@ -440,7 +440,9 @@ bool CAddonInstallJob::DoWork()
}
// run any pre-install functions
- bool reloadAddon = OnPreInstall();
+ bool reloadAddon = false;
+ if (!OnPreInstall(reloadAddon))
+ return false;
// perform install
if (!Install(installFrom))
@@ -462,13 +464,15 @@ bool CAddonInstallJob::DownloadPackage(const CStdString &path, const CStdString
return CFileOperationJob::DoWork();
}
-bool CAddonInstallJob::OnPreInstall()
+bool CAddonInstallJob::OnPreInstall(bool &reloadAfterInstall)
{
// check whether this is an active skin - we need to unload it if so
if (g_guiSettings.GetString("lookandfeel.skin") == m_addon->ID())
{
+ if (!CGUIDialogYesNo::ShowAndGetInput("Skin has an update", "are you sure", "this might break shit", "(j/k)"))
+ return false;
g_application.getApplicationMessenger().ExecBuiltIn("UnloadSkin", true);
- return true;
+ reloadAfterInstall = true;
}
if (m_addon->Type() == ADDON_SERVICE)
@@ -476,9 +480,9 @@ bool CAddonInstallJob::OnPreInstall()
boost::shared_ptr<CService> service = boost::dynamic_pointer_cast<CService>(m_addon);
if (service)
service->Stop();
- return true;
+ reloadAfterInstall = true;
}
- return false;
+ return true;
}
bool CAddonInstallJob::DeleteAddon(const CStdString &addonFolder)
View
2  xbmc/addons/AddonInstaller.h
@@ -147,7 +147,7 @@ class CAddonInstallJob : public CFileOperationJob
*/
static bool DeleteAddon(const CStdString &addonFolder);
private:
- bool OnPreInstall();
+ bool OnPreInstall(bool &reloadAfterInstall);
void OnPostInstall(bool reloadAddon);
bool Install(const CStdString &installFrom);
bool DownloadPackage(const CStdString &path, const CStdString &dest);
Please sign in to comment.
Something went wrong with that request. Please try again.