add a "Set an avatar when I connect" checkbutton in wizard, so that when we connect it open the vcard in the about tab and opens the filechooser

This commit is contained in:
Yann Leboulanger 2005-11-07 15:43:47 +00:00
parent 183d59333f
commit 02d88c5915
3 changed files with 36 additions and 2 deletions

View File

@ -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', '')

View File

@ -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

View File

@ -14433,6 +14433,25 @@ Please wait...</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkCheckButton" id="show_vcard_checkbutton">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">Set an avatar when I connect</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<property name="active">True</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
</widget>
<packing>
<property name="tab_expand">False</property>