Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PVR] activate PVR windows only if PVR is enabled #8232

Merged
merged 1 commit into from Oct 16, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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