summaryrefslogtreecommitdiff
path: root/menu.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2021-05-21 10:41:46 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2021-05-21 10:41:46 +0200
commitada85b693e41d9f41393e266f9a7829a6f69ac6b (patch)
treedf11c89e06a87dde04b7b7d572ef630ce721061b /menu.c
parenta1a8c5d94c4cc2ed6cc5b77c1c3a9bda4796b782 (diff)
downloadvdr-ada85b693e41d9f41393e266f9a7829a6f69ac6b.tar.gz
vdr-ada85b693e41d9f41393e266f9a7829a6f69ac6b.tar.bz2
The 'Edit path' dialog now also shows the total size of all recordings in that path
Diffstat (limited to 'menu.c')
-rw-r--r--menu.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/menu.c b/menu.c
index c6104e67..8f4eb19e 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 5.5 2021/05/19 11:22:20 kls Exp $
+ * $Id: menu.c 5.6 2021/05/21 10:41:31 kls Exp $
*/
#include "menu.h"
@@ -2549,6 +2549,23 @@ cMenuPathEdit::cMenuPathEdit(const char *Path)
p->SetSelectable(!pathIsInUse);
Add(p = new cMenuEditStrItem(tr("Name"), name, sizeof(name)));
p->SetSelectable(!pathIsInUse);
+ if (*path) {
+ int DirSize = 0;
+ {
+ LOCK_RECORDINGS_READ;
+ for (const cRecording *Recording = Recordings->First(); Recording; Recording = Recordings->Next(Recording)) {
+ if (Recording->IsInPath(path)) {
+ int FileSizeMB = Recording->FileSizeMB();
+ if (FileSizeMB > 0 )
+ DirSize += FileSizeMB;
+ }
+ }
+ }
+ if (DirSize > 1023)
+ Add(new cOsdItem(cString::sprintf("%s:\t%.2f GB", tr("Size"), DirSize / 1024.), osUnknown, false));
+ else
+ Add(new cOsdItem(cString::sprintf("%s:\t%d MB", tr("Size"), DirSize), osUnknown, false));
+ }
if (pathIsInUse) {
Add(new cOsdItem("", osUnknown, false));
Add(new cOsdItem(tr("This folder is currently in use - no changes are possible!"), osUnknown, false));