예제 #1
0
 def createEditor(self, parent, option, index):
     m = index.model()
     col = m.column_map[index.column()]
     text = m.db.data[index.row()][m.custom_columns[col]['rec_index']]
     editor = CommentsDialog(parent, text, column_name=m.custom_columns[col]['name'])
     d = editor.exec_()
     if d:
         m.setData(index, (editor.textbox.html), Qt.EditRole)
     return None
예제 #2
0
 def set_comments(self):
     from calibre.gui2.dialogs.comments_dialog import CommentsDialog
     d = CommentsDialog(self, '' if self.comments is null else (self.comments or ''), _('Comments'))
     if d.exec_() == d.Accepted:
         self.comments = d.textbox.html
         b = self.comments_button
         b.setStyleSheet('QPushButton { font-weight: bold }')
         if unicode(b.text())[-1] != '*':
             b.setText(unicode(b.text()) + ' *')
예제 #3
0
파일: delegates.py 프로젝트: oheil/calibre
 def createEditor(self, parent, option, index):
     m = index.model()
     col = m.column_map[index.column()]
     text = m.db.data[index.row()][m.custom_columns[col]['rec_index']]
     editor = CommentsDialog(parent, text)
     d = editor.exec_()
     if d:
         m.setData(index, QVariant(editor.textbox.html), Qt.EditRole)
     return None
예제 #4
0
 def createEditor(self, parent, option, index):
     m = index.model()
     col = m.column_map[index.column()]
     if check_key_modifier(Qt.KeyboardModifier.ControlModifier):
         text = ''
     else:
         text = m.db.data[index.row()][m.custom_columns[col]['rec_index']]
     editor = CommentsDialog(parent, text, column_name=m.custom_columns[col]['name'])
     d = editor.exec_()
     if d:
         m.setData(index, (editor.textbox.html), Qt.ItemDataRole.EditRole)
     return None