def __init__(self, mainwindow, settings, iocontroller, viewerContainer): super(EditMenu, self).__init__(mainwindow) self.appendUICommands( uicommand.EditUndo(), uicommand.EditRedo(), None, uicommand.EditCut(viewer=viewerContainer, id=wx.ID_CUT), uicommand.EditCopy(viewer=viewerContainer, id=wx.ID_COPY), uicommand.EditPaste(), uicommand.EditPasteAsSubItem(viewer=viewerContainer), None, uicommand.Edit(viewer=viewerContainer, id=wx.ID_EDIT), uicommand.Delete(viewer=viewerContainer, id=wx.ID_DELETE), None) # Leave sufficient room for command names in the Undo and Redo menu # items: self.appendMenu(_('&Select') + ' ' * 50, SelectMenu(mainwindow, viewerContainer)) self.appendUICommands(None, uicommand.EditPreferences(settings)) if settings.getboolean('feature', 'syncml'): try: import taskcoachlib.syncml.core # pylint: disable=W0612,W0404 except ImportError: pass else: self.appendUICommands(uicommand.EditSyncPreferences(mainwindow=mainwindow, iocontroller=iocontroller))
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, 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, attachments, attachmentViewer): super(AttachmentPopupMenu, self).__init__(mainwindow) self.appendUICommands( uicommand.EditCut(viewer=attachmentViewer), uicommand.EditCopy(viewer=attachmentViewer), uicommand.EditPaste(), None, uicommand.Edit(viewer=attachmentViewer), uicommand.Delete(viewer=attachmentViewer), None, uicommand.AddNote(viewer=attachmentViewer, settings=settings), uicommand.OpenAllNotes(viewer=attachmentViewer, settings=settings), None, uicommand.AttachmentOpen(viewer=attachmentViewer, attachments=attachments, settings=settings))
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))
def __init__(self, mainwindow, settings, notes, 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.NoteNew(notes=notes, settings=settings), uicommand.NoteNewSubNote(viewer=noteViewer, notes=notes), uicommand.NoteEdit(viewer=noteViewer, notes=notes), uicommand.NoteDelete(viewer=noteViewer, notes=notes), None, uicommand.NoteMail(viewer=noteViewer), None, uicommand.AddNoteAttachment(viewer=noteViewer, settings=settings), uicommand.OpenAllNoteAttachments(viewer=noteViewer, settings=settings)) self.appendMenu( _('&Toggle category'), ToggleCategoryMenu(mainwindow, categories=categories, viewer=noteViewer), 'folder_blue_arrow_icon')
def __init__(self, mainwindow, settings, attachments, attachmentViewer): super(AttachmentPopupMenu, self).__init__(mainwindow) self.appendUICommands( uicommand.EditCut(viewer=attachmentViewer), uicommand.EditCopy(viewer=attachmentViewer), uicommand.EditPaste(), None, uicommand.AttachmentNew(attachments=attachments, settings=settings), uicommand.AttachmentEdit(viewer=attachmentViewer, attachments=attachments), uicommand.AttachmentDelete(viewer=attachmentViewer, attachments=attachments), uicommand.AttachmentOpen(viewer=attachmentViewer, attachments=attachments, settings=settings), ) if settings.getboolean('feature', 'notes'): self.appendUICommands( None, uicommand.AttachmentAddNote(viewer=attachmentViewer, settings=settings))