summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--ranger/gui/widgets/taskview.py59
1 files changed, 33 insertions, 26 deletions
diff --git a/ranger/gui/widgets/taskview.py b/ranger/gui/widgets/taskview.py
index a7f90dff..70c3b8ae 100644
--- a/ranger/gui/widgets/taskview.py
+++ b/ranger/gui/widgets/taskview.py
@@ -10,6 +10,8 @@ from ranger.container import CommandList
 from collections import deque
 
 class TaskView(Widget, Accumulator):
+	old_lst = None
+	
 	def __init__(self, win):
 		Widget.__init__(self, win)
 		Accumulator.__init__(self)
@@ -22,39 +24,45 @@ class TaskView(Widget, Accumulator):
 		base_clr.append('in_taskview')
 		lst = self.get_list()
 
-		if not self.pointer_is_synced():
-			self.sync_index()
+		if self.old_lst != lst:
+			self.old_lst = lst
+			self.need_redraw = True
 
-		if self.hei <= 0:
-			return
+		if self.need_redraw:
+			self.win.erase()
+			if not self.pointer_is_synced():
+				self.sync_index()
 
-		self.addstr(0, 0, "Task View")
-		self.color_at(0, 0, self.wid, base_clr, 'title')
+			if self.hei <= 0:
+				return
 
-		if lst:
-			for i in range(self.hei - 1):
-				i += self.scroll_begin
-				try:
-					obj = lst[i]
-				except IndexError:
-					break
+			self.addstr(0, 0, "Task View")
+			self.color_at(0, 0, self.wid, base_clr, 'title')
 
-				y = i + 1
-				clr = deque(base_clr)
+			if lst:
+				for i in range(self.hei - 1):
+					i += self.scroll_begin
+					try:
+						obj = lst[i]
+					except IndexError:
+						break
 
-				if self.pointer == i:
-					clr.append('selected')
+					y = i + 1
+					clr = deque(base_clr)
 
-				descr = obj.get_description()
-				self.addstr(y, 0, descr, self.wid)
-				self.color_at(y, 0, self.wid, clr)
+					if self.pointer == i:
+						clr.append('selected')
 
-		else:
-			if self.hei > 1:
-				self.addstr(1, 0, "No task in the queue.")
-				self.color_at(1, 0, self.wid, base_clr, 'error')
+					descr = obj.get_description()
+					self.addstr(y, 0, descr, self.wid)
+					self.color_at(y, 0, self.wid, clr)
+
+			else:
+				if self.hei > 1:
+					self.addstr(1, 0, "No task in the queue.")
+					self.color_at(1, 0, self.wid, base_clr, 'error')
 
-		self.color_reset()
+			self.color_reset()
 
 	def task_remove(self, i=None):
 		if i is None:
@@ -85,4 +93,3 @@ class TaskView(Widget, Accumulator):
 	
 	def get_list(self):
 		return self.fm.loader.queue
-		return self.loader.queue
d'>cba63cf3 ^
ce9e6572 ^
8fa87054 ^


a66c4a26 ^

f027adc0 ^
08f08fb9 ^
d8084b41 ^
08f08fb9 ^
d8084b41 ^

08f08fb9 ^





cba63cf3 ^
3de15ddd ^

d8084b41 ^
24e68318 ^
d8084b41 ^

d36c43ff ^
d8084b41 ^

cba63cf3 ^
b4250dbc ^

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