Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop any running timer before unloading the plugin #586

Merged
merged 4 commits into from
Jun 20, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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