ui: fixed delay closing the GUI

When closing the GUI we were not stopping notifications channel in all
cases, causing some issues (delays, log in/out problems, ...).

Closes #1217
This commit is contained in:
Gustavo Iñiguez Goia 2024-11-24 00:41:07 +01:00
parent 9a51e88ebc
commit cdf93c72c1
2 changed files with 9 additions and 3 deletions

View file

@ -243,3 +243,7 @@ Examples:
on_exit()
except Exception as e:
print(e)
finally:
if service:
# finish gracefully, closing notifications channel.
service.close()

View file

@ -743,6 +743,11 @@ class UIService(ui_pb2_grpc.UIServicer, QtWidgets.QGraphicsObject):
elif kwargs['action'] == self.NODE_DELETE:
self._delete_node(kwargs['peer'])
def OpenWindow(self):
self._stats_dialog.show()
def close(self):
self._on_close()
def PostAlert(self, alert, context):
proto, addr = self._get_peer(context.peer())
@ -935,6 +940,3 @@ class UIService(ui_pb2_grpc.UIServicer, QtWidgets.QGraphicsObject):
context.cancel()
return node_iter
def OpenWindow(self):
self._stats_dialog.show()