From 33999247615fe66a3843250587aa54cece7bd140 Mon Sep 17 00:00:00 2001 From: Yann Leboulanger <asterix@lagaule.org> Date: Fri, 8 Sep 2006 21:34:10 +0000 Subject: [PATCH] don't put contact's avatar in a button. Fixes #2381 --- data/glade/vcard_information_window.glade | 27 +++++++++-------------- src/vcard.py | 13 +---------- 2 files changed, 11 insertions(+), 29 deletions(-) diff --git a/data/glade/vcard_information_window.glade b/data/glade/vcard_information_window.glade index 79215a8c58..32b23fe257 100644 --- a/data/glade/vcard_information_window.glade +++ b/data/glade/vcard_information_window.glade @@ -587,26 +587,19 @@ <property name="spacing">0</property> <child> - <widget class="GtkButton" id="set_avatar_button"> - <property name="can_focus">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="focus_on_click">True</property> + <widget class="GtkEventBox" id="PHOTO_eventbox"> + <property name="visible">True</property> + <property name="visible_window">False</property> + <property name="above_child">False</property> + <signal name="button_press_event" handler="on_PHOTO_eventbox_button_press_event" last_modification_time="Fri, 08 Sep 2006 21:34:18 GMT"/> <child> - <widget class="GtkEventBox" id="PHOTO_eventbox3"> + <widget class="GtkImage" id="PHOTO_image"> <property name="visible">True</property> - <property name="visible_window">False</property> - <property name="above_child">False</property> - - <child> - <widget class="GtkImage" id="PHOTO_image"> - <property name="visible">True</property> - <property name="xalign">0.5</property> - <property name="yalign">0</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - </child> + <property name="xalign">0.5</property> + <property name="yalign">0</property> + <property name="xpad">0</property> + <property name="ypad">0</property> </widget> </child> </widget> diff --git a/src/vcard.py b/src/vcard.py index b20a7e7d71..009605b382 100644 --- a/src/vcard.py +++ b/src/vcard.py @@ -68,16 +68,9 @@ class VcardWindow: self.avatar_mime_type = None self.avatar_encoded = None - self.avatar_save_as_id = None self.fill_jabber_page() - button = self.xml.get_widget('set_avatar_button') - button.set_no_show_all(True) - button.connect('clicked', - gtkgui_helpers.on_avatar_save_as_menuitem_activate, - self.contact.jid, self.account, self.contact.name + '.jpeg') - self.xml.signal_autoconnect(self) self.window.show_all() @@ -104,7 +97,7 @@ class VcardWindow: gajim.config.set_per('accounts', self.account, 'no_log_for', ' '.join(no_log_for)) - def on_PHOTO_button_press_event(self, widget, event): + def on_PHOTO_eventbox_button_press_event(self, widget, event): '''If right-clicked, show popup''' if event.button == 3: # right click menu = gtk.Menu() @@ -136,10 +129,6 @@ class VcardWindow: continue pixbuf = gtkgui_helpers.get_scaled_pixbuf(pixbuf, 'vcard') image.set_from_pixbuf(pixbuf) - button = self.xml.get_widget('set_avatar_button') - self.avatar_save_as_id = button.connect('button-press-event', - self.on_PHOTO_button_press_event) - button.show() continue if i == 'ADR' or i == 'TEL' or i == 'EMAIL': for entry in vcard[i]: -- GitLab