Author: jim++ Date: 2008-07-27 12:21:51 +0200 (Sun, 27 Jul 2008) New Revision: 10038
Modified: trunk/src/gtkgui_helpers.py trunk/src/notify.py trunk/src/roster_window.py trunk/src/vcard.py Log: Remove useless function and check. Make avatar in notification works with jpeg too. See #4060.
Modified: trunk/src/gtkgui_helpers.py =================================================================== --- trunk/src/gtkgui_helpers.py 2008-07-26 22:42:40 UTC (rev 10037) +++ trunk/src/gtkgui_helpers.py 2008-07-27 10:21:51 UTC (rev 10038) @@ -615,16 +615,21 @@ def get_path_to_generic_or_avatar(generic, jid = None, suffix = None): '''Chooses between avatar image and default image. Returns full path to the avatar image if it exists, - otherwise returns full path to the image.''' + otherwise returns full path to the image. + generic must be with extension and suffix without''' if jid: + # we want an avatar puny_jid = helpers.sanitize_filename(jid) path_to_file = os.path.join(gajim.AVATAR_PATH, puny_jid) + suffix - filepath, extension = os.path.splitext(path_to_file) - path_to_local_file = filepath + '_local' + extension - if os.path.exists(path_to_local_file): - return path_to_local_file - if os.path.exists(path_to_file): - return path_to_file + path_to_local_file = path_to_file + '_local' + for extension in ('.png', '.jpeg'): + path_to_local_file_full = path_to_local_file + extension + if os.path.exists(path_to_local_file_full): + return path_to_local_file_full + for extension in ('.png', '.jpeg'): + path_to_file_full = path_to_file + extension + if os.path.exists(path_to_file_full): + return path_to_file_full return os.path.abspath(generic)
def decode_filechooser_file_paths(file_paths):
Modified: trunk/src/notify.py =================================================================== --- trunk/src/notify.py 2008-07-26 22:42:40 UTC (rev 10037) +++ trunk/src/notify.py 2008-07-27 10:21:51 UTC (rev 10038) @@ -205,13 +205,13 @@ 'status_change'): # Common code for popup for these three events if event == 'contact_disconnected': show_image = 'offline.png' - suffix = '_notif_size_bw.png' + suffix = '_notif_size_bw' else: #Status Change or Connected # FIXME: for status change, # we don't always 'online.png', but we # first need 48x48 for all status show_image = 'online.png' - suffix = '_notif_size_colored.png' + suffix = '_notif_size_colored' transport_name = gajim.get_transport_name_from_jid(jid) img = None if transport_name:
Modified: trunk/src/roster_window.py =================================================================== --- trunk/src/roster_window.py 2008-07-26 22:42:40 UTC (rev 10037) +++ trunk/src/roster_window.py 2008-07-27 10:21:51 UTC (rev 10038) @@ -4116,7 +4116,7 @@ # Update chat window
ctrl = gajim.interface.msg_win_mgr.get_control(jid, account) - if ctrl and ctrl.type_id != message_control.TYPE_GC: + if ctrl: ctrl.show_avatar()
def on_roster_treeview_style_set(self, treeview, style):
Modified: trunk/src/vcard.py =================================================================== --- trunk/src/vcard.py 2008-07-26 22:42:40 UTC (rev 10037) +++ trunk/src/vcard.py 2008-07-27 10:21:51 UTC (rev 10038) @@ -121,15 +121,6 @@ self.progressbar.pulse() return True # loop forever
- def update_avatar_in_gui(self): - jid = self.contact.jid - # Update roster - gajim.interface.roster.draw_avatar(jid, self.account) - # Update chat windows - ctrl = gajim.interface.msg_win_mgr.get_control(jid, self.account) - if ctrl and ctrl.type_id != message_control.TYPE_GC: - ctrl.show_avatar() - def on_vcard_information_window_destroy(self, widget): if self.update_progressbar_timeout_id is not None: gobject.source_remove(self.update_progressbar_timeout_id)