From e9351ae870a96e8a26d10d53ebae682b114c7f76 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 23 Sep 2020 10:11:00 +0530 Subject: [PATCH] Fix #1896559 [feature request: edit book name of TOC blank](https://bugs.launchpad.net/calibre/+bug/1896559) --- src/calibre/gui2/toc/location.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/calibre/gui2/toc/location.py b/src/calibre/gui2/toc/location.py index 0fec94b75b..cde6e36c27 100644 --- a/src/calibre/gui2/toc/location.py +++ b/src/calibre/gui2/toc/location.py @@ -163,6 +163,7 @@ class ItemEdit(QWidget): f.la2 = la = QLabel(''+_('&Name of the ToC entry:')) l.addWidget(la) self.name = QLineEdit(self) + self.name.setPlaceholderText(_('(Untitled)')) la.setBuddy(self.name) l.addWidget(self.name) @@ -252,7 +253,7 @@ class ItemEdit(QWidget): self.current_item, self.current_where = item, where self.current_name = None self.current_frag = None - self.name.setText(_('(Untitled)')) + self.name.setText('') dest_index, frag = 0, None if item is not None: if where is None: @@ -298,4 +299,4 @@ class ItemEdit(QWidget): @property def result(self): return (self.current_item, self.current_where, self.current_name, - self.current_frag, unicode_type(self.name.text())) + self.current_frag, self.name.text().strip() or _('(Untitled)'))