Handle both space and comma separated font size keys

This commit is contained in:
Kovid Goyal 2013-08-13 20:53:53 +05:30
parent a58b15a0ad
commit 2822ddfd5f
2 changed files with 7 additions and 2 deletions

View File

@ -64,7 +64,7 @@ class FontKeyChooser(QDialog, Ui_Dialog):
@property
def fsizes(self):
key = unicode(self.font_size_key.text()).strip()
return [float(x.strip()) for x in key.split(',') if x.strip()]
return [float(x.strip()) for x in key.split(',' if ',' in key else ' ') if x.strip()]
@property
def dbase(self):

View File

@ -76,6 +76,10 @@ class LookAndFeelWidget(Widget, Ui_Form):
ans = ans.union(set([x.strip().lower() for x in
unicode(self.filter_css_others.text()).split(',')]))
return ','.join(ans) if ans else None
if g is self.opt_font_size_mapping:
val = unicode(g.text()).strip()
val = [x.strip() for x in val.split(',' if ',' in val else ' ') if x.strip()]
return ', '.join(val) or None
return Widget.get_value_handler(self, g)
def set_value_handler(self, g, val):
@ -87,7 +91,8 @@ class LookAndFeelWidget(Widget, Ui_Form):
break
return True
if g is self.opt_filter_css:
if not val: val = ''
if not val:
val = ''
items = frozenset([x.strip().lower() for x in val.split(',')])
for key, vals in self.FILTER_CSS.iteritems():
w = getattr(self, 'filter_css_%s'%key)