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())
def __init__(self, mainwindow, tasks, efforts, settings, effortViewer): super(EffortPopupMenu, self).__init__(mainwindow) self.appendUICommands( uicommand.EditCut(viewer=effortViewer), uicommand.EditCopy(viewer=effortViewer), uicommand.EditPaste(), None, uicommand.Edit(viewer=effortViewer), uicommand.Delete(viewer=effortViewer), None, uicommand.EffortNew(viewer=effortViewer, effortList=efforts, taskList=tasks, settings=settings), uicommand.EffortStartForEffort(viewer=effortViewer, taskList=tasks), uicommand.EffortStop(viewer=effortViewer, effortList=efforts, taskList=tasks))
def __init__(self, mainwindow, settings, taskFile, viewerContainer): super(EffortMenu, self).__init__(mainwindow) tasks = taskFile.tasks() efforts = taskFile.efforts() self.appendUICommands( uicommand.EffortNew(viewer=viewerContainer, effortList=efforts, taskList=tasks, settings=settings), uicommand.EffortEdit(viewer=viewerContainer, effortList=efforts), uicommand.EffortDelete(viewer=viewerContainer, effortList=efforts), None, uicommand.EffortStart(viewer=viewerContainer, taskList=tasks), uicommand.EffortStop(taskList=tasks))
def getToolBarUICommands(self): ''' UI commands to put on the toolbar of this window. ''' uiCommands = [ uicommand.FileOpen(iocontroller=self.iocontroller), uicommand.FileSave(iocontroller=self.iocontroller), uicommand.Print(viewer=self.viewer, settings=self.settings), None, uicommand.EditUndo(), uicommand.EditRedo() ] if self.settings.getboolean('feature', 'effort'): uiCommands.extend([ None, uicommand.EffortStartButton(taskList=self.taskFile.tasks()), uicommand.EffortStop(taskList=self.taskFile.tasks()) ]) return uiCommands
def __init__(self, mainwindow, settings, tasks, efforts, categories, taskViewer): super(TaskPopupMenu, self).__init__(mainwindow) self.appendUICommands( uicommand.EditCut(viewer=taskViewer), uicommand.EditCopy(viewer=taskViewer), uicommand.EditPaste(), uicommand.EditPasteAsSubItem(viewer=taskViewer), None, uicommand.Edit(viewer=taskViewer), uicommand.Delete(viewer=taskViewer), None, uicommand.AddAttachment(viewer=taskViewer, settings=settings), uicommand.OpenAllAttachments(viewer=taskViewer, settings=settings), None) if settings.getboolean('feature', 'notes'): self.appendUICommands( uicommand.AddNote(viewer=taskViewer, settings=settings), uicommand.OpenAllNotes(viewer=taskViewer, settings=settings)) self.appendUICommands( None, uicommand.Mail(viewer=taskViewer), None) self.appendMenu(_('&Toggle category'), ToggleCategoryMenu(mainwindow, categories=categories, viewer=taskViewer), 'folder_blue_arrow_icon') self.appendUICommands( None, uicommand.TaskMarkInactive(settings=settings, viewer=taskViewer), uicommand.TaskMarkActive(settings=settings, viewer=taskViewer), uicommand.TaskMarkCompleted(settings=settings, viewer=taskViewer), None) self.appendMenu(_('&Priority'), TaskPriorityMenu(mainwindow, tasks, taskViewer), 'incpriority') if settings.getboolean('feature', 'effort'): self.appendUICommands( None, uicommand.EffortNew(viewer=taskViewer, effortList=efforts, taskList=tasks, settings=settings), uicommand.EffortStart(viewer=taskViewer, taskList=tasks), uicommand.EffortStop(viewer=taskViewer, effortList=efforts, taskList=tasks)) self.appendUICommands( None, uicommand.NewSubItem(viewer=taskViewer))
def __init__(self, mainwindow, settings, taskFile, viewerContainer): super(ActionMenu, self).__init__(mainwindow) tasks = taskFile.tasks() efforts = taskFile.efforts() categories = taskFile.categories() # Generic actions, applicable to all/most domain objects: self.appendUICommands( uicommand.AddAttachment(viewer=viewerContainer, settings=settings), uicommand.OpenAllAttachments(viewer=viewerContainer, settings=settings), None) if settings.getboolean('feature', 'notes'): self.appendUICommands( uicommand.AddNote(viewer=viewerContainer, settings=settings), uicommand.OpenAllNotes(viewer=viewerContainer, settings=settings), None) self.appendUICommands( uicommand.Mail(viewer=viewerContainer, settings=settings), None) self.appendMenu(_('&Toggle category'), ToggleCategoryMenu(mainwindow, categories=categories, viewer=viewerContainer), 'folder_blue_arrow_icon') # Start of task specific actions: self.appendUICommands( None, uicommand.TaskMarkInactive(settings=settings, viewer=viewerContainer), uicommand.TaskMarkActive(settings=settings, viewer=viewerContainer), uicommand.TaskMarkCompleted(settings=settings, viewer=viewerContainer), None) self.appendMenu(_('Change task &priority'), TaskPriorityMenu(mainwindow, tasks, viewerContainer), 'incpriority') if settings.getboolean('feature', 'effort'): self.appendUICommands( None, uicommand.EffortStart(viewer=viewerContainer, taskList=tasks), uicommand.EffortStop(viewer=viewerContainer, effortList=efforts, taskList=tasks), uicommand.EditTrackedTasks(taskList=tasks, settings=settings), uicommand.SikuliTests(settings=settings, viewer=viewerContainer))