Permalink
Browse files

[pvr] fixed - (re)start the pvr manager when enabling a pvr add-on or…

… when disabling one with the pvr manager enabled
  • Loading branch information...
1 parent 9a01fac commit 02f2a4d47d17b9396049cb661c61c87d79e8919d @opdenkamp opdenkamp committed Dec 31, 2012
Showing with 9 additions and 4 deletions.
  1. +8 −1 xbmc/addons/AddonDatabase.cpp
  2. +1 −3 xbmc/addons/GUIDialogAddonInfo.cpp
@@ -25,6 +25,7 @@
#include "XBDateTime.h"
#include "addons/Service.h"
#include "dbwrappers/dataset.h"
+#include "pvr/PVRManager.h"
using namespace ADDON;
using namespace std;
@@ -581,6 +582,10 @@ bool CAddonDatabase::DisableAddon(const CStdString &addonID, bool disable /* = t
if (service)
service->Stop();
}
+ // restart the pvr manager when disabling a pvr add-on with the pvr manager enabled
+ else if (CAddonMgr::Get().GetAddon(addonID, addon, ADDON_PVRDLL, false) && addon &&
+ PVR::CPVRManager::Get().IsStarted())
+ PVR::CPVRManager::Get().Start(true);
return true;
}
@@ -599,7 +604,9 @@ bool CAddonDatabase::DisableAddon(const CStdString &addonID, bool disable /* = t
if (service)
service->Start();
}
-
+ // (re)start the pvr manager when enabling a pvr add-on
+ else if (CAddonMgr::Get().GetAddon(addonID, addon, ADDON_PVRDLL, false) && addon)
+ PVR::CPVRManager::Get().Start(true);
}
return true;
}
@@ -37,6 +37,7 @@
#include "utils/URIUtils.h"
#include "addons/AddonInstaller.h"
#include "Application.h"
+#include "pvr/PVRManager.h"
#define CONTROL_BTN_INSTALL 6
#define CONTROL_BTN_ENABLE 7
@@ -226,9 +227,6 @@ void CGUIDialogAddonInfo::OnEnable(bool enable)
database.DisableAddon(m_localAddon->ID(), !enable);
database.Close();
- if (m_localAddon->Type() == ADDON_PVRDLL && enable)
- g_application.StartPVRManager();
-
SetItem(m_item);
UpdateControls();
g_windowManager.SendMessage(GUI_MSG_NOTIFY_ALL, 0, 0, GUI_MSG_UPDATE);

0 comments on commit 02f2a4d

Please sign in to comment.