we can now modify our transportregistration (JEP-0100)

This commit is contained in:
Yann Leboulanger 2005-05-25 22:15:28 +00:00
parent 693aad9b19
commit 492a21a5cb
2 changed files with 20 additions and 7 deletions

View File

@ -1389,7 +1389,7 @@ class Service_registration_window:
nbrow = 0 nbrow = 0
table = self.xml.get_widget('table') table = self.xml.get_widget('table')
for name in self.infos.keys(): for name in self.infos.keys():
if name == 'key' or name == 'instructions' or name == 'x': if name in ['key', 'instructions', 'x', 'registered']:
continue continue
nbrow = nbrow + 1 nbrow = nbrow + 1
@ -1412,6 +1412,11 @@ class Service_registration_window:
send registration info to the core''' send registration info to the core'''
for name in self.entries.keys(): for name in self.entries.keys():
self.infos[name] = self.entries[name].get_text() self.infos[name] = self.entries[name].get_text()
if self.infos.has_key('instructions'):
del self.infos['instructions']
if self.infos.has_key('registered'):
del self.infos['registered']
else:
user1 = User(self.service, self.service, ['Transports'], 'offline', user1 = User(self.service, self.service, ['Transports'], 'offline',
'offline', 'from', '', '', 0, '') 'offline', 'from', '', '', 0, '')
self.plugin.roster.contacts[self.account][self.service] = [user1] self.plugin.roster.contacts[self.account][self.service] = [user1]

View File

@ -430,6 +430,10 @@ class Roster_window:
'''When an agent is requested to log in or off''' '''When an agent is requested to log in or off'''
gajim.connections[account].send_agent_status(jid, state) gajim.connections[account].send_agent_status(jid, state)
def on_edit_agent(self, widget, user, account):
'''When we want to modify the agent registration'''
gajim.connections[account].request_register_agent_info(user.jid)
def on_remove_agent(self, widget, user, account): def on_remove_agent(self, widget, user, account):
'''When an agent is requested to log in or off''' '''When an agent is requested to log in or off'''
window = dialogs.Confirmation_dialog(_('Are you sure you want to remove %s transport from your roster?') % user.jid) window = dialogs.Confirmation_dialog(_('Are you sure you want to remove %s transport from your roster?') % user.jid)
@ -534,14 +538,14 @@ class Roster_window:
account = model.get_value(iter, 4) account = model.get_value(iter, 4)
user = self.contacts[account][jid][0] user = self.contacts[account][jid][0]
menu = gtk.Menu() menu = gtk.Menu()
item = gtk.MenuItem(_('Log on')) item = gtk.MenuItem(_('_Log on'))
show = self.contacts[account][jid][0].show show = self.contacts[account][jid][0].show
if show != 'offline' and show != 'error': if show != 'offline' and show != 'error':
item.set_sensitive(False) item.set_sensitive(False)
menu.append(item) menu.append(item)
item.connect('activate', self.on_agent_logging, jid, 'available', account) item.connect('activate', self.on_agent_logging, jid, 'available', account)
item = gtk.MenuItem(_('Log off')) item = gtk.MenuItem(_('Log _off'))
if show == 'offline' or show == 'error': if show == 'offline' or show == 'error':
item.set_sensitive(False) item.set_sensitive(False)
menu.append(item) menu.append(item)
@ -551,7 +555,11 @@ class Roster_window:
item = gtk.MenuItem() item = gtk.MenuItem()
menu.append(item) menu.append(item)
item = gtk.MenuItem(_('Remove')) item = gtk.MenuItem(_('_Edit'))
menu.append(item)
item.connect('activate', self.on_edit_agent, user, account)
item = gtk.MenuItem(_('_Remove'))
menu.append(item) menu.append(item)
item.connect('activate', self.on_remove_agent, user, account) item.connect('activate', self.on_remove_agent, user, account)