From cf5a93407797337f5bc0bcf6878ce10c2efa5749 Mon Sep 17 00:00:00 2001 From: ReimarBauer Date: Sun, 7 Apr 2024 20:11:28 +0200 Subject: [PATCH] disconnect mainwindow_signal_logout_mscolab on the window closeEvent --- mslib/msui/topview.py | 3 --- mslib/msui/viewwindows.py | 5 +++++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/mslib/msui/topview.py b/mslib/msui/topview.py index c4c101f9f..26b729ccd 100644 --- a/mslib/msui/topview.py +++ b/mslib/msui/topview.py @@ -201,9 +201,6 @@ def __init__(self, parent=None, mainwindow=None, model=None, _id=None, self.mainwindow_signal_permission_revoked = mainwindow.signal_permission_revoked self.mainwindow_signal_render_new_permission = mainwindow.signal_render_new_permission self.mainwindow_signal_activate_flighttrack = mainwindow.signal_activate_flighttrack - self.mainwindow_signal_activate_operation = mainwindow.signal_activate_operation - self.mainwindow_signal_login_mscolab = mainwindow.signal_login_mscolab - self.mainwindow_signal_logout_mscolab = mainwindow.signal_logout_mscolab self.mainwindow_listFlightTracks = mainwindow.listFlightTracks self.mainwindow_filterCategoryCb = mainwindow.filterCategoryCb self.mainwindow_listOperationsMSC = mainwindow.listOperationsMSC diff --git a/mslib/msui/viewwindows.py b/mslib/msui/viewwindows.py index a72c62c6d..8e75d9e6a 100644 --- a/mslib/msui/viewwindows.py +++ b/mslib/msui/viewwindows.py @@ -76,6 +76,11 @@ def closeEvent(self, event): Overloads QtGui.QMainWindow.closeEvent(). This method is called if Qt receives a window close request for our application window. """ + if self.mainwindow_signal_logout_mscolab is not None: + # we need to disconnect the mainwindow_signal_logout when the topview is closed + # the next topview will connect one again + self.mainwindow_signal_logout_mscolab.disconnect() + if self.force_close: ret = QtWidgets.QMessageBox.Yes else: