Show More
@@ -31,12 +31,13 b' class MainWindow(QtGui.QMainWindow):' | |||
|
31 | 31 | # 'object' interface |
|
32 | 32 | #--------------------------------------------------------------------------- |
|
33 | 33 | |
|
34 | def __init__(self, frontend, existing=False): | |
|
34 | def __init__(self, app, frontend, existing=False): | |
|
35 | 35 | """ Create a MainWindow for the specified FrontendWidget. |
|
36 | 36 | |
|
37 | 37 | If existing is True, then this Window does not own the Kernel. |
|
38 | 38 | """ |
|
39 | 39 | super(MainWindow, self).__init__() |
|
40 | self._app = app | |
|
40 | 41 | self._frontend = frontend |
|
41 | 42 | self._existing = existing |
|
42 | 43 | self._frontend.exit_requested.connect(self.close) |
@@ -56,7 +57,6 b' class MainWindow(QtGui.QMainWindow):' | |||
|
56 | 57 | "Close just this console, or shutdown the kernel and close "+ |
|
57 | 58 | "all windows attached to it?", |
|
58 | 59 | 'Cancel', 'Close Console', 'Close All') |
|
59 | print reply | |
|
60 | 60 | if reply == 2: |
|
61 | 61 | kernel_manager.shutdown_kernel() |
|
62 | 62 | #kernel_manager.stop_channels() |
@@ -67,7 +67,8 b' class MainWindow(QtGui.QMainWindow):' | |||
|
67 | 67 | event.accept() |
|
68 | 68 | else: |
|
69 | 69 | # only destroy the Window, save the Kernel |
|
70 |
self. |
|
|
70 | self._app.setQuitOnLastWindowClosed(False) | |
|
71 | self.deleteLater() | |
|
71 | 72 | event.ignore() |
|
72 | 73 | else: |
|
73 | 74 | event.ignore() |
@@ -146,7 +147,7 b' def main():' | |||
|
146 | 147 | widget.kernel_manager = kernel_manager |
|
147 | 148 | |
|
148 | 149 | # Create the main window. |
|
149 | window = MainWindow(widget, args.existing) | |
|
150 | window = MainWindow(app, widget, args.existing) | |
|
150 | 151 | window.setWindowTitle('Python' if args.pure else 'IPython') |
|
151 | 152 | window.show() |
|
152 | 153 |
General Comments 0
You need to be logged in to leave comments.
Login now