mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Remove single format save option
This commit is contained in:
parent
5f0c27e6d6
commit
486e1fd375
@ -27,8 +27,6 @@ def _config():
|
|||||||
help=_('Frequently used directories'))
|
help=_('Frequently used directories'))
|
||||||
c.add_opt('send_to_storage_card_by_default', default=False,
|
c.add_opt('send_to_storage_card_by_default', default=False,
|
||||||
help=_('Send file to storage card instead of main memory by default'))
|
help=_('Send file to storage card instead of main memory by default'))
|
||||||
c.add_opt('save_to_disk_single_format', default='lrf',
|
|
||||||
help=_('The format to use when saving single files to disk'))
|
|
||||||
c.add_opt('confirm_delete', default=False,
|
c.add_opt('confirm_delete', default=False,
|
||||||
help=_('Confirm before deleting'))
|
help=_('Confirm before deleting'))
|
||||||
c.add_opt('toolbar_icon_size', default=QSize(48, 48),
|
c.add_opt('toolbar_icon_size', default=QSize(48, 48),
|
||||||
|
@ -395,16 +395,12 @@ class ConfigDialog(QDialog, Ui_Dialog):
|
|||||||
output_formats = sorted(available_output_formats())
|
output_formats = sorted(available_output_formats())
|
||||||
output_formats.remove('oeb')
|
output_formats.remove('oeb')
|
||||||
for f in output_formats:
|
for f in output_formats:
|
||||||
self.output_format.addItem(f)
|
self.output_format.addItem(f.upper())
|
||||||
default_index = self.output_format.findText(prefs['output_format'])
|
default_index = \
|
||||||
|
self.output_format.findText(prefs['output_format'].upper())
|
||||||
self.output_format.setCurrentIndex(default_index if default_index != -1 else 0)
|
self.output_format.setCurrentIndex(default_index if default_index != -1 else 0)
|
||||||
|
|
||||||
self.book_exts = sorted(BOOK_EXTENSIONS)
|
|
||||||
for ext in self.book_exts:
|
|
||||||
self.single_format.addItem(ext.upper(), QVariant(ext))
|
|
||||||
|
|
||||||
single_format = config['save_to_disk_single_format']
|
|
||||||
self.single_format.setCurrentIndex(self.book_exts.index(single_format))
|
|
||||||
self.cover_browse.setValue(config['cover_flow_queue_length'])
|
self.cover_browse.setValue(config['cover_flow_queue_length'])
|
||||||
self.systray_notifications.setChecked(not config['disable_tray_notification'])
|
self.systray_notifications.setChecked(not config['disable_tray_notification'])
|
||||||
from calibre.translations.compiled import translations
|
from calibre.translations.compiled import translations
|
||||||
@ -426,17 +422,17 @@ class ConfigDialog(QDialog, Ui_Dialog):
|
|||||||
|
|
||||||
self.pdf_metadata.setChecked(prefs['read_file_metadata'])
|
self.pdf_metadata.setChecked(prefs['read_file_metadata'])
|
||||||
|
|
||||||
added_html = False
|
exts = set([])
|
||||||
for ext in self.book_exts:
|
for ext in BOOK_EXTENSIONS:
|
||||||
ext = ext.lower()
|
ext = ext.lower()
|
||||||
ext = re.sub(r'(x{0,1})htm(l{0,1})', 'html', ext)
|
ext = re.sub(r'(x{0,1})htm(l{0,1})', 'html', ext)
|
||||||
if ext == 'lrf' or is_supported('book.'+ext):
|
if ext == 'lrf' or is_supported('book.'+ext):
|
||||||
if ext == 'html' and added_html:
|
exts.add(ext)
|
||||||
continue
|
|
||||||
|
for ext in sorted(exts):
|
||||||
self.viewer.addItem(ext.upper())
|
self.viewer.addItem(ext.upper())
|
||||||
self.viewer.item(self.viewer.count()-1).setFlags(Qt.ItemIsEnabled|Qt.ItemIsUserCheckable)
|
self.viewer.item(self.viewer.count()-1).setFlags(Qt.ItemIsEnabled|Qt.ItemIsUserCheckable)
|
||||||
self.viewer.item(self.viewer.count()-1).setCheckState(Qt.Checked if ext.upper() in config['internally_viewed_formats'] else Qt.Unchecked)
|
self.viewer.item(self.viewer.count()-1).setCheckState(Qt.Checked if ext.upper() in config['internally_viewed_formats'] else Qt.Unchecked)
|
||||||
added_html = ext == 'html'
|
|
||||||
self.viewer.sortItems()
|
self.viewer.sortItems()
|
||||||
self.start.setEnabled(not getattr(self.server, 'is_running', False))
|
self.start.setEnabled(not getattr(self.server, 'is_running', False))
|
||||||
self.test.setEnabled(not self.start.isEnabled())
|
self.test.setEnabled(not self.start.isEnabled())
|
||||||
@ -767,8 +763,7 @@ class ConfigDialog(QDialog, Ui_Dialog):
|
|||||||
p = {0:'normal', 1:'high', 2:'low'}[self.priority.currentIndex()]
|
p = {0:'normal', 1:'high', 2:'low'}[self.priority.currentIndex()]
|
||||||
prefs['worker_process_priority'] = p
|
prefs['worker_process_priority'] = p
|
||||||
prefs['read_file_metadata'] = bool(self.pdf_metadata.isChecked())
|
prefs['read_file_metadata'] = bool(self.pdf_metadata.isChecked())
|
||||||
prefs['output_format'] = self.output_format.currentText()
|
prefs['output_format'] = unicode(self.output_format.currentText()).upper()
|
||||||
config['save_to_disk_single_format'] = self.book_exts[self.single_format.currentIndex()]
|
|
||||||
config['cover_flow_queue_length'] = self.cover_browse.value()
|
config['cover_flow_queue_length'] = self.cover_browse.value()
|
||||||
prefs['language'] = str(self.language.itemData(self.language.currentIndex()).toString())
|
prefs['language'] = str(self.language.itemData(self.language.currentIndex()).toString())
|
||||||
config['systray_icon'] = self.systray_icon.checkState() == Qt.Checked
|
config['systray_icon'] = self.systray_icon.checkState() == Qt.Checked
|
||||||
|
@ -147,19 +147,6 @@
|
|||||||
<item>
|
<item>
|
||||||
<layout class="QGridLayout" name="gridLayout_2">
|
<layout class="QGridLayout" name="gridLayout_2">
|
||||||
<item row="1" column="0">
|
<item row="1" column="0">
|
||||||
<widget class="QLabel" name="label_5">
|
|
||||||
<property name="text">
|
|
||||||
<string>Format for &single file save:</string>
|
|
||||||
</property>
|
|
||||||
<property name="buddy">
|
|
||||||
<cstring>single_format</cstring>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="1">
|
|
||||||
<widget class="QComboBox" name="single_format"/>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="0">
|
|
||||||
<widget class="QLabel" name="label_2">
|
<widget class="QLabel" name="label_2">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Default network &timeout:</string>
|
<string>Default network &timeout:</string>
|
||||||
@ -169,7 +156,7 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="1">
|
<item row="1" column="1">
|
||||||
<widget class="QSpinBox" name="timeout">
|
<widget class="QSpinBox" name="timeout">
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
<string>Set the default timeout for network fetches (i.e. anytime we go out to the internet to get information)</string>
|
<string>Set the default timeout for network fetches (i.e. anytime we go out to the internet to get information)</string>
|
||||||
@ -188,10 +175,10 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="1">
|
<item row="2" column="1">
|
||||||
<widget class="QComboBox" name="language"/>
|
<widget class="QComboBox" name="language"/>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="0">
|
<item row="2" column="0">
|
||||||
<widget class="QLabel" name="label_7">
|
<widget class="QLabel" name="label_7">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Choose &language (requires restart):</string>
|
<string>Choose &language (requires restart):</string>
|
||||||
@ -201,7 +188,7 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="4" column="1">
|
<item row="3" column="1">
|
||||||
<widget class="QComboBox" name="priority">
|
<widget class="QComboBox" name="priority">
|
||||||
<item>
|
<item>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@ -220,7 +207,7 @@
|
|||||||
</item>
|
</item>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="4" column="0">
|
<item row="3" column="0">
|
||||||
<widget class="QLabel" name="priority_label">
|
<widget class="QLabel" name="priority_label">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Job &priority:</string>
|
<string>Job &priority:</string>
|
||||||
|
@ -201,8 +201,6 @@ class Main(MainWindow, Ui_MainWindow, DeviceGUI):
|
|||||||
self.save_menu = QMenu()
|
self.save_menu = QMenu()
|
||||||
self.save_menu.addAction(_('Save to disk'))
|
self.save_menu.addAction(_('Save to disk'))
|
||||||
self.save_menu.addAction(_('Save to disk in a single directory'))
|
self.save_menu.addAction(_('Save to disk in a single directory'))
|
||||||
self.save_menu.addAction(_('Save only %s format to disk')%\
|
|
||||||
config.get('save_to_disk_single_format').upper())
|
|
||||||
|
|
||||||
self.view_menu = QMenu()
|
self.view_menu = QMenu()
|
||||||
self.view_menu.addAction(_('View'))
|
self.view_menu.addAction(_('View'))
|
||||||
@ -214,8 +212,6 @@ class Main(MainWindow, Ui_MainWindow, DeviceGUI):
|
|||||||
self.save_to_disk)
|
self.save_to_disk)
|
||||||
QObject.connect(self.save_menu.actions()[1], SIGNAL("triggered(bool)"),
|
QObject.connect(self.save_menu.actions()[1], SIGNAL("triggered(bool)"),
|
||||||
self.save_to_single_dir)
|
self.save_to_single_dir)
|
||||||
QObject.connect(self.save_menu.actions()[2], SIGNAL("triggered(bool)"),
|
|
||||||
self.save_single_format_to_disk)
|
|
||||||
QObject.connect(self.action_view, SIGNAL("triggered(bool)"),
|
QObject.connect(self.action_view, SIGNAL("triggered(bool)"),
|
||||||
self.view_book)
|
self.view_book)
|
||||||
QObject.connect(self.view_menu.actions()[0],
|
QObject.connect(self.view_menu.actions()[0],
|
||||||
|
@ -42,7 +42,7 @@
|
|||||||
<property name="maximumSize">
|
<property name="maximumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>16777215</width>
|
<width>16777215</width>
|
||||||
<height>100</height>
|
<height>75</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="verticalScrollBarPolicy">
|
<property name="verticalScrollBarPolicy">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user