mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-08-11 09:13:57 -04:00
Fix #1896559 [feature request: edit book name of TOC blank](https://bugs.launchpad.net/calibre/+bug/1896559)
This commit is contained in:
parent
754ebf854b
commit
e9351ae870
@ -163,6 +163,7 @@ class ItemEdit(QWidget):
|
|||||||
f.la2 = la = QLabel('<b>'+_('&Name of the ToC entry:'))
|
f.la2 = la = QLabel('<b>'+_('&Name of the ToC entry:'))
|
||||||
l.addWidget(la)
|
l.addWidget(la)
|
||||||
self.name = QLineEdit(self)
|
self.name = QLineEdit(self)
|
||||||
|
self.name.setPlaceholderText(_('(Untitled)'))
|
||||||
la.setBuddy(self.name)
|
la.setBuddy(self.name)
|
||||||
l.addWidget(self.name)
|
l.addWidget(self.name)
|
||||||
|
|
||||||
@ -252,7 +253,7 @@ class ItemEdit(QWidget):
|
|||||||
self.current_item, self.current_where = item, where
|
self.current_item, self.current_where = item, where
|
||||||
self.current_name = None
|
self.current_name = None
|
||||||
self.current_frag = None
|
self.current_frag = None
|
||||||
self.name.setText(_('(Untitled)'))
|
self.name.setText('')
|
||||||
dest_index, frag = 0, None
|
dest_index, frag = 0, None
|
||||||
if item is not None:
|
if item is not None:
|
||||||
if where is None:
|
if where is None:
|
||||||
@ -298,4 +299,4 @@ class ItemEdit(QWidget):
|
|||||||
@property
|
@property
|
||||||
def result(self):
|
def result(self):
|
||||||
return (self.current_item, self.current_where, self.current_name,
|
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)'))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user