def getItemTooltipData(self, index, column=0): if self.settings.getboolean('view', 'descriptionpopups'): note = self.getItemWithIndex(index) if note.description(): result = [(None, map(lambda x: x.rstrip('\r'), note.description().split('\n')))] else: result = [] result.append(('attachment', [unicode(attachment) for attachment in note.attachments()])) return result else: return []
def _createColumns(self): columns = [widgets.Column(name, columnHeader, width=self.getColumnWidth(name), resizeCallback=self.onResizeColumn, renderCallback=renderCallback, sortCallback=uicommand.ViewerSortByCommand(viewer=self, value=name.lower(), menuText=sortMenuText, helpText=sortHelpText), imageIndexCallback=imageIndexCallback, *eventTypes) \ for name, columnHeader, sortMenuText, sortHelpText, eventTypes, renderCallback, imageIndexCallback in \ ('subject', _('Subject'), _('&Subject'), _('Sort notes by subject'), (note.Note.subjectChangedEventType(),), lambda note: note.subject(recursive=False), self.subjectImageIndex), ('description', _('Description'), _('&Description'), _('Sort notes by description'), (note.Note.descriptionChangedEventType(),), lambda note: note.description(), lambda *args: -1), ('categories', _('Categories'), _('&Categories'), _('Sort notes by categories'), (note.Note.categoryAddedEventType(), note.Note.categoryRemovedEventType(), note.Note.categorySubjectChangedEventType(), note.Note.expansionChangedEventType()), self.renderCategories, lambda *args: -1)] attachmentsColumn = widgets.Column('attachments', '', note.Note.attachmentsChangedEventType(), # pylint: disable-msg=E1101 width=self.getColumnWidth('attachments'), alignment=wx.LIST_FORMAT_LEFT, imageIndexCallback=self.attachmentImageIndex, headerImageIndex=self.imageIndex['paperclip_icon'], renderCallback=lambda note: '') columns.insert(2, attachmentsColumn) return columns
def _createColumns(self): subjectColumn = widgets.Column('subject', _('Subject'), width=self.getColumnWidth('subject'), resizeCallback=self.onResizeColumn, renderCallback=lambda note: note.subject(), sortCallback=uicommand.ViewerSortByCommand(viewer=self, value='subject', menuText=_('&Subject'), helpText=_('Sort notes by subject')), imageIndicesCallback=self.subjectImageIndices, editCallback=self.onEditSubject, editControl=inplace_editor.SubjectCtrl) descriptionColumn = widgets.Column('description', _('Description'), note.Note.descriptionChangedEventType(), width=self.getColumnWidth('description'), resizeCallback=self.onResizeColumn, renderCallback=lambda note: note.description(), sortCallback=uicommand.ViewerSortByCommand(viewer=self, value='description', menuText=_('&Description'), helpText=_('Sort notes by description')), editCallback=self.onEditDescription, editControl=inplace_editor.DescriptionCtrl) attachmentsColumn = widgets.Column('attachments', '', note.Note.attachmentsChangedEventType(), # pylint: disable=E1101 width=self.getColumnWidth('attachments'), alignment=wx.LIST_FORMAT_LEFT, imageIndicesCallback=self.attachmentImageIndices, # pylint: disable=E1101 headerImageIndex=self.imageIndex['paperclip_icon'], renderCallback=lambda note: '') categoriesColumn = widgets.Column('categories', _('Categories'), note.Note.categoryAddedEventType(), note.Note.categoryRemovedEventType(), note.Note.categorySubjectChangedEventType(), note.Note.expansionChangedEventType(), width=self.getColumnWidth('categories'), resizeCallback=self.onResizeColumn, renderCallback=self.renderCategories, sortCallback=uicommand.ViewerSortByCommand(viewer=self, value='categories', menuText=_('&Categories'), helpText=_('Sort notes by categories'))) creationDateTimeColumn = widgets.Column('creationDateTime', _('Creation date'), width=self.getColumnWidth('creationDateTime'), resizeCallback=self.onResizeColumn, renderCallback=self.renderCreationDateTime, sortCallback=uicommand.ViewerSortByCommand(viewer=self, value='creationDateTime', menuText=_('&Creation date'), helpText=_('Sort notes by creation date'))) modificationDateTimeColumn = widgets.Column('modificationDateTime', _('Modification date'), width=self.getColumnWidth('modificationDateTime'), resizeCallback=self.onResizeColumn, renderCallback=self.renderModificationDateTime, sortCallback=uicommand.ViewerSortByCommand(viewer=self, value='modificationDateTime', menuText=_('&Modification date'), helpText=_('Sort notes by last modification date')), *note.Note.modificationEventTypes()) return [subjectColumn, descriptionColumn, attachmentsColumn, categoriesColumn, creationDateTimeColumn, modificationDateTimeColumn]
def _createColumns(self): columns = [widgets.Column(name, columnHeader, width=self.getColumnWidth(name), resizeCallback=self.onResizeColumn, renderCallback=renderCallback, sortCallback=uicommand.ViewerSortByCommand(viewer=self, value=name.lower(), menuText=sortMenuText, helpText=sortHelpText), imageIndexCallback=imageIndexCallback, *eventTypes) \ for name, columnHeader, sortMenuText, sortHelpText, eventTypes, renderCallback, imageIndexCallback in \ ('subject', _('Subject'), _('&Subject'), _('Sort notes by subject'), (note.Note.subjectChangedEventType(),), lambda note: note.subject(recursive=False), self.subjectImageIndex), ('description', _('Description'), _('&Description'), _('Sort notes by description'), (note.Note.descriptionChangedEventType(),), lambda note: note.description(), lambda *args: -1), ('categories', _('Categories'), _('&Categories'), _('Sort notes by categories'), (note.Note.categoryAddedEventType(), note.Note.categoryRemovedEventType(), note.Note.categorySubjectChangedEventType(), note.Note.expansionChangedEventType()), self.renderCategories, lambda *args: -1)] attachmentsColumn = widgets.Column( 'attachments', '', note.Note.attachmentsChangedEventType( ), # pylint: disable-msg=E1101 width=self.getColumnWidth('attachments'), alignment=wx.LIST_FORMAT_LEFT, imageIndexCallback=self.attachmentImageIndex, headerImageIndex=self.imageIndex['paperclip_icon'], renderCallback=lambda note: '') columns.insert(2, attachmentsColumn) return columns