really execute ad hoc command when clicking on Execute command in disco window

This commit is contained in:
Yann Leboulanger 2009-06-05 21:26:23 +02:00
parent d844f7f632
commit 610a747c79
2 changed files with 11 additions and 6 deletions

View file

@ -44,7 +44,7 @@ class CommandWindow:
TODO: gtk 2.10 has a special wizard-widget, consider using it...''' TODO: gtk 2.10 has a special wizard-widget, consider using it...'''
def __init__(self, account, jid): def __init__(self, account, jid, commandnode=None):
'''Create new window.''' '''Create new window.'''
# an account object # an account object
@ -55,7 +55,7 @@ class CommandWindow:
self.commandlist=None # a list of (commandname, commanddescription) self.commandlist=None # a list of (commandname, commanddescription)
# command's data # command's data
self.commandnode = None self.commandnode = commandnode
self.sessionid = None self.sessionid = None
self.dataform = None self.dataform = None
self.allow_stage3_close = False self.allow_stage3_close = False
@ -78,6 +78,10 @@ class CommandWindow:
self.data_form_widget.show() self.data_form_widget.show()
self.sending_form_stage_vbox.pack_start(self.data_form_widget) self.sending_form_stage_vbox.pack_start(self.data_form_widget)
if self.commandnode:
# Execute command
self.stage3()
else:
# setting initial stage # setting initial stage
self.stage1() self.stage1()

View file

@ -1265,7 +1265,8 @@ class ToplevelAgentBrowser(AgentBrowser):
if not iter_: if not iter_:
return return
service = model[iter_][0].decode('utf-8') service = model[iter_][0].decode('utf-8')
adhoc_commands.CommandWindow(self.account, service) node = model[iter_][1].decode('utf-8')
adhoc_commands.CommandWindow(self.account, service, commandnode=node)
def on_register_button_clicked(self, widget = None): def on_register_button_clicked(self, widget = None):
'''When we want to register an agent: '''When we want to register an agent: