Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

pvr: disable the 'scan for channels' option if none of the add-ons ha…

…s the ability to do that

Conflicts:

	xbmc/settings/GUIWindowSettingsCategory.cpp
  • Loading branch information...
commit cf8695c65f1d04e477ab3b449f5a285fcb2c1498 1 parent d46f0b6
@opdenkamp authored
View
18 xbmc/pvr/addons/PVRClients.cpp
@@ -968,22 +968,28 @@ bool CPVRClients::IsRunningChannelScan(void) const
return m_bChannelScanRunning;
}
-void CPVRClients::StartChannelScan(void)
+vector< boost::shared_ptr<CPVRClient> > CPVRClients::GetClientsSupportingChannelScan(void) const
{
- CLIENTMAP clients;
vector< boost::shared_ptr<CPVRClient> > possibleScanClients;
- boost::shared_ptr<CPVRClient> scanClient;
CSingleLock lock(m_critSection);
- GetConnectedClients(&clients);
- m_bChannelScanRunning = true;
/* get clients that support channel scanning */
- for (CLIENTMAPITR itr = m_clientMap.begin(); itr != m_clientMap.end(); itr++)
+ for (CLIENTMAPCITR itr = m_clientMap.begin(); itr != m_clientMap.end(); itr++)
{
if (itr->second->ReadyToUse() && itr->second->GetAddonCapabilities().bSupportsChannelScan)
possibleScanClients.push_back(itr->second);
}
+ return possibleScanClients;
+}
+
+void CPVRClients::StartChannelScan(void)
+{
+ boost::shared_ptr<CPVRClient> scanClient;
+ CSingleLock lock(m_critSection);
+ vector< boost::shared_ptr<CPVRClient> > possibleScanClients = GetClientsSupportingChannelScan();
+ m_bChannelScanRunning = true;
+
/* multiple clients found */
if (possibleScanClients.size() > 1)
{
View
5 xbmc/pvr/addons/PVRClients.h
@@ -568,6 +568,11 @@ namespace PVR
*/
void StartChannelScan(void);
+ /*!
+ * @return All clients that support channel scanning.
+ */
+ std::vector< boost::shared_ptr<CPVRClient> > GetClientsSupportingChannelScan(void) const;
+
//@}
void Notify(const Observable &obs, const CStdString& msg);
View
12 xbmc/settings/GUIWindowSettingsCategory.cpp
@@ -110,6 +110,9 @@
#include "utils/StringUtils.h"
#include "utils/URIUtils.h"
#include "windowing/WindowingFactory.h"
+#include "pvr/dialogs/GUIDialogPVRChannelManager.h"
+#include "pvr/PVRManager.h"
+#include "pvr/addons/PVRClients.h"
#if defined(HAVE_LIBCRYSTALHD)
#include "cores/dvdplayer/DVDCodecs/Video/CrystalHD.h"
@@ -676,9 +679,12 @@ void CGUIWindowSettingsCategory::UpdateSettings()
CGUIControl *pControl = (CGUIControl *)GetControl(pSettingControl->GetID());
if (pControl) pControl->SetEnabled(g_settings.GetMasterProfile().getLockMode() != LOCK_MODE_EVERYONE);
}
- else if (!strSetting.Equals("pvrmanager.enabled") &&
- (strSetting.Equals("pvrmanager.channelscan") || strSetting.Equals("pvrmanager.channelmanager") ||
- strSetting.Equals("pvrmenu.searchicons")))
+ else if (strSetting.Equals("pvrmanager.channelscan"))
+ {
+ CGUIControl *pControl = (CGUIControl *)GetControl(pSettingControl->GetID());
+ if (pControl) pControl->SetEnabled(g_guiSettings.GetBool("pvrmanager.enabled") && g_PVRClients->GetClientsSupportingChannelScan().size() > 0);
+ }
+ else if (strSetting.Equals("pvrmanager.channelmanager") || strSetting.Equals("pvrmenu.searchicons"))
{
CGUIControl *pControl = (CGUIControl *)GetControl(pSettingControl->GetID());
if (pControl) pControl->SetEnabled(g_guiSettings.GetBool("pvrmanager.enabled"));
Please sign in to comment.
Something went wrong with that request. Please try again.