diff --git a/src/calibre/gui2/dialogs/comments_dialog.py b/src/calibre/gui2/dialogs/comments_dialog.py index 51b29fa989..2734a1bd21 100644 --- a/src/calibre/gui2/dialogs/comments_dialog.py +++ b/src/calibre/gui2/dialogs/comments_dialog.py @@ -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)) + diff --git a/src/calibre/gui2/library/delegates.py b/src/calibre/gui2/library/delegates.py index e14e79fb3e..6895f34667 100644 --- a/src/calibre/gui2/library/delegates.py +++ b/src/calibre/gui2/library/delegates.py @@ -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)