diff options
author | Luo Jinghua <sunmoon1997@gmail.com> | 2009-09-16 08:08:24 +0800 |
---|---|---|
committer | Luo Jinghua <sunmoon1997@gmail.com> | 2009-09-16 08:08:24 +0800 |
commit | 9a84fa520381b9a337f0bd40223f30db6cfa7f45 (patch) | |
tree | ed7aa54c543db1d39a606d1f3f80ff1a7bf5340c | |
parent | ff8d5dac29bf59a69f8dba5fbf7d59738bdafbc9 (diff) |
totem: don't use load_interface.
-rw-r--r-- | totem/plugin/sopcast.py | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/totem/plugin/sopcast.py b/totem/plugin/sopcast.py index 1757439..4cb3496 100644 --- a/totem/plugin/sopcast.py +++ b/totem/plugin/sopcast.py @@ -144,8 +144,9 @@ class Sopcast (totem.Plugin): else: if obj.get_text (): obj.set_text(_(obj.get_text ())) - except AttributeError: - pass + except AttributeError, e: + #print 'Failed to update translation for', obj, e + pass try: text = obj.get_property ('tooltip_text') @@ -154,6 +155,15 @@ class Sopcast (totem.Plugin): except TypeError: pass + def load_ui (self, filename, fatal, parent, user_data): + datadir = os.path.dirname (__file__) + filename = os.path.join (datadir, filename) + builder = gtk.Builder () + builder.set_translation_domain ('totem-sopcast') + builder.add_from_file (filename) + builder.connect_signals (self, user_data) + return builder + def activate (self, totem_object): """Check for the availability of the scsrc GStreamer plugins""" bvw_name = totem_object.get_video_widget_backend_name () @@ -182,11 +192,11 @@ class Sopcast (totem.Plugin): """Do nothing; either it's using xine or python-gstreamer isn't installed""" """Continue loading the plugin as before""" - self.builder = self.load_interface ("sopcast.ui", True, totem_object.get_main_window (), self) - self.config_builder = self.load_interface ("sopcast-config.ui", True, - totem_object.get_main_window (), self) - self.update_translation (self.builder) - self.update_translation (self.config_builder) + self.builder = self.load_ui ("sopcast.ui", True, totem_object.get_main_window (), self) + self.config_builder = self.load_ui ("sopcast-config.ui", True, + totem_object.get_main_window (), self) + #self.update_translation (self.builder) + #self.update_translation (self.config_builder) self.totem = totem_object |