mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 10:44:09 -04:00
Bulk conversion: Add option to disable using per-book settings from a previous conversion
This commit is contained in:
parent
1d107a2714
commit
15dc2da704
@ -31,6 +31,13 @@ class BulkConfig(Config):
|
||||
|
||||
self.input_label.hide()
|
||||
self.input_formats.hide()
|
||||
self.opt_individual_saved_settings.setVisible(True)
|
||||
self.opt_individual_saved_settings.setChecked(True)
|
||||
self.opt_individual_saved_settings.setToolTip(_('For '
|
||||
'settings that cannot be specified in this dialog, use the '
|
||||
'values saved in a previous conversion (if they exist) instead '
|
||||
'of using the defaults specified in the Preferences'))
|
||||
|
||||
|
||||
self.connect(self.output_formats, SIGNAL('currentIndexChanged(QString)'),
|
||||
self.setup_pipeline)
|
||||
|
@ -116,6 +116,7 @@ class Config(ResizableDialog, Ui_Dialog):
|
||||
def __init__(self, parent, db, book_id,
|
||||
preferred_input_format=None, preferred_output_format=None):
|
||||
ResizableDialog.__init__(self, parent)
|
||||
self.opt_individual_saved_settings.setVisible(False)
|
||||
self.db, self.book_id = db, book_id
|
||||
|
||||
self.setup_input_output_formats(self.db, self.book_id, preferred_input_format,
|
||||
|
@ -33,6 +33,13 @@
|
||||
<item>
|
||||
<widget class="QComboBox" name="input_formats"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="opt_individual_saved_settings">
|
||||
<property name="text">
|
||||
<string>Use &saved conversion settings for individual books</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
@ -109,7 +116,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>810</width>
|
||||
<height>492</height>
|
||||
<height>489</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
|
@ -111,17 +111,21 @@ def convert_bulk_ebook(parent, queue, db, book_ids, out_format=None, args=[]):
|
||||
user_recs = cPickle.loads(d.recommendations)
|
||||
|
||||
book_ids = convert_existing(parent, db, book_ids, output_format)
|
||||
return QueueBulk(parent, book_ids, output_format, queue, db, user_recs, args)
|
||||
use_saved_single_settings = d.opt_individual_saved_settings.isChecked()
|
||||
return QueueBulk(parent, book_ids, output_format, queue, db, user_recs,
|
||||
args, use_saved_single_settings=use_saved_single_settings)
|
||||
|
||||
class QueueBulk(QProgressDialog):
|
||||
|
||||
def __init__(self, parent, book_ids, output_format, queue, db, user_recs, args):
|
||||
def __init__(self, parent, book_ids, output_format, queue, db, user_recs,
|
||||
args, use_saved_single_settings=True):
|
||||
QProgressDialog.__init__(self, '',
|
||||
QString(), 0, len(book_ids), parent)
|
||||
self.setWindowTitle(_('Queueing books for bulk conversion'))
|
||||
self.book_ids, self.output_format, self.queue, self.db, self.args, self.user_recs = \
|
||||
book_ids, output_format, queue, db, args, user_recs
|
||||
self.parent = parent
|
||||
self.use_saved_single_settings = use_saved_single_settings
|
||||
self.i, self.bad, self.jobs, self.changed = 0, [], [], False
|
||||
self.timer = QTimer(self)
|
||||
self.connect(self.timer, SIGNAL('timeout()'), self.do_book)
|
||||
@ -149,11 +153,12 @@ class QueueBulk(QProgressDialog):
|
||||
|
||||
combined_recs = GuiRecommendations()
|
||||
default_recs = load_defaults('%s_input' % input_format)
|
||||
specific_recs = load_specifics(self.db, book_id)
|
||||
for key in default_recs:
|
||||
combined_recs[key] = default_recs[key]
|
||||
for key in specific_recs:
|
||||
combined_recs[key] = specific_recs[key]
|
||||
if self.use_saved_single_settings:
|
||||
specific_recs = load_specifics(self.db, book_id)
|
||||
for key in specific_recs:
|
||||
combined_recs[key] = specific_recs[key]
|
||||
for item in self.user_recs:
|
||||
combined_recs[item[0]] = item[1]
|
||||
save_specifics(self.db, book_id, combined_recs)
|
||||
|
@ -421,7 +421,7 @@ button in the individual book conversion dialog.
|
||||
When you Bulk Convert a set of books, settings are taken in the following order:
|
||||
|
||||
* From the defaults set in Preferences->Conversion
|
||||
* From the saved conversion settings for each book being converted (if any)
|
||||
* From the saved conversion settings for each book being converted (if any). This can be turned off by the option in the top left corner of the Bulk Conversion dialog.
|
||||
* From the settings set in the Bulk conversion dialog
|
||||
|
||||
Note that the final settings for each book in a Bulk Conversion will be saved and re-used if the book is converted again. Since the
|
||||
|
Loading…
x
Reference in New Issue
Block a user