Beispiel #1
0
    def __init__(self, mainwindow, settings, taskFile, viewerContainer):
        super(NewMenu, self).__init__(mainwindow)
        tasks = taskFile.tasks()
        self.appendUICommands(
            uicommand.TaskNew(taskList=tasks, settings=settings),
            uicommand.NewTaskWithSelectedTasksAsPrerequisites(taskList=tasks, 
                viewer=viewerContainer, settings=settings),
            uicommand.NewTaskWithSelectedTasksAsDependencies(taskList=tasks, 
                viewer=viewerContainer, settings=settings))
	self.appendMenu(_('New task from &template'),
            	TaskTemplateMenu(mainwindow, taskList=tasks, settings=settings),
            	'newtmpl')
        self.appendUICommands(None)
        if settings.getboolean('feature', 'effort'):
            self.appendUICommands(
                uicommand.EffortNew(viewer=viewerContainer, 
                                    effortList=taskFile.efforts(), 
                                    taskList=tasks, settings=settings))
        self.appendUICommands(
            uicommand.CategoryNew(categories=taskFile.categories(), 
                                  settings=settings))
        if settings.getboolean('feature', 'notes'):
            self.appendUICommands(
                uicommand.NoteNew(notes=taskFile.notes(), settings=settings))
        self.appendUICommands(
            None,
            uicommand.NewSubItem(viewer=viewerContainer))
Beispiel #2
0
 def __init__(self, taskBarIcon, settings, taskFile, viewer):
     super(TaskBarMenu, self).__init__(taskBarIcon)
     tasks = taskFile.tasks()
     efforts = taskFile.efforts()
     self.appendUICommands(
         uicommand.TaskNew(taskList=tasks, settings=settings))
     self.appendMenu(_('New task from &template'),
         TaskTemplateMenu(taskBarIcon, taskList=tasks, settings=settings),
         'newtmpl')
     self.appendUICommands(None)  # Separator
     if settings.getboolean('feature', 'effort'):
         self.appendUICommands(
             uicommand.EffortNew(effortList=efforts, taskList=tasks, 
                                 settings=settings))
     self.appendUICommands(
         uicommand.CategoryNew(categories=taskFile.categories(), 
                               settings=settings))
     if settings.getboolean('feature', 'notes'):
         self.appendUICommands(
             uicommand.NoteNew(notes=taskFile.notes(), settings=settings))
     if settings.getboolean('feature', 'effort'):
         self.appendUICommands(None)  # Separator
         label = _('&Start tracking effort')
         self.appendMenu(label,
             StartEffortForTaskMenu(taskBarIcon, 
                                    base.filter.DeletedFilter(tasks), 
                                    self, label), 'clock_icon')
         self.appendUICommands(uicommand.EffortStop(viewer=viewer,
                                                    effortList=efforts,
                                                    taskList=tasks))
     self.appendUICommands(
         None,
         uicommand.MainWindowRestore(),
         uicommand.FileQuit())
Beispiel #3
0
 def __init__(self, mainwindow, taskList, viewerContainer, settings):
     super(NewTaskMenu, self).__init__(mainwindow)
     self.appendUICommands(
         uicommand.TaskNew(taskList=taskList, settings=settings),
         uicommand.TaskNewSubTask(taskList=taskList,
                                  viewer=viewerContainer),
         uicommand.NewTaskWithSelectedTasksAsPrerequisites(
             taskList=taskList, viewer=viewerContainer, settings=settings),
         uicommand.NewTaskWithSelectedTasksAsDependencies(
             taskList=taskList, viewer=viewerContainer, settings=settings))
     self.appendMenu(
         _('New task from &template'),
         TaskTemplateMenu(mainwindow, taskList=taskList, settings=settings),
         'newtmpl')