aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--addons/resource.language.en_gb/resources/strings.po125
-rw-r--r--addons/skin.estuary/media/osd/fullscreen/buttons/calendar.pngbin0 -> 3404 bytes
-rw-r--r--addons/skin.estuary/media/osd/fullscreen/buttons/forward.pngbin0 -> 1921 bytes
-rw-r--r--addons/skin.estuary/media/osd/fullscreen/buttons/rewind.pngbin0 -> 2004 bytes
-rw-r--r--addons/skin.estuary/xml/DialogPVRGuideControls.xml180
-rw-r--r--addons/skin.estuary/xml/Variables.xml14
-rw-r--r--system/keymaps/keyboard.xml8
-rw-r--r--xbmc/dialogs/GUIDialogContextMenu.cpp6
-rw-r--r--xbmc/dialogs/GUIDialogContextMenu.h8
-rw-r--r--xbmc/guilib/GUIWindowManager.cpp17
-rw-r--r--xbmc/guilib/WindowIDs.h3
-rw-r--r--xbmc/input/WindowTranslator.cpp1
-rw-r--r--xbmc/interfaces/builtins/PVRBuiltins.cpp100
-rw-r--r--xbmc/pvr/dialogs/CMakeLists.txt2
-rw-r--r--xbmc/pvr/dialogs/GUIDialogPVRGuideControls.cpp17
-rw-r--r--xbmc/pvr/dialogs/GUIDialogPVRGuideControls.h18
-rw-r--r--xbmc/pvr/windows/GUIEPGGridContainer.cpp13
-rw-r--r--xbmc/pvr/windows/GUIEPGGridContainer.h4
-rw-r--r--xbmc/pvr/windows/GUIWindowPVRBase.cpp44
-rw-r--r--xbmc/pvr/windows/GUIWindowPVRBase.h6
-rw-r--r--xbmc/pvr/windows/GUIWindowPVRGuide.cpp159
-rw-r--r--xbmc/pvr/windows/GUIWindowPVRGuide.h16
22 files changed, 660 insertions, 81 deletions
diff --git a/addons/resource.language.en_gb/resources/strings.po b/addons/resource.language.en_gb/resources/strings.po
index 49005de6fc..1bb8559954 100644
--- a/addons/resource.language.en_gb/resources/strings.po
+++ b/addons/resource.language.en_gb/resources/strings.po
@@ -785,7 +785,7 @@ msgstr ""
#. generic "duration" label used in different places
#: xbmc/dialogs/GUIDialogMediaFilter.cpp
#: xbmc/playlists/SmartPlaylist.cpp
-#: xbmc/xbmc/pvr/windows/GUIViewStatePVR.cpp
+#: xbmc/pvr/windows/GUIViewStatePVR.cpp
#: addons/skin.estuary/xml/Variables.xml
#: addons/skin.estuary/xml/View_51_Poster.xml
#: addons/skin.estuary/xml/DialogVideoInfo.xml
@@ -2514,8 +2514,8 @@ msgid "Downmix multichannel audio to stereo"
msgstr ""
#. generic "number" label used in different places
-#: xbmc/xbmc/pvr/windows/GUIViewStatePVR.cpp
-#: xbmc/xbmc/utils/SortUtils.cpp
+#: xbmc/pvr/windows/GUIViewStatePVR.cpp
+#: xbmc/utils/SortUtils.cpp
msgctxt "#549"
msgid "Number"
msgstr ""
@@ -2526,7 +2526,7 @@ msgid "Sort by: {0:s}"
msgstr ""
#. generic "name" label used in different places
-#: xbmc/xbmc/pvr/windows/GUIViewStatePVR.cpp
+#: xbmc/pvr/windows/GUIViewStatePVR.cpp
#: xbmc/view/GUIViewState.cpp
msgctxt "#551"
msgid "Name"
@@ -2534,7 +2534,7 @@ msgstr ""
#. generic "date" label used in different places
#: addons/skin.estuary/xml/Variables.xml
-#: xbmc/xbmc/pvr/windows/GUIViewStatePVR.cpp
+#: xbmc/pvr/windows/GUIViewStatePVR.cpp
msgctxt "#552"
msgid "Date"
msgstr ""
@@ -2641,7 +2641,7 @@ msgstr ""
#. generic "last played" label used in different places
#: xbmc/dialogs/GUIDialogMediaFilter.cpp
#: xbmc/playlists/SmartPlaylist.cpp
-#: xbmc/xbmc/pvr/windows/GUIViewStatePVR.cpp
+#: xbmc/pvr/windows/GUIViewStatePVR.cpp
msgctxt "#568"
msgid "Last played"
msgstr ""
@@ -9246,24 +9246,20 @@ msgstr ""
#. generic 'now' label used in different places
#: addons/skin.estuary/xml/DialogPVRRadioRDSInfo.xml
-#: addons/skin.estuary/xml/MyWeather.xml
-#: xbmc/pvr/windows/GUIWindowPVRGuide.cpp
msgctxt "#19030"
msgid "Now"
msgstr ""
#. generic 'next' label used in different places in pvr context
-#: addons/skin.estuary/xml/DialogFullScreenInfo.xml
#: addons/skin.estuary/xml/DialogPVRRadioRDSInfo.xml
+#: addons/skin.estuary/xml/DialogSeekBar.xml
#: addons/skin.estuary/xml/MyPVRChannels.xml
-#: xbmc/pvr/windows/GUIWindowPVRGuide.cpp
msgctxt "#19031"
msgid "Next"
msgstr ""
#. 'timeline' label used in pvr guide window
-#. xbmc/pvr/windows/GUIWindowPVRGuide.cpp
-#: addons/skin.estuary/xml/MyPVRGuide.xml
+#: xbmc/pvr/windows/GUIWindowPVRGuide.cpp
msgctxt "#19032"
msgid "Timeline"
msgstr ""
@@ -9468,16 +9464,18 @@ msgctxt "#19062"
msgid "Sort by: Channel"
msgstr ""
-#. Label for epg grid window "jump to grid start" (oldest available events) context menu entry
-#: /xbmc/pvr/windows/GUIWindowPVRGuide.cpp
+#. Label for epg grid window "jump to grid start" (oldest available programme) context menu entry and epg grid controls dialog help text
+#: addons/skin.estuary/xml/Variables.xml
+#: xbmc/pvr/windows/GUIWindowPVRGuide.cpp
msgctxt "#19063"
-msgid "Go to beginning"
+msgid "First programme"
msgstr ""
-#. Label for epg grid window "jump to grid end" (youngest available events) context menu entry
-#: /xbmc/pvr/windows/GUIWindowPVRGuide.cpp
+#. Label for epg grid window "jump to grid end" (youngest available programme) context menu entry and epg grid controls dialog help text
+#: addons/skin.estuary/xml/Variables.xml
+#: xbmc/pvr/windows/GUIWindowPVRGuide.cpp
msgctxt "#19064"
-msgid "Go to end"
+msgid "Last programme"
msgstr ""
#. Label for timer settings dialog header
@@ -9510,10 +9508,11 @@ msgctxt "#19069"
msgid "Guide"
msgstr ""
-#. Label for epg grid window "jump to now" (current epg events) context menu entry
+#. Label for epg grid window "jump to now" (current programme) context menu entry and epg grid controls dialog help text
+#: addons/skin.estuary/xml/Variables.xml
#: xbmc/pvr/windows/GUIWindowPVRGuide.cpp
msgctxt "#19070"
-msgid "Go to now"
+msgid "Current programme"
msgstr ""
#. pvr settings "epg update interval" setting label
@@ -9932,9 +9931,10 @@ msgctxt "#19140"
msgid "Search..."
msgstr ""
-#. part of PVR window's active channel group label (e.g. "Group: HD Sports Channels")
-#: addons/skin.estuary/xml/Includes_MediaMenu.xml
+#. generic PVR channel 'group' label used in different places
+#: addons/skin.estuary/xml/DialogPVRGuideControls.xml
#: addons/skin.estuary/xml/DialogPVRGuideSearch.xml
+#: addons/skin.estuary/xml/Includes_MediaMenu.xml
#: xbmc/pvr/windows/GUIWindowPVRBase.cpp
msgctxt "#19141"
msgid "Group"
@@ -9971,7 +9971,9 @@ msgctxt "#19147"
msgid "Setting the lifetime of this recording to {0:d} days will immediately expire the recording, which might result in instant deletion of the recording. Proceed anyway?"
msgstr ""
+#. generic PVR 'channel' label used in different places
#: addons/skin.estuary/xml/DialogPVRRadioRDSInfo.xml
+#: addons/skin.estuary/xml/DialogPVRGuideControls.xml
#: addons/skin.estuary/xml/DialogPVRGuideSearch.xml
msgctxt "#19148"
msgid "Channel"
@@ -10802,9 +10804,10 @@ msgid "All channels"
msgstr ""
#. Label for epg grid window "go to date" context menu entry
+#: addons/skin.estuary/xml/Variables.xml
#: xbmc/pvr/windows/GUIWindowPVRGuide.cpp
msgctxt "#19288"
-msgid "Go to date"
+msgid "Date selector"
msgstr ""
#. Label for button to hide a group in the group manager
@@ -10977,7 +10980,75 @@ msgctxt "#19316"
msgid "Start group channel numbers from 1"
msgstr ""
-#empty strings from id 19317 to 19498
+#. Label for epg grid window "Jump 12 hours back" context menu entry and epg grid controls dialog help text
+#: addons/skin.estuary/xml/Variables.xml
+#: xbmc/pvr/windows/GUIWindowPVRGuide.cpp
+msgctxt "#19317"
+msgid "12 hours back"
+msgstr ""
+
+#. Label for epg grid window "Jump 12 hours forward" context menu entry and epg grid controls dialog help text
+#: addons/skin.estuary/xml/Variables.xml
+#: xbmc/pvr/windows/GUIWindowPVRGuide.cpp
+msgctxt "#19318"
+msgid "12 hours forward"
+msgstr ""
+
+#. Label for epg grid window "Activate previous channel group" context menu entry and epg grid controls dialog help text
+#: addons/skin.estuary/xml/Variables.xml
+#: xbmc/pvr/windows/GUIWindowPVRGuide.cpp
+msgctxt "#19319"
+msgid "Previous group"
+msgstr ""
+
+#. Label for epg grid window "Activate next channel group" context menu entry and epg grid controls dialog help text
+#: addons/skin.estuary/xml/Variables.xml
+#: xbmc/pvr/windows/GUIWindowPVRGuide.cpp
+msgctxt "#19320"
+msgid "Next group"
+msgstr ""
+
+#. Label for epg grid window "Activate channel group selector" context menu entry and epg grid controls dialog help text
+#: addons/skin.estuary/xml/Variables.xml
+#: xbmc/pvr/windows/GUIWindowPVRGuide.cpp
+msgctxt "#19321"
+msgid "Group selector"
+msgstr ""
+
+#. Label for epg grid window "Jump to first channel" context menu entry and epg grid controls dialog help text
+#: addons/skin.estuary/xml/Variables.xml
+#: xbmc/pvr/windows/GUIWindowPVRGuide.cpp
+msgctxt "#19322"
+msgid "First channel"
+msgstr ""
+
+#. Label for epg grid window "Jump to playing channel" context menu entry and epg grid controls dialog help text
+#: addons/skin.estuary/xml/Variables.xml
+#: xbmc/pvr/windows/GUIWindowPVRGuide.cpp
+msgctxt "#19323"
+msgid "Playing channel"
+msgstr ""
+
+#. Label for epg grid window "Jump to last channel" context menu entry and epg grid controls dialog help text
+#: addons/skin.estuary/xml/Variables.xml
+#: xbmc/pvr/windows/GUIWindowPVRGuide.cpp
+msgctxt "#19324"
+msgid "Last channel"
+msgstr ""
+
+#. Label for epg grid controls "Programme" group header"
+#: addons/skin.estuary/xml/DialogPVRGuideControls.xml
+msgctxt "#19325"
+msgid "Programme"
+msgstr ""
+
+#. Label for epg grid window "Navigate..." context menu entry
+#: xbmc/pvr/windows/GUIWindowPVRGuide.cpp
+msgctxt "#19326"
+msgid "Navigate..."
+msgstr ""
+
+#empty strings from id 19327 to 19498
#. label for epg genre value
#: xbmc/pvr/epg/Epg.cpp
@@ -20944,12 +21015,12 @@ msgctxt "#38023"
msgid "Set my rating"
msgstr ""
-#: /xbmc/settings/dialogs/GUIDialogContentSettings.cpp
+#: xbmc/settings/dialogs/GUIDialogContentSettings.cpp
msgctxt "#38024"
msgid "Information provider selection"
msgstr ""
-#: /xbmc/settings/dialogs/GUIDialogContentSettings.cpp
+#: xbmc/settings/dialogs/GUIDialogContentSettings.cpp
msgctxt "#38025"
msgid "Choose information provider"
msgstr ""
@@ -21563,7 +21634,7 @@ msgctxt "#39014"
msgid "Would you also like to remove all related data (e.g. settings) of this add-on?"
msgstr ""
-#: /xbmc/addons/Addon.cpp
+#: xbmc/addons/Addon.cpp
msgctxt "#39015"
msgid "Image decoder"
msgstr ""
diff --git a/addons/skin.estuary/media/osd/fullscreen/buttons/calendar.png b/addons/skin.estuary/media/osd/fullscreen/buttons/calendar.png
new file mode 100644
index 0000000000..a39a622e6f
--- /dev/null
+++ b/addons/skin.estuary/media/osd/fullscreen/buttons/calendar.png
Binary files differ
diff --git a/addons/skin.estuary/media/osd/fullscreen/buttons/forward.png b/addons/skin.estuary/media/osd/fullscreen/buttons/forward.png
new file mode 100644
index 0000000000..bb572ca2fd
--- /dev/null
+++ b/addons/skin.estuary/media/osd/fullscreen/buttons/forward.png
Binary files differ
diff --git a/addons/skin.estuary/media/osd/fullscreen/buttons/rewind.png b/addons/skin.estuary/media/osd/fullscreen/buttons/rewind.png
new file mode 100644
index 0000000000..e60b3c9922
--- /dev/null
+++ b/addons/skin.estuary/media/osd/fullscreen/buttons/rewind.png
Binary files differ
diff --git a/addons/skin.estuary/xml/DialogPVRGuideControls.xml b/addons/skin.estuary/xml/DialogPVRGuideControls.xml
new file mode 100644
index 0000000000..9e91a54549
--- /dev/null
+++ b/addons/skin.estuary/xml/DialogPVRGuideControls.xml
@@ -0,0 +1,180 @@
+<?xml version="1.0" encoding="utf-8"?>
+<window>
+ <defaultcontrol always="true">602</defaultcontrol>
+ <include>Animation_BottomSlide</include>
+ <depth>DepthOSD</depth>
+ <controls>
+ <control type="button">
+ <description>background close area</description>
+ <left>0</left>
+ <top>0</top>
+ <width>100%</width>
+ <bottom>280</bottom>
+ <texturefocus />
+ <texturenofocus />
+ <onclick>Action(close)</onclick>
+ </control>
+ <control type="group">
+ <bottom>0</bottom>
+ <height>150</height>
+ <animation effect="fade" time="200">VisibleChange</animation>
+ <control type="group" id="200">
+ <control type="image">
+ <left>0</left>
+ <top>0</top>
+ <width>100%</width>
+ <height>100%</height>
+ <texture>dialogs/dialog-bg-nobo.png</texture>
+ </control>
+ <control type="group">
+ <left>20</left>
+ <width>600</width>
+ <control type="label">
+ <top>12</top>
+ <height>20</height>
+ <align>center</align>
+ <aligny>center</aligny>
+ <label>$LOCALIZE[19325]</label>
+ </control>
+ <control type="grouplist" id="201">
+ <top>54</top>
+ <height>135</height>
+ <align>center</align>
+ <itemgap>20</itemgap>
+ <scrolltime tween="sine">200</scrolltime>
+ <orientation>horizontal</orientation>
+ <onleft>70045</onleft>
+ <onright>70040</onright>
+ <control type="radiobutton" id="600">
+ <include content="OSDButton">
+ <param name="texture" value="osd/fullscreen/buttons/previous.png"/>
+ </include>
+ <onclick>PVR.EpgGridControl(FirstProgramme)</onclick>
+ </control>
+ <control type="radiobutton" id="601">
+ <include content="OSDButton">
+ <param name="texture" value="osd/fullscreen/buttons/rewind.png"/>
+ </include>
+ <onclick>PVR.EpgGridControl(-12)</onclick>
+ </control>
+ <control type="radiobutton" id="602">
+ <include content="OSDButton">
+ <param name="texture" value="osd/fullscreen/buttons/play.png"/>
+ </include>
+ <animation effect="rotate" start="0" end="-90" center="auto" condition="true">Conditional</animation>
+ <onclick>PVR.EpgGridControl(CurrentProgramme)</onclick>
+ </control>
+ <control type="radiobutton" id="603">
+ <include content="OSDButton">
+ <param name="texture" value="osd/fullscreen/buttons/forward.png"/>
+ </include>
+ <onclick>PVR.EpgGridControl(+12)</onclick>
+ </control>
+ <control type="radiobutton" id="604">
+ <include content="OSDButton">
+ <param name="texture" value="osd/fullscreen/buttons/next.png"/>
+ </include>
+ <onclick>PVR.EpgGridControl(LastProgramme)</onclick>
+ </control>
+ <control type="radiobutton" id="605">
+ <include content="OSDButton">
+ <param name="texture" value="osd/fullscreen/buttons/calendar.png"/>
+ </include>
+ <onclick>PVR.EpgGridControl(SelectDate)</onclick>
+ </control>
+ </control>
+ </control>
+ <control type="textbox">
+ <left>620</left>
+ <top>54</top>
+ <align>center</align>
+ <aligny>center</aligny>
+ <width>630</width>
+ <height>76</height>
+ <label>$VAR[PVRGuideControlsHelpTextVar]</label>
+ </control>
+ <control type="group">
+ <right>370</right>
+ <width>300</width>
+ <control type="label">
+ <top>12</top>
+ <height>20</height>
+ <align>center</align>
+ <aligny>center</aligny>
+ <label>$LOCALIZE[19148]</label>
+ </control>
+ <control type="grouplist" id="202">
+ <top>54</top>
+ <height>135</height>
+ <align>center</align>
+ <itemgap>20</itemgap>
+ <scrolltime tween="sine">200</scrolltime>
+ <orientation>horizontal</orientation>
+ <onleft>605</onleft>
+ <onright>70043</onright>
+ <control type="radiobutton" id="70040">
+ <include content="OSDButton">
+ <param name="texture" value="osd/fullscreen/buttons/previous.png"/>
+ </include>
+ <onclick>PVR.EpgGridControl(FirstChannel)</onclick>
+ </control>
+ <control type="radiobutton" id="70041">
+ <include content="OSDButton">
+ <param name="texture" value="osd/fullscreen/buttons/play.png"/>
+ </include>
+ <animation effect="rotate" start="0" end="-90" center="auto" condition="true">Conditional</animation>
+ <onclick>PVR.EpgGridControl(PlayingChannel)</onclick>
+ <visible>PVR.IsPlayingTV | PVR.IsPlayingRadio</visible>
+ </control>
+ <control type="radiobutton" id="70042">
+ <include content="OSDButton">
+ <param name="texture" value="osd/fullscreen/buttons/next.png"/>
+ </include>
+ <onclick>PVR.EpgGridControl(LastChannel)</onclick>
+ </control>
+ </control>
+ </control>
+ <control type="group">
+ <right>20</right>
+ <width>300</width>
+ <control type="label">
+ <top>12</top>
+ <height>20</height>
+ <align>center</align>
+ <aligny>center</aligny>
+ <label>$LOCALIZE[19141]</label>
+ </control>
+ <control type="grouplist" id="203">
+ <top>54</top>
+ <height>135</height>
+ <align>center</align>
+ <itemgap>20</itemgap>
+ <scrolltime tween="sine">200</scrolltime>
+ <orientation>horizontal</orientation>
+ <onleft>70042</onleft>
+ <onright>600</onright>
+ <control type="radiobutton" id="70043">
+ <include content="OSDButton">
+ <param name="texture" value="osd/fullscreen/buttons/play.png"/>
+ </include>
+ <animation effect="rotate" start="0" end="180" center="auto" condition="true">Conditional</animation>
+ <onclick>PVR.EpgGridControl(PreviousGroup)</onclick>
+ </control>
+ <control type="radiobutton" id="70044">
+ <include content="OSDButton">
+ <param name="texture" value="osd/fullscreen/buttons/play.png"/>
+ </include>
+ <onclick>PVR.EpgGridControl(NextGroup)</onclick>
+ </control>
+ <control type="radiobutton" id="70045">
+ <include content="OSDButton">
+ <param name="texture" value="DefaultPlaylist.png"/>
+ </include>
+ <onclick>PVR.EpgGridControl(SelectGroup)</onclick>
+ </control>
+ </control>
+ </control>
+ </control>
+ </control>
+ </controls>
+</window>
diff --git a/addons/skin.estuary/xml/Variables.xml b/addons/skin.estuary/xml/Variables.xml
index a1c1f5f5c2..510c269316 100644
--- a/addons/skin.estuary/xml/Variables.xml
+++ b/addons/skin.estuary/xml/Variables.xml
@@ -214,6 +214,20 @@
<value condition="VideoPlayer.HasEpg">$INFO[PVR.EpgEventElapsedTime]$INFO[PVR.EpgEventDuration, / ]</value>
<value>$INFO[Player.Time]$INFO[Player.Duration, / ]</value>
</variable>
+ <variable name="PVRGuideControlsHelpTextVar">
+ <value condition="Control.HasFocus(600)">$LOCALIZE[19063]</value>
+ <value condition="Control.HasFocus(601)">$LOCALIZE[19317]</value>
+ <value condition="Control.HasFocus(602)">$LOCALIZE[19070]</value>
+ <value condition="Control.HasFocus(603)">$LOCALIZE[19318]</value>
+ <value condition="Control.HasFocus(604)">$LOCALIZE[19064]</value>
+ <value condition="Control.HasFocus(605)">$LOCALIZE[19288]</value>
+ <value condition="Control.HasFocus(70040)">$LOCALIZE[19322]</value>
+ <value condition="Control.HasFocus(70041)">$LOCALIZE[19323]</value>
+ <value condition="Control.HasFocus(70042)">$LOCALIZE[19324]</value>
+ <value condition="Control.HasFocus(70043)">$LOCALIZE[19319]</value>
+ <value condition="Control.HasFocus(70044)">$LOCALIZE[19320]</value>
+ <value condition="Control.HasFocus(70045)">$LOCALIZE[19321]</value>
+ </variable>
<variable name="VideoOSDHelpTextVar">
<value condition="Control.HasFocus(87) + [Player.Rewinding | Player.Forwarding]">$LOCALIZE[31050]</value>
<value condition="Control.HasFocus(700)">$LOCALIZE[298]</value>
diff --git a/system/keymaps/keyboard.xml b/system/keymaps/keyboard.xml
index 99b30207ad..b1638067de 100644
--- a/system/keymaps/keyboard.xml
+++ b/system/keymaps/keyboard.xml
@@ -249,6 +249,9 @@
<t>ShowTimerRule</t>
<epg>PreviousMenu</epg>
<g>NextChannelGroup</g>
+ <n>ActivateWindow(PVRGuideControls)</n>
+ <enter mod="longpress">ActivateWindow(PVRGuideControls)</enter>
+ <return mod="longpress">ActivateWindow(PVRGuideControls)</return>
<backspace mod="longpress">Number0</backspace> <!-- 0 key goes to "now" on EPG timeline -->
<browser_back mod="longpress">Number0</browser_back> <!-- 0 key goes to "now" on EPG timeline -->
<period mod="longpress">ChannelNumberSeparator</period>
@@ -298,6 +301,11 @@
<keyboard>
<e>PreviousMenu</e>
<t>ShowTimerRule</t>
+ <epg>PreviousMenu</epg>
+ <g>NextChannelGroup</g>
+ <n>ActivateWindow(PVRGuideControls)</n>
+ <enter mod="longpress">ActivateWindow(PVRGuideControls)</enter>
+ <return mod="longpress">ActivateWindow(PVRGuideControls)</return>
<backspace mod="longpress">Number0</backspace> <!-- 0 key goes to "now" on EPG timeline -->
<browser_back mod="longpress">Number0</browser_back> <!-- 0 key goes to "now" on EPG timeline -->
<period mod="longpress">ChannelNumberSeparator</period>
diff --git a/xbmc/dialogs/GUIDialogContextMenu.cpp b/xbmc/dialogs/GUIDialogContextMenu.cpp
index aaba123723..13b8656702 100644
--- a/xbmc/dialogs/GUIDialogContextMenu.cpp
+++ b/xbmc/dialogs/GUIDialogContextMenu.cpp
@@ -98,7 +98,7 @@ void CGUIDialogContextMenu::OnInitWindow()
{
m_clickedButton = -1;
// set initial control focus
- m_lastControlID = BUTTON_START;
+ m_lastControlID = m_initiallyFocusedButtonIdx + BUTTON_START;
CGUIDialog::OnInitWindow();
}
@@ -574,6 +574,7 @@ void CGUIDialogContextMenu::OnDeinitWindow(int nextWindowID)
}
m_buttons.clear();
+ m_initiallyFocusedButtonIdx = 0;
CGUIDialog::OnDeinitWindow(nextWindowID);
}
@@ -624,7 +625,7 @@ void CGUIDialogContextMenu::SwitchMedia(const std::string& strType, const std::s
}
}
-int CGUIDialogContextMenu::Show(const CContextButtons& choices)
+int CGUIDialogContextMenu::Show(const CContextButtons& choices, int focusedButtonIdx /* = 0 */)
{
auto dialog = CServiceBroker::GetGUI()->GetWindowManager().GetWindow<CGUIDialogContextMenu>(WINDOW_DIALOG_CONTEXT_MENU);
if (!dialog)
@@ -635,6 +636,7 @@ int CGUIDialogContextMenu::Show(const CContextButtons& choices)
dialog->SetInitialVisibility();
dialog->SetupButtons();
dialog->PositionAtCurrentFocus();
+ dialog->m_initiallyFocusedButtonIdx = focusedButtonIdx;
dialog->Open();
return dialog->m_clickedButton;
}
diff --git a/xbmc/dialogs/GUIDialogContextMenu.h b/xbmc/dialogs/GUIDialogContextMenu.h
index 5b5544085b..f6bac6328d 100644
--- a/xbmc/dialogs/GUIDialogContextMenu.h
+++ b/xbmc/dialogs/GUIDialogContextMenu.h
@@ -78,10 +78,6 @@ enum CONTEXT_BUTTON { CONTEXT_BUTTON_CANCELLED = 0,
CONTEXT_BUTTON_GROUP_MANAGER,
CONTEXT_BUTTON_CHANNEL_MANAGER,
CONTEXT_BUTTON_SET_MOVIESET_ART,
- CONTEXT_BUTTON_BEGIN,
- CONTEXT_BUTTON_END,
- CONTEXT_BUTTON_NOW,
- CONTEXT_BUTTON_DATE,
CONTEXT_BUTTON_PLAY_AND_QUEUE,
CONTEXT_BUTTON_PLAY_ONLY_THIS,
CONTEXT_BUTTON_UPDATE_EPG,
@@ -94,6 +90,7 @@ enum CONTEXT_BUTTON { CONTEXT_BUTTON_CANCELLED = 0,
CONTEXT_BUTTON_DELETE_ALL,
CONTEXT_BUTTON_HELP,
CONTEXT_BUTTON_PLAY_NEXT,
+ CONTEXT_BUTTON_NAVIGATE,
};
class CContextButtons : public std::vector< std::pair<size_t, std::string> >
@@ -122,7 +119,7 @@ public:
/*! Show the context menu with the given choices and return the index of the selected item,
or -1 if cancelled.
*/
- static int Show(const CContextButtons& choices);
+ static int Show(const CContextButtons& choices, int focusedButton = 0);
/*! Legacy method that returns the context menu id, or -1 on cancel */
static int ShowAndGetChoice(const CContextButtons &choices);
@@ -149,6 +146,7 @@ private:
float m_coordX, m_coordY;
/// \brief Stored size of background image (height or width depending on grouplist orientation)
float m_backgroundImageSize;
+ int m_initiallyFocusedButtonIdx = 0;
int m_clickedButton;
CContextButtons m_buttons;
const CGUIControl *m_backgroundImage = nullptr;
diff --git a/xbmc/guilib/GUIWindowManager.cpp b/xbmc/guilib/GUIWindowManager.cpp
index ddb923e456..e10d41d0a0 100644
--- a/xbmc/guilib/GUIWindowManager.cpp
+++ b/xbmc/guilib/GUIWindowManager.cpp
@@ -103,23 +103,24 @@
/* PVR related include Files */
#include "pvr/PVRManager.h"
-#include "pvr/windows/GUIWindowPVRChannels.h"
-#include "pvr/windows/GUIWindowPVRRecordings.h"
-#include "pvr/windows/GUIWindowPVRGuide.h"
-#include "pvr/windows/GUIWindowPVRTimers.h"
-#include "pvr/windows/GUIWindowPVRTimerRules.h"
-#include "pvr/windows/GUIWindowPVRSearch.h"
+#include "pvr/dialogs/GUIDialogPVRChannelGuide.h"
#include "pvr/dialogs/GUIDialogPVRChannelManager.h"
#include "pvr/dialogs/GUIDialogPVRChannelsOSD.h"
#include "pvr/dialogs/GUIDialogPVRClientPriorities.h"
#include "pvr/dialogs/GUIDialogPVRGroupManager.h"
+#include "pvr/dialogs/GUIDialogPVRGuideControls.h"
#include "pvr/dialogs/GUIDialogPVRGuideInfo.h"
-#include "pvr/dialogs/GUIDialogPVRChannelGuide.h"
#include "pvr/dialogs/GUIDialogPVRGuideSearch.h"
#include "pvr/dialogs/GUIDialogPVRRadioRDSInfo.h"
#include "pvr/dialogs/GUIDialogPVRRecordingInfo.h"
#include "pvr/dialogs/GUIDialogPVRRecordingSettings.h"
#include "pvr/dialogs/GUIDialogPVRTimerSettings.h"
+#include "pvr/windows/GUIWindowPVRChannels.h"
+#include "pvr/windows/GUIWindowPVRGuide.h"
+#include "pvr/windows/GUIWindowPVRRecordings.h"
+#include "pvr/windows/GUIWindowPVRSearch.h"
+#include "pvr/windows/GUIWindowPVRTimerRules.h"
+#include "pvr/windows/GUIWindowPVRTimers.h"
#include "video/dialogs/GUIDialogTeletext.h"
#include "dialogs/GUIDialogSlider.h"
@@ -270,6 +271,7 @@ void CGUIWindowManager::CreateWindows()
Add(new CGUIDialogPVRChannelGuide);
Add(new CGUIDialogPVRRecordingSettings);
Add(new CGUIDialogPVRClientPriorities);
+ Add(new CGUIDialogPVRGuideControls);
Add(new CGUIDialogSelect);
Add(new CGUIDialogMusicInfo);
@@ -380,6 +382,7 @@ bool CGUIWindowManager::DestroyWindows()
DestroyWindow(WINDOW_DIALOG_OSD_TELETEXT);
DestroyWindow(WINDOW_DIALOG_PVR_RECORDING_SETTING);
DestroyWindow(WINDOW_DIALOG_PVR_CLIENT_PRIORITIES);
+ DestroyWindow(WINDOW_DIALOG_PVR_GUIDE_CONTROLS);
DestroyWindow(WINDOW_DIALOG_TEXT_VIEWER);
DestroyWindow(WINDOW_DIALOG_PLAY_EJECT);
diff --git a/xbmc/guilib/WindowIDs.h b/xbmc/guilib/WindowIDs.h
index 539e676c06..1cb9a691b3 100644
--- a/xbmc/guilib/WindowIDs.h
+++ b/xbmc/guilib/WindowIDs.h
@@ -115,7 +115,8 @@
#define WINDOW_DIALOG_PVR_RADIO_RDS_INFO (WINDOW_DIALOG_PVR_ID_START+10)
#define WINDOW_DIALOG_PVR_RECORDING_SETTING (WINDOW_DIALOG_PVR_ID_START+11)
#define WINDOW_DIALOG_PVR_CLIENT_PRIORITIES (WINDOW_DIALOG_PVR_ID_START+12)
-#define WINDOW_DIALOG_PVR_ID_END WINDOW_DIALOG_PVR_CLIENT_PRIORITIES
+#define WINDOW_DIALOG_PVR_GUIDE_CONTROLS (WINDOW_DIALOG_PVR_ID_START+13)
+#define WINDOW_DIALOG_PVR_ID_END WINDOW_DIALOG_PVR_GUIDE_CONTROLS
#define WINDOW_PVR_ID_START 10700
#define WINDOW_TV_CHANNELS (WINDOW_PVR_ID_START)
diff --git a/xbmc/input/WindowTranslator.cpp b/xbmc/input/WindowTranslator.cpp
index 7029d684c2..dfbd42c46e 100644
--- a/xbmc/input/WindowTranslator.cpp
+++ b/xbmc/input/WindowTranslator.cpp
@@ -41,6 +41,7 @@ const CWindowTranslator::WindowMapByName CWindowTranslator::WindowMappingByName
{ "radiosearch" , WINDOW_RADIO_SEARCH },
{ "gamecontrollers" , WINDOW_DIALOG_GAME_CONTROLLERS },
{ "games" , WINDOW_GAMES },
+ { "pvrguidecontrols" , WINDOW_DIALOG_PVR_GUIDE_CONTROLS },
{ "pvrguideinfo" , WINDOW_DIALOG_PVR_GUIDE_INFO },
{ "pvrrecordinginfo" , WINDOW_DIALOG_PVR_RECORDING_INFO },
{ "pvrradiordsinfo" , WINDOW_DIALOG_PVR_RADIO_RDS_INFO },
diff --git a/xbmc/interfaces/builtins/PVRBuiltins.cpp b/xbmc/interfaces/builtins/PVRBuiltins.cpp
index f17ff6d8bb..a3cd8d5720 100644
--- a/xbmc/interfaces/builtins/PVRBuiltins.cpp
+++ b/xbmc/interfaces/builtins/PVRBuiltins.cpp
@@ -12,13 +12,18 @@
#include "GUIInfoManager.h"
#include "ServiceBroker.h"
#include "guilib/GUIComponent.h"
+#include "guilib/GUIWindowManager.h"
#include "guilib/guiinfo/GUIInfoLabels.h"
#include "pvr/PVRGUIActions.h"
#include "pvr/PVRManager.h"
+#include "pvr/windows/GUIWindowPVRGuide.h"
#include "utils/log.h"
#include <algorithm>
#include <cstdlib>
+#include <regex>
+
+using namespace PVR;
/*! \brief Search for missing channel icons
* \param params (ignored)
@@ -74,6 +79,95 @@ static int SeekPercentage(const std::vector<std::string>& params)
return 0;
}
+namespace
+{
+/*! \brief Control PVR Guide window's EPG grid.
+ * \param params The parameters
+ * \details params[0] = Control to execute.
+ */
+int EpgGridControl(const std::vector<std::string>& params)
+{
+ if (params.empty())
+ {
+ CLog::Log(LOGERROR, "EpgGridControl(n) - No argument given");
+ return 0;
+ }
+
+ int activeWindow = CServiceBroker::GetGUI()->GetWindowManager().GetActiveWindow();
+ if (activeWindow != WINDOW_TV_GUIDE && activeWindow != WINDOW_RADIO_GUIDE)
+ {
+ CLog::Log(LOGERROR, "EpgGridControl(n) - Guide window not active");
+ return 0;
+ }
+
+ CGUIWindowPVRGuideBase* guideWindow = CServiceBroker::GetGUI()->GetWindowManager().GetWindow<CGUIWindowPVRGuideBase>(activeWindow);
+ if (!guideWindow)
+ {
+ CLog::Log(LOGERROR, "EpgGridControl(n) - Unable to get Guide window instance");
+ return 0;
+ }
+
+ std::string param(params[0]);
+ StringUtils::ToLower(param);
+
+ if (param == "firstprogramme")
+ {
+ guideWindow->GotoBegin();
+ }
+ else if (param == "lastprogramme")
+ {
+ guideWindow->GotoEnd();
+ }
+ else if (param == "currentprogramme")
+ {
+ guideWindow->GotoNow();
+ }
+ else if (param == "selectdate")
+ {
+ guideWindow->OpenDateSelectionDialog();
+ }
+ else if (StringUtils::StartsWithNoCase(param, "+") || StringUtils::StartsWithNoCase(param, "-"))
+ {
+ // jump back/forward n hours
+ if (std::regex_match(param, std::regex("[(-|+)|][0-9]+")))
+ {
+ guideWindow->GotoDate(std::atoi(param.c_str()));
+ }
+ else
+ {
+ CLog::Log(LOGERROR, "EpgGridControl(n) - invalid argument");
+ }
+ }
+ else if (param == "firstchannel")
+ {
+ guideWindow->GotoFirstChannel();
+ }
+ else if (param == "playingchannel")
+ {
+ guideWindow->GotoPlayingChannel();
+ }
+ else if (param == "lastchannel")
+ {
+ guideWindow->GotoLastChannel();
+ }
+ else if (param == "previousgroup")
+ {
+ guideWindow->ActivatePreviousChannelGroup();
+ }
+ else if (param == "nextgroup")
+ {
+ guideWindow->ActivateNextChannelGroup();
+ }
+ else if (param == "selectgroup")
+ {
+ guideWindow->OpenChannelGroupSelectionDialog();
+ }
+
+ return 0;
+}
+
+} // unnamed namespace
+
// Note: For new Texts with comma add a "\" before!!! Is used for table text.
//
/// \page page_List_of_built_in_functions
@@ -100,6 +194,11 @@ static int SeekPercentage(const std::vector<std::string>& params)
/// ,
/// Performs a seek to the given percentage in timeshift buffer\, if timeshifting is supported
/// }
+/// \table_row2_l{
+/// <b>`PVR.EpgGridControl`</b>
+/// ,
+/// Control PVR Guide window's EPG grid
+/// }
/// \table_end
///
@@ -109,5 +208,6 @@ CBuiltins::CommandMap CPVRBuiltins::GetOperations() const
{"pvr.searchmissingchannelicons", {"Search for missing channel icons", 0, SearchMissingIcons}},
{"pvr.togglerecordplayingchannel", {"Toggle recording on playing channel", 0, ToggleRecordPlayingChannel}},
{"pvr.seekpercentage", {"Performs a seek to the given percentage in timeshift buffer", 1, SeekPercentage}},
+ {"pvr.epggridcontrol", {"Control PVR Guide window's EPG grid", 1, EpgGridControl}},
};
}
diff --git a/xbmc/pvr/dialogs/CMakeLists.txt b/xbmc/pvr/dialogs/CMakeLists.txt
index c746a07299..39b88ed4ec 100644
--- a/xbmc/pvr/dialogs/CMakeLists.txt
+++ b/xbmc/pvr/dialogs/CMakeLists.txt
@@ -3,6 +3,7 @@ set(SOURCES GUIDialogPVRChannelManager.cpp
GUIDialogPVRGroupManager.cpp
GUIDialogPVRGuideInfo.cpp
GUIDialogPVRChannelGuide.cpp
+ GUIDialogPVRGuideControls.cpp
GUIDialogPVRGuideSearch.cpp
GUIDialogPVRRadioRDSInfo.cpp
GUIDialogPVRRecordingInfo.cpp
@@ -16,6 +17,7 @@ set(HEADERS GUIDialogPVRChannelManager.h
GUIDialogPVRGroupManager.h
GUIDialogPVRGuideInfo.h
GUIDialogPVRChannelGuide.h
+ GUIDialogPVRGuideControls.h
GUIDialogPVRGuideSearch.h
GUIDialogPVRRadioRDSInfo.h
GUIDialogPVRRecordingInfo.h
diff --git a/xbmc/pvr/dialogs/GUIDialogPVRGuideControls.cpp b/xbmc/pvr/dialogs/GUIDialogPVRGuideControls.cpp
new file mode 100644
index 0000000000..57baad98a4
--- /dev/null
+++ b/xbmc/pvr/dialogs/GUIDialogPVRGuideControls.cpp
@@ -0,0 +1,17 @@
+/*
+ * Copyright (C) 2005-2018 Team Kodi
+ * This file is part of Kodi - https://kodi.tv
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ * See LICENSES/README.md for more information.
+ */
+
+#include "GUIDialogPVRGuideControls.h"
+
+CGUIDialogPVRGuideControls::CGUIDialogPVRGuideControls()
+ : CGUIDialog(WINDOW_DIALOG_PVR_GUIDE_CONTROLS, "DialogPVRGuideControls.xml")
+{
+ m_loadType = KEEP_IN_MEMORY;
+}
+
+CGUIDialogPVRGuideControls::~CGUIDialogPVRGuideControls() = default;
diff --git a/xbmc/pvr/dialogs/GUIDialogPVRGuideControls.h b/xbmc/pvr/dialogs/GUIDialogPVRGuideControls.h
new file mode 100644
index 0000000000..f04c892453
--- /dev/null
+++ b/xbmc/pvr/dialogs/GUIDialogPVRGuideControls.h
@@ -0,0 +1,18 @@
+/*
+ * Copyright (C) 2005-2018 Team Kodi
+ * This file is part of Kodi - https://kodi.tv
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ * See LICENSES/README.md for more information.
+ */
+
+#pragma once
+
+#include "guilib/GUIDialog.h"
+
+class CGUIDialogPVRGuideControls : public CGUIDialog
+{
+public:
+ CGUIDialogPVRGuideControls();
+ ~CGUIDialogPVRGuideControls() override;
+};
diff --git a/xbmc/pvr/windows/GUIEPGGridContainer.cpp b/xbmc/pvr/windows/GUIEPGGridContainer.cpp
index 3de7938c6e..8becd88ddc 100644
--- a/xbmc/pvr/windows/GUIEPGGridContainer.cpp
+++ b/xbmc/pvr/windows/GUIEPGGridContainer.cpp
@@ -1655,6 +1655,19 @@ void CGUIEPGGridContainer::GoToDate(const CDateTime& date)
SetBlock(offset);
}
+void CGUIEPGGridContainer::GoToFirstChannel()
+{
+ GoToChannel(0);
+}
+
+void CGUIEPGGridContainer::GoToLastChannel()
+{
+ if (m_gridModel->ChannelItemsSize())
+ GoToChannel(m_gridModel->ChannelItemsSize() - 1);
+ else
+ GoToChannel(0);
+}
+
void CGUIEPGGridContainer::GoToTop()
{
if (m_orientation == VERTICAL)
diff --git a/xbmc/pvr/windows/GUIEPGGridContainer.h b/xbmc/pvr/windows/GUIEPGGridContainer.h
index ffe67b56f6..38a40aee3c 100644
--- a/xbmc/pvr/windows/GUIEPGGridContainer.h
+++ b/xbmc/pvr/windows/GUIEPGGridContainer.h
@@ -87,6 +87,10 @@ namespace PVR
void GoToEnd();
void GoToNow();
void GoToDate(const CDateTime& date);
+
+ void GoToFirstChannel();
+ void GoToLastChannel();
+
void GoToTop();
void GoToBottom();
void GoToMostLeft();
diff --git a/xbmc/pvr/windows/GUIWindowPVRBase.cpp b/xbmc/pvr/windows/GUIWindowPVRBase.cpp
index 9d4dfeea1d..85688cfe2f 100644
--- a/xbmc/pvr/windows/GUIWindowPVRBase.cpp
+++ b/xbmc/pvr/windows/GUIWindowPVRBase.cpp
@@ -185,17 +185,13 @@ bool CGUIWindowPVRBase::OnAction(const CAction& action)
switch (action.GetID())
{
case ACTION_PREVIOUS_CHANNELGROUP:
+ ActivatePreviousChannelGroup();
+ return true;
+
case ACTION_NEXT_CHANNELGROUP:
- {
- // switch to next or previous group
- const std::shared_ptr<CPVRChannelGroup> channelGroup = GetChannelGroup();
- if (channelGroup)
- {
- const CPVRChannelGroups* groups = CServiceBroker::GetPVRManager().ChannelGroups()->Get(channelGroup->IsRadio());
- SetChannelGroup(action.GetID() == ACTION_NEXT_CHANNELGROUP ? groups->GetNextGroup(*channelGroup) : groups->GetPreviousGroup(*channelGroup));
- }
+ ActivateNextChannelGroup();
return true;
- }
+
case ACTION_MOVE_RIGHT:
case ACTION_MOVE_LEFT:
{
@@ -226,6 +222,36 @@ bool CGUIWindowPVRBase::OnBack(int actionID)
return CGUIMediaWindow::OnBack(actionID);
}
+bool CGUIWindowPVRBase::ActivatePreviousChannelGroup()
+{
+ const std::shared_ptr<CPVRChannelGroup> channelGroup = GetChannelGroup();
+ if (channelGroup)
+ {
+ const CPVRChannelGroups* groups = CServiceBroker::GetPVRManager().ChannelGroups()->Get(channelGroup->IsRadio());
+ if (groups)
+ {
+ SetChannelGroup(groups->GetPreviousGroup(*channelGroup));
+ return true;
+ }
+ }
+ return false;
+}
+
+bool CGUIWindowPVRBase::ActivateNextChannelGroup()
+{
+ const std::shared_ptr<CPVRChannelGroup> channelGroup = GetChannelGroup();
+ if (channelGroup)
+ {
+ const CPVRChannelGroups* groups = CServiceBroker::GetPVRManager().ChannelGroups()->Get(channelGroup->IsRadio());
+ if (groups)
+ {
+ SetChannelGroup(groups->GetNextGroup(*channelGroup));
+ return true;
+ }
+ }
+ return false;
+}
+
void CGUIWindowPVRBase::ClearData()
{
CSingleLock lock(m_critSection);
diff --git a/xbmc/pvr/windows/GUIWindowPVRBase.h b/xbmc/pvr/windows/GUIWindowPVRBase.h
index 12063567a4..80eff48cd4 100644
--- a/xbmc/pvr/windows/GUIWindowPVRBase.h
+++ b/xbmc/pvr/windows/GUIWindowPVRBase.h
@@ -79,6 +79,10 @@ namespace PVR
*/
bool DoRefresh(void) { return Refresh(true); }
+ bool ActivatePreviousChannelGroup();
+ bool ActivateNextChannelGroup();
+ bool OpenChannelGroupSelectionDialog();
+
protected:
CGUIWindowPVRBase(bool bRadio, int id, const std::string& xmlFile);
@@ -116,8 +120,6 @@ namespace PVR
std::atomic_bool m_bUpdating = {false};
private:
- bool OpenChannelGroupSelectionDialog(void);
-
/*!
* @brief Show or update the progress dialog.
* @param strText The current status.
diff --git a/xbmc/pvr/windows/GUIWindowPVRGuide.cpp b/xbmc/pvr/windows/GUIWindowPVRGuide.cpp
index a6ed0ad0ac..620141d446 100644
--- a/xbmc/pvr/windows/GUIWindowPVRGuide.cpp
+++ b/xbmc/pvr/windows/GUIWindowPVRGuide.cpp
@@ -11,10 +11,12 @@
#include "FileItem.h"
#include "GUIUserMessages.h"
#include "ServiceBroker.h"
+#include "addons/Skin.h"
#include "dialogs/GUIDialogBusy.h"
#include "dialogs/GUIDialogContextMenu.h"
#include "dialogs/GUIDialogNumeric.h"
#include "guilib/GUIMessage.h"
+#include "guilib/GUIWindowManager.h"
#include "guilib/LocalizeStrings.h"
#include "input/actions/Action.h"
#include "input/actions/ActionIDs.h"
@@ -36,6 +38,7 @@
#include "threads/SingleLock.h"
#include "view/GUIViewState.h"
+#include <functional>
#include <memory>
#include <utility>
#include <vector>
@@ -120,6 +123,12 @@ void CGUIWindowPVRGuideBase::OnDeinitWindow(int nextWindowID)
}
}
+ CGUIDialog* dialog = CServiceBroker::GetGUI()->GetWindowManager().GetDialog(WINDOW_DIALOG_PVR_GUIDE_CONTROLS);
+ if (dialog && dialog->IsDialogRunning())
+ {
+ dialog->Close();
+ }
+
CGUIWindowPVRBase::OnDeinitWindow(nextWindowID);
}
@@ -171,12 +180,9 @@ void CGUIWindowPVRGuideBase::SetInvalid()
void CGUIWindowPVRGuideBase::GetContextButtons(int itemNumber, CContextButtons& buttons)
{
- buttons.Add(CONTEXT_BUTTON_BEGIN, 19063); /* Go to begin */
- buttons.Add(CONTEXT_BUTTON_NOW, 19070); /* Go to now */
- buttons.Add(CONTEXT_BUTTON_DATE, 19288); /* Go to date */
- buttons.Add(CONTEXT_BUTTON_END, 19064); /* Go to end */
-
CGUIWindowPVRBase::GetContextButtons(itemNumber, buttons);
+
+ buttons.Add(CONTEXT_BUTTON_NAVIGATE, 19326); // Navigate...
}
void CGUIWindowPVRGuideBase::UpdateSelectedItemPath()
@@ -592,28 +598,93 @@ bool CGUIWindowPVRGuideBase::OnMessage(CGUIMessage& message)
bool CGUIWindowPVRGuideBase::OnContextButton(int itemNumber, CONTEXT_BUTTON button)
{
- switch (button)
- {
- case CONTEXT_BUTTON_BEGIN:
- return OnContextButtonBegin();
+ if (OnContextButtonNavigate(button))
+ return true;
- case CONTEXT_BUTTON_NOW:
- return OnContextButtonNow();
+ if (itemNumber < 0 || itemNumber >= m_vecItems->Size())
+ return false;
- case CONTEXT_BUTTON_DATE:
- return OnContextButtonDate();
+ return CGUIMediaWindow::OnContextButton(itemNumber, button);
+}
- case CONTEXT_BUTTON_END:
- return OnContextButtonEnd();
+namespace
+{
- default:
- break;
+template<typename A>
+class CContextMenuFunctions : public CContextButtons
+{
+public:
+ explicit CContextMenuFunctions(A* instance) : m_instance(instance) {}
+
+ void Add(bool (A::*function)(), unsigned int resId)
+ {
+ CContextButtons::Add(size(), resId);
+ m_functions.emplace_back(std::bind(function, m_instance));
}
- if (itemNumber < 0 || itemNumber >= m_vecItems->Size())
- return false;
+ bool Call(int idx)
+ {
+ if (idx < 0 || idx >= static_cast<int>(m_functions.size()))
+ return false;
- return CGUIMediaWindow::OnContextButton(itemNumber, button);
+ return m_functions[idx]();
+ }
+
+private:
+ A* m_instance = nullptr;
+ std::vector<std::function<bool()>> m_functions;
+};
+
+} // unnamed namespace
+
+bool CGUIWindowPVRGuideBase::OnContextButtonNavigate(CONTEXT_BUTTON button)
+{
+ bool bReturn = false;
+
+ if (button == CONTEXT_BUTTON_NAVIGATE)
+ {
+ if (g_SkinInfo->HasSkinFile("DialogPVRGuideControls.xml"))
+ {
+ // use controls dialog
+ CGUIDialog* dialog = CServiceBroker::GetGUI()->GetWindowManager().GetDialog(WINDOW_DIALOG_PVR_GUIDE_CONTROLS);
+ if (dialog && !dialog->IsDialogRunning())
+ {
+ dialog->Open();
+ }
+ }
+ else
+ {
+ // use context menu
+ CContextMenuFunctions<CGUIWindowPVRGuideBase> buttons(this);
+ buttons.Add(&CGUIWindowPVRGuideBase::GotoBegin, 19063); // First programme
+ buttons.Add(&CGUIWindowPVRGuideBase::Go12HoursBack, 19317); // 12 hours back
+ buttons.Add(&CGUIWindowPVRGuideBase::GotoNow, 19070); // Current programme
+ buttons.Add(&CGUIWindowPVRGuideBase::Go12HoursForward, 19318); // 12 hours forward
+ buttons.Add(&CGUIWindowPVRGuideBase::GotoEnd, 19064); // Last programme
+ buttons.Add(&CGUIWindowPVRGuideBase::OpenDateSelectionDialog, 19288); // Date selector
+ buttons.Add(&CGUIWindowPVRGuideBase::GotoFirstChannel, 19322); // First channel
+ if (CServiceBroker::GetPVRManager().IsPlayingTV() || CServiceBroker::GetPVRManager().IsPlayingRadio())
+ buttons.Add(&CGUIWindowPVRGuideBase::GotoPlayingChannel, 19323); // Playing channel
+ buttons.Add(&CGUIWindowPVRGuideBase::GotoLastChannel, 19324); // Last channel
+ buttons.Add(&CGUIWindowPVRBase::ActivatePreviousChannelGroup, 19319); // Previous group
+ buttons.Add(&CGUIWindowPVRBase::ActivateNextChannelGroup, 19320); // Next group
+ buttons.Add(&CGUIWindowPVRBase::OpenChannelGroupSelectionDialog, 19321); // Group selector
+
+ int buttonIdx = 0;
+ int lastButtonIdx = 2; // initially select "Current programme"
+
+ // loop until canceled
+ while (buttonIdx >= 0)
+ {
+ buttonIdx = CGUIDialogContextMenu::Show(buttons, lastButtonIdx);
+ lastButtonIdx = buttonIdx;
+ buttons.Call(buttonIdx);
+ }
+ }
+ bReturn = true;
+ }
+
+ return bReturn;
}
bool CGUIWindowPVRGuideBase::RefreshTimelineItems()
@@ -703,25 +774,25 @@ bool CGUIWindowPVRGuideBase::RefreshTimelineItems()
return false;
}
-bool CGUIWindowPVRGuideBase::OnContextButtonBegin()
+bool CGUIWindowPVRGuideBase::GotoBegin()
{
GetGridControl()->GoToBegin();
return true;
}
-bool CGUIWindowPVRGuideBase::OnContextButtonEnd()
+bool CGUIWindowPVRGuideBase::GotoEnd()
{
GetGridControl()->GoToEnd();
return true;
}
-bool CGUIWindowPVRGuideBase::OnContextButtonNow()
+bool CGUIWindowPVRGuideBase::GotoNow()
{
GetGridControl()->GoToNow();
return true;
}
-bool CGUIWindowPVRGuideBase::OnContextButtonDate()
+bool CGUIWindowPVRGuideBase::OpenDateSelectionDialog()
{
bool bReturn = false;
@@ -738,6 +809,46 @@ bool CGUIWindowPVRGuideBase::OnContextButtonDate()
return bReturn;
}
+bool CGUIWindowPVRGuideBase::Go12HoursBack()
+{
+ return GotoDate(-12);
+}
+
+bool CGUIWindowPVRGuideBase::Go12HoursForward()
+{
+ return GotoDate(+12);
+}
+
+bool CGUIWindowPVRGuideBase::GotoDate(int deltaHours)
+{
+ CGUIEPGGridContainer* epgGridContainer = GetGridControl();
+ epgGridContainer->GoToDate(epgGridContainer->GetSelectedDate() + CDateTimeSpan(0, deltaHours, 0, 0));
+ return true;
+}
+
+bool CGUIWindowPVRGuideBase::GotoFirstChannel()
+{
+ GetGridControl()->GoToFirstChannel();
+ return true;
+}
+
+bool CGUIWindowPVRGuideBase::GotoLastChannel()
+{
+ GetGridControl()->GoToLastChannel();
+ return true;
+}
+
+bool CGUIWindowPVRGuideBase::GotoPlayingChannel()
+{
+ const std::shared_ptr<CPVRChannel> channel = CServiceBroker::GetPVRManager().GetPlayingChannel();
+ if (channel)
+ {
+ GetGridControl()->SetChannel(channel);
+ return true;
+ }
+ return false;
+}
+
void CGUIWindowPVRGuideBase::OnInputDone()
{
const CPVRChannelNumber channelNumber = GetChannelNumber();
diff --git a/xbmc/pvr/windows/GUIWindowPVRGuide.h b/xbmc/pvr/windows/GUIWindowPVRGuide.h
index d134d12fdf..8046d1c8e3 100644
--- a/xbmc/pvr/windows/GUIWindowPVRGuide.h
+++ b/xbmc/pvr/windows/GUIWindowPVRGuide.h
@@ -52,6 +52,17 @@ namespace PVR
void GetChannelNumbers(std::vector<std::string>& channelNumbers) override;
void OnInputDone() override;
+ bool GotoBegin();
+ bool GotoEnd();
+ bool GotoNow();
+ bool GotoDate(int deltaHours);
+ bool OpenDateSelectionDialog();
+ bool Go12HoursBack();
+ bool Go12HoursForward();
+ bool GotoFirstChannel();
+ bool GotoLastChannel();
+ bool GotoPlayingChannel();
+
protected:
void UpdateSelectedItemPath() override;
std::string GetDirectoryPath(void) override { return ""; }
@@ -65,10 +76,7 @@ namespace PVR
CGUIEPGGridContainer* GetGridControl();
void InitEpgGridControl();
- bool OnContextButtonBegin();
- bool OnContextButtonEnd();
- bool OnContextButtonNow();
- bool OnContextButtonDate();
+ bool OnContextButtonNavigate(CONTEXT_BUTTON button);
bool ShouldNavigateToGridContainer(int iAction);