The refresh button in the toolbar reloads the currently active workflow module.

This commit is contained in:
Einar Ryeng 2006-04-25 10:46:06 +00:00
parent 9d7a5ba769
commit 16820cf29e
2 changed files with 26 additions and 1 deletions

12
fluent
View File

@ -93,7 +93,8 @@ class FluentApp:
'on_zoom_out_button_clicked' : (self.on_multiple_view),
'on_new1_activate' : (self.on_create_project),
'on_button_new_clicked' : (self.on_create_project),
'on_about1_activate' : (self.on_help_about)}
'on_about1_activate' : (self.on_help_about),
'on_workflow_refresh_clicked' : (self.on_workflow_refresh_clicked)}
self.widget_tree.signal_autoconnect(signals)
# Log that we've set up the app now
@ -123,6 +124,15 @@ class FluentApp:
about = widget_tree.get_widget('aboutdialog')
about.run()
def on_workflow_refresh_clicked(self, *ignored):
try:
reload(sys.modules[self.workflow.__class__.__module__])
except Exception, e:
logger.log('error', 'Relading workflow failed.')
logger.log('error', e)
else:
logger.log('notice', 'Successfully reloaded workflow.')
if __name__ == '__main__':
gnome.program_init(PROGRAM_NAME, VERSION)
app = FluentApp()

View File

@ -299,6 +299,21 @@
<property name="homogeneous">True</property>
</packing>
</child>
<child>
<widget class="GtkToolButton" id="workflow_refresh">
<property name="visible">True</property>
<property name="stock_id">gtk-refresh</property>
<property name="visible_horizontal">True</property>
<property name="visible_vertical">True</property>
<property name="is_important">False</property>
<signal name="clicked" handler="on_workflow_refresh_clicked" last_modification_time="Tue, 25 Apr 2006 10:13:36 GMT"/>
</widget>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
</widget>
</child>
</widget>