summaryrefslogtreecommitdiff
path: root/src/leap/bitmask/gui/preferenceswindow.py
diff options
context:
space:
mode:
authorelijah <elijah@riseup.net>2014-09-19 14:22:42 -0700
committerelijah <elijah@riseup.net>2014-09-19 14:23:14 -0700
commitd47adca6cb7494e55c4a9fbc88896c62c06affa5 (patch)
tree7b53fbd9344baeadd569ca972a401cd4d52b1771 /src/leap/bitmask/gui/preferenceswindow.py
parent0ad8c8ea3f8d5130f44aa90b55da59622d0048c7 (diff)
single pref win: fix problems with cleaning up closed windows (lambdas were keeping the python object from getting garbage collected, and this keeps the old signal connections active)
Diffstat (limited to 'src/leap/bitmask/gui/preferenceswindow.py')
-rw-r--r--src/leap/bitmask/gui/preferenceswindow.py14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/leap/bitmask/gui/preferenceswindow.py b/src/leap/bitmask/gui/preferenceswindow.py
index e18be976..f1252301 100644
--- a/src/leap/bitmask/gui/preferenceswindow.py
+++ b/src/leap/bitmask/gui/preferenceswindow.py
@@ -59,7 +59,7 @@ class PreferencesWindow(QtGui.QDialog):
self.ui = Ui_Preferences()
self.ui.setupUi(self)
- self.ui.close_button.clicked.connect(self.close_window)
+ self.ui.close_button.clicked.connect(self.close)
self.ui.account_label.setText(account.address)
self.app.service_selection_changed.connect(self._update_icons)
@@ -129,26 +129,20 @@ class PreferencesWindow(QtGui.QDialog):
self.ui.pages_widget.addWidget(self._vpn_page)
self.ui.pages_widget.addWidget(self._email_page)
- def closeEvent(self, e):
- """
- Override closeEvent to capture when user closes the window.
- """
- self.close_window()
-
#
# Slots
#
- @QtCore.Slot()
- def close_window(self):
+ def closeEvent(self, e):
"""
TRIGGERS:
self.ui.close_button.clicked
+ (since self.close() will trigger closeEvent)
+ whenever the window is closed
Close this dialog and destroy it.
"""
PreferencesWindow._current_window = None
- self.close()
# deleteLater does not seem to cascade to items in stackLayout
# (even with QtCore.Qt.WA_DeleteOnClose attribute).