eric6/Tasks/Task.py

changeset 7533
88261c96484b
parent 7360
9190402e4505
child 7663
b4d5234f92e7
equal deleted inserted replaced
7532:1358e9d67a1c 7533:88261c96484b
79 self.setData(2, Qt.DisplayRole, self.summary) 79 self.setData(2, Qt.DisplayRole, self.summary)
80 self.setData(3, Qt.DisplayRole, self.filename) 80 self.setData(3, Qt.DisplayRole, self.filename)
81 self.setData(4, Qt.DisplayRole, self.lineno or "") 81 self.setData(4, Qt.DisplayRole, self.lineno or "")
82 82
83 if self.completed: 83 if self.completed:
84 self.setIcon(0, UI.PixmapCache.getIcon("taskCompleted.png")) 84 self.setIcon(0, UI.PixmapCache.getIcon("taskCompleted"))
85 strikeOut = True 85 strikeOut = True
86 else: 86 else:
87 self.setIcon(0, UI.PixmapCache.getIcon("empty.png")) 87 self.setIcon(0, UI.PixmapCache.getIcon("empty"))
88 strikeOut = False 88 strikeOut = False
89 for column in range(2, 5): 89 for column in range(2, 5):
90 f = self.font(column) 90 f = self.font(column)
91 f.setStrikeOut(strikeOut) 91 f.setStrikeOut(strikeOut)
92 self.setFont(column, f) 92 self.setFont(column, f)
93 93
94 if self.priority == 1: 94 if self.priority == 1:
95 self.setIcon(1, UI.PixmapCache.getIcon("empty.png")) 95 self.setIcon(1, UI.PixmapCache.getIcon("empty"))
96 elif self.priority == 0: 96 elif self.priority == 0:
97 self.setIcon(1, UI.PixmapCache.getIcon("taskPrioHigh.png")) 97 self.setIcon(1, UI.PixmapCache.getIcon("taskPrioHigh"))
98 elif self.priority == 2: 98 elif self.priority == 2:
99 self.setIcon(1, UI.PixmapCache.getIcon("taskPrioLow.png")) 99 self.setIcon(1, UI.PixmapCache.getIcon("taskPrioLow"))
100 else: 100 else:
101 self.setIcon(1, UI.PixmapCache.getIcon("empty.png")) 101 self.setIcon(1, UI.PixmapCache.getIcon("empty"))
102 102
103 if self.taskType == Task.TypeFixme: 103 if self.taskType == Task.TypeFixme:
104 self.setIcon(2, UI.PixmapCache.getIcon("taskFixme.png")) 104 self.setIcon(2, UI.PixmapCache.getIcon("taskFixme"))
105 elif self.taskType == Task.TypeWarning: 105 elif self.taskType == Task.TypeWarning:
106 self.setIcon(2, UI.PixmapCache.getIcon("taskWarning.png")) 106 self.setIcon(2, UI.PixmapCache.getIcon("taskWarning"))
107 elif self.taskType == Task.TypeTodo: 107 elif self.taskType == Task.TypeTodo:
108 self.setIcon(2, UI.PixmapCache.getIcon("taskTodo.png")) 108 self.setIcon(2, UI.PixmapCache.getIcon("taskTodo"))
109 else: 109 else:
110 self.setIcon(2, UI.PixmapCache.getIcon("taskNote.png")) 110 self.setIcon(2, UI.PixmapCache.getIcon("taskNote"))
111 111
112 self.colorizeTask() 112 self.colorizeTask()
113 self.setTextAlignment(4, Qt.AlignRight) 113 self.setTextAlignment(4, Qt.AlignRight)
114 114
115 def colorizeTask(self): 115 def colorizeTask(self):
165 self.priority = priority 165 self.priority = priority
166 else: 166 else:
167 self.priority = 1 167 self.priority = 1
168 168
169 if self.priority == 1: 169 if self.priority == 1:
170 self.setIcon(1, UI.PixmapCache.getIcon("empty.png")) 170 self.setIcon(1, UI.PixmapCache.getIcon("empty"))
171 elif self.priority == 0: 171 elif self.priority == 0:
172 self.setIcon(1, UI.PixmapCache.getIcon("taskPrioHigh.png")) 172 self.setIcon(1, UI.PixmapCache.getIcon("taskPrioHigh"))
173 elif self.priority == 2: 173 elif self.priority == 2:
174 self.setIcon(1, UI.PixmapCache.getIcon("taskPrioLow.png")) 174 self.setIcon(1, UI.PixmapCache.getIcon("taskPrioLow"))
175 else: 175 else:
176 self.setIcon(1, UI.PixmapCache.getIcon("empty.png")) 176 self.setIcon(1, UI.PixmapCache.getIcon("empty"))
177 177
178 def setCompleted(self, completed): 178 def setCompleted(self, completed):
179 """ 179 """
180 Public slot to update the completed flag. 180 Public slot to update the completed flag.
181 181
182 @param completed flag indicating completion status (boolean) 182 @param completed flag indicating completion status (boolean)
183 """ 183 """
184 self.completed = completed 184 self.completed = completed
185 if self.completed: 185 if self.completed:
186 self.setIcon(0, UI.PixmapCache.getIcon("taskCompleted.png")) 186 self.setIcon(0, UI.PixmapCache.getIcon("taskCompleted"))
187 strikeOut = True 187 strikeOut = True
188 else: 188 else:
189 self.setIcon(0, UI.PixmapCache.getIcon("empty.png")) 189 self.setIcon(0, UI.PixmapCache.getIcon("empty"))
190 strikeOut = False 190 strikeOut = False
191 for column in range(2, 5): 191 for column in range(2, 5):
192 f = self.font(column) 192 f = self.font(column)
193 f.setStrikeOut(strikeOut) 193 f.setStrikeOut(strikeOut)
194 self.setFont(column, f) 194 self.setFont(column, f)

eric ide

mercurial