mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-03 04:53:20 +02:00
Also use paper sizes widget in PDF output settings
This commit is contained in:
parent
aef66816a3
commit
9df4be4015
3 changed files with 14 additions and 3 deletions
|
|
@ -146,6 +146,8 @@ def get_value(self, g):
|
|||
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 @@ def set_value(self, g, val):
|
|||
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 @@ def __init__(self, parent, get_option, get_help, db=None, book_id=None):
|
|||
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…
Reference in a new issue