mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
cleanup. Pdb config honor defaults.
This commit is contained in:
parent
bce9fce7f6
commit
272e163e12
@ -23,7 +23,7 @@ class DeviceConfig(object):
|
||||
@classmethod
|
||||
def config_widget(cls):
|
||||
from calibre.gui2.device_drivers.configwidget import ConfigWidget
|
||||
cw = ConfigWidget(cls._configProxy(), cls.FORMATS)
|
||||
cw = ConfigWidget(cls.settings(), cls.FORMATS)
|
||||
return cw
|
||||
|
||||
@classmethod
|
||||
|
@ -30,6 +30,7 @@ class BulkConfig(Config):
|
||||
|
||||
self.setup_pipeline()
|
||||
|
||||
self.input_label.hide()
|
||||
self.input_formats.hide()
|
||||
|
||||
self.connect(self.output_formats, SIGNAL('currentIndexChanged(QString)'),
|
||||
|
@ -20,9 +20,14 @@ class PluginWidget(Widget, Ui_Form):
|
||||
self.db, self.book_id = db, book_id
|
||||
self.initialize_options(get_option, get_help, db, book_id)
|
||||
|
||||
default = self.opt_format.currentText()
|
||||
|
||||
global format_model
|
||||
if format_model is None:
|
||||
format_model = BasicComboModel(FORMAT_WRITERS.keys())
|
||||
self.format_model = format_model
|
||||
self.opt_format.setModel(self.format_model)
|
||||
|
||||
default_index = self.opt_format.findText(default)
|
||||
self.opt_format.setCurrentIndex(default_index if default_index != -1 else 0)
|
||||
|
||||
|
@ -21,7 +21,7 @@
|
||||
<item row="0" column="0" colspan="2">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<widget class="QLabel" name="input_label">
|
||||
<property name="text">
|
||||
<string>&Input format:</string>
|
||||
</property>
|
||||
@ -108,8 +108,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>810</width>
|
||||
<height>492</height>
|
||||
<width>800</width>
|
||||
<height>471</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
|
@ -10,14 +10,14 @@ from calibre.gui2.device_drivers.configwidget_ui import Ui_ConfigWidget
|
||||
|
||||
class ConfigWidget(QWidget, Ui_ConfigWidget):
|
||||
|
||||
def __init__(self, config, all_formats):
|
||||
def __init__(self, settings, all_formats):
|
||||
QWidget.__init__(self)
|
||||
Ui_ConfigWidget.__init__(self)
|
||||
self.setupUi(self)
|
||||
|
||||
self.config = config
|
||||
self.settings = settings
|
||||
|
||||
format_map = config['format_map']
|
||||
format_map = settings.format_map
|
||||
disabled_formats = list(set(all_formats).difference(format_map))
|
||||
for format in format_map + disabled_formats:
|
||||
item = QListWidgetItem(format, self.columns)
|
||||
|
Loading…
x
Reference in New Issue
Block a user