mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Implement #1389 (Select Output Format at Conversion Time)
This commit is contained in:
parent
839d4baf4c
commit
83086312a3
@ -101,7 +101,6 @@ class ConfigDialog(QDialog, Ui_Dialog):
|
|||||||
for item in items:
|
for item in items:
|
||||||
self.language.addItem(item[1], QVariant(item[0]))
|
self.language.addItem(item[1], QVariant(item[0]))
|
||||||
|
|
||||||
self.output_format.setCurrentIndex(0 if prefs['output_format'] == 'LRF' else 1)
|
|
||||||
self.pdf_metadata.setChecked(prefs['read_file_metadata'])
|
self.pdf_metadata.setChecked(prefs['read_file_metadata'])
|
||||||
|
|
||||||
added_html = False
|
added_html = False
|
||||||
@ -255,16 +254,11 @@ class ConfigDialog(QDialog, Ui_Dialog):
|
|||||||
sc.set('max_cover', mcs)
|
sc.set('max_cover', mcs)
|
||||||
config['delete_news_from_library_on_upload'] = self.delete_news.isChecked()
|
config['delete_news_from_library_on_upload'] = self.delete_news.isChecked()
|
||||||
config['upload_news_to_device'] = self.sync_news.isChecked()
|
config['upload_news_to_device'] = self.sync_news.isChecked()
|
||||||
of = str(self.output_format.currentText())
|
|
||||||
fmts = []
|
fmts = []
|
||||||
for i in range(self.viewer.count()):
|
for i in range(self.viewer.count()):
|
||||||
if self.viewer.item(i).checkState() == Qt.Checked:
|
if self.viewer.item(i).checkState() == Qt.Checked:
|
||||||
fmts.append(str(self.viewer.item(i).text()))
|
fmts.append(str(self.viewer.item(i).text()))
|
||||||
config['internally_viewed_formats'] = fmts
|
config['internally_viewed_formats'] = fmts
|
||||||
if of != prefs['output_format'] and 'epub' in of.lower():
|
|
||||||
warning_dialog(self, 'Warning',
|
|
||||||
'<p>EPUB support is still in beta. If you find bugs, please report them by opening a <a href="http://calibre.kovidgoyal.net">ticket</a>.').exec_()
|
|
||||||
prefs['output_format'] = of
|
|
||||||
|
|
||||||
if not path or not os.path.exists(path) or not os.path.isdir(path):
|
if not path or not os.path.exists(path) or not os.path.isdir(path):
|
||||||
d = error_dialog(self, _('Invalid database location'),
|
d = error_dialog(self, _('Invalid database location'),
|
||||||
|
@ -149,7 +149,7 @@
|
|||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<layout class="QGridLayout" name="gridLayout_2" >
|
<layout class="QGridLayout" name="gridLayout_2" >
|
||||||
<item row="1" column="0" >
|
<item row="0" column="0" >
|
||||||
<widget class="QLabel" name="label_5" >
|
<widget class="QLabel" name="label_5" >
|
||||||
<property name="text" >
|
<property name="text" >
|
||||||
<string>Format for &single file save:</string>
|
<string>Format for &single file save:</string>
|
||||||
@ -159,10 +159,10 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="1" >
|
<item row="0" column="1" >
|
||||||
<widget class="QComboBox" name="single_format" />
|
<widget class="QComboBox" name="single_format" />
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="0" >
|
<item row="1" 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>
|
||||||
@ -172,7 +172,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>
|
||||||
@ -191,10 +191,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>
|
||||||
@ -204,34 +204,7 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="1" >
|
<item row="3" column="1" >
|
||||||
<widget class="QComboBox" name="output_format" >
|
|
||||||
<property name="toolTip" >
|
|
||||||
<string>The default output format for ebook conversions.</string>
|
|
||||||
</property>
|
|
||||||
<item>
|
|
||||||
<property name="text" >
|
|
||||||
<string>LRF</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text" >
|
|
||||||
<string>EPUB</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="0" >
|
|
||||||
<widget class="QLabel" name="label_8" >
|
|
||||||
<property name="text" >
|
|
||||||
<string>&Output format:</string>
|
|
||||||
</property>
|
|
||||||
<property name="buddy" >
|
|
||||||
<cstring>output_format</cstring>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="4" column="1" >
|
|
||||||
<widget class="QComboBox" name="priority" >
|
<widget class="QComboBox" name="priority" >
|
||||||
<item>
|
<item>
|
||||||
<property name="text" >
|
<property name="text" >
|
||||||
@ -250,7 +223,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>
|
||||||
|
@ -126,6 +126,21 @@ class Main(MainWindow, Ui_MainWindow):
|
|||||||
self.location_selected)
|
self.location_selected)
|
||||||
QObject.connect(self.stack, SIGNAL('currentChanged(int)'),
|
QObject.connect(self.stack, SIGNAL('currentChanged(int)'),
|
||||||
self.location_view.location_changed)
|
self.location_view.location_changed)
|
||||||
|
|
||||||
|
self.output_formats = sorted(['EPUB', 'LRF'])
|
||||||
|
for f in self.output_formats:
|
||||||
|
self.output_format.addItem(f)
|
||||||
|
self.output_format.setCurrentIndex(self.output_formats.index(prefs['output_format']))
|
||||||
|
def change_output_format(x):
|
||||||
|
of = unicode(x).strip()
|
||||||
|
if of != prefs['output_format']:
|
||||||
|
if of in ('EPUB', 'LIT'):
|
||||||
|
warning_dialog(self, 'Warning',
|
||||||
|
'<p>%s support is still in beta. If you find bugs, please report them by opening a <a href="http://calibre.kovidgoyal.net">ticket</a>.'%of).exec_()
|
||||||
|
prefs.set('output_format', of)
|
||||||
|
|
||||||
|
self.connect(self.output_format, SIGNAL('currentIndexChanged(QString)'),
|
||||||
|
change_output_format)
|
||||||
|
|
||||||
####################### Vanity ########################
|
####################### Vanity ########################
|
||||||
self.vanity_template = _('<p>For help visit <a href="http://%s.kovidgoyal.net/user_manual">%s.kovidgoyal.net</a><br>')%(__appname__, __appname__)
|
self.vanity_template = _('<p>For help visit <a href="http://%s.kovidgoyal.net/user_manual">%s.kovidgoyal.net</a><br>')%(__appname__, __appname__)
|
||||||
@ -489,7 +504,7 @@ class Main(MainWindow, Ui_MainWindow):
|
|||||||
return
|
return
|
||||||
info, cp, fs = job.result
|
info, cp, fs = job.result
|
||||||
self.location_view.model().update_devices(cp, fs)
|
self.location_view.model().update_devices(cp, fs)
|
||||||
self.device_info = _('Connected ')+' '.join(info[:-1])
|
self.device_info = _('Connected ')+info[0]
|
||||||
self.vanity.setText(self.vanity_template%dict(version=self.latest_version, device=self.device_info))
|
self.vanity.setText(self.vanity_template%dict(version=self.latest_version, device=self.device_info))
|
||||||
|
|
||||||
self.device_manager.books(Dispatcher(self.metadata_downloaded))
|
self.device_manager.books(Dispatcher(self.metadata_downloaded))
|
||||||
|
@ -27,15 +27,9 @@
|
|||||||
<normaloff>:/library</normaloff>:/library</iconset>
|
<normaloff>:/library</normaloff>:/library</iconset>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="centralwidget" >
|
<widget class="QWidget" name="centralwidget" >
|
||||||
<layout class="QGridLayout" >
|
<layout class="QGridLayout" name="gridLayout" >
|
||||||
<item row="0" column="0" >
|
<item row="0" column="0" >
|
||||||
<layout class="QHBoxLayout" >
|
<layout class="QHBoxLayout" name="horizontalLayout_3" >
|
||||||
<property name="spacing" >
|
|
||||||
<number>6</number>
|
|
||||||
</property>
|
|
||||||
<property name="margin" >
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<item>
|
<item>
|
||||||
<widget class="LocationView" name="location_view" >
|
<widget class="LocationView" name="location_view" >
|
||||||
<property name="sizePolicy" >
|
<property name="sizePolicy" >
|
||||||
@ -89,29 +83,47 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="vanity" >
|
<layout class="QVBoxLayout" name="verticalLayout_3" >
|
||||||
<property name="sizePolicy" >
|
<item>
|
||||||
<sizepolicy vsizetype="Preferred" hsizetype="Preferred" >
|
<widget class="QLabel" name="vanity" >
|
||||||
<horstretch>0</horstretch>
|
<property name="sizePolicy" >
|
||||||
<verstretch>0</verstretch>
|
<sizepolicy vsizetype="Preferred" hsizetype="Preferred" >
|
||||||
</sizepolicy>
|
<horstretch>0</horstretch>
|
||||||
</property>
|
<verstretch>0</verstretch>
|
||||||
<property name="maximumSize" >
|
</sizepolicy>
|
||||||
<size>
|
</property>
|
||||||
<width>16777215</width>
|
<property name="maximumSize" >
|
||||||
<height>90</height>
|
<size>
|
||||||
</size>
|
<width>16777215</width>
|
||||||
</property>
|
<height>90</height>
|
||||||
<property name="text" >
|
</size>
|
||||||
<string/>
|
</property>
|
||||||
</property>
|
<property name="text" >
|
||||||
<property name="textFormat" >
|
<string/>
|
||||||
<enum>Qt::RichText</enum>
|
</property>
|
||||||
</property>
|
<property name="textFormat" >
|
||||||
<property name="openExternalLinks" >
|
<enum>Qt::RichText</enum>
|
||||||
<bool>true</bool>
|
</property>
|
||||||
</property>
|
<property name="openExternalLinks" >
|
||||||
</widget>
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_2" >
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label_2" >
|
||||||
|
<property name="text" >
|
||||||
|
<string>Output:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QComboBox" name="output_format" />
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user