diff options
author | Matthias Kortstiege <mkortstiege@kodi.tv> | 2015-07-06 11:21:51 +0200 |
---|---|---|
committer | Matthias Kortstiege <mkortstiege@kodi.tv> | 2015-10-18 11:54:05 +0200 |
commit | 911de9142e0dc69434e627d238d9daad0dbacaf2 (patch) | |
tree | 1f785f1ecf07ac171022dc6db5a71b37e261a2ee | |
parent | dceb627fa4c86f45800aab7fe693030fca3b1f55 (diff) |
[guilib] handle oninfo as control action
-rw-r--r-- | xbmc/guilib/GUIBaseContainer.cpp | 9 | ||||
-rw-r--r-- | xbmc/guilib/GUIControl.cpp | 11 | ||||
-rw-r--r-- | xbmc/guilib/GUIControl.h | 1 | ||||
-rw-r--r-- | xbmc/guilib/GUIControlFactory.cpp | 1 |
4 files changed, 22 insertions, 0 deletions
diff --git a/xbmc/guilib/GUIBaseContainer.cpp b/xbmc/guilib/GUIBaseContainer.cpp index ba52a5d100..b7c417c0fa 100644 --- a/xbmc/guilib/GUIBaseContainer.cpp +++ b/xbmc/guilib/GUIBaseContainer.cpp @@ -350,6 +350,15 @@ bool CGUIBaseContainer::OnAction(const CAction &action) } break; + case ACTION_SHOW_INFO: + { + if (OnInfo()) + return true; + else if (action.GetID()) + return OnClick(action.GetID()); + } + break; + case ACTION_FIRST_PAGE: SelectItem(0); return true; diff --git a/xbmc/guilib/GUIControl.cpp b/xbmc/guilib/GUIControl.cpp index c1ca32cc7f..c29dee0646 100644 --- a/xbmc/guilib/GUIControl.cpp +++ b/xbmc/guilib/GUIControl.cpp @@ -227,6 +227,9 @@ bool CGUIControl::OnAction(const CAction &action) OnRight(); return true; + case ACTION_SHOW_INFO: + return OnInfo(); + case ACTION_NAV_BACK: return OnBack(); @@ -278,6 +281,14 @@ bool CGUIControl::OnBack() return Navigate(ACTION_NAV_BACK); } +bool CGUIControl::OnInfo() +{ + CGUIAction action = GetNavigateAction(ACTION_SHOW_INFO); + if (action.HasAnyActions()) + return action.ExecuteActions(GetID(), GetParentID()); + return false; +} + void CGUIControl::OnNextControl() { Navigate(ACTION_NEXT_CONTROL); diff --git a/xbmc/guilib/GUIControl.h b/xbmc/guilib/GUIControl.h index c877c10dac..b09606c426 100644 --- a/xbmc/guilib/GUIControl.h +++ b/xbmc/guilib/GUIControl.h @@ -105,6 +105,7 @@ public: virtual void OnLeft(); virtual void OnRight(); virtual bool OnBack(); + virtual bool OnInfo(); virtual void OnNextControl(); virtual void OnPrevControl(); virtual void OnFocus() {}; diff --git a/xbmc/guilib/GUIControlFactory.cpp b/xbmc/guilib/GUIControlFactory.cpp index 9c757d6c9c..955dcc1c4c 100644 --- a/xbmc/guilib/GUIControlFactory.cpp +++ b/xbmc/guilib/GUIControlFactory.cpp @@ -832,6 +832,7 @@ CGUIControl* CGUIControlFactory::Create(int parentID, const CRect &rect, TiXmlEl GetActions(pControlNode, "onnext", actions[ACTION_NEXT_CONTROL]); GetActions(pControlNode, "onprev", actions[ACTION_PREV_CONTROL]); GetActions(pControlNode, "onback", actions[ACTION_NAV_BACK]); + GetActions(pControlNode, "oninfo", actions[ACTION_SHOW_INFO]); if (XMLUtils::GetInt(pControlNode, "defaultcontrol", defaultControl)) { |