changed zeroconf account name to local,

properties window fixes,
use all fields from it in txt record,
saving prefs automatically reconnects
This commit is contained in:
Stefan Bethge 2006-09-23 17:05:20 +00:00
parent c180efba3a
commit 354b4f17e9
5 changed files with 140 additions and 118 deletions

View file

@ -120,6 +120,9 @@ status_before_autoaway = {}
SHOW_LIST = ['offline', 'connecting', 'online', 'chat', 'away', 'xa', 'dnd', SHOW_LIST = ['offline', 'connecting', 'online', 'chat', 'away', 'xa', 'dnd',
'invisible'] 'invisible']
# zeroconf account name
LOCAL_ACC = 'local'
def get_nick_from_jid(jid): def get_nick_from_jid(jid):
pos = jid.find('@') pos = jid.find('@')
return jid[:pos] return jid[:pos]

View file

@ -68,7 +68,7 @@ class ConnectionZeroconf(ConnectionHandlersZeroconf):
self.bookmarks = [] self.bookmarks = []
#we don't need a password, but must be non-empty #we don't need a password, but must be non-empty
self.password = 'zeroconf' self.password = gajim.LOCAL_ACC
#XXX use that somewhere #XXX use that somewhere
self.autoconnect = False self.autoconnect = False
@ -88,37 +88,40 @@ class ConnectionZeroconf(ConnectionHandlersZeroconf):
self.retrycount = 0 self.retrycount = 0
self.jids_for_auto_auth = [] # list of jid to auto-authorize self.jids_for_auto_auth = [] # list of jid to auto-authorize
self.get_config_values_or_default() self.get_config_values_or_default()
self.zeroconf = zeroconf.Zeroconf(self._on_new_service, self._on_remove_service, self.username, self.host, self.port)
self.muc_jid = {} # jid of muc server for each transport type self.muc_jid = {} # jid of muc server for each transport type
self.vcard_supported = False self.vcard_supported = False
def get_config_values_or_default(self): def get_config_values_or_default(self):
''' get name, host, port from config, or ''' get name, host, port from config, or
create zeroconf account with default values''' create zeroconf account with default values'''
if not gajim.config.get_per('accounts', 'zeroconf', 'name'): if not gajim.config.get_per('accounts', gajim.LOCAL_ACC, 'name'):
print 'Creating zeroconf account' print 'Creating zeroconf account'
gajim.config.add_per('accounts', 'zeroconf') gajim.config.add_per('accounts', gajim.LOCAL_ACC)
gajim.config.set_per('accounts', 'zeroconf', 'autoconnect', True) gajim.config.set_per('accounts', gajim.LOCAL_ACC, 'autoconnect', True)
gajim.config.set_per('accounts', 'zeroconf', 'no_log_for', '') gajim.config.set_per('accounts', gajim.LOCAL_ACC, 'no_log_for', '')
gajim.config.set_per('accounts', 'zeroconf', 'password', 'zeroconf') gajim.config.set_per('accounts', gajim.LOCAL_ACC, 'password', 'zeroconf')
gajim.config.set_per('accounts', 'zeroconf', 'sync_with_global_status', True) gajim.config.set_per('accounts', gajim.LOCAL_ACC, 'sync_with_global_status', True)
username = unicode(getpass.getuser()) self.username = unicode(getpass.getuser())
gajim.config.set_per('accounts', 'zeroconf', 'name', username) gajim.config.set_per('accounts', gajim.LOCAL_ACC, 'name', self.username)
#XXX make sure host is US-ASCII #XXX make sure host is US-ASCII
host = unicode(socket.gethostname()) self.host = unicode(socket.gethostname())
gajim.config.set_per('accounts', 'zeroconf', 'hostname', host) gajim.config.set_per('accounts', gajim.LOCAL_ACC, 'hostname', self.host)
port = 5298 self.port = 5298
gajim.config.set_per('accounts', 'zeroconf', 'custom_port', port) gajim.config.set_per('accounts', gajim.LOCAL_ACC, 'custom_port', self.port)
gajim.config.set_per('accounts', 'zeroconf', 'is_zeroconf', True) gajim.config.set_per('accounts', gajim.LOCAL_ACC, 'is_zeroconf', True)
else: else:
username = gajim.config.get_per('accounts', 'zeroconf', 'name') self.username = gajim.config.get_per('accounts', gajim.LOCAL_ACC, 'name')
host = gajim.config.get_per('accounts', 'zeroconf', 'hostname') self.host = gajim.config.get_per('accounts', gajim.LOCAL_ACC, 'hostname')
port = gajim.config.get_per('accounts', 'zeroconf', 'custom_port') self.port = gajim.config.get_per('accounts', gajim.LOCAL_ACC, 'custom_port')
self.autoconnect = gajim.config.get_per('accounts', 'zeroconf', 'autoconnect') self.autoconnect = gajim.config.get_per('accounts', gajim.LOCAL_ACC, 'autoconnect')
self.sync_with_global_status = gajim.config.get_per('accounts', 'zeroconf', 'sync_with_global_status') self.sync_with_global_status = gajim.config.get_per('accounts', gajim.LOCAL_ACC, 'sync_with_global_status')
self.no_log_for = gajim.config.get_per('accounts', 'zeroconf', 'no_log_for') self.no_log_for = gajim.config.get_per('accounts', gajim.LOCAL_ACC, 'no_log_for')
self.first = gajim.config.get_per('accounts', gajim.LOCAL_ACC, 'zeroconf_first_name')
self.zeroconf = zeroconf.Zeroconf(self._on_new_service, self._on_remove_service, username, host, port) self.last = gajim.config.get_per('accounts', gajim.LOCAL_ACC, 'zeroconf_last_name')
self.jabber_id = gajim.config.get_per('accounts', gajim.LOCAL_ACC, 'zeroconf_jabber_id')
self.email = gajim.config.get_per('accounts', gajim.LOCAL_ACC, 'zeroconf_email')
# END __init__ # END __init__
def put_event(self, ev): def put_event(self, ev):
@ -190,8 +193,19 @@ class ConnectionZeroconf(ConnectionHandlersZeroconf):
# keyID, timestamp)) # keyID, timestamp))
self.dispatch('NOTIFY', (jid, 'offline', '', 'local', 0, None, 0)) self.dispatch('NOTIFY', (jid, 'offline', '', 'local', 0, None, 0))
def connect(self, data = None, show = 'online', msg = ''):
self.get_config_values_or_default()
self.zeroconf.txt['status'] = show
self.zeroconf.txt['msg'] = msg
self.zeroconf.txt['1st'] = self.first
self.zeroconf.txt['last'] = self.last
self.zeroconf.txt['jid'] = self.jabber_id
self.zeroconf.txt['email'] = self.email
self.zeroconf.username = self.username
self.zeroconf.host = self.host
self.zeroconf.port = self.port
def connect(self, data = None, show = 'online'):
if self.connection: if self.connection:
return self.connection, '' return self.connection, ''
@ -211,16 +225,11 @@ class ConnectionZeroconf(ConnectionHandlersZeroconf):
self.call_resolve_timeout = True self.call_resolve_timeout = True
gobject.timeout_add(10000, self._on_resolve_timeout) gobject.timeout_add(10000, self._on_resolve_timeout)
else: else:
pass notify.popup(_('Connection problem:'), gajim.LOCAL_ACC, None,
#TODO: display visual notification that we could not connect to avahi title=_('Can not get connection'),
text=_('Please check if avahi-daemon is running.') )
def connect_and_init(self, show, msg, signed): self.dispatch('STATUS', 'offline')
self.continue_connect_info = [show, msg, signed] self.status = 'offline'
self.zeroconf.txt['status'] = show
self.zeroconf.txt['msg'] = msg
self.connect('',show)
def disconnect(self, on_purpose = False): def disconnect(self, on_purpose = False):
self.connected = 0 self.connected = 0
@ -233,15 +242,23 @@ class ConnectionZeroconf(ConnectionHandlersZeroconf):
self.call_resolve_timeout = False self.call_resolve_timeout = False
self.zeroconf.disconnect() self.zeroconf.disconnect()
def reconnect(self):
status = self.status
if status != 'offline':
msg = self.zeroconf.txt['msg']
self.change_status('offline', msg)
self.change_status(status, msg)
def change_status(self, show, msg, sync = False, auto = False): def change_status(self, show, msg, sync = False, auto = False):
if not show in STATUS_LIST: if not show in STATUS_LIST:
return -1 return -1
self.status = show
check = True #to check for errors from zeroconf check = True #to check for errors from zeroconf
# 'connect' # 'connect'
if show != 'offline' and not self.connected: if show != 'offline' and not self.connected:
self.connect_and_init(show, msg, '') self.connect(None, show, msg)
if show != 'invisible': if show != 'invisible':
check = self.zeroconf.announce() check = self.zeroconf.announce()
else: else:
@ -270,11 +287,11 @@ class ConnectionZeroconf(ConnectionHandlersZeroconf):
if check: if check:
self.dispatch('STATUS', show) self.dispatch('STATUS', show)
else: else:
# self.dispatch('ERROR', 'Could not change status. Please check if avahi-daemon is running.') notify.popup(_('Connection problem:'), gajim.LOCAL_ACC, None,
notify.popup(_('Connection problem:'), 'zeroconf', None,
title=_('Could not change status'), title=_('Could not change status'),
text=_('Please check if avahi-daemon is running.') ) text=_('Please check if avahi-daemon is running.') )
self.dispatch('STATUS', 'offline') self.dispatch('STATUS', 'offline')
self.status = 'offline'
def get_status(self): def get_status(self):
return STATUS_LIST[self.connected] return STATUS_LIST[self.connected]

View file

@ -1817,13 +1817,6 @@ class AccountsWindow:
if not iter: if not iter:
return return
account = model[iter][0].decode('utf-8') account = model[iter][0].decode('utf-8')
if account == 'zeroconf':
if gajim.interface.instances.has_key('zeroconf_properties'):
gajim.interface.instances['zeroconf_properties'].window.present()
else:
gajim.interface.instances['zeroconf_properties'] = \
ZeroconfPropertiesWindow()
else:
self.show_modification_window(account) self.show_modification_window(account)
def on_accounts_treeview_row_activated(self, widget, path, column): def on_accounts_treeview_row_activated(self, widget, path, column):
@ -1832,6 +1825,13 @@ class AccountsWindow:
self.show_modification_window(account) self.show_modification_window(account)
def show_modification_window(self, account): def show_modification_window(self, account):
if account == gajim.LOCAL_ACC:
if gajim.interface.instances.has_key('zeroconf_properties'):
gajim.interface.instances['zeroconf_properties'].window.present()
else:
gajim.interface.instances['zeroconf_properties'] = \
ZeroconfPropertiesWindow()
else:
if gajim.interface.instances[account].has_key('account_modification'): if gajim.interface.instances[account].has_key('account_modification'):
gajim.interface.instances[account]['account_modification'].window.present() gajim.interface.instances[account]['account_modification'].window.present()
else: else:
@ -1857,23 +1857,23 @@ class AccountsWindow:
def on_enable_zeroconf_checkbutton_toggled(self, widget): def on_enable_zeroconf_checkbutton_toggled(self, widget):
if gajim.config.get('enable_zeroconf'): if gajim.config.get('enable_zeroconf'):
#disable #disable
gajim.interface.roster.close_all('zeroconf') gajim.interface.roster.close_all(gajim.LOCAL_ACC)
gajim.connections['zeroconf'].disable_account() gajim.connections[gajim.LOCAL_ACC].disable_account()
del gajim.connections['zeroconf'] del gajim.connections[gajim.LOCAL_ACC]
gajim.interface.save_config() gajim.interface.save_config()
del gajim.interface.instances['zeroconf'] del gajim.interface.instances[gajim.LOCAL_ACC]
del gajim.nicks['zeroconf'] del gajim.nicks[gajim.LOCAL_ACC]
del gajim.block_signed_in_notifications['zeroconf'] del gajim.block_signed_in_notifications[gajim.LOCAL_ACC]
del gajim.groups['zeroconf'] del gajim.groups[gajim.LOCAL_ACC]
gajim.contacts.remove_account('zeroconf') gajim.contacts.remove_account(gajim.LOCAL_ACC)
del gajim.gc_connected['zeroconf'] del gajim.gc_connected[gajim.LOCAL_ACC]
del gajim.automatic_rooms['zeroconf'] del gajim.automatic_rooms[gajim.LOCAL_ACC]
del gajim.to_be_removed['zeroconf'] del gajim.to_be_removed[gajim.LOCAL_ACC]
del gajim.newly_added['zeroconf'] del gajim.newly_added[gajim.LOCAL_ACC]
del gajim.sleeper_state['zeroconf'] del gajim.sleeper_state[gajim.LOCAL_ACC]
del gajim.encrypted_chats['zeroconf'] del gajim.encrypted_chats[gajim.LOCAL_ACC]
del gajim.last_message_time['zeroconf'] del gajim.last_message_time[gajim.LOCAL_ACC]
del gajim.status_before_autoaway['zeroconf'] del gajim.status_before_autoaway[gajim.LOCAL_ACC]
if len(gajim.connections) >= 2: # Do not merge accounts if only one exists if len(gajim.connections) >= 2: # Do not merge accounts if only one exists
gajim.interface.roster.regroup = gajim.config.get('mergeaccounts') gajim.interface.roster.regroup = gajim.config.get('mergeaccounts')
else: else:
@ -1885,23 +1885,23 @@ class AccountsWindow:
else: else:
# enable (will create new account if not present) # enable (will create new account if not present)
gajim.connections['zeroconf'] = common.zeroconf.connection_zeroconf.ConnectionZeroconf('zeroconf') gajim.connections[gajim.LOCAL_ACC] = common.zeroconf.connection_zeroconf.ConnectionZeroconf(gajim.LOCAL_ACC)
# update variables # update variables
gajim.interface.instances['zeroconf'] = {'infos': {}, 'disco': {}, gajim.interface.instances[gajim.LOCAL_ACC] = {'infos': {}, 'disco': {},
'gc_config': {}} 'gc_config': {}}
gajim.connections['zeroconf'].connected = 0 gajim.connections[gajim.LOCAL_ACC].connected = 0
gajim.groups['zeroconf'] = {} gajim.groups[gajim.LOCAL_ACC] = {}
gajim.contacts.add_account('zeroconf') gajim.contacts.add_account(gajim.LOCAL_ACC)
gajim.gc_connected['zeroconf'] = {} gajim.gc_connected[gajim.LOCAL_ACC] = {}
gajim.automatic_rooms['zeroconf'] = {} gajim.automatic_rooms[gajim.LOCAL_ACC] = {}
gajim.newly_added['zeroconf'] = [] gajim.newly_added[gajim.LOCAL_ACC] = []
gajim.to_be_removed['zeroconf'] = [] gajim.to_be_removed[gajim.LOCAL_ACC] = []
gajim.nicks['zeroconf'] = 'zeroconf' gajim.nicks[gajim.LOCAL_ACC] = gajim.LOCAL_ACC
gajim.block_signed_in_notifications['zeroconf'] = True gajim.block_signed_in_notifications[gajim.LOCAL_ACC] = True
gajim.sleeper_state['zeroconf'] = 'off' gajim.sleeper_state[gajim.LOCAL_ACC] = 'off'
gajim.encrypted_chats['zeroconf'] = [] gajim.encrypted_chats[gajim.LOCAL_ACC] = []
gajim.last_message_time['zeroconf'] = {} gajim.last_message_time[gajim.LOCAL_ACC] = {}
gajim.status_before_autoaway['zeroconf'] = '' gajim.status_before_autoaway[gajim.LOCAL_ACC] = ''
# refresh accounts window # refresh accounts window
if gajim.interface.instances.has_key('accounts'): if gajim.interface.instances.has_key('accounts'):
gajim.interface.instances['accounts'].init_accounts() gajim.interface.instances['accounts'].init_accounts()
@ -1913,7 +1913,7 @@ class AccountsWindow:
gajim.interface.roster.draw_roster() gajim.interface.roster.draw_roster()
gajim.interface.roster.actions_menu_needs_rebuild = True gajim.interface.roster.actions_menu_needs_rebuild = True
gajim.interface.save_config() gajim.interface.save_config()
gajim.connections['zeroconf'].change_status('online', '') gajim.connections[gajim.LOCAL_ACC].change_status('online', '')
self.on_checkbutton_toggled(widget, 'enable_zeroconf') self.on_checkbutton_toggled(widget, 'enable_zeroconf')
@ -3053,55 +3053,53 @@ class ZeroconfPropertiesWindow:
self.window.set_transient_for(gajim.interface.roster.window) self.window.set_transient_for(gajim.interface.roster.window)
self.xml.signal_autoconnect(self) self.xml.signal_autoconnect(self)
self.account = 'zeroconf' st = gajim.config.get_per('accounts', gajim.LOCAL_ACC, 'autoconnect')
st = gajim.config.get_per('accounts', 'zeroconf', 'autoconnect')
if st: if st:
self.xml.get_widget('autoconnect_checkbutton').set_active(st) self.xml.get_widget('autoconnect_checkbutton').set_active(st)
list_no_log_for = gajim.config.get_per('accounts', self.account,'no_log_for').split() list_no_log_for = gajim.config.get_per('accounts', gajim.LOCAL_ACC,'no_log_for').split()
if 'zeroconf' in list_no_log_for: if gajim.LOCAL_ACC in list_no_log_for:
self.xml.get_widget('log_history_checkbutton').set_active(0) self.xml.get_widget('log_history_checkbutton').set_active(0)
else: else:
self.xml.get_widget('log_history_checkbutton').set_active(1) self.xml.get_widget('log_history_checkbutton').set_active(1)
st = gajim.config.get_per('accounts', 'zeroconf', 'sync_with_global_status') st = gajim.config.get_per('accounts', gajim.LOCAL_ACC, 'sync_with_global_status')
if st: if st:
self.xml.get_widget('sync_with_global_status_checkbutton').set_active(st) self.xml.get_widget('sync_with_global_status_checkbutton').set_active(st)
st = gajim.config.get_per('accounts', 'zeroconf', 'zeroconf_first_name') st = gajim.config.get_per('accounts', gajim.LOCAL_ACC, 'zeroconf_first_name')
if st: if st:
self.xml.get_widget('first_name_entry').set_text(st) self.xml.get_widget('first_name_entry').set_text(st)
st = gajim.config.get_per('accounts', 'zeroconf', 'zeroconf_last_name') st = gajim.config.get_per('accounts', gajim.LOCAL_ACC, 'zeroconf_last_name')
if st: if st:
self.xml.get_widget('last_name_entry').set_text(st) self.xml.get_widget('last_name_entry').set_text(st)
st = gajim.config.get_per('accounts', 'zeroconf', 'zeroconf_jabber_id') st = gajim.config.get_per('accounts', gajim.LOCAL_ACC, 'zeroconf_jabber_id')
if st: if st:
self.xml.get_widget('jabber_id_entry').set_text(st) self.xml.get_widget('jabber_id_entry').set_text(st)
st = gajim.config.get_per('accounts', 'zeroconf', 'zeroconf_email') st = gajim.config.get_per('accounts', gajim.LOCAL_ACC, 'zeroconf_email')
if st: if st:
self.xml.get_widget('email_entry').set_text(st) self.xml.get_widget('email_entry').set_text(st)
st = gajim.config.get_per('accounts', 'zeroconf', 'use_ssl') st = gajim.config.get_per('accounts', gajim.LOCAL_ACC, 'use_ssl')
if st: if st:
self.xml.get_widget('use_tls_checkbutton').set_active(st) self.xml.get_widget('use_tls_checkbutton').set_active(st)
st = gajim.config.get_per('accounts', 'zeroconf', 'custom_port') st = gajim.config.get_per('accounts', gajim.LOCAL_ACC, 'custom_port')
if st: if st:
self.xml.get_widget('custom_port_entry').set_text(str(st)) self.xml.get_widget('custom_port_entry').set_text(str(st))
st = gajim.config.get_per('accounts', 'zeroconf', 'use_custom_host') st = gajim.config.get_per('accounts', gajim.LOCAL_ACC, 'use_custom_host')
if st: if st:
self.xml.get_widget('custom_port_checkbutton').set_active(st) self.xml.get_widget('custom_port_checkbutton').set_active(st)
self.xml.get_widget('custom_port_entry').set_sensitive(bool(st)) self.xml.get_widget('custom_port_entry').set_sensitive(bool(st))
if not st: if not st:
gajim.config.set_per('accounts', 'zeroconf', 'custom_port', '5298') gajim.config.set_per('accounts', gajim.LOCAL_ACC, 'custom_port', '5298')
self.xml.get_widget('save_button').grab_focus() self.xml.get_widget('save_button').grab_focus()
self.window.show_all() self.window.show_all()
@ -3120,38 +3118,44 @@ class ZeroconfPropertiesWindow:
def on_save_button_clicked(self, widget): def on_save_button_clicked(self, widget):
st = self.xml.get_widget('autoconnect_checkbutton').get_active() st = self.xml.get_widget('autoconnect_checkbutton').get_active()
gajim.config.set_per('accounts', 'zeroconf', 'autoconnect', st) gajim.config.set_per('accounts', gajim.LOCAL_ACC, 'autoconnect', st)
list_no_log_for = gajim.config.get_per('accounts', list_no_log_for = gajim.config.get_per('accounts',
self.account, 'no_log_for').split() gajim.LOCAL_ACC, 'no_log_for').split()
if self.account in list_no_log_for: if gajim.LOCAL_ACC in list_no_log_for:
list_no_log_for.remove(self.account) list_no_log_for.remove(gajim.LOCAL_ACC)
if not self.xml.get_widget('log_history_checkbutton').get_active(): if not self.xml.get_widget('log_history_checkbutton').get_active():
list_no_log_for.append(self.account) list_no_log_for.append(gajim.LOCAL_ACC)
gajim.config.set_per('accounts', 'zeroconf', 'no_log_for', ' '.join(list_no_log_for)) gajim.config.set_per('accounts', gajim.LOCAL_ACC, 'no_log_for', ' '.join(list_no_log_for))
st = self.xml.get_widget('sync_with_global_status_checkbutton').get_active() st = self.xml.get_widget('sync_with_global_status_checkbutton').get_active()
gajim.config.set_per('accounts', 'zeroconf', 'sync_with_global_status', st) gajim.config.set_per('accounts', gajim.LOCAL_ACC, 'sync_with_global_status', st)
st = self.xml.get_widget('first_name_entry').get_text() st = self.xml.get_widget('first_name_entry').get_text()
gajim.config.set_per('accounts', 'zeroconf', 'zeroconf_first_name', st) gajim.config.set_per('accounts', gajim.LOCAL_ACC, 'zeroconf_first_name', st)
st = self.xml.get_widget('last_name_entry').get_text() st = self.xml.get_widget('last_name_entry').get_text()
gajim.config.set_per('accounts', 'zeroconf', 'zeroconf_last_name', st) gajim.config.set_per('accounts', gajim.LOCAL_ACC, 'zeroconf_last_name', st)
st = self.xml.get_widget('jabber_id_entry').get_text() st = self.xml.get_widget('jabber_id_entry').get_text()
gajim.config.set_per('accounts', 'zeroconf', 'zeroconf_jabber_id', st) gajim.config.set_per('accounts', gajim.LOCAL_ACC, 'zeroconf_jabber_id', st)
st = self.xml.get_widget('email_entry').get_text() st = self.xml.get_widget('email_entry').get_text()
gajim.config.set_per('accounts', 'zeroconf', 'zeroconf_email', st) gajim.config.set_per('accounts', gajim.LOCAL_ACC, 'zeroconf_email', st)
st = self.xml.get_widget('use_tls_checkbutton').get_active() st = self.xml.get_widget('use_tls_checkbutton').get_active()
gajim.config.set_per('accounts', 'zeroconf', 'use_ssl', st) gajim.config.set_per('accounts', gajim.LOCAL_ACC, 'use_ssl', st)
st = self.xml.get_widget('custom_port_checkbutton').get_active() st = self.xml.get_widget('custom_port_checkbutton').get_active()
gajim.config.set_per('accounts', 'zeroconf', 'use_custom_host', st) gajim.config.set_per('accounts', gajim.LOCAL_ACC, 'use_custom_host', st)
if st:
st = self.xml.get_widget('custom_port_entry').get_text() st = self.xml.get_widget('custom_port_entry').get_text()
gajim.config.set_per('accounts', 'zeroconf', 'custom_port', st) gajim.config.set_per('accounts', gajim.LOCAL_ACC, 'custom_port', st)
else:
gajim.config.set_per('accounts', gajim.LOCAL_ACC, 'custom_port', '5298')
if gajim.connections.has_key(gajim.LOCAL_ACC):
gajim.connections[gajim.LOCAL_ACC].reconnect()
self.window.destroy() self.window.destroy()

View file

@ -1853,13 +1853,11 @@ class Interface:
gajim.proxy65_manager = proxy65_manager.Proxy65Manager(gajim.idlequeue) gajim.proxy65_manager = proxy65_manager.Proxy65Manager(gajim.idlequeue)
self.register_handlers() self.register_handlers()
if gajim.config.get('enable_zeroconf'): if gajim.config.get('enable_zeroconf'):
gajim.connections['zeroconf'] = common.zeroconf.connection_zeroconf.ConnectionZeroconf('zeroconf') gajim.connections[gajim.LOCAL_ACC] = common.zeroconf.connection_zeroconf.ConnectionZeroconf(gajim.LOCAL_ACC)
for account in gajim.config.get_per('accounts'): for account in gajim.config.get_per('accounts'):
if account != 'zeroconf': if account != gajim.LOCAL_ACC:
gajim.connections[account] = common.connection.Connection(account) gajim.connections[account] = common.connection.Connection(account)
gtk.about_dialog_set_email_hook(self.on_launch_browser_mailer, 'mail') gtk.about_dialog_set_email_hook(self.on_launch_browser_mailer, 'mail')
gtk.about_dialog_set_url_hook(self.on_launch_browser_mailer, 'url') gtk.about_dialog_set_url_hook(self.on_launch_browser_mailer, 'url')