summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CONTRIBUTORS4
-rw-r--r--HISTORY3
-rw-r--r--menu.c6
-rw-r--r--osdbase.c9
-rw-r--r--osdbase.h4
-rw-r--r--skins.h14
6 files changed, 36 insertions, 4 deletions
diff --git a/CONTRIBUTORS b/CONTRIBUTORS
index a60a54c7..1c3dd2ec 100644
--- a/CONTRIBUTORS
+++ b/CONTRIBUTORS
@@ -3319,3 +3319,7 @@ Dieter Ferdinand <dieter.ferdinand@gmx.de>
Jasmin Jessich <jasmin@anw.at>
for modifying the CAM API so that it is possible to implement CAMs that can be freely
assigned to any devices
+
+Martin Schirrmacher <schirrmie@gmail.com>
+ for suggesting to provide a way for skin plugins to get informed about the currently
+ used sort mode of a menu
diff --git a/HISTORY b/HISTORY
index 1d6ea88b..84870418 100644
--- a/HISTORY
+++ b/HISTORY
@@ -8373,3 +8373,6 @@ Video Disk Recorder Revision History
Dietmar Spingler).
- Modified the CAM API so that it is possible to implement CAMs that can be freely
assigned to any devices (thanks to Jasmin Jessich).
+- Plugins can now implement the function SetMenuSortMode() in their skin objects
+ derived from cSkinDisplayMenu, to get informed about the currently used sort
+ mode, if applicable (suggested by Martin Schirrmacher).
diff --git a/menu.c b/menu.c
index e5d7e098..08445bc1 100644
--- a/menu.c
+++ b/menu.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: menu.c 3.26 2015/01/14 12:10:58 kls Exp $
+ * $Id: menu.c 3.27 2015/01/15 10:31:41 kls Exp $
*/
#include "menu.h"
@@ -387,6 +387,9 @@ void cMenuChannels::Setup(void)
currentItem = item;
}
}
+ SetMenuSortMode(cMenuChannelItem::SortMode() == cMenuChannelItem::csmName ? msmName :
+ cMenuChannelItem::SortMode() == cMenuChannelItem::csmProvider ? msmProvider :
+ msmNumber);
if (cMenuChannelItem::SortMode() != cMenuChannelItem::csmNumber)
Sort();
SetCurrent(currentItem);
@@ -2670,6 +2673,7 @@ void cMenuRecordings::Set(bool Refresh)
LastDir->IncrementCounter(recording->IsNew());
}
}
+ SetMenuSortMode(RecordingsSortMode == rsmName ? msmName : msmTime);
if (Refresh)
Display();
}
diff --git a/osdbase.c b/osdbase.c
index b788edb0..e03f2d07 100644
--- a/osdbase.c
+++ b/osdbase.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: osdbase.c 3.2 2013/09/22 14:01:17 kls Exp $
+ * $Id: osdbase.c 3.3 2015/01/15 10:11:11 kls Exp $
*/
#include "osdbase.h"
@@ -86,6 +86,7 @@ cOsdMenu::cOsdMenu(const char *Title, int c0, int c1, int c2, int c3, int c4)
displayMenuItems = 0;
title = NULL;
menuCategory = mcUnknown;
+ menuSortMode = msmUnknown;
SetTitle(Title);
SetCols(c0, c1, c2, c3, c4);
first = 0;
@@ -114,6 +115,11 @@ void cOsdMenu::SetMenuCategory(eMenuCategory MenuCategory)
menuCategory = MenuCategory;
}
+void cOsdMenu::SetMenuSortMode(eMenuSortMode MenuSortMode)
+{
+ menuSortMode = MenuSortMode;
+}
+
void cOsdMenu::SetDisplayMenu(void)
{
if (displayMenu) {
@@ -224,6 +230,7 @@ void cOsdMenu::Display(void)
cStatus::MsgOsdClear();
if (menuCategory != displayMenu->MenuCategory())
displayMenu->SetMenuCategory(menuCategory);
+ displayMenu->SetMenuSortMode(menuSortMode);
displayMenuItems = displayMenu->MaxItems();
displayMenu->SetTabs(cols[0], cols[1], cols[2], cols[3], cols[4]);//XXX
displayMenu->SetTitle(title);
diff --git a/osdbase.h b/osdbase.h
index 07dce352..5b8ae1cc 100644
--- a/osdbase.h
+++ b/osdbase.h
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: osdbase.h 3.1 2013/09/22 14:00:47 kls Exp $
+ * $Id: osdbase.h 3.2 2015/01/15 10:09:18 kls Exp $
*/
#ifndef __OSDBASE_H
@@ -92,6 +92,7 @@ private:
int cols[cSkinDisplayMenu::MaxTabs];
int first, current, marked;
eMenuCategory menuCategory;
+ eMenuSortMode menuSortMode;
cOsdMenu *subMenu;
const char *helpRed, *helpGreen, *helpYellow, *helpBlue;
bool helpDisplayed;
@@ -131,6 +132,7 @@ public:
virtual ~cOsdMenu();
virtual bool NeedsFastResponse(void) { return subMenu ? subMenu->NeedsFastResponse() : cOsdObject::NeedsFastResponse(); }
void SetMenuCategory(eMenuCategory MenuCategory);
+ void SetMenuSortMode(eMenuSortMode MenuSortMode);
int Current(void) const { return current; }
void Add(cOsdItem *Item, bool Current = false, cOsdItem *After = NULL);
void Ins(cOsdItem *Item, bool Current = false, cOsdItem *Before = NULL);
diff --git a/skins.h b/skins.h
index 6b8cfa06..e1d12c05 100644
--- a/skins.h
+++ b/skins.h
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: skins.h 3.3 2014/02/18 13:48:05 kls Exp $
+ * $Id: skins.h 3.4 2015/01/15 10:45:47 kls Exp $
*/
#ifndef __SKINS_H
@@ -121,6 +121,14 @@ enum eMenuCategory {
mcCam
};
+enum eMenuSortMode {
+ msmUnknown = 0,
+ msmNumber,
+ msmName,
+ msmTime,
+ msmProvider
+ };
+
class cSkinDisplayMenu : public cSkinDisplay {
///< This class implements the general purpose menu display, which is
///< used throughout the program to display information and let the
@@ -167,6 +175,10 @@ public:
virtual void SetTabs(int Tab1, int Tab2 = 0, int Tab3 = 0, int Tab4 = 0, int Tab5 = 0);
///< Sets the tab columns to the given values, which are the number of
///< characters in each column.
+ virtual void SetMenuSortMode(eMenuSortMode MenuSortMode) {}
+ ///< Sets the mode by which the items in this menu are sorted.
+ ///< This is purely informative and may be used by a skin to display the
+ ///< current sort mode by means of some text or symbol.
virtual void Scroll(bool Up, bool Page);
///< If this menu contains a text area that can be scrolled, this function
///< will be called to actually scroll the text. Up indicates whether the