Ejemplo n.º 1
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())
Ejemplo n.º 2
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))
Ejemplo n.º 3
0
 def __init__(self,
              mainwindow,
              settings,
              taskFile,
              categoryViewer,
              localOnly=False):
     super(CategoryPopupMenu, self).__init__(mainwindow)
     categories = categoryViewer.presentation()
     tasks = taskFile.tasks()
     notes = taskFile.notes()
     self.appendUICommands(
         uicommand.EditCut(viewer=categoryViewer),
         uicommand.EditCopy(viewer=categoryViewer), uicommand.EditPaste(),
         uicommand.EditPasteAsSubItem(viewer=categoryViewer))
     if not localOnly:
         self.appendUICommands(
             None,
             uicommand.NewTaskWithSelectedCategories(taskList=tasks,
                                                     settings=settings,
                                                     categories=categories,
                                                     viewer=categoryViewer))
         if settings.getboolean('feature', 'notes'):
             self.appendUICommands(
                 uicommand.NewNoteWithSelectedCategories(
                     notes=notes,
                     settings=settings,
                     categories=categories,
                     viewer=categoryViewer))
     self.appendUICommands(
         None,
         uicommand.CategoryNew(categories=categories, settings=settings),
         uicommand.CategoryNewSubCategory(viewer=categoryViewer,
                                          categories=categories),
         uicommand.CategoryEdit(viewer=categoryViewer,
                                categories=categories),
         uicommand.CategoryDelete(viewer=categoryViewer,
                                  categories=categories), None,
         uicommand.AddCategoryAttachment(viewer=categoryViewer,
                                         settings=settings),
         uicommand.OpenAllCategoryAttachments(viewer=categoryViewer,
                                              settings=settings))
     if settings.getboolean('feature', 'notes'):
         self.appendUICommands(
             uicommand.CategoryAddNote(viewer=categoryViewer,
                                       settings=settings))
Ejemplo n.º 4
0
 def __init__(self, mainwindow, settings, categories, viewerContainer):
     super(CategoryMenu, self).__init__(mainwindow)
     self.appendUICommands(
         uicommand.CategoryNew(categories=categories, settings=settings),
         uicommand.CategoryNewSubCategory(viewer=viewerContainer,
                                          categories=categories),
         uicommand.CategoryEdit(viewer=viewerContainer,
                                categories=categories),
         uicommand.CategoryDelete(viewer=viewerContainer,
                                  categories=categories), None,
         uicommand.AddCategoryAttachment(viewer=viewerContainer,
                                         settings=settings),
         uicommand.OpenAllCategoryAttachments(viewer=viewerContainer,
                                              settings=settings))
     if settings.getboolean('feature', 'notes'):
         self.appendUICommands(
             uicommand.CategoryAddNote(viewer=viewerContainer,
                                       settings=settings))