Skip to content

Commit

Permalink
Merge pull request #8232 from ksooo/pvr-keymapping
Browse files Browse the repository at this point in the history
[PVR] activate PVR windows only if PVR is enabled
  • Loading branch information
ksooo committed Oct 16, 2015
2 parents e14bdb8 + dbece55 commit 86c6a15
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions xbmc/guilib/GUIWindow.h
Expand Up @@ -153,6 +153,7 @@ class CGUIWindow : public CGUIControlGroup, protected CCriticalSection
virtual bool IsSoundEnabled() const { return true; };
virtual CFileItemPtr GetCurrentListItem(int offset = 0) { return CFileItemPtr(); };
virtual int GetViewContainerID() const { return 0; };
virtual bool CanBeActivated() const { return true; };
virtual bool IsActive() const;
void SetCoordsRes(const RESOLUTION_INFO &res) { m_coordsRes = res; };
const RESOLUTION_INFO &GetCoordsRes() const { return m_coordsRes; };
Expand Down
4 changes: 4 additions & 0 deletions xbmc/guilib/GUIWindowManager.cpp
Expand Up @@ -773,6 +773,10 @@ void CGUIWindowManager::ActivateWindow_Internal(int iWindowID, const std::vector
CLog::Log(LOGERROR, "Unable to locate window with id %d. Check skin files", iWindowID - WINDOW_HOME);
return ;
}
else if (!pNewWindow->CanBeActivated())
{
return;
}
else if (pNewWindow->IsDialog())
{ // if we have a dialog, we do a DoModal() rather than activate the window
if (!pNewWindow->IsDialogRunning())
Expand Down
6 changes: 6 additions & 0 deletions xbmc/pvr/windows/GUIWindowPVRBase.cpp
Expand Up @@ -299,6 +299,12 @@ void CGUIWindowPVRBase::SetInvalid()
}
}

bool CGUIWindowPVRBase::CanBeActivated() const
{
// No activation if PVR is not enabled.
return CSettings::GetInstance().GetBool(CSettings::SETTING_PVRMANAGER_ENABLED);
}

bool CGUIWindowPVRBase::OpenGroupSelectionDialog(void)
{
CGUIDialogSelect *dialog = (CGUIDialogSelect*)g_windowManager.GetWindow(WINDOW_DIALOG_SELECT);
Expand Down
1 change: 1 addition & 0 deletions xbmc/pvr/windows/GUIWindowPVRBase.h
Expand Up @@ -71,6 +71,7 @@ namespace PVR
virtual void ResetObservers(void) {};
virtual void Notify(const Observable &obs, const ObservableMessage msg);
virtual void SetInvalid();
virtual bool CanBeActivated() const;

static std::string GetSelectedItemPath(bool bRadio);
static void SetSelectedItemPath(bool bRadio, const std::string &path);
Expand Down

0 comments on commit 86c6a15

Please sign in to comment.