Skip to content

Commit

Permalink
Merge pull request #11554 from xhaggi/pvr-channel-guide-dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
jenkins4kodi committed Mar 13, 2017
2 parents 830804c + 38b5d08 commit fa6693c
Show file tree
Hide file tree
Showing 19 changed files with 114 additions and 45 deletions.
10 changes: 7 additions & 3 deletions addons/resource.language.en_gb/resources/strings.po
Original file line number Diff line number Diff line change
Expand Up @@ -9002,7 +9002,7 @@ msgid "Folder with channel icons"
msgstr ""

#. label for PVR backend number of channels in system information's PVR section
#: addons/skin.estuary/xml/DialogPVRGuideOSD.xml
#: addons/skin.estuary/xml/DialogPVRChannelGuide.xml
#: addons/skin.estuary/xml/DialogPVRChannelManager.xml
#: addons/skin.estuary/xml/DialogPVRChannelsOSD.xml
#: addons/skin.estuary/xml/Variables.xml
Expand Down Expand Up @@ -9746,7 +9746,7 @@ msgctxt "#19135"
msgid "Case sensitive"
msgstr ""

#. unused?
#: xbmc/pvr/dialogs/GUIDialogPVRGuideInfo.cpp
msgctxt "#19136"
msgid "Channel unavailable"
msgstr ""
Expand Down Expand Up @@ -11241,7 +11241,11 @@ msgctxt "#19685"
msgid "Confirm shutdown"
msgstr ""

#empty string with id 19686
#: Label for buttons to open channel guide dialog
#: addons/skin.estuary/xml/DialogPVRInfo.xml
msgctxt "#19686"
msgid "Channel guide"
msgstr ""

#: Label for context menu entries, dialog heading, button to start playing a recording
#: xbmc/pvr/PVRContextMenus.cpp
Expand Down
2 changes: 1 addition & 1 deletion addons/skin.estouchy/xml/Includes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2450,7 +2450,7 @@
<control type="button">
<label>19222</label>
<include>MenuButtonCommonValues</include>
<onclick>ActivateWindow(PVROSDGuide)</onclick>
<onclick>ActivateWindow(pvrchannelguide)</onclick>
<visible>VideoPlayer.Content(LiveTV)</visible>
</control>
<control type="button">
Expand Down
4 changes: 2 additions & 2 deletions addons/skin.estuary/xml/Custom_1109_TopBarOverlay.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<window type="dialog" id="1109">
<visible>Window.IsActive(fullscreenvideo) | Window.IsActive(visualisation)</visible>
<visible>Window.IsActive(seekbar) | Window.IsActive(pvrosdchannels) | Window.IsActive(pvrosdguide)</visible>
<visible>Window.IsActive(seekbar) | Window.IsActive(pvrosdchannels) | Window.IsActive(pvrchannelguide)</visible>
<depth>DepthOSD</depth>
<include>Animation_TopSlide</include>
<zorder>0</zorder>
Expand All @@ -25,7 +25,7 @@
<aspectratio aligny="top" align="left">keep</aspectratio>
</control>
<control type="group">
<visible>!Window.IsActive(pvrosdchannels) + !Window.IsActive(pvrosdguide)</visible>
<visible>!Window.IsActive(pvrosdchannels) + !Window.IsActive(pvrchannelguide)</visible>
<visible>String.IsEmpty(Player.Art(clearlogo))</visible>
<animation effect="fade" time="150">VisibleChange</animation>
<left>30</left>
Expand Down
4 changes: 2 additions & 2 deletions addons/skin.estuary/xml/VideoOSD.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<control type="group">
<bottom>0</bottom>
<height>180</height>
<visible>![Window.IsVisible(SliderDialog) | Window.IsVisible(osdaudiosettings) | Window.IsVisible(osdvideosettings) | Window.IsVisible(OSDAudioDSPSettings) | Window.IsVisible(VideoBookmarks) | Window.IsVisible(playerprocessinfo) | Window.IsVisible(osdcmssettings) | Window.IsVisible(PVROSDChannels) | Window.IsVisible(PVROSDGuide)]</visible>
<visible>![Window.IsVisible(SliderDialog) | Window.IsVisible(osdaudiosettings) | Window.IsVisible(osdvideosettings) | Window.IsVisible(OSDAudioDSPSettings) | Window.IsVisible(VideoBookmarks) | Window.IsVisible(playerprocessinfo) | Window.IsVisible(osdcmssettings) | Window.IsVisible(PVROSDChannels) | Window.IsVisible(pvrchannelguide)]</visible>
<animation effect="fade" time="200">VisibleChange</animation>
<control type="label">
<right>30</right>
Expand Down Expand Up @@ -146,7 +146,7 @@
<param name="texture" value="osd/fullscreen/buttons/guide.png"/>
</include>
<onclick>Dialog.Close(VideoOSD)</onclick>
<onclick>ActivateWindow(PVROSDGuide)</onclick>
<onclick>ActivateWindow(pvrchannelguide)</onclick>
<visible>VideoPlayer.Content(livetv)</visible>
</control>
<control type="radiobutton" id="700">
Expand Down
8 changes: 4 additions & 4 deletions system/keymaps/remote.xml
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@
<select>OSD</select>
<title>PlayerProcessInfo</title>
<info>Info</info>
<guide>ActivateWindow(PVROSDGuide)</guide>
<guide>ActivateWindow(PVRChannelGuide)</guide>
<teletext>ActivateWindow(Teletext)</teletext>
<subtitle>NextSubtitle</subtitle>
<star>NextSubtitle</star>
Expand Down Expand Up @@ -259,7 +259,7 @@
<rootmenu>OSD</rootmenu>
<start>OSD</start>
<info>Info</info>
<guide>ActivateWindow(PVROSDGuide)</guide>
<guide>ActivateWindow(PVRChannelGuide)</guide>
<playlist>ActivateWindow(PVROSDChannels)</playlist>
<zero>Number0</zero>
<one>Number1</one>
Expand Down Expand Up @@ -609,7 +609,7 @@
<nine>number9</nine>
</remote>
</PVROSDChannels>
<PVROSDGuide>
<PVRChannelGuide>
<remote>
<back>Close</back>
<menu>Close</menu>
Expand All @@ -628,7 +628,7 @@
<eight>number8</eight>
<nine>number9</nine>
</remote>
</PVROSDGuide>
</PVRChannelGuide>
<TVChannels>
<remote>
<zero>Number0</zero>
Expand Down
4 changes: 2 additions & 2 deletions system/keymaps/wetek-play/keyboard.xml
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@
<nine>Number9</nine>
</keyboard>
</TVChannels>
<PVROSDGuide>
<PVRChannelGuide>
<keyboard>
<zero>Number0</zero>
<one>Number1</one>
Expand All @@ -209,7 +209,7 @@
<eight>Number8</eight>
<nine>Number9</nine>
</keyboard>
</PVROSDGuide>
</PVRChannelGuide>
<TVGuide>
<keyboard>
<zero>Number0</zero>
Expand Down
6 changes: 3 additions & 3 deletions xbmc/guilib/GUIWindowManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@
#include "pvr/dialogs/GUIDialogPVRChannelsOSD.h"
#include "pvr/dialogs/GUIDialogPVRGroupManager.h"
#include "pvr/dialogs/GUIDialogPVRGuideInfo.h"
#include "pvr/dialogs/GUIDialogPVRGuideOSD.h"
#include "pvr/dialogs/GUIDialogPVRChannelGuide.h"
#include "pvr/dialogs/GUIDialogPVRGuideSearch.h"
#include "pvr/dialogs/GUIDialogPVRRadioRDSInfo.h"
#include "pvr/dialogs/GUIDialogPVRRecordingInfo.h"
Expand Down Expand Up @@ -280,7 +280,7 @@ void CGUIWindowManager::CreateWindows()
Add(new CGUIDialogPVRChannelManager);
Add(new CGUIDialogPVRGuideSearch);
Add(new CGUIDialogPVRChannelsOSD);
Add(new CGUIDialogPVRGuideOSD);
Add(new CGUIDialogPVRChannelGuide);

Add(new ActiveAE::CGUIDialogAudioDSPManager);
Add(new ActiveAE::CGUIDialogAudioDSPSettings);
Expand Down Expand Up @@ -380,7 +380,7 @@ bool CGUIWindowManager::DestroyWindows()
Delete(WINDOW_DIALOG_PVR_RADIO_RDS_INFO);
Delete(WINDOW_DIALOG_PVR_UPDATE_PROGRESS);
Delete(WINDOW_DIALOG_PVR_OSD_CHANNELS);
Delete(WINDOW_DIALOG_PVR_OSD_GUIDE);
Delete(WINDOW_DIALOG_PVR_CHANNEL_GUIDE);
Delete(WINDOW_DIALOG_OSD_TELETEXT);

Delete(WINDOW_DIALOG_AUDIO_DSP_MANAGER);
Expand Down
2 changes: 1 addition & 1 deletion xbmc/guilib/WindowIDs.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
#define WINDOW_DIALOG_PVR_CHANNEL_SCAN (WINDOW_DIALOG_PVR_ID_START+6)
#define WINDOW_DIALOG_PVR_UPDATE_PROGRESS (WINDOW_DIALOG_PVR_ID_START+7)
#define WINDOW_DIALOG_PVR_OSD_CHANNELS (WINDOW_DIALOG_PVR_ID_START+8)
#define WINDOW_DIALOG_PVR_OSD_GUIDE (WINDOW_DIALOG_PVR_ID_START+9)
#define WINDOW_DIALOG_PVR_CHANNEL_GUIDE (WINDOW_DIALOG_PVR_ID_START+9)
#define WINDOW_DIALOG_PVR_RADIO_RDS_INFO (WINDOW_DIALOG_PVR_ID_START+10)
#define WINDOW_DIALOG_PVR_ID_END WINDOW_DIALOG_PVR_RADIO_RDS_INFO

Expand Down
3 changes: 2 additions & 1 deletion xbmc/input/ButtonTranslator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,8 @@ static const ActionMapping windows[] =
{ "pvrchannelscan" , WINDOW_DIALOG_PVR_CHANNEL_SCAN },
{ "pvrupdateprogress" , WINDOW_DIALOG_PVR_UPDATE_PROGRESS },
{ "pvrosdchannels" , WINDOW_DIALOG_PVR_OSD_CHANNELS },
{ "pvrosdguide" , WINDOW_DIALOG_PVR_OSD_GUIDE },
{ "pvrchannelguide" , WINDOW_DIALOG_PVR_CHANNEL_GUIDE },
{ "pvrosdguide" , WINDOW_DIALOG_PVR_CHANNEL_GUIDE }, // backward compatibility to v17
{ "pvrosdteletext" , WINDOW_DIALOG_OSD_TELETEXT },
{ "systeminfo" , WINDOW_SYSTEM_INFORMATION },
{ "testpattern" , WINDOW_TEST_PATTERN },
Expand Down
20 changes: 20 additions & 0 deletions xbmc/pvr/PVRGUIActions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
#include "pvr/addons/PVRClients.h"
#include "pvr/channels/PVRChannelGroupsContainer.h"
#include "pvr/dialogs/GUIDialogPVRGuideInfo.h"
#include "pvr/dialogs/GUIDialogPVRChannelGuide.h"
#include "pvr/dialogs/GUIDialogPVRRecordingInfo.h"
#include "pvr/dialogs/GUIDialogPVRTimerSettings.h"
#include "pvr/PVRDatabase.h"
Expand Down Expand Up @@ -98,6 +99,25 @@ namespace PVR
return true;
}


bool CPVRGUIActions::ShowChannelEPG(const CFileItemPtr &item) const
{
const CPVRChannelPtr channel(CPVRItem(item).GetChannel());
if (channel && !CheckParentalLock(channel))
return false;

CGUIDialogPVRChannelGuide* pDlgInfo = dynamic_cast<CGUIDialogPVRChannelGuide*>(g_windowManager.GetWindow(WINDOW_DIALOG_PVR_CHANNEL_GUIDE));
if (!pDlgInfo)
{
CLog::Log(LOGERROR, "CPVRGUIActions - %s - unable to get WINDOW_DIALOG_PVR_CHANNEL_GUIDE!", __FUNCTION__);
return false;
}

pDlgInfo->Open(channel);
return true;
}


bool CPVRGUIActions::ShowRecordingInfo(const CFileItemPtr &item) const
{
if (!item->IsPVRRecording())
Expand Down
7 changes: 7 additions & 0 deletions xbmc/pvr/PVRGUIActions.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,13 @@ namespace PVR
*/
bool ShowEPGInfo(const CFileItemPtr &item) const;

/*!
* @brief Open a dialog with the epg list for a given item.
* @param item containing channel info. item must be an epg tag, a channel or a timer.
* @return true on success, false otherwise.
*/
bool ShowChannelEPG(const CFileItemPtr &item) const;

/*!
* @brief Open a window containing a list of epg tags 'similar' to a given item.
* @param item containing epg data for matching. item must be an epg tag, a channel or a recording.
Expand Down
4 changes: 2 additions & 2 deletions xbmc/pvr/dialogs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ set(SOURCES GUIDialogPVRChannelManager.cpp
GUIDialogPVRChannelsOSD.cpp
GUIDialogPVRGroupManager.cpp
GUIDialogPVRGuideInfo.cpp
GUIDialogPVRGuideOSD.cpp
GUIDialogPVRChannelGuide.cpp
GUIDialogPVRGuideSearch.cpp
GUIDialogPVRRadioRDSInfo.cpp
GUIDialogPVRRecordingInfo.cpp
Expand All @@ -12,7 +12,7 @@ set(HEADERS GUIDialogPVRChannelManager.h
GUIDialogPVRChannelsOSD.h
GUIDialogPVRGroupManager.h
GUIDialogPVRGuideInfo.h
GUIDialogPVRGuideOSD.h
GUIDialogPVRChannelGuide.h
GUIDialogPVRGuideSearch.h
GUIDialogPVRRadioRDSInfo.h
GUIDialogPVRRecordingInfo.h
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,24 +27,23 @@
#include "pvr/PVRGUIActions.h"
#include "pvr/PVRManager.h"

#include "GUIDialogPVRGuideOSD.h"
#include "GUIDialogPVRChannelGuide.h"

using namespace PVR;

#define CONTROL_LIST 11

CGUIDialogPVRGuideOSD::CGUIDialogPVRGuideOSD()
: CGUIDialog(WINDOW_DIALOG_PVR_OSD_GUIDE, "DialogPVRGuideOSD.xml")
CGUIDialogPVRChannelGuide::CGUIDialogPVRChannelGuide()
: CGUIDialog(WINDOW_DIALOG_PVR_CHANNEL_GUIDE, "DialogPVRChannelGuide.xml")
{
m_vecItems = new CFileItemList;
m_vecItems.reset(new CFileItemList);
}

CGUIDialogPVRGuideOSD::~CGUIDialogPVRGuideOSD()
CGUIDialogPVRChannelGuide::~CGUIDialogPVRChannelGuide()
{
delete m_vecItems;
}

bool CGUIDialogPVRGuideOSD::OnMessage(CGUIMessage& message)
bool CGUIDialogPVRChannelGuide::OnMessage(CGUIMessage& message)
{
switch (message.GetMessage())
{
Expand All @@ -70,10 +69,20 @@ bool CGUIDialogPVRGuideOSD::OnMessage(CGUIMessage& message)
return CGUIDialog::OnMessage(message);
}

void CGUIDialogPVRGuideOSD::OnInitWindow()
void CGUIDialogPVRChannelGuide::Open(const CPVRChannelPtr &channel)
{
/* Close dialog immediately if no TV or radio channel is playing */
if (!g_PVRManager.IsPlaying())
m_channel = channel;
CGUIDialog::Open();
}

void CGUIDialogPVRChannelGuide::OnInitWindow()
{
// no user-specific channel is set use current playing channel
if (!m_channel)
m_channel = g_PVRManager.GetCurrentChannel();

// no channel at all, close the dialog
if (!m_channel)
{
Close();
return;
Expand All @@ -86,7 +95,7 @@ void CGUIDialogPVRGuideOSD::OnInitWindow()
// empty the list ready for population
Clear();

g_PVRManager.GetCurrentEpg(*m_vecItems);
m_channel->GetEPG(*m_vecItems);
m_viewControl.SetItems(*m_vecItems);

g_graphicsContext.Unlock();
Expand All @@ -108,41 +117,42 @@ void CGUIDialogPVRGuideOSD::OnInitWindow()
m_viewControl.SetSelectedItem(iSelectedItem);
}

void CGUIDialogPVRGuideOSD::OnDeinitWindow(int nextWindowID)
void CGUIDialogPVRChannelGuide::OnDeinitWindow(int nextWindowID)
{
CGUIDialog::OnDeinitWindow(nextWindowID);
m_channel.reset();
Clear();
}

void CGUIDialogPVRGuideOSD::Clear()
void CGUIDialogPVRChannelGuide::Clear()
{
m_viewControl.Clear();
m_vecItems->Clear();
}

void CGUIDialogPVRGuideOSD::ShowInfo(int item)
void CGUIDialogPVRChannelGuide::ShowInfo(int item)
{
if (item < 0 || item >= (int)m_vecItems->Size())
return;

CPVRGUIActions::GetInstance().ShowEPGInfo(m_vecItems->Get(item));
}

void CGUIDialogPVRGuideOSD::OnWindowLoaded()
void CGUIDialogPVRChannelGuide::OnWindowLoaded()
{
CGUIDialog::OnWindowLoaded();
m_viewControl.Reset();
m_viewControl.SetParentWindow(GetID());
m_viewControl.AddView(GetControl(CONTROL_LIST));
}

void CGUIDialogPVRGuideOSD::OnWindowUnload()
void CGUIDialogPVRChannelGuide::OnWindowUnload()
{
CGUIDialog::OnWindowUnload();
m_viewControl.Reset();
}

CGUIControl *CGUIDialogPVRGuideOSD::GetFirstFocusableControl(int id)
CGUIControl *CGUIDialogPVRChannelGuide::GetFirstFocusableControl(int id)
{
if (m_viewControl.HasControl(id))
id = m_viewControl.GetCurrentControl();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,15 @@ class CFileItemList;

namespace PVR
{
class CGUIDialogPVRGuideOSD : public CGUIDialog
class CGUIDialogPVRChannelGuide : public CGUIDialog
{
public:
CGUIDialogPVRGuideOSD(void);
virtual ~CGUIDialogPVRGuideOSD(void);
CGUIDialogPVRChannelGuide(void);
virtual ~CGUIDialogPVRChannelGuide(void);
virtual bool OnMessage(CGUIMessage& message);
virtual void OnWindowLoaded();
virtual void OnWindowUnload();
virtual void Open(const CPVRChannelPtr &channel);

protected:
virtual void OnInitWindow();
Expand All @@ -44,7 +45,10 @@ namespace PVR

CGUIControl *GetFirstFocusableControl(int id);

CFileItemList *m_vecItems;
CGUIViewControl m_viewControl;
std::unique_ptr<CFileItemList> m_vecItems;
CGUIViewControl m_viewControl;

private:
CPVRChannelPtr m_channel;
};
}
Loading

0 comments on commit fa6693c

Please sign in to comment.