summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomás Touceda <chiiph@leap.se>2014-08-06 16:25:49 -0300
committerTomás Touceda <chiiph@leap.se>2014-08-06 16:25:49 -0300
commit465c0b89ca61279eb036afec2de3b4d24b257311 (patch)
tree838ef2999e1540047c1b22b1641fa19f447aa6ab
parentaaec2c78dc0bf39d7d4b9ae930de9b7f95ae763c (diff)
parente6a7feeb93a27ef36d15dddcb45c2cc4812a37b0 (diff)
Merge remote-tracking branch 'refs/remotes/ivan/bug/logger-hangs-quit' into develop
-rw-r--r--changes/bug_logger-hangs-quit1
-rw-r--r--src/leap/bitmask/gui/loggerwindow.py4
-rw-r--r--src/leap/bitmask/gui/mainwindow.py21
3 files changed, 9 insertions, 17 deletions
diff --git a/changes/bug_logger-hangs-quit b/changes/bug_logger-hangs-quit
new file mode 100644
index 00000000..b76f6218
--- /dev/null
+++ b/changes/bug_logger-hangs-quit
@@ -0,0 +1 @@
+- Fix logger window blocking the bitmask quit().
diff --git a/src/leap/bitmask/gui/loggerwindow.py b/src/leap/bitmask/gui/loggerwindow.py
index c4f44dd7..360dd5f0 100644
--- a/src/leap/bitmask/gui/loggerwindow.py
+++ b/src/leap/bitmask/gui/loggerwindow.py
@@ -40,14 +40,14 @@ class LoggerWindow(QtGui.QDialog):
_paste_ok = QtCore.Signal(object)
_paste_error = QtCore.Signal(object)
- def __init__(self, handler):
+ def __init__(self, parent, handler):
"""
Initialize the widget with the custom handler.
:param handler: Custom handler that supports history and signal.
:type handler: LeapLogHandler.
"""
- QtGui.QDialog.__init__(self)
+ QtGui.QDialog.__init__(self, parent)
leap_assert(handler, "We need a handler for the logger window")
leap_assert_type(handler, LeapLogHandler)
diff --git a/src/leap/bitmask/gui/mainwindow.py b/src/leap/bitmask/gui/mainwindow.py
index 1bc4c96f..389ff172 100644
--- a/src/leap/bitmask/gui/mainwindow.py
+++ b/src/leap/bitmask/gui/mainwindow.py
@@ -277,8 +277,6 @@ class MainWindow(QtGui.QMainWindow):
self._wizard = None
self._wizard_firstrun = False
- self._logger_window = None
-
self._start_hidden = start_hidden
self._backend_pid = backend_pid
@@ -568,17 +566,13 @@ class MainWindow(QtGui.QMainWindow):
Display the window with the history of messages logged until now
and displays the new ones on arrival.
"""
- if self._logger_window is None:
- leap_log_handler = self._get_leap_logging_handler()
- if leap_log_handler is None:
- logger.error('Leap logger handler not found')
- return
- else:
- self._logger_window = LoggerWindow(handler=leap_log_handler)
- self._logger_window.setVisible(
- not self._logger_window.isVisible())
+ leap_log_handler = self._get_leap_logging_handler()
+ if leap_log_handler is None:
+ logger.error('Leap logger handler not found')
+ return
else:
- self._logger_window.setVisible(not self._logger_window.isVisible())
+ lw = LoggerWindow(self, handler=leap_log_handler)
+ lw.show()
@QtCore.Slot()
def _show_AKM(self):
@@ -1837,9 +1831,6 @@ class MainWindow(QtGui.QMainWindow):
if self._wizard:
self._wizard.close()
- if self._logger_window is not None:
- self._logger_window.close()
-
# Set this in case that the app is hidden
QtGui.QApplication.setQuitOnLastWindowClosed(True)