231 |
231 |
232 @param o flag indicating the project status |
232 @param o flag indicating the project status |
233 """ |
233 """ |
234 self.projectOpen = o |
234 self.projectOpen = o |
235 |
235 |
236 def addTask(self, description, priority=1, filename="", lineno=0, |
236 def addTask(self, summary, priority=1, filename="", lineno=0, |
237 completed=False, _time=0, isProjectTask=False, |
237 completed=False, _time=0, isProjectTask=False, |
238 taskType=Task.TypeTodo, longtext=""): |
238 taskType=Task.TypeTodo, description=""): |
239 """ |
239 """ |
240 Public slot to add a task. |
240 Public slot to add a task. |
241 |
241 |
242 @param description descriptive text of the task (string) |
242 @param summary summary text of the task (string) |
243 @param priority priority of the task (0=high, 1=normal, 2=low) |
243 @param priority priority of the task (0=high, 1=normal, 2=low) |
244 @param filename filename containing the task (string) |
244 @param filename filename containing the task (string) |
245 @param lineno line number containing the task (integer) |
245 @param lineno line number containing the task (integer) |
246 @param completed flag indicating completion status (boolean) |
246 @param completed flag indicating completion status (boolean) |
247 @param _time creation time of the task (float, if 0 use current time) |
247 @param _time creation time of the task (float, if 0 use current time) |
248 @param isProjectTask flag indicating a task related to the current |
248 @param isProjectTask flag indicating a task related to the current |
249 project (boolean) |
249 project (boolean) |
250 @param taskType type of the task (one of Task.TypeFixme, Task.TypeTodo, |
250 @param taskType type of the task (one of Task.TypeFixme, Task.TypeTodo, |
251 Task.TypeWarning, Task.TypeNote) |
251 Task.TypeWarning, Task.TypeNote) |
252 @param longtext explanatory text of the task (string) |
252 @param description explanatory text of the task (string) |
253 """ |
253 """ |
254 task = Task(description, priority, filename, lineno, completed, |
254 task = Task(summary, priority, filename, lineno, completed, |
255 _time, isProjectTask, taskType, |
255 _time, isProjectTask, taskType, |
256 self.project, longtext) |
256 self.project, description) |
257 self.tasks.append(task) |
257 self.tasks.append(task) |
258 if self.taskFilter.showTask(task): |
258 if self.taskFilter.showTask(task): |
259 self.addTopLevelItem(task) |
259 self.addTopLevelItem(task) |
260 self.__resort() |
260 self.__resort() |
261 self.__resizeColumns() |
261 self.__resizeColumns() |
262 |
262 |
263 if isProjectTask: |
263 if isProjectTask: |
264 self.__projectTasksSaveTimer.changeOccurred() |
264 self.__projectTasksSaveTimer.changeOccurred() |
265 |
265 |
266 def addFileTask(self, description, filename, lineno, taskType=Task.TypeTodo, |
266 def addFileTask(self, summary, filename, lineno, taskType=Task.TypeTodo, |
267 longtext=""): |
267 description=""): |
268 """ |
268 """ |
269 Public slot to add a file related task. |
269 Public slot to add a file related task. |
270 |
270 |
271 @param description descriptive text of the task (string) |
271 @param summary summary text of the task (string) |
272 @param filename filename containing the task (string) |
272 @param filename filename containing the task (string) |
273 @param lineno line number containing the task (integer) |
273 @param lineno line number containing the task (integer) |
274 @param taskType type of the task (one of Task.TypeFixme, Task.TypeTodo, |
274 @param taskType type of the task (one of Task.TypeFixme, Task.TypeTodo, |
275 Task.TypeWarning, Task.TypeNote) |
275 Task.TypeWarning, Task.TypeNote) |
276 @param longtext explanatory text of the task (string) |
276 @param description explanatory text of the task (string) |
277 """ |
277 """ |
278 self.addTask(description, filename=filename, lineno=lineno, |
278 self.addTask(summary, filename=filename, lineno=lineno, |
279 isProjectTask=( |
279 isProjectTask=( |
280 self.project and self.project.isProjectSource(filename)), |
280 self.project and self.project.isProjectSource(filename)), |
281 taskType=taskType, longtext=longtext) |
281 taskType=taskType, description=description) |
282 |
282 |
283 def getProjectTasks(self): |
283 def getProjectTasks(self): |
284 """ |
284 """ |
285 Public method to retrieve all project related tasks. |
285 Public method to retrieve all project related tasks. |
286 |
286 |
356 ro = task.getFilename() != "" |
356 ro = task.getFilename() != "" |
357 if ro: |
357 if ro: |
358 dlg.setReadOnly() |
358 dlg.setReadOnly() |
359 if dlg.exec_() == QDialog.Accepted and not ro: |
359 if dlg.exec_() == QDialog.Accepted and not ro: |
360 data = dlg.getData() |
360 data = dlg.getData() |
361 task.setDescription(data[0]) |
361 task.setSummary(data[0]) |
362 task.setPriority(data[1]) |
362 task.setPriority(data[1]) |
363 task.setCompleted(data[2]) |
363 task.setCompleted(data[2]) |
364 task.setProjectTask(data[3]) |
364 task.setProjectTask(data[3]) |
365 task.setLongText(data[4]) |
365 task.setDescription(data[4]) |
366 self.__projectTasksSaveTimer.changeOccurred() |
366 self.__projectTasksSaveTimer.changeOccurred() |
367 |
367 |
368 def __newTask(self): |
368 def __newTask(self): |
369 """ |
369 """ |
370 Private slot to handle the "New Task" context menu entry. |
370 Private slot to handle the "New Task" context menu entry. |
371 """ |
371 """ |
372 dlg = TaskPropertiesDialog(None, self, self.projectOpen) |
372 dlg = TaskPropertiesDialog(None, self, self.projectOpen) |
373 if dlg.exec_() == QDialog.Accepted: |
373 if dlg.exec_() == QDialog.Accepted: |
374 data = dlg.getData() |
374 data = dlg.getData() |
375 self.addTask(data[0], data[1], completed=data[2], isProjectTask=data[3], |
375 self.addTask(data[0], data[1], completed=data[2], isProjectTask=data[3], |
376 longtext=data[4]) |
376 description=data[4]) |
377 |
377 |
378 def __markCompleted(self): |
378 def __markCompleted(self): |
379 """ |
379 """ |
380 Private slot to handle the "Mark Completed" context menu entry. |
380 Private slot to handle the "Mark Completed" context menu entry. |
381 """ |
381 """ |