/b-gtk/fix-viz

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/b-gtk/fix-viz

« back to all changes in this revision

Viewing changes to avatarbox.py

  • Committer: zedtux
  • Date: 2011-03-14 17:09:59 UTC
  • mto: This revision was merged to the branch mainline in revision 723.
  • Revision ID: zedtux@zedroot.org-20110314170959-tiqwqtyo975ej0m4
Patched code following Jelmer's recommandations

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
        """ Constructor """
26
26
        gtk.HBox.__init__(self, homogeneous, spacing)
27
27
        self.__avatars = {}
28
 
        self.__current_avatar = None
 
28
        self.avatar = None
29
29
        self.__displaying = None
30
30
    
31
31
    
32
 
    # ~~~~~ Properties ~~~~~
33
 
    # Avatar
34
 
    def get_avatar(self):
35
 
        return self.__current_avatar
36
 
    def set_avatar(self, avatar):
37
 
        self.__current_avatar = avatar
38
 
    avatar = property(get_avatar, set_avatar)
39
 
    
40
 
    
41
32
    # ~~~~~ Public methods ~~~~~
42
33
    def reset_view(self):
43
34
        """ Remove current avatars from the gtk box """
57
48
        Return True if the displaying avatar is the same
58
49
        as the given one otherwise return False
59
50
        """
60
 
        return self.__displaying and self.__displaying.is_identical(avatar)
 
51
        return self.__displaying and self.__displaying == avatar
61
52
    
62
53
    def append_avatars_with(self, avatar):
63
54
        """
80
71
        in order to apply future actions
81
72
        """
82
73
        self.avatar = None
83
 
        if not email is "":
84
 
            self.avatar = self.__avatars[email] if email in self.__avatars else None
 
74
        if not email is "" and email in self.__avatars:
 
75
            self.avatar = self.__avatars[email]
 
76
        else:
 
77
            self.avatar = None
85
78
        return self
86
79
    
87
80
    def update_avatar_image_from_pixbuf_loader(self, loader):