summaryrefslogtreecommitdiff
path: root/skinclassic.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2012-04-23 09:07:55 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2012-04-23 09:07:55 +0200
commit3d32b07862aff8de213e999f27eaf9082696ec01 (patch)
tree89a8261b475654df3cce58b81743ecc451aab448 /skinclassic.c
parent09e58657a1abc2dcebf1761c5c2406f3b4a4345f (diff)
downloadvdr-3d32b07862aff8de213e999f27eaf9082696ec01.tar.gz
vdr-3d32b07862aff8de213e999f27eaf9082696ec01.tar.bz2
The disk usage is no longer automatically added to the title of the main and "Recordings" menus
Diffstat (limited to 'skinclassic.c')
-rw-r--r--skinclassic.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/skinclassic.c b/skinclassic.c
index 49f0bcb5..64944ded 100644
--- a/skinclassic.c
+++ b/skinclassic.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: skinclassic.c 2.6 2011/08/21 11:02:06 kls Exp $
+ * $Id: skinclassic.c 2.7 2012/04/23 08:48:03 kls Exp $
*/
#include "skinclassic.h"
@@ -12,6 +12,7 @@
#include "i18n.h"
#include "osd.h"
#include "themes.h"
+#include "videodir.h"
#define ScrollWidth (Setup.FontOsdSize / 4)
#define TextFrame (Setup.FontOsdSize / 10)
@@ -170,7 +171,10 @@ private:
int y0, y1, y2, y3, y4, y5;
int lineHeight;
int dateWidth;
+ cString title;
cString lastDate;
+ int lastDiskUsageState;
+ void DrawTitle(void);
void DrawScrollbar(int Total, int Offset, int Shown, int Top, int Height, bool CanScrollUp, bool CanScrollDown);
void SetTextScrollbar(void);
public:
@@ -196,6 +200,7 @@ cSkinClassicDisplayMenu::cSkinClassicDisplayMenu(void)
{
const cFont *font = cFont::GetFont(fontOsd);
lineHeight = font->Height();
+ lastDiskUsageState = -1;
dateWidth = 0;
x0 = 0;
x1 = x0 + 2 * TextSpacing;
@@ -270,10 +275,17 @@ void cSkinClassicDisplayMenu::Clear(void)
osd->DrawRectangle(x0, y1, x3 - 1, y4 - 1, Theme.Color(clrBackground));
}
-void cSkinClassicDisplayMenu::SetTitle(const char *Title)
+void cSkinClassicDisplayMenu::DrawTitle(void)
{
const cFont *font = cFont::GetFont(fontOsd);
- osd->DrawText(x0, y0, Title, Theme.Color(clrMenuTitleFg), Theme.Color(clrMenuTitleBg), font, x3 - x0 - dateWidth);
+ bool WithDisk = MenuCategory() == mcMain || MenuCategory() == mcRecording;
+ osd->DrawText(x0, y0, WithDisk ? cString::sprintf("%s - %s", *title, *cVideoDiskUsage::String()) : title, Theme.Color(clrMenuTitleFg), Theme.Color(clrMenuTitleBg), font, x3 - x0 - dateWidth);
+}
+
+void cSkinClassicDisplayMenu::SetTitle(const char *Title)
+{
+ title = Title;
+ DrawTitle();
}
void cSkinClassicDisplayMenu::SetButtons(const char *Red, const char *Green, const char *Yellow, const char *Blue)
@@ -422,6 +434,8 @@ const cFont *cSkinClassicDisplayMenu::GetTextAreaFont(bool FixedFont) const
void cSkinClassicDisplayMenu::Flush(void)
{
+ if (cVideoDiskUsage::HasChanged(lastDiskUsageState))
+ DrawTitle();
cString date = DayDateTime();
if (!*lastDate || strcmp(date, lastDate)) {
const cFont *font = cFont::GetFont(fontOsd);