605 Public slot to clear all tasks from display. |
605 Public slot to clear all tasks from display. |
606 """ |
606 """ |
607 self.tasks = [] |
607 self.tasks = [] |
608 self.clear() |
608 self.clear() |
609 |
609 |
610 def clearProjectTasks(self): |
610 def clearProjectTasks(self, fileOnly=False): |
611 """ |
611 """ |
612 Public slot to clear project related tasks. |
612 Public slot to clear project related tasks. |
|
613 |
|
614 @keyparam fileOnly flag indicating to clear only file related |
|
615 project tasks (boolean) |
613 """ |
616 """ |
614 for task in self.tasks[:]: |
617 for task in self.tasks[:]: |
615 if task.isProjectTask(): |
618 if (fileOnly and task.isProjectFileTask()) or \ |
|
619 (not fileOnly and task.isProjectTask()): |
616 if self.copyTask == task: |
620 if self.copyTask == task: |
617 self.copyTask = None |
621 self.copyTask = None |
618 index = self.indexOfTopLevelItem(task) |
622 index = self.indexOfTopLevelItem(task) |
619 self.takeTopLevelItem(index) |
623 self.takeTopLevelItem(index) |
620 self.tasks.remove(task) |
624 self.tasks.remove(task) |
802 if filterList: |
806 if filterList: |
803 for filter in filterList: |
807 for filter in filterList: |
804 files = [f for f in files if not fnmatch.fnmatch(f, filter)] |
808 files = [f for f in files if not fnmatch.fnmatch(f, filter)] |
805 |
809 |
806 # remove all project tasks |
810 # remove all project tasks |
807 self.clearProjectTasks() |
811 self.clearProjectTasks(fileOnly=True) |
808 |
812 |
809 # now process them |
813 # now process them |
810 progress = QProgressDialog(self.trUtf8("Extracting project tasks..."), |
814 progress = QProgressDialog(self.trUtf8("Extracting project tasks..."), |
811 self.trUtf8("Abort"), 0, len(files)) |
815 self.trUtf8("Abort"), 0, len(files)) |
812 progress.setMinimumDuration(0) |
816 progress.setMinimumDuration(0) |