summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHuang Peng <shawn.p.huang@gmail.com>2008-08-25 08:34:01 +0800
committerHuang Peng <shawn.p.huang@gmail.com>2008-08-25 08:34:01 +0800
commitf25b1350150f0b2db51115362bbb4d3da3a8ef08 (patch)
tree8d2367b60d45ad0e6d9b9e928ad41cf8a434c096
parentcaf982d0574f27b66d1e8bc8362ee9b94c79611f (diff)
downloadibus-f25b1350150f0b2db51115362bbb4d3da3a8ef08.tar.gz
ibus-f25b1350150f0b2db51115362bbb4d3da3a8ef08.tar.xz
ibus-f25b1350150f0b2db51115362bbb4d3da3a8ef08.zip
Fix problem when font_name has unicode char.
-rw-r--r--panel/panel.py1
-rw-r--r--setup/main.py2
2 files changed, 3 insertions, 0 deletions
diff --git a/panel/panel.py b/panel/panel.py
index 58b5ca7..1ae3323 100644
--- a/panel/panel.py
+++ b/panel/panel.py
@@ -204,6 +204,7 @@ class Panel(ibus.PanelBase):
def __config_load_custom_font(self):
use_custom_font = self.__bus.config_get_value(CONFIG_PANEL_USE_CUSTOM_FONT, False)
font_name = gtk.settings_get_default().get_property("gtk-font-name")
+ font_name = unicode(font_name, "utf-8")
custom_font = self.__bus.config_get_value(CONFIG_PANEL_CUSTOM_FONT, font_name)
style_string = 'style "custom-font" { font_name="%s" }\nclass "IBusPanelLabel" style "custom-font"\n'
if use_custom_font:
diff --git a/setup/main.py b/setup/main.py
index b7bead3..f3e0f54 100644
--- a/setup/main.py
+++ b/setup/main.py
@@ -124,6 +124,7 @@ class Setup(object):
else:
self.__fontbutton_custom_font.set_sensitive(False)
font_name = gtk.settings_get_default().get_property("gtk-font-name")
+ font_name = unicode(font_name, "utf-8")
font_name = self.__bus.config_get_value(CONFIG_PANEL_CUSTOM_FONT, font_name)
self.__fontbutton_custom_font.connect("notify::font-name", self.__fontbutton_custom_font_notify_cb)
self.__fontbutton_custom_font.set_font_name(font_name)
@@ -411,6 +412,7 @@ class Setup(object):
def __fontbutton_custom_font_notify_cb(self, button, arg):
font_name = self.__fontbutton_custom_font.get_font_name()
+ font_name = unicode(font_name, "utf-8")
self.__bus.config_set_value(CONFIG_PANEL_CUSTOM_FONT, font_name)
def __config_value_changed_cb(self, bus, key, value):