Esempio n. 1
0
 def newItemDialog(self, *args, **kwargs):
     selectedTasks = kwargs.get('selectedTasks', [])
     if not selectedTasks:
         subjectDecoratedTaskList = [(render.subject(task, 
             recursively=True), task) for task in self.taskList]
         subjectDecoratedTaskList.sort() # Sort by subject
         selectedTasks = [subjectDecoratedTaskList[0][1]]
     return dialog.editor.EffortEditor(wx.GetTopLevelParent(self), 
         command.NewEffortCommand(self.list, selectedTasks),
         self.uiCommands, self.list, self.taskList, bitmap=kwargs['bitmap'])
Esempio n. 2
0
 def _createColumns(self):
     return [widgets.Column(columnHeader, eventType, 
             renderCallback=renderCallback) \
         for columnHeader, eventType, renderCallback in \
         (_('Period'), 'effort.duration', self.renderPeriod),
         (_('Task'), 'effort.task', lambda effort: render.subject(effort.task(), recursively=True))] + \
         [widgets.Column(columnHeader, eventType, 
          visibilitySetting=('view', setting), 
          renderCallback=renderCallback, alignment=wx.LIST_FORMAT_RIGHT) \
         for columnHeader, eventType, setting, renderCallback in \
         (_('Time spent'), 'effort.duration', 'efforttimespent', 
             lambda effort: render.timeSpent(effort.duration())),
         (_('Revenue'), 'effort.duration', 'effortrevenue', 
             lambda effort: render.amount(effort.revenue()))]
Esempio n. 3
0
 def renderSubject(self, task):
     return render.subject(task, recursively=False)