mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Minor cleanups
This commit is contained in:
parent
5c4b41c39e
commit
b060a20f71
@ -7,6 +7,7 @@ from PyQt4.Qt import QDialog
|
||||
from calibre.gui2.dialogs.comments_dialog_ui import Ui_CommentsDialog
|
||||
|
||||
class CommentsDialog(QDialog, Ui_CommentsDialog):
|
||||
|
||||
def __init__(self, parent, text):
|
||||
QDialog.__init__(self, parent)
|
||||
Ui_CommentsDialog.__init__(self)
|
||||
|
@ -162,17 +162,16 @@ class TagsDelegate(QStyledItemDelegate):
|
||||
editor = TagsLineEdit(parent, self.db.all_tags())
|
||||
else:
|
||||
editor = TagsLineEdit(parent, sorted(list(self.db.all_custom(label=col))))
|
||||
return editor;
|
||||
return editor
|
||||
else:
|
||||
editor = EnLineEdit(parent)
|
||||
return editor
|
||||
|
||||
class CcTextDelegate(QStyledItemDelegate):
|
||||
def __init__(self, parent):
|
||||
'''
|
||||
Delegate for text/int/float data.
|
||||
'''
|
||||
QStyledItemDelegate.__init__(self, parent)
|
||||
|
||||
def createEditor(self, parent, option, index):
|
||||
m = index.model()
|
||||
col = m.column_map[index.column()]
|
||||
@ -191,12 +190,9 @@ class CcTextDelegate(QStyledItemDelegate):
|
||||
return editor
|
||||
|
||||
class CcCommentsDelegate(QStyledItemDelegate):
|
||||
def __init__(self, parent):
|
||||
'''
|
||||
Delegate for comments data.
|
||||
'''
|
||||
QStyledItemDelegate.__init__(self, parent)
|
||||
self.parent = parent
|
||||
|
||||
def createEditor(self, parent, option, index):
|
||||
m = index.model()
|
||||
@ -211,7 +207,7 @@ class CcCommentsDelegate(QStyledItemDelegate):
|
||||
return None
|
||||
|
||||
def setModelData(self, editor, model, index):
|
||||
model.setData(index, QVariant(editor.textbox.text()), Qt.EditRole)
|
||||
model.setData(index, QVariant(editor.textbox.toPlainText()), Qt.EditRole)
|
||||
|
||||
class CcBoolDelegate(QStyledItemDelegate):
|
||||
def __init__(self, parent):
|
||||
|
Loading…
x
Reference in New Issue
Block a user