mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Also use paper sizes widget in PDF output settings
This commit is contained in:
parent
aef66816a3
commit
9df4be4015
@ -146,6 +146,8 @@ class Widget(QWidget):
|
||||
ret = self.get_value_handler(g)
|
||||
if ret != 'this is a dummy return value, xcswx1avcx4x':
|
||||
return ret
|
||||
if hasattr(g, 'get_value_for_config'):
|
||||
return g.get_value_for_config
|
||||
if isinstance(g, (QSpinBox, QDoubleSpinBox)):
|
||||
return g.value()
|
||||
elif isinstance(g, (QLineEdit, QTextEdit, QPlainTextEdit)):
|
||||
@ -218,6 +220,9 @@ class Widget(QWidget):
|
||||
from calibre.gui2.widgets import EncodingComboBox
|
||||
if self.set_value_handler(g, val):
|
||||
return
|
||||
if hasattr(g, 'set_value_for_config'):
|
||||
g.set_value_for_config = val
|
||||
return
|
||||
if isinstance(g, (QSpinBox, QDoubleSpinBox)):
|
||||
g.setValue(val)
|
||||
elif isinstance(g, (QLineEdit, QTextEdit, QPlainTextEdit)):
|
||||
|
@ -33,8 +33,7 @@ class PluginWidget(Widget, Ui_Form):
|
||||
except TypeError:
|
||||
pass # link already localized
|
||||
|
||||
for x in get_option('paper_size').option.choices:
|
||||
self.opt_paper_size.addItem(x)
|
||||
self.opt_paper_size.initialize(get_option('paper_size').option.choices)
|
||||
for x in get_option('unit').option.choices:
|
||||
self.opt_unit.addItem(x)
|
||||
for x in get_option('pdf_standard_font').option.choices:
|
||||
|
@ -32,7 +32,7 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QComboBox" name="opt_paper_size"/>
|
||||
<widget class="PaperSizes" name="opt_paper_size"/>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_3">
|
||||
@ -300,6 +300,13 @@
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>PaperSizes</class>
|
||||
<extends>QComboBox</extends>
|
||||
<header>calibre/gui2/widgets.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
Loading…
x
Reference in New Issue
Block a user