diff --git a/src/config.py b/src/config.py index 492e98f1f..c96df7757 100644 --- a/src/config.py +++ b/src/config.py @@ -2616,7 +2616,10 @@ class AccountCreationWizardWindow: def on_finish_button_clicked(self, widget): go_online = self.xml.get_widget('go_online_checkbutton').get_active() + show_vcard = self.xml.get_widget('show_vcard_checkbutton').get_active() self.window.destroy() + if show_vcard: + gajim.interface.show_vcard_when_connect.append(self.account) if go_online: gajim.interface.roster.send_status(self.account, 'online', '') diff --git a/src/gajim.py b/src/gajim.py index a106f9d3a..e022d5dc5 100755 --- a/src/gajim.py +++ b/src/gajim.py @@ -251,6 +251,12 @@ class Interface: gobject.timeout_add(30000, self.allow_notif, account) model[self.roster.status_message_menuitem_iter][3] = True # sensitivity for this menuitem self.roster.on_status_changed(account, status) + if account in self.show_vcard_when_connect: + jid = gajim.get_jid_from_account(account) + if not self.windows[account]['infos'].has_key('vcard'): + self.windows[account]['infos'][jid] = \ + dialogs.VcardWindow(jid, account, True) + gajim.connections[account].request_vcard(jid) if self.remote and self.remote.is_enabled(): self.remote.raise_signal('AccountPresence', (status, account)) @@ -629,8 +635,12 @@ class Interface: if nick: gajim.nicks[account] = nick if self.windows[account]['infos'].has_key(array['jid']): - win = self.windows[account]['infos'][array['jid']] - win.set_values(array) + win = self.windows[account]['infos'][array['jid']] + win.set_values(array) + if account in self.show_vcard_when_connect: + win.xml.get_widget('information_notebook').set_current_page(-1) + win.xml.get_widget('set_avatar_button').clicked() + self.show_vcard_when_connect.remove(account) def handle_event_vcard(self, account, vcard): # ('VCARD', account, data) @@ -1293,6 +1303,8 @@ class Interface: else: self.disable_dbus() + self.show_vcard_when_connect = [] + path_to_file = os.path.join(gajim.DATA_DIR, 'pixmaps/gajim.png') pix = gtk.gdk.pixbuf_new_from_file(path_to_file) gtk.window_set_default_icon(pix) # set the icon to all newly opened windows diff --git a/src/gtkgui.glade b/src/gtkgui.glade index 8487f0dca..c57cbfe8a 100644 --- a/src/gtkgui.glade +++ b/src/gtkgui.glade @@ -14433,6 +14433,25 @@ Please wait... False + + + + True + True + Set an avatar when I connect + True + GTK_RELIEF_NORMAL + True + True + False + True + + + 0 + False + False + + False