Esempio n. 1
0
    def __on_profile_fetched(self, profile):
        if not profile:
            print "failed to fetch profile"
            return
        
        #print str(profile)

        if profile.get_online():
            self.__online.set_property('text', 'Online')
        else:
            self.__online.set_property('text', 'Offline')

        self.__ribbon_bar.remove_all()
        for a in profile.get_accounts():
            badge = CanvasMugshotURLImageButton(scale_width=16, scale_height=16)
            badge.set_url(a['icon'])
            badge.set_property('tooltip', a['linkText']) # doesn't work...
            self.__ribbon_bar.append(badge)

        self.__address_box.remove_all()
        if profile.get_email():
            email = hippo.CanvasLink(text=profile.get_email(), xalign=hippo.ALIGNMENT_START)
            email.connect('activated', self.__on_activate_email, profile)
            self.__address_box.append(email)

        if profile.get_aim():
            aim = hippo.CanvasLink(text=profile.get_aim(), xalign=hippo.ALIGNMENT_START)
            aim.connect('activated', self.__on_activate_aim, profile)
            self.__address_box.append(aim)
Esempio n. 2
0
 def __on_activate_aim(self, canvas_item, profile):
     os.spawnlp(os.P_NOWAIT, 'gnome-open', 'gnome-open', 'aim:GoIM?screenname=' + cgi.escape(profile.get_aim()))