Welcome to mirror list, hosted at ThFree Co, Russian Federation.

dev.gajim.org/gajim/gajim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYann Leboulanger <asterix@lagaule.org>2007-01-23 15:34:07 +0300
committerYann Leboulanger <asterix@lagaule.org>2007-01-23 15:34:07 +0300
commit20a146dabf55a2c2c913ba78dde76235bd2227ce (patch)
tree432a563b84110f9425e282403d7e4cc35e8c57da /src/profile_window.py
parentafd2d150d186483943a8c26a7089dfb5c6e3fdc5 (diff)
use 2 buttons in profile windows because some GTK themes don't show images in buttons when there is text. gtk-button-images option in gtkrc file.
Diffstat (limited to 'src/profile_window.py')
-rw-r--r--src/profile_window.py28
1 files changed, 19 insertions, 9 deletions
diff --git a/src/profile_window.py b/src/profile_window.py
index 91f22afc4..3b9ff5e80 100644
--- a/src/profile_window.py
+++ b/src/profile_window.py
@@ -77,6 +77,10 @@ class ProfileWindow:
# Create Image for avatar button
image = gtk.Image()
self.xml.get_widget('PHOTO_button').set_image(image)
+ text_button = self.xml.get_widget('NOPHOTO_button')
+ # We use 2 buttons because some GTK theme don't show images in buttons
+ text_button.set_no_show_all(True)
+ text_button.hide()
self.xml.signal_autoconnect(self)
self.window.show_all()
@@ -104,7 +108,9 @@ class ProfileWindow:
button = self.xml.get_widget('PHOTO_button')
image = button.get_image()
image.set_from_pixbuf(None)
- button.set_label(_('Click to set your avatar'))
+ button.hide()
+ text_button = self.xml.get_widget('NOPHOTO_button')
+ text_button.show()
self.avatar_encoded = None
self.avatar_mime_type = None
@@ -152,7 +158,9 @@ class ProfileWindow:
button = self.xml.get_widget('PHOTO_button')
image = button.get_image()
image.set_from_pixbuf(pixbuf)
- button.set_label('')
+ button.show()
+ text_button = self.xml.get_widget('NOPHOTO_button')
+ text_button.hide()
self.avatar_encoded = base64.encodestring(data)
# returns None if unknown type
self.avatar_mime_type = mimetypes.guess_type(path_to_file)[0]
@@ -202,25 +210,27 @@ class ProfileWindow:
pass
def set_values(self, vcard):
+ button = self.xml.get_widget('PHOTO_button')
+ image = button.get_image()
+ text_button = self.xml.get_widget('NOPHOTO_button')
if not 'PHOTO' in vcard:
# set default image
- button = self.xml.get_widget('PHOTO_button')
- image = button.get_image()
image.set_from_pixbuf(None)
- button.set_label(_('Click to set your avatar'))
+ button.hide()
+ text_button.show()
for i in vcard.keys():
if i == 'PHOTO':
pixbuf, self.avatar_encoded, self.avatar_mime_type = \
get_avatar_pixbuf_encoded_mime(vcard[i])
- button = self.xml.get_widget('PHOTO_button')
- image = button.get_image()
if not pixbuf:
image.set_from_pixbuf(None)
- button.set_label(_('Click to set your avatar'))
+ button.hide()
+ text_button.show()
continue
pixbuf = gtkgui_helpers.get_scaled_pixbuf(pixbuf, 'vcard')
image.set_from_pixbuf(pixbuf)
- button.set_label('')
+ button.show()
+ text_button.hide()
continue
if i == 'ADR' or i == 'TEL' or i == 'EMAIL':
for entry in vcard[i]: