Skip to content

Commit

Permalink
Merge pull request #586 from gem/stop-timers
Browse files Browse the repository at this point in the history
Stop any running timer before unloading the plugin
  • Loading branch information
ptormene authored Jun 20, 2019
2 parents c21fe0c + 9ad3142 commit 8138132
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
5 changes: 4 additions & 1 deletion svir/dialogs/show_console_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,14 @@ def __init__(self, driver_dialog, calc_id):
def refresh_calc_log(self):
calc_status = self.driver_dialog.get_calc_status(self.calc_id)
if calc_status is None:
self.timer.stop()
self.reject()
return
if calc_status['status'] in ('complete', 'failed'):
self.timer.stop()
calc_log = self.driver_dialog.get_calc_log(self.calc_id)
if calc_log:
self.text_browser.append(calc_log)

def reject(self):
self.timer.stop()
super().reject()
5 changes: 5 additions & 0 deletions svir/irmt.py
Original file line number Diff line number Diff line change
Expand Up @@ -556,6 +556,11 @@ def unload(self):
"""
Remove all plugin's actions and corresponding buttons and connects
"""

# stop any running timers
if self.drive_oq_engine_server_dlg is not None:
self.drive_oq_engine_server_dlg.reject()

# Remove the plugin menu items and toolbar icons
for action_name in self.registered_actions:
action = self.registered_actions[action_name]
Expand Down
1 change: 1 addition & 0 deletions svir/metadata.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ [email protected]
changelog=
3.6.0
* Changed the realizations output for OQ-Engine scenario calculations, displaying the GSIM names instead of the branch path
* All possibly running timers are stopped before the plugin is unloaded
3.5.3
* The GUI elements for loading OQ-Engine outputs are in a scrollable area, usable also on low resolution screens
* Some GUI sections can be expanded/collapsed
Expand Down

0 comments on commit 8138132

Please sign in to comment.