changeset fd021f7d2795 in /home/hg/repos/gajim
details:http://hg.gajim.org/gajim?cmd=changeset;node=fd021f7d2795 description: really execute ad hoc command when clicking on Execute command in disco window diffstat:
src/adhoc_commands.py | 12 ++++++++---- src/disco.py | 5 +++-- 2 files changed, 11 insertions(+), 6 deletions(-)
diffs (57 lines):
diff -r 715d6986b745 -r fd021f7d2795 src/adhoc_commands.py --- a/src/adhoc_commands.py Thu Jun 04 22:46:05 2009 +0200 +++ b/src/adhoc_commands.py Fri Jun 05 21:26:23 2009 +0200 @@ -44,7 +44,7 @@
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.'''
# an account object @@ -55,7 +55,7 @@ self.commandlist=None # a list of (commandname, commanddescription)
# command's data - self.commandnode = None + self.commandnode = commandnode self.sessionid = None self.dataform = None self.allow_stage3_close = False @@ -78,8 +78,12 @@ self.data_form_widget.show() self.sending_form_stage_vbox.pack_start(self.data_form_widget)
- # setting initial stage - self.stage1() + if self.commandnode: + # Execute command + self.stage3() + else: + # setting initial stage + self.stage1()
# displaying the window self.xml.signal_autoconnect(self) diff -r 715d6986b745 -r fd021f7d2795 src/disco.py --- a/src/disco.py Thu Jun 04 22:46:05 2009 +0200 +++ b/src/disco.py Fri Jun 05 21:26:23 2009 +0200 @@ -1258,14 +1258,15 @@ self._renderer.set_property('cell-background', bgcolor) self.window.services_treeview.queue_draw()
- def on_execute_button_clicked(self, widget = None): + def on_execute_button_clicked(self, widget=None): '''When we want to execute a command: open adhoc command window''' model, iter_ = self.window.services_treeview.get_selection().get_selected() if not iter_: return 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): '''When we want to register an agent: