aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxhaggi <sascha.woo@gmail.com>2014-07-29 10:18:34 +0200
committerxhaggi <sascha.woo@gmail.com>2014-08-06 12:08:56 +0200
commit6301ef58b75407aab71b71645cda53ae3758520c (patch)
treef69ff14f98eaa40e87b9fc1d5644c5be64b54e2e
parente59068ddf0d9fc4c3ae40adf71f14fc820215d34 (diff)
[pvr] adds 'Find similar' button to GUIDialogPVRGuideInfo
-rw-r--r--xbmc/pvr/dialogs/GUIDialogPVRGuideInfo.cpp28
-rw-r--r--xbmc/pvr/dialogs/GUIDialogPVRGuideInfo.h1
-rw-r--r--xbmc/pvr/windows/GUIWindowPVRBase.h2
-rw-r--r--xbmc/pvr/windows/GUIWindowPVRSearch.h2
4 files changed, 30 insertions, 3 deletions
diff --git a/xbmc/pvr/dialogs/GUIDialogPVRGuideInfo.cpp b/xbmc/pvr/dialogs/GUIDialogPVRGuideInfo.cpp
index dd4e702ef1..79ee8da924 100644
--- a/xbmc/pvr/dialogs/GUIDialogPVRGuideInfo.cpp
+++ b/xbmc/pvr/dialogs/GUIDialogPVRGuideInfo.cpp
@@ -31,10 +31,12 @@
#include "epg/EpgInfoTag.h"
#include "pvr/timers/PVRTimers.h"
#include "pvr/timers/PVRTimerInfoTag.h"
+#include "pvr/windows/GUIWindowPVRBase.h"
using namespace PVR;
using namespace EPG;
+#define CONTROL_BTN_FIND 4
#define CONTROL_BTN_SWITCH 5
#define CONTROL_BTN_RECORD 6
#define CONTROL_BTN_OK 7
@@ -195,6 +197,29 @@ bool CGUIDialogPVRGuideInfo::OnClickButtonSwitch(CGUIMessage &message)
return bReturn;
}
+bool CGUIDialogPVRGuideInfo::OnClickButtonFind(CGUIMessage &message)
+{
+ bool bReturn = false;
+
+ if (message.GetSenderId() == CONTROL_BTN_FIND)
+ {
+ const CEpgInfoTag *tag = m_progItem->GetEPGInfoTag();
+ if (tag && tag->HasPVRChannel())
+ {
+ int windowSearchId = tag->ChannelTag()->IsRadio() ? WINDOW_RADIO_SEARCH : WINDOW_TV_SEARCH;
+ CGUIWindowPVRBase *windowSearch = (CGUIWindowPVRBase*) g_windowManager.GetWindow(windowSearchId);
+ if (windowSearch)
+ {
+ Close();
+ g_windowManager.ActivateWindow(windowSearchId);
+ bReturn = windowSearch->OnContextButton(*m_progItem.get(), CONTEXT_BUTTON_FIND);
+ }
+ }
+ }
+
+ return bReturn;
+}
+
bool CGUIDialogPVRGuideInfo::OnMessage(CGUIMessage& message)
{
switch (message.GetMessage())
@@ -202,7 +227,8 @@ bool CGUIDialogPVRGuideInfo::OnMessage(CGUIMessage& message)
case GUI_MSG_CLICKED:
return OnClickButtonOK(message) ||
OnClickButtonRecord(message) ||
- OnClickButtonSwitch(message);
+ OnClickButtonSwitch(message) ||
+ OnClickButtonFind(message);
}
return CGUIDialog::OnMessage(message);
diff --git a/xbmc/pvr/dialogs/GUIDialogPVRGuideInfo.h b/xbmc/pvr/dialogs/GUIDialogPVRGuideInfo.h
index 0b11ebdfbe..243573300b 100644
--- a/xbmc/pvr/dialogs/GUIDialogPVRGuideInfo.h
+++ b/xbmc/pvr/dialogs/GUIDialogPVRGuideInfo.h
@@ -50,6 +50,7 @@ namespace PVR
bool OnClickButtonOK(CGUIMessage &message);
bool OnClickButtonRecord(CGUIMessage &message);
bool OnClickButtonSwitch(CGUIMessage &message);
+ bool OnClickButtonFind(CGUIMessage &message);
CFileItemPtr m_progItem;
};
diff --git a/xbmc/pvr/windows/GUIWindowPVRBase.h b/xbmc/pvr/windows/GUIWindowPVRBase.h
index d4d745e240..ff0f6d8723 100644
--- a/xbmc/pvr/windows/GUIWindowPVRBase.h
+++ b/xbmc/pvr/windows/GUIWindowPVRBase.h
@@ -53,6 +53,7 @@ namespace PVR
virtual void OnInitWindow(void);
virtual bool OnMessage(CGUIMessage& message);
virtual bool OnContextButton(int itemNumber, CONTEXT_BUTTON button);
+ virtual bool OnContextButton(const CFileItem &item, CONTEXT_BUTTON button) { return false; };
virtual bool Update(const std::string &strDirectory, bool updateFilterPath = true);
virtual void UpdateButtons(void);
virtual bool OnAction(const CAction &action);
@@ -66,7 +67,6 @@ namespace PVR
CGUIWindowPVRBase(bool bRadio, int id, const std::string &xmlFile);
virtual ~CGUIWindowPVRBase(void);
- virtual bool OnContextButton(const CFileItem &item, CONTEXT_BUTTON button) { return false; };
virtual std::string GetDirectoryPath(void) { return ""; };
virtual CPVRChannelGroupPtr GetGroup(void);
virtual void SetGroup(CPVRChannelGroupPtr group);
diff --git a/xbmc/pvr/windows/GUIWindowPVRSearch.h b/xbmc/pvr/windows/GUIWindowPVRSearch.h
index f71cef786e..5ed5fa254c 100644
--- a/xbmc/pvr/windows/GUIWindowPVRSearch.h
+++ b/xbmc/pvr/windows/GUIWindowPVRSearch.h
@@ -35,10 +35,10 @@ namespace PVR
void OnWindowLoaded();
void GetContextButtons(int itemNumber, CContextButtons &buttons);
bool OnContextButton(int itemNumber, CONTEXT_BUTTON button);
+ bool OnContextButton(const CFileItem &item, CONTEXT_BUTTON button);
protected:
void OnPrepareFileItems(CFileItemList &items);
- virtual bool OnContextButton(const CFileItem &item, CONTEXT_BUTTON button);
private:
bool OnContextButtonClear(CFileItem *item, CONTEXT_BUTTON button);