From 9a84fa520381b9a337f0bd40223f30db6cfa7f45 Mon Sep 17 00:00:00 2001 From: Luo Jinghua Date: Wed, 16 Sep 2009 08:08:24 +0800 Subject: totem: don't use load_interface. --- totem/plugin/sopcast.py | 24 +++++++++++++++++------- 1 file 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 -- cgit v1.2.3