From 28e54bc648502820202ea44f6a990c9502f901f7 Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sun, 27 Jan 2002 13:11:23 +0100 Subject: The 'Main' menu now displays the used disk space in the title --- menu.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'menu.c') diff --git a/menu.c b/menu.c index ea55f272..74a4a9d7 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 1.144 2002/01/26 11:09:25 kls Exp $ + * $Id: menu.c 1.145 2002/01/27 13:09:49 kls Exp $ */ #include "menu.h" @@ -15,6 +15,7 @@ #include "config.h" #include "eit.h" #include "i18n.h" +#include "videodir.h" #define MENUTIMEOUT 120 // seconds #define MAXWAIT4EPGINFO 10 // seconds @@ -1936,6 +1937,18 @@ cMenuMain::cMenuMain(bool Replaying, eOSState State) { digit = 0; + // Title with disk usage: + +#define MB_PER_MINUTE 30 // this is just an estimate! + + char buffer[40]; + int FreeMB; + int Percent = VideoDiskSpace(&FreeMB); + int Hours = int(double(FreeMB) / MB_PER_MINUTE / 60); + int Minutes = (FreeMB / MB_PER_MINUTE) % 60; + snprintf(buffer, sizeof(buffer), "%s - Disk %d%% - %2d:%02d %s", tr("Main"), Percent, Hours, Minutes, tr("free")); + SetTitle(buffer); + // Basic menu items: Add(new cOsdItem(hk(tr("Schedule")), osSchedule)); -- cgit v1.2.3