mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Catalogs: Add an option to not add the generated catalog to the library. Fixes #1481529 [[Enhancement] Don't Save Catalogue in Library Option](https://bugs.launchpad.net/calibre/+bug/1481529)
This commit is contained in:
parent
1f15db67f2
commit
a2120265e0
@ -78,6 +78,7 @@ class GenerateCatalogAction(InterfaceAction):
|
|||||||
|
|
||||||
if job.failed:
|
if job.failed:
|
||||||
return self.gui.job_exception(job)
|
return self.gui.job_exception(job)
|
||||||
|
if dynamic.get('catalog_add_to_library', True):
|
||||||
id = self.gui.library_view.model().add_catalog(job.catalog_file_path, job.catalog_title)
|
id = self.gui.library_view.model().add_catalog(job.catalog_file_path, job.catalog_title)
|
||||||
self.gui.library_view.model().beginResetModel(), self.gui.library_view.model().endResetModel()
|
self.gui.library_view.model().beginResetModel(), self.gui.library_view.model().endResetModel()
|
||||||
if job.catalog_sync:
|
if job.catalog_sync:
|
||||||
@ -86,7 +87,7 @@ class GenerateCatalogAction(InterfaceAction):
|
|||||||
dynamic.set('catalogs_to_be_synced', sync)
|
dynamic.set('catalogs_to_be_synced', sync)
|
||||||
self.gui.status_bar.show_message(_('Catalog generated.'), 3000)
|
self.gui.status_bar.show_message(_('Catalog generated.'), 3000)
|
||||||
self.gui.sync_catalogs()
|
self.gui.sync_catalogs()
|
||||||
if job.fmt not in {'EPUB','MOBI', 'AZW3'}:
|
if not dynamic.get('catalog_add_to_library', True) or job.fmt not in {'EPUB','MOBI', 'AZW3'}:
|
||||||
export_dir = choose_dir(self.gui, _('Export Catalog Directory'),
|
export_dir = choose_dir(self.gui, _('Export Catalog Directory'),
|
||||||
_('Select destination for %(title)s.%(fmt)s') % dict(
|
_('Select destination for %(title)s.%(fmt)s') % dict(
|
||||||
title=job.catalog_title, fmt=job.fmt.lower()))
|
title=job.catalog_title, fmt=job.fmt.lower()))
|
||||||
@ -104,4 +105,3 @@ class GenerateCatalogAction(InterfaceAction):
|
|||||||
show=True)
|
show=True)
|
||||||
return
|
return
|
||||||
raise
|
raise
|
||||||
|
|
||||||
|
@ -114,6 +114,7 @@ class Catalog(ResizableDialog, Ui_Dialog):
|
|||||||
|
|
||||||
if self.sync.isEnabled():
|
if self.sync.isEnabled():
|
||||||
self.sync.setChecked(dynamic.get('catalog_sync_to_device', True))
|
self.sync.setChecked(dynamic.get('catalog_sync_to_device', True))
|
||||||
|
self.add_to_library.setChecked(dynamic.get('catalog_add_to_library', True))
|
||||||
|
|
||||||
self.format.currentIndexChanged.connect(self.show_plugin_tab)
|
self.format.currentIndexChanged.connect(self.show_plugin_tab)
|
||||||
self.buttonBox.button(self.buttonBox.Apply).clicked.connect(self.apply)
|
self.buttonBox.button(self.buttonBox.Apply).clicked.connect(self.apply)
|
||||||
@ -169,6 +170,7 @@ class Catalog(ResizableDialog, Ui_Dialog):
|
|||||||
self.catalog_sync = bool(self.sync.isChecked())
|
self.catalog_sync = bool(self.sync.isChecked())
|
||||||
dynamic.set('catalog_sync_to_device', self.catalog_sync)
|
dynamic.set('catalog_sync_to_device', self.catalog_sync)
|
||||||
dynamic.set('catalog_window_geom', bytearray(self.saveGeometry()))
|
dynamic.set('catalog_window_geom', bytearray(self.saveGeometry()))
|
||||||
|
dynamic.set('catalog_add_to_library', self.add_to_library.isChecked())
|
||||||
|
|
||||||
def apply(self, *args):
|
def apply(self, *args):
|
||||||
# Store current values without building catalog
|
# Store current values without building catalog
|
||||||
|
@ -96,7 +96,7 @@
|
|||||||
<item row="0" column="0">
|
<item row="0" column="0">
|
||||||
<widget class="QLabel" name="label">
|
<widget class="QLabel" name="label">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Catalog &format:</string>
|
<string>Catalo&g format:</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="buddy">
|
<property name="buddy">
|
||||||
<cstring>format</cstring>
|
<cstring>format</cstring>
|
||||||
@ -122,7 +122,7 @@
|
|||||||
<item row="1" column="2">
|
<item row="1" column="2">
|
||||||
<widget class="QLineEdit" name="title"/>
|
<widget class="QLineEdit" name="title"/>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="1">
|
<item row="4" column="1">
|
||||||
<spacer name="verticalSpacer">
|
<spacer name="verticalSpacer">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Vertical</enum>
|
<enum>Qt::Vertical</enum>
|
||||||
@ -142,6 +142,18 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="3" column="0" colspan="3">
|
||||||
|
<widget class="QCheckBox" name="add_to_library">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Add the catalog to your calibre library after it is generated.
|
||||||
|
Note that if you disable adding of the catalog to the library
|
||||||
|
sending of the catalog todevice will not work.</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>&Add catalog to library</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user