def __createStatusSortKey(self):
     if self.__sortByTaskStatusFirst:
         if self.isAscending():
             return lambda task: [task.completed(), task.inactive()]
         else:
             return lambda task: [not task.completed(), not task.inactive()]
     else:
         return lambda task: []
Example #2
0
 def __createStatusSortKey(self):
     if self.__sortByTaskStatusFirst:
         if self._sortAscending:
             return lambda task: [task.completed(), task.inactive()]
         else:
             return lambda task: [not task.completed(), not task.inactive()]
     else:
         return lambda task: []
Example #3
0
 def onCompletionDate(self, event):
     task = event.source()
     if task.parent():
         self.__markParentCompletedOrUncompletedIfNecessary(task.parent(), 
             task)
     if task.completed():
         self.__markUncompletedChildrenCompleted(task)
         if task.isBeingTracked():
             task.stopTracking()
Example #4
0
 def filterTask(self, task): # pylint: disable-msg=W0621
     result = True
     if self.__hideCompletedTasks and task.completed():
         result = False
     elif self.__hideInactiveTasks and task.inactive():
         result = False
     elif self.__hideActiveTasks and task.active():
         result = False
     elif self.__hideCompositeTasks and not self.treeMode() and task.children():
         result = False
     elif task.dueDateTime(recursive=self.treeMode()) > self.__dueDateTimeFilter():
         result = False
     return result
Example #5
0
 def filterTask(self, task):  # pylint: disable-msg=W0621
     result = True
     if self.__hideCompletedTasks and task.completed():
         result = False
     elif self.__hideInactiveTasks and task.inactive():
         result = False
     elif self.__hideActiveTasks and task.active():
         result = False
     elif self.__hideCompositeTasks and not self.treeMode(
     ) and task.children():
         result = False
     elif task.dueDateTime(
             recursive=self.treeMode()) > self.__dueDateTimeFilter():
         result = False
     return result
Example #6
0
 def filterTask(self, task):
     result = True
     if self.__hideCompletedTasks and task.completed():
         result = False
     elif self.__hideInactiveTasks and task.inactive():
         result = False
     elif self.__hideOverdueTasks and task.overdue():
         result = False
     elif self.__hideActiveTasks and task.active():
         result = False
     elif self.__hideOverbudgetTasks and \
         task.budgetLeft(recursive=True) < date.TimeDelta():
         result = False
     elif self.__hideCompositeTasks and not self.treeMode() and task.children():
         result = False
     elif task.dueDate(recursive=self.treeMode()) > self.__dueDateFilter:
         result = False
     return result
Example #7
0
 def filterTask(self, task, hideCompletedTasks, hideInactiveTasks, 
                hideOverdueTasks, hideActiveTasks, hideOverBudgetTasks,
                viewTasksDueBeforeDate):
     result = True
     if hideCompletedTasks and task.completed():
         result = False
     elif hideInactiveTasks and task.inactive():
         result = False
     elif hideOverdueTasks and task.overdue():
         result = False
     elif hideActiveTasks and task.active():
         result = False
     elif hideOverBudgetTasks and \
         task.budgetLeft(recursive=True) < date.TimeDelta():
         result = False
     elif task.dueDate(recursive=self.treeMode()) > viewTasksDueBeforeDate:
         result = False        
     return result
Example #8
0
 def __markTaskUncompletedIfNecessary(self, task):
     if task.completed():
         task.setCompletionDate(date.Date())
Example #9
0
 def __markTaskCompletedIfNecessary(self, task, completionDate):
     if task.allChildrenCompleted() and not task.completed() and \
             self.__shouldMarkTaskCompletedWhenAllChildrenCompleted(task):
         task.setCompletionDate(completionDate)