mirror of
https://github.com/kovidgoyal/calibre.git
synced 2026-04-24 17:59:53 -04:00
Merge branch 'fix-button-author' of https://github.com/un-pogaz/calibre
This commit is contained in:
commit
2184a9cfbc
@ -74,8 +74,9 @@ You can also use a number between 0.0 and 1.0 to pick a fixed size.
|
||||
Note that this setting is per-library, which means that you have to set it again for every
|
||||
different calibre library you use.</p>''').format('{size}', '{random}', '{pages}'))
|
||||
|
||||
self.template_title_button.clicked.connect(partial(self.edit_template_button, self.opt_bookshelf_title_template))
|
||||
self.template_pages_button.clicked.connect(partial(self.edit_template_button, self.opt_bookshelf_spine_size_template))
|
||||
self.template_title_button.clicked.connect(partial(self.edit_template_button, self.opt_bookshelf_title_template, _('Edit template for title')))
|
||||
self.template_author_button.clicked.connect(partial(self.edit_template_button, self.opt_bookshelf_author_template, _('Edit template for author')))
|
||||
self.template_pages_button.clicked.connect(partial(self.edit_template_button, self.opt_bookshelf_spine_size_template, _('Edit template for book size')))
|
||||
self.use_pages_button.clicked.connect(self.use_pages)
|
||||
self.recount_button.clicked.connect(self.recount_pages)
|
||||
|
||||
@ -92,7 +93,7 @@ different calibre library you use.</p>''').format('{size}', '{random}', '{pages}
|
||||
self.gui.library_view.model().zero_page_cache.clear()
|
||||
self.gui.bookshelf_view.invalidate()
|
||||
|
||||
def edit_template_button(self, line_edit):
|
||||
def edit_template_button(self, line_edit, title):
|
||||
rows = self.gui.library_view.selectionModel().selectedRows()
|
||||
mi = None
|
||||
db = self.gui.current_db.new_api
|
||||
@ -102,7 +103,7 @@ different calibre library you use.</p>''').format('{size}', '{random}', '{pages}
|
||||
for bk in ids[0:min(10, len(ids))]:
|
||||
mi.append(db.get_proxy_metadata(bk))
|
||||
t = TemplateDialog(self, line_edit.text(), mi=mi, fm=db.field_metadata)
|
||||
t.setWindowTitle(_('Edit template for caption') if line_edit is self.opt_bookshelf_title_template else _('Edit template for book size'))
|
||||
t.setWindowTitle(title)
|
||||
if t.exec():
|
||||
line_edit.setText(t.rule[1])
|
||||
|
||||
|
||||
@ -119,7 +119,7 @@
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Template for spine a&uthor::</string>
|
||||
<string>Template for spine a&uthor:</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>opt_bookshelf_author_template</cstring>
|
||||
@ -136,7 +136,7 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="template_title_button_2">
|
||||
<widget class="QPushButton" name="template_author_button">
|
||||
<property name="text">
|
||||
<string>Template &editor</string>
|
||||
</property>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user