mirror of
https://github.com/vdr-projects/vdr.git
synced 2025-03-01 10:50:46 +00:00
The 'Main' menu now displays the used disk space in the title
This commit is contained in:
15
menu.c
15
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));
|
||||
|
Reference in New Issue
Block a user