summaryrefslogtreecommitdiff
path: root/menu.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2002-01-27 13:11:23 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2002-01-27 13:11:23 +0100
commit28e54bc648502820202ea44f6a990c9502f901f7 (patch)
tree436b3e56eb28e8c13002e97c511c11234c55f0b4 /menu.c
parent53c5499a0b93cd1cb47394381c4262f01b6c0c00 (diff)
downloadvdr-28e54bc648502820202ea44f6a990c9502f901f7.tar.gz
vdr-28e54bc648502820202ea44f6a990c9502f901f7.tar.bz2
The 'Main' menu now displays the used disk space in the title
Diffstat (limited to 'menu.c')
-rw-r--r--menu.c15
1 files changed, 14 insertions, 1 deletions
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));