From aad614556f7f9ed40d9fe60fac0fb382eeeb85fb Mon Sep 17 00:00:00 2001 From: hut Date: Tue, 9 Feb 2010 14:14:04 +0100 Subject: implemented #61: show sum of size of marked files --- TODO | 4 ++-- ranger/gui/widgets/statusbar.py | 16 ++++++++++++---- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/TODO b/TODO index 55b31290..3366ca4e 100644 --- a/TODO +++ b/TODO @@ -42,7 +42,7 @@ General ( ) #56 10/01/30 warn before deleting mount points ( ) #57 10/01/30 warn before deleting unseen marked files (X) #58 10/02/04 change the title of the terminal - ( ) #61 10/02/09 show sum of size of marked files + (X) #61 10/02/09 show sum of size of marked files Bugs @@ -78,5 +78,5 @@ Goals for next minor version (X) #54 10/01/23 max_dirsize_for_autopreview not working ( ) #55 10/01/24 allow change of filename when pasting - ( ) #61 10/02/09 show sum of size of marked files + (X) #61 10/02/09 show sum of size of marked files diff --git a/ranger/gui/widgets/statusbar.py b/ranger/gui/widgets/statusbar.py index a2b8dbd6..3aab5e2f 100644 --- a/ranger/gui/widgets/statusbar.py +++ b/ranger/gui/widgets/statusbar.py @@ -202,10 +202,18 @@ class StatusBar(Widget): max_pos = len(target) - self.column.hei base = 'scroll' - right.add(human_readable(target.disk_usage, seperator='')) - right.add(", ", "space") - right.add(human_readable(self.env.get_free_space(target.mount_path), - seperator='')) + if target.marked_items: + if len(target.marked_items) == len(target.files): + right.add(human_readable(target.disk_usage, seperator='')) + else: + right.add(human_readable(sum(f.size \ + for f in target.marked_items \ + if f.is_file), seperator='')) + else: + right.add(human_readable(target.disk_usage, seperator='')) + right.add(", ", "space") + right.add(human_readable(self.env.get_free_space( \ + target.mount_path), seperator='')) right.add(" ", "space") if target.marked_items: -- cgit 1.4.1-2-gfad0 author
path: root/themes/spawn
blob: b32862d3f396fcb3a3b0a2e635358e353ebeb948 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50