summary refs log tree commit diff stats
path: root/ranger
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2010-02-09 14:14:04 +0100
committerhut <hut@lavabit.com>2010-02-09 14:28:47 +0100
commitaad614556f7f9ed40d9fe60fac0fb382eeeb85fb (patch)
treeeeedf22918b9c275c0ad532c9e90d6e56884649c /ranger
parentab1a2682540aff4642886873c225b1f17635ef94 (diff)
downloadranger-aad614556f7f9ed40d9fe60fac0fb382eeeb85fb.tar.gz
implemented #61: show sum of size of marked files
Diffstat (limited to 'ranger')
-rw-r--r--ranger/gui/widgets/statusbar.py16
1 files changed, 12 insertions, 4 deletions
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:
ef='/akspecs/aerc/commit/widgets/spinner.go?id=a93b4de6f3c362d6e0db0b1f6d3f2e1c9a5cd64d'>a93b4de ^
a782b70 ^

e4104a8 ^
a782b70 ^
e4104a8 ^


a782b70 ^




0f8b7a1 ^



2159eb8 ^

a782b70 ^



2159eb8 ^

a782b70 ^

2159eb8 ^
a782b70 ^






0f8b7a1 ^



2159eb8 ^

a782b70 ^



2159eb8 ^
a782b70 ^


0f8b7a1 ^
de36484 ^
0f8b7a1 ^

e4104a8 ^
2159eb8 ^
a782b70 ^
e4104a8 ^

a782b70 ^

a782b70 ^
5685a17 ^
a782b70 ^
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80