Changeset 7888 for branches/gajim_0.11/src/profile_window.py
- Timestamp:
- 01/23/07 21:32:43 (22 months ago)
- Files:
-
- 1 modified
-
branches/gajim_0.11/src/profile_window.py (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/gajim_0.11/src/profile_window.py
r7829 r7888 78 78 image = gtk.Image() 79 79 self.xml.get_widget('PHOTO_button').set_image(image) 80 text_button = self.xml.get_widget('NOPHOTO_button') 81 # We use 2 buttons because some GTK theme don't show images in buttons 82 text_button.set_no_show_all(True) 83 text_button.hide() 80 84 self.xml.signal_autoconnect(self) 81 85 self.window.show_all() … … 105 109 image = button.get_image() 106 110 image.set_from_pixbuf(None) 107 button.set_label(_('Click to set your avatar')) 111 button.hide() 112 text_button = self.xml.get_widget('NOPHOTO_button') 113 text_button.show() 108 114 self.avatar_encoded = None 109 115 self.avatar_mime_type = None … … 153 159 image = button.get_image() 154 160 image.set_from_pixbuf(pixbuf) 155 button.set_label('') 161 button.show() 162 text_button = self.xml.get_widget('NOPHOTO_button') 163 text_button.hide() 156 164 self.avatar_encoded = base64.encodestring(data) 157 165 # returns None if unknown type … … 203 211 204 212 def set_values(self, vcard): 213 button = self.xml.get_widget('PHOTO_button') 214 image = button.get_image() 215 text_button = self.xml.get_widget('NOPHOTO_button') 205 216 if not 'PHOTO' in vcard: 206 217 # set default image 207 button = self.xml.get_widget('PHOTO_button')208 image = button.get_image()209 218 image.set_from_pixbuf(None) 210 button.set_label(_('Click to set your avatar')) 219 button.hide() 220 text_button.show() 211 221 for i in vcard.keys(): 212 222 if i == 'PHOTO': 213 223 pixbuf, self.avatar_encoded, self.avatar_mime_type = \ 214 224 get_avatar_pixbuf_encoded_mime(vcard[i]) 215 button = self.xml.get_widget('PHOTO_button')216 image = button.get_image()217 225 if not pixbuf: 218 226 image.set_from_pixbuf(None) 219 button.set_label(_('Click to set your avatar')) 227 button.hide() 228 text_button.show() 220 229 continue 221 230 pixbuf = gtkgui_helpers.get_scaled_pixbuf(pixbuf, 'vcard') 222 231 image.set_from_pixbuf(pixbuf) 223 button.set_label('') 232 button.show() 233 text_button.hide() 224 234 continue 225 235 if i == 'ADR' or i == 'TEL' or i == 'EMAIL':
