Changeset 10038

Show
Ignore:
Timestamp:
07/27/08 12:21:51 (4 months ago)
Author:
jim++
Message:

Remove useless function and check. Make avatar in notification works with jpeg too. See #4060.

Location:
trunk/src
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/gtkgui_helpers.py

    r9986 r10038  
    616616        '''Chooses between avatar image and default image. 
    617617        Returns full path to the avatar image if it exists, 
    618         otherwise returns full path to the image.''' 
     618        otherwise returns full path to the image. 
     619        generic must be with extension and suffix without''' 
    619620        if jid: 
     621                # we want an avatar 
    620622                puny_jid = helpers.sanitize_filename(jid) 
    621623                path_to_file = os.path.join(gajim.AVATAR_PATH, puny_jid) + suffix 
    622                 filepath, extension = os.path.splitext(path_to_file)  
    623                 path_to_local_file = filepath + '_local' + extension  
    624                 if os.path.exists(path_to_local_file): 
    625                         return path_to_local_file 
    626                 if os.path.exists(path_to_file): 
    627                         return path_to_file 
     624                path_to_local_file = path_to_file + '_local' 
     625                for extension in ('.png', '.jpeg'): 
     626                        path_to_local_file_full = path_to_local_file + extension 
     627                        if os.path.exists(path_to_local_file_full): 
     628                                return path_to_local_file_full  
     629                for extension in ('.png', '.jpeg'): 
     630                        path_to_file_full = path_to_file + extension 
     631                        if os.path.exists(path_to_file_full): 
     632                                return path_to_file_full 
    628633        return os.path.abspath(generic) 
    629634 
  • trunk/src/notify.py

    r9664 r10038  
    206206                        if event == 'contact_disconnected': 
    207207                                show_image = 'offline.png' 
    208                                 suffix = '_notif_size_bw.png' 
     208                                suffix = '_notif_size_bw' 
    209209                        else: #Status Change or Connected 
    210210                                # FIXME: for status change, 
     
    212212                                # first need 48x48 for all status 
    213213                                show_image = 'online.png' 
    214                                 suffix = '_notif_size_colored.png' 
     214                                suffix = '_notif_size_colored' 
    215215                        transport_name = gajim.get_transport_name_from_jid(jid) 
    216216                        img = None 
  • trunk/src/roster_window.py

    r10036 r10038  
    41174117 
    41184118                ctrl = gajim.interface.msg_win_mgr.get_control(jid, account) 
    4119                 if ctrl and ctrl.type_id != message_control.TYPE_GC: 
     4119                if ctrl: 
    41204120                        ctrl.show_avatar() 
    41214121 
  • trunk/src/vcard.py

    r9905 r10038  
    121121                self.progressbar.pulse() 
    122122                return True # loop forever 
    123  
    124         def update_avatar_in_gui(self): 
    125                 jid = self.contact.jid 
    126                 # Update roster 
    127                 gajim.interface.roster.draw_avatar(jid, self.account) 
    128                 # Update chat windows 
    129                 ctrl = gajim.interface.msg_win_mgr.get_control(jid, self.account) 
    130                 if ctrl and ctrl.type_id != message_control.TYPE_GC: 
    131                         ctrl.show_avatar() 
    132123 
    133124        def on_vcard_information_window_destroy(self, widget):