mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
When editing custom comments from the spreadsheet, add the column name to the title bar
This commit is contained in:
parent
8b820767d0
commit
3db2d844cb
@ -9,7 +9,7 @@ from calibre.library.comments import comments_to_html
|
||||
|
||||
class CommentsDialog(QDialog, Ui_CommentsDialog):
|
||||
|
||||
def __init__(self, parent, text):
|
||||
def __init__(self, parent, text, column_name=None):
|
||||
QDialog.__init__(self, parent)
|
||||
Ui_CommentsDialog.__init__(self)
|
||||
self.setupUi(self)
|
||||
@ -24,3 +24,6 @@ class CommentsDialog(QDialog, Ui_CommentsDialog):
|
||||
self.buttonBox.button(QDialogButtonBox.Ok).setText(_('&OK'))
|
||||
self.buttonBox.button(QDialogButtonBox.Cancel).setText(_('&Cancel'))
|
||||
|
||||
if column_name:
|
||||
self.setWindowTitle(_('Edit "{0}"').format(column_name))
|
||||
|
||||
|
@ -398,7 +398,7 @@ class CcCommentsDelegate(QStyledItemDelegate): # {{{
|
||||
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)
|
||||
editor = CommentsDialog(parent, text, column_name=m.custom_columns[col]['name'])
|
||||
d = editor.exec_()
|
||||
if d:
|
||||
m.setData(index, QVariant(editor.textbox.html), Qt.EditRole)
|
||||
|
Loading…
x
Reference in New Issue
Block a user