Exemplo n.º 1
0
 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))
Exemplo n.º 2
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),
         None,
         uicommand.Edit(viewer=categoryViewer),
         uicommand.Delete(viewer=categoryViewer),
         None,
         uicommand.AddAttachment(viewer=categoryViewer, settings=settings),
         uicommand.OpenAllAttachments(viewer=categoryViewer,
                                      settings=settings))
     if settings.getboolean('feature', 'notes'):
         self.appendUICommands(
             None,
             uicommand.AddNote(viewer=categoryViewer, settings=settings),
             uicommand.OpenAllNotes(viewer=categoryViewer, settings=settings))
     self.appendUICommands(
         None, 
         uicommand.Mail(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.NewSubItem(viewer=categoryViewer))
Exemplo n.º 3
0
 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))
Exemplo n.º 4
0
 def __init__(self, mainwindow, settings, categories, noteViewer):
     super(NotePopupMenu, self).__init__(mainwindow)
     self.appendUICommands(
         uicommand.EditCut(viewer=noteViewer),
         uicommand.EditCopy(viewer=noteViewer),
         uicommand.EditPaste(),
         uicommand.EditPasteAsSubItem(viewer=noteViewer),
         None,
         uicommand.Edit(viewer=noteViewer),
         uicommand.Delete(viewer=noteViewer),
         None,
         uicommand.AddAttachment(viewer=noteViewer, settings=settings),
         uicommand.OpenAllAttachments(viewer=noteViewer,
                                      settings=settings),
         None,
         uicommand.Mail(viewer=noteViewer),
         None)
     self.appendMenu(_('&Toggle category'),
                     ToggleCategoryMenu(mainwindow, categories=categories,
                                        viewer=noteViewer),
                     'folder_blue_arrow_icon')
     self.appendUICommands(
         None,
         uicommand.NewSubItem(viewer=noteViewer))