Merge with latest rev at default branch.

This commit is contained in:
Mateusz Biliński 2009-06-07 02:08:42 +02:00
commit 85163360c6
3 changed files with 12 additions and 7 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,8 +78,12 @@ 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)
# setting initial stage if self.commandnode:
self.stage1() # Execute command
self.stage3()
else:
# setting initial stage
self.stage1()
# displaying the window # displaying the window
self.xml.signal_autoconnect(self) self.xml.signal_autoconnect(self)

View File

@ -1258,14 +1258,15 @@ class ToplevelAgentBrowser(AgentBrowser):
self._renderer.set_property('cell-background', bgcolor) self._renderer.set_property('cell-background', bgcolor)
self.window.services_treeview.queue_draw() 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: '''When we want to execute a command:
open adhoc command window''' open adhoc command window'''
model, iter_ = self.window.services_treeview.get_selection().get_selected() model, iter_ = self.window.services_treeview.get_selection().get_selected()
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:

View File

@ -589,7 +589,7 @@ _('Connection with peer cannot be established.'))
return return
file_props['elapsed-time'] = 0 file_props['elapsed-time'] = 0
self.files_props[file_props['type']][file_props['sid']] = file_props self.files_props[file_props['type']][file_props['sid']] = file_props
iter_ = self.model.append() iter_ = self.model.prepend()
text_labels = '<b>' + _('Name: ') + '</b>\n' text_labels = '<b>' + _('Name: ') + '</b>\n'
if file_props['type'] == 'r': if file_props['type'] == 'r':
text_labels += '<b>' + _('Sender: ') + '</b>' text_labels += '<b>' + _('Sender: ') + '</b>'