summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2013-01-10 03:49:58 +0100
committerhut <hut@lavabit.com>2013-01-10 03:49:58 +0100
commitf30f732d8833a784106090555b57526cc32ab709 (patch)
treeca91555dabc2a46ee83720d99a8c7ab410582da5
parentd5ccc411a9a8f0904cefbde2d6069575acabb71c (diff)
downloadranger-f30f732d8833a784106090555b57526cc32ab709.tar.gz
config.commands: use new prompting mechanism for :delete
-rw-r--r--ranger/config/commands.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/ranger/config/commands.py b/ranger/config/commands.py
index 07c595e0..c4192d0d 100644
--- a/ranger/config/commands.py
+++ b/ranger/config/commands.py
@@ -517,12 +517,16 @@ class delete(Command):
 				and len(os.listdir(cf.path)) > 0))
 
 		if confirm != 'never' and (confirm != 'multiple' or many_files):
-			# better ask for a confirmation, when attempting to
-			# delete multiple files or a non-empty directory.
-			return self.fm.open_console(DELETE_WARNING)
+			self.fm.ui.console.ask("Confirm deletion of: %s (y/N)" %
+				', '.join(f.basename for f in self.fm.thistab.get_selection()),
+				self._question_callback, ('y', 'n', 'Y', 'N'))
+		else:
+			# no need for a confirmation, just delete
+			self.fm.delete()
 
-		# no need for a confirmation, just delete
-		self.fm.delete()
+	def _question_callback(self, answer):
+		if answer == 'y' or answer == 'Y':
+			self.fm.delete()
 
 
 class mark(Command):
f3612481 ^
261b1b80 ^
f3612481 ^
2131b055 ^
33352536 ^
261b1b80 ^
2131b055 ^
d1e5e391 ^
2131b055 ^




f3612481 ^

ee9a9237 ^


f3612481 ^
261b1b80 ^

306812cc ^

71eb22a5 ^
7a583220 ^
33352536 ^

ee9a9237 ^
33352536 ^




6030d7e2 ^





33352536 ^
9d27e966 ^
33352536 ^

6030d7e2 ^

33352536 ^



6030d7e2 ^
33352536 ^
261b1b80 ^
33352536 ^

261b1b80 ^
33352536 ^




6030d7e2 ^
33352536 ^
cf02c20b ^
ee9a9237 ^
33352536 ^

7a583220 ^
33352536 ^

6030d7e2 ^
f3612481 ^
71eb22a5 ^
7a583220 ^
33352536 ^

80f53f4a ^


1639687b ^
33352536 ^
80f53f4a ^
261b1b80 ^
6030d7e2 ^
33352536 ^


1639687b ^
33352536 ^
80f53f4a ^








6030d7e2 ^
f3612481 ^

7a583220 ^
33352536 ^
6030d7e2 ^
33352536 ^
6030d7e2 ^
33352536 ^


6030d7e2 ^


71eb22a5 ^
64e8faba ^

33352536 ^
6030d7e2 ^

ee9a9237 ^
6030d7e2 ^
33352536 ^
ee9a9237 ^
6030d7e2 ^
ee9a9237 ^
33352536 ^
9d27e966 ^
ee9a9237 ^
33352536 ^
ee9a9237 ^
6030d7e2 ^
33352536 ^
93be389b ^
33352536 ^
6030d7e2 ^
328a8e11 ^
ee9a9237 ^
6030d7e2 ^

9d27e966 ^
33352536 ^
ee9a9237 ^
6030d7e2 ^
ee9a9237 ^
33352536 ^
7a583220 ^
33352536 ^


6030d7e2 ^
f3612481 ^
71eb22a5 ^
7a583220 ^
33352536 ^

6030d7e2 ^
ee9a9237 ^
33352536 ^
ee9a9237 ^
6030d7e2 ^
9d27e966 ^
cf02c20b ^
ee9a9237 ^
33352536 ^
6030d7e2 ^
ee9a9237 ^
6030d7e2 ^


ee9a9237 ^
6030d7e2 ^
ee9a9237 ^
33352536 ^
7a583220 ^
33352536 ^

6030d7e2 ^
f3612481 ^
71eb22a5 ^
7a583220 ^
33352536 ^

9d27e966 ^
ee9a9237 ^
6030d7e2 ^
33352536 ^
ee9a9237 ^
6030d7e2 ^
9d27e966 ^
cf02c20b ^
7a583220 ^
33352536 ^

6030d7e2 ^
6ee77ba7 ^
ee9a9237 ^
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214