[eMerzh and me] ability to restart a new adhoc command without closing / reopening the window. Fixes #5698
This commit is contained in:
parent
bcee7c2125
commit
fc5e91a039
2 changed files with 44 additions and 13 deletions
|
@ -358,6 +358,22 @@
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="spacing">12</property>
|
<property name="spacing">12</property>
|
||||||
<property name="layout_style">end</property>
|
<property name="layout_style">end</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkButton" id="restart_button">
|
||||||
|
<property name="label">gtk-goto-first</property>
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">True</property>
|
||||||
|
<property name="can_default">True</property>
|
||||||
|
<property name="receives_default">False</property>
|
||||||
|
<property name="use_stock">True</property>
|
||||||
|
<signal name="clicked" handler="on_restart_button_clicked"/>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">False</property>
|
||||||
|
<property name="position">0</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkButton" id="back_button">
|
<object class="GtkButton" id="back_button">
|
||||||
<property name="label">gtk-go-back</property>
|
<property name="label">gtk-go-back</property>
|
||||||
|
@ -371,7 +387,7 @@
|
||||||
<packing>
|
<packing>
|
||||||
<property name="expand">False</property>
|
<property name="expand">False</property>
|
||||||
<property name="fill">False</property>
|
<property name="fill">False</property>
|
||||||
<property name="position">0</property>
|
<property name="position">1</property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
|
@ -387,7 +403,7 @@
|
||||||
<packing>
|
<packing>
|
||||||
<property name="expand">False</property>
|
<property name="expand">False</property>
|
||||||
<property name="fill">False</property>
|
<property name="fill">False</property>
|
||||||
<property name="position">1</property>
|
<property name="position">2</property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
|
@ -403,7 +419,7 @@
|
||||||
<packing>
|
<packing>
|
||||||
<property name="expand">False</property>
|
<property name="expand">False</property>
|
||||||
<property name="fill">False</property>
|
<property name="fill">False</property>
|
||||||
<property name="position">2</property>
|
<property name="position">3</property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
|
@ -419,7 +435,7 @@
|
||||||
<packing>
|
<packing>
|
||||||
<property name="expand">False</property>
|
<property name="expand">False</property>
|
||||||
<property name="fill">False</property>
|
<property name="fill">False</property>
|
||||||
<property name="position">3</property>
|
<property name="position">4</property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
|
|
|
@ -55,22 +55,15 @@ class CommandWindow:
|
||||||
# an account object
|
# an account object
|
||||||
self.account = gajim.connections[account]
|
self.account = gajim.connections[account]
|
||||||
self.jid = jid
|
self.jid = jid
|
||||||
|
|
||||||
self.pulse_id = None # to satisfy self.setup_pulsing()
|
|
||||||
self.commandlist = None # a list of (commandname, commanddescription)
|
|
||||||
|
|
||||||
# command's data
|
|
||||||
self.commandnode = commandnode
|
self.commandnode = commandnode
|
||||||
self.sessionid = None
|
self.data_form_widget = None
|
||||||
self.dataform = None
|
|
||||||
self.allow_stage3_close = False
|
|
||||||
|
|
||||||
# retrieving widgets from xml
|
# retrieving widgets from xml
|
||||||
self.xml = gtkgui_helpers.get_gtk_builder('adhoc_commands_window.ui')
|
self.xml = gtkgui_helpers.get_gtk_builder('adhoc_commands_window.ui')
|
||||||
self.window = self.xml.get_object('adhoc_commands_window')
|
self.window = self.xml.get_object('adhoc_commands_window')
|
||||||
self.window.connect('delete-event',
|
self.window.connect('delete-event',
|
||||||
self.on_adhoc_commands_window_delete_event)
|
self.on_adhoc_commands_window_delete_event)
|
||||||
for name in ('back_button', 'forward_button',
|
for name in ('restart_button', 'back_button', 'forward_button',
|
||||||
'execute_button', 'close_button', 'stages_notebook',
|
'execute_button', 'close_button', 'stages_notebook',
|
||||||
'retrieving_commands_stage_vbox',
|
'retrieving_commands_stage_vbox',
|
||||||
'command_list_stage_vbox', 'command_list_vbox',
|
'command_list_stage_vbox', 'command_list_vbox',
|
||||||
|
@ -79,7 +72,22 @@ class CommandWindow:
|
||||||
'error_description_label'):
|
'error_description_label'):
|
||||||
self.__dict__[name] = self.xml.get_object(name)
|
self.__dict__[name] = self.xml.get_object(name)
|
||||||
|
|
||||||
|
self.initiate()
|
||||||
|
|
||||||
|
def initiate(self):
|
||||||
|
|
||||||
|
self.pulse_id = None # to satisfy self.setup_pulsing()
|
||||||
|
self.commandlist = None # a list of (commandname, commanddescription)
|
||||||
|
|
||||||
|
# command's data
|
||||||
|
self.sessionid = None
|
||||||
|
self.dataform = None
|
||||||
|
self.allow_stage3_close = False
|
||||||
|
|
||||||
# creating data forms widget
|
# creating data forms widget
|
||||||
|
if self.data_form_widget:
|
||||||
|
self.sending_form_stage_vbox.remove(self.data_form_widget)
|
||||||
|
self.data_form_widget.destroy()
|
||||||
self.data_form_widget = dataforms_widget.DataFormWidget()
|
self.data_form_widget = dataforms_widget.DataFormWidget()
|
||||||
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)
|
||||||
|
@ -95,6 +103,8 @@ class CommandWindow:
|
||||||
self.xml.connect_signals(self)
|
self.xml.connect_signals(self)
|
||||||
self.window.show_all()
|
self.window.show_all()
|
||||||
|
|
||||||
|
self.restart_button.set_sensitive(False)
|
||||||
|
|
||||||
# These functions are set up by appropriate stageX methods.
|
# These functions are set up by appropriate stageX methods.
|
||||||
def stage_finish(self, *anything):
|
def stage_finish(self, *anything):
|
||||||
pass
|
pass
|
||||||
|
@ -377,6 +387,7 @@ class CommandWindow:
|
||||||
|
|
||||||
if self.form_status == 'completed':
|
if self.form_status == 'completed':
|
||||||
self.close_button.set_sensitive(True)
|
self.close_button.set_sensitive(True)
|
||||||
|
self.restart_button.set_sensitive(True)
|
||||||
self.back_button.hide()
|
self.back_button.hide()
|
||||||
self.forward_button.hide()
|
self.forward_button.hide()
|
||||||
self.execute_button.hide()
|
self.execute_button.hide()
|
||||||
|
@ -393,6 +404,10 @@ class CommandWindow:
|
||||||
self.notes_label.set_no_show_all(True)
|
self.notes_label.set_no_show_all(True)
|
||||||
self.notes_label.hide()
|
self.notes_label.hide()
|
||||||
|
|
||||||
|
def on_restart_button_clicked(self, widget):
|
||||||
|
self.commandnode = None
|
||||||
|
self.initiate()
|
||||||
|
|
||||||
# stage 4: no commands are exposed
|
# stage 4: no commands are exposed
|
||||||
def stage4(self):
|
def stage4(self):
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Add table
Reference in a new issue