mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #5551 (CSS properties are affected by the selected UI translation)
This commit is contained in:
parent
a747879afc
commit
9860cd989b
@ -6,7 +6,7 @@ __license__ = 'GPL v3'
|
||||
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
|
||||
__docformat__ = 'restructuredtext en'
|
||||
|
||||
from PyQt4.Qt import SIGNAL
|
||||
from PyQt4.Qt import SIGNAL, QVariant
|
||||
|
||||
from calibre.gui2.convert.look_and_feel_ui import Ui_Form
|
||||
from calibre.gui2.convert import Widget
|
||||
@ -26,6 +26,12 @@ class LookAndFeelWidget(Widget, Ui_Form):
|
||||
'remove_paragraph_spacing', 'remove_paragraph_spacing_indent_size','input_encoding',
|
||||
'asciiize', 'keep_ligatures']
|
||||
)
|
||||
for val, text in [
|
||||
('original', _('Original')),
|
||||
('left', _('Left align')),
|
||||
('justify', _('Justify text'))
|
||||
]:
|
||||
self.opt_change_justification.addItem(text, QVariant(val))
|
||||
self.db, self.book_id = db, book_id
|
||||
self.initialize_options(get_option, get_help, db, book_id)
|
||||
self.opt_disable_font_rescaling.toggle()
|
||||
@ -35,6 +41,21 @@ class LookAndFeelWidget(Widget, Ui_Form):
|
||||
self.opt_remove_paragraph_spacing.toggle()
|
||||
self.opt_remove_paragraph_spacing.toggle()
|
||||
|
||||
def get_value_handler(self, g):
|
||||
if g is self.opt_change_justification:
|
||||
ans = unicode(g.itemData(g.currentIndex()).toString())
|
||||
return ans
|
||||
return Widget.get_value_handler(self, g)
|
||||
|
||||
def set_value_handler(self, g, val):
|
||||
if g is self.opt_change_justification:
|
||||
for i in range(g.count()):
|
||||
c = unicode(g.itemData(i).toString())
|
||||
if val == c:
|
||||
g.setCurrentIndex(i)
|
||||
break
|
||||
return True
|
||||
|
||||
def font_key_wizard(self):
|
||||
from calibre.gui2.convert.font_key import FontKeyChooser
|
||||
d = FontKeyChooser(self, self.opt_base_font_size.value(),
|
||||
|
@ -191,26 +191,7 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="2" colspan="2">
|
||||
<widget class="QComboBox" name="opt_change_justification">
|
||||
<property name="currentIndex">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>justify</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>left</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>original</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
<widget class="QComboBox" name="opt_change_justification"/>
|
||||
</item>
|
||||
<item row="7" column="1" colspan="3">
|
||||
<widget class="QCheckBox" name="opt_asciiize">
|
||||
|
Loading…
x
Reference in New Issue
Block a user