aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKai Sommerfeld <kai.sommerfeld@gmx.com>2016-09-23 12:31:40 +0200
committerGitHub <noreply@github.com>2016-09-23 12:31:40 +0200
commit73ce8862cafdcc21e2a8ef6c3feca7593d11ea33 (patch)
treeaafecd86927d69de45a1b5a049132f8648f1d83c
parentfcba1bb7b3264bba50101593af5864a0c2ddedff (diff)
parent544cfb24b4149db08b1116c4626d937b8cacea3f (diff)
Merge pull request #10536 from ksooo/estuary-pvrinfodialog-add-timer-button
[Estuary][PVR] PVR Info dialog: Add 'Add timer' button.
-rw-r--r--addons/resource.language.en_gb/resources/strings.po1
-rw-r--r--addons/skin.estuary/1080i/DialogPVRInfo.xml6
-rw-r--r--addons/skin.estuary/media/icons/infodialogs/timer.pngbin0 -> 719 bytes
-rw-r--r--xbmc/pvr/dialogs/GUIDialogPVRGuideInfo.cpp35
-rw-r--r--xbmc/pvr/dialogs/GUIDialogPVRGuideInfo.h2
5 files changed, 43 insertions, 1 deletions
diff --git a/addons/resource.language.en_gb/resources/strings.po b/addons/resource.language.en_gb/resources/strings.po
index 53a8ca8e1a..16014ae2e6 100644
--- a/addons/resource.language.en_gb/resources/strings.po
+++ b/addons/resource.language.en_gb/resources/strings.po
@@ -9179,6 +9179,7 @@ msgstr ""
#. Label for a context menu entry to open the timer settings dialog
#: xbmc/pvr/windows/GUIWindowPVRGuide.cpp
#: xbmc/pvr/windows/GUIWindowPVRSearch.cpp
+#: addons/skin.estuary/1080i/DialogPVRInfo.xml
msgctxt "#19061"
msgid "Add timer"
msgstr ""
diff --git a/addons/skin.estuary/1080i/DialogPVRInfo.xml b/addons/skin.estuary/1080i/DialogPVRInfo.xml
index 93524e1f44..17b51fbbb1 100644
--- a/addons/skin.estuary/1080i/DialogPVRInfo.xml
+++ b/addons/skin.estuary/1080i/DialogPVRInfo.xml
@@ -90,6 +90,12 @@
<param name="visible" value="Window.IsActive(PVRGuideInfo)" />
</include>
<include content="InfoDialogButton">
+ <param name="id" value="9" />
+ <param name="icon" value="icons/infodialogs/timer.png" />
+ <param name="label" value="$LOCALIZE[19061]" />
+ <param name="visible" value="Window.IsActive(PVRGuideInfo)" />
+ </include>
+ <include content="InfoDialogButton">
<param name="id" value="440" />
<param name="icon" value="icons/infodialogs/trailer.png" />
<param name="label" value="$LOCALIZE[31114]" />
diff --git a/addons/skin.estuary/media/icons/infodialogs/timer.png b/addons/skin.estuary/media/icons/infodialogs/timer.png
new file mode 100644
index 0000000000..b1d117bd8d
--- /dev/null
+++ b/addons/skin.estuary/media/icons/infodialogs/timer.png
Binary files differ
diff --git a/xbmc/pvr/dialogs/GUIDialogPVRGuideInfo.cpp b/xbmc/pvr/dialogs/GUIDialogPVRGuideInfo.cpp
index 2a65b06dea..bf99578367 100644
--- a/xbmc/pvr/dialogs/GUIDialogPVRGuideInfo.cpp
+++ b/xbmc/pvr/dialogs/GUIDialogPVRGuideInfo.cpp
@@ -46,6 +46,7 @@ using namespace KODI::MESSAGING;
#define CONTROL_BTN_RECORD 6
#define CONTROL_BTN_OK 7
#define CONTROL_BTN_PLAY_RECORDING 8
+#define CONTROL_BTN_ADD_TIMER 9
CGUIDialogPVRGuideInfo::CGUIDialogPVRGuideInfo(void)
: CGUIDialog(WINDOW_DIALOG_PVR_GUIDE_INFO, "DialogPVRInfo.xml")
@@ -84,6 +85,19 @@ bool CGUIDialogPVRGuideInfo::ActionCancelTimer(const CFileItemPtr &timer)
return bReturn;
}
+bool CGUIDialogPVRGuideInfo::ActionAddTimerRule(const CEpgInfoTagPtr &tag)
+{
+ bool bReturn = false;
+
+ const CFileItemPtr item(new CFileItem(tag));
+ bReturn = CGUIWindowPVRBase::AddTimerRule(item.get(), true);
+
+ if (bReturn)
+ Close();
+
+ return bReturn;
+}
+
bool CGUIDialogPVRGuideInfo::OnClickButtonOK(CGUIMessage &message)
{
bool bReturn = false;
@@ -123,6 +137,21 @@ bool CGUIDialogPVRGuideInfo::OnClickButtonRecord(CGUIMessage &message)
return bReturn;
}
+bool CGUIDialogPVRGuideInfo::OnClickButtonAddTimer(CGUIMessage &message)
+{
+ bool bReturn = false;
+
+ if (message.GetSenderId() == CONTROL_BTN_ADD_TIMER)
+ {
+ if (m_progItem && !m_progItem->Timer())
+ ActionAddTimerRule(m_progItem);
+
+ bReturn = true;
+ }
+
+ return bReturn;
+}
+
bool CGUIDialogPVRGuideInfo::OnClickButtonPlay(CGUIMessage &message)
{
bool bReturn = false;
@@ -189,7 +218,8 @@ bool CGUIDialogPVRGuideInfo::OnMessage(CGUIMessage& message)
return OnClickButtonOK(message) ||
OnClickButtonRecord(message) ||
OnClickButtonPlay(message) ||
- OnClickButtonFind(message);
+ OnClickButtonFind(message) ||
+ OnClickButtonAddTimer(message);
}
return CGUIDialog::OnMessage(message);
@@ -240,6 +270,9 @@ void CGUIDialogPVRGuideInfo::OnInitWindow()
SET_CONTROL_LABEL(CONTROL_BTN_RECORD, 19060); /* Delete timer */
bHideRecord = false;
}
+
+ /* already has a timer. hide the add timer button */
+ SET_CONTROL_HIDDEN(CONTROL_BTN_ADD_TIMER);
}
else if (m_progItem->EndAsLocalTime() > CDateTime::GetCurrentDateTime())
{
diff --git a/xbmc/pvr/dialogs/GUIDialogPVRGuideInfo.h b/xbmc/pvr/dialogs/GUIDialogPVRGuideInfo.h
index 2cfbfe491a..f595b2b49b 100644
--- a/xbmc/pvr/dialogs/GUIDialogPVRGuideInfo.h
+++ b/xbmc/pvr/dialogs/GUIDialogPVRGuideInfo.h
@@ -49,11 +49,13 @@ namespace PVR
bool ActionStartTimer(const EPG::CEpgInfoTagPtr &tag);
bool ActionCancelTimer(const CFileItemPtr &timer);
+ bool ActionAddTimerRule(const EPG::CEpgInfoTagPtr &tag);
bool OnClickButtonOK(CGUIMessage &message);
bool OnClickButtonRecord(CGUIMessage &message);
bool OnClickButtonPlay(CGUIMessage &message);
bool OnClickButtonFind(CGUIMessage &message);
+ bool OnClickButtonAddTimer(CGUIMessage &message);
EPG::CEpgInfoTagPtr m_progItem;
};