[GTKUI] Fix open dialogs preventing gtk app closing

This commit is contained in:
Calum Lind 2015-11-15 12:47:07 +00:00
parent 058b0e41d2
commit fc9bc2976f
1 changed files with 6 additions and 0 deletions

View File

@ -237,6 +237,8 @@ class GtkUI(object):
self.daemon_bps = (0, 0, 0)
self.rpc_stats = LoopingCall(self.print_rpc_stats)
# Twisted catches signals to terminate, so have it call a pre_shutdown method.
reactor.addSystemEventTrigger("before", "shutdown", self.pre_shutdown)
reactor.callWhenRunning(self._on_reactor_start)
# Initialize gdk threading
@ -260,6 +262,10 @@ class GtkUI(object):
# Make sure the config is saved.
self.config.save()
def pre_shutdown(self, *args, **kwargs):
"""Modal dialogs can prevent the application exiting so destroy mainwindow"""
self.mainwindow.window.destroy()
def print_rpc_stats(self):
if not client.connected():
return