Changeset 3452 for branches/gajim_0.8.2

Show
Ignore:
Timestamp:
09/06/05 13:39:51 (3 years ago)
Author:
nk
Message:

filemanager fixes

Location:
branches/gajim_0.8.2/src
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • branches/gajim_0.8.2/src/config.py

    r3441 r3452  
    19491949        def update_preview(self, widget): 
    19501950                path_to_file = widget.get_preview_filename() 
    1951                 widget.get_preview_widget().set_from_file(path_to_file) 
     1951                if os.path.isdir(path_to_file): 
     1952                        return 
     1953                try: 
     1954                        pixbuf = gtk.gdk.pixbuf_new_from_file_at_size(path_to_file, 32, 32) 
     1955                except (gobject.GError, TypeError): 
     1956                        return 
     1957                widget.get_preview_widget().set_from_pixbuf(pixbuf) 
    19521958 
    19531959        def on_set_image_button_clicked(self, widget, data=None): 
  • branches/gajim_0.8.2/src/vcard.py

    r3319 r3452  
    2020import gtk 
    2121import gtk.glade 
     22import gobject 
    2223import urllib 
    2324import base64 
     
    121122        def update_preview(self, widget): 
    122123                path_to_file = widget.get_preview_filename() 
    123                 widget.get_preview_widget().set_from_file(path_to_file) 
     124                if os.path.isdir(path_to_file): 
     125                        return 
     126                try: 
     127                        pixbuf = gtk.gdk.pixbuf_new_from_file_at_size(path_to_file, 100, 100) 
     128                except gobject.GError: 
     129                        return 
     130                widget.get_preview_widget().set_from_pixbuf(pixbuf) 
    124131 
    125132        def on_set_avatar_button_clicked(self, widget):