298 Public slot to clear all tasks from display. |
298 Public slot to clear all tasks from display. |
299 """ |
299 """ |
300 self.tasks = [] |
300 self.tasks = [] |
301 self.clear() |
301 self.clear() |
302 |
302 |
303 def clearProjectTasks(self): |
303 def clearProjectTasks(self, fileOnly=False): |
304 """ |
304 """ |
305 Public slot to clear project related tasks. |
305 Public slot to clear project related tasks. |
|
306 |
|
307 @keyparam fileOnly flag indicating to clear only file related |
|
308 project tasks (boolean) |
306 """ |
309 """ |
307 for task in self.tasks[:]: |
310 for task in self.tasks[:]: |
308 if task.isProjectTask(): |
311 if (fileOnly and task.isProjectFileTask()) or \ |
|
312 (not fileOnly and task.isProjectTask()): |
309 if self.copyTask == task: |
313 if self.copyTask == task: |
310 self.copyTask = None |
314 self.copyTask = None |
311 index = self.indexOfTopLevelItem(task) |
315 index = self.indexOfTopLevelItem(task) |
312 self.takeTopLevelItem(index) |
316 self.takeTopLevelItem(index) |
313 self.tasks.remove(task) |
317 self.tasks.remove(task) |
506 if filterList: |
510 if filterList: |
507 for filter in filterList: |
511 for filter in filterList: |
508 files = [f for f in files if not fnmatch.fnmatch(f, filter)] |
512 files = [f for f in files if not fnmatch.fnmatch(f, filter)] |
509 |
513 |
510 # remove all project tasks |
514 # remove all project tasks |
511 self.clearProjectTasks() |
515 self.clearProjectTasks(fileOnly=True) |
512 |
516 |
513 # now process them |
517 # now process them |
514 progress = QProgressDialog(self.trUtf8("Extracting project tasks..."), |
518 progress = QProgressDialog(self.trUtf8("Extracting project tasks..."), |
515 self.trUtf8("Abort"), 0, len(files)) |
519 self.trUtf8("Abort"), 0, len(files)) |
516 progress.setMinimumDuration(0) |
520 progress.setMinimumDuration(0) |