##// END OF EJS Templates
comment/doc logic cleanup
MinRK -
Show More
@@ -34,6 +34,9 b' class MainWindow(QtGui.QMainWindow):'
34 def __init__(self, app, frontend, existing=False):
34 def __init__(self, app, frontend, existing=False):
35 """ Create a MainWindow for the specified FrontendWidget.
35 """ Create a MainWindow for the specified FrontendWidget.
36
36
37 The app is passed as an argument to allow for different
38 closing behavior depending on whether we are the Kernel's parent.
39
37 If existing is True, then this Window does not own the Kernel.
40 If existing is True, then this Window does not own the Kernel.
38 """
41 """
39 super(MainWindow, self).__init__()
42 super(MainWindow, self).__init__()
@@ -57,19 +60,15 b' class MainWindow(QtGui.QMainWindow):'
57 "Close just this console, or shutdown the kernel and close "+
60 "Close just this console, or shutdown the kernel and close "+
58 "all windows attached to it?",
61 "all windows attached to it?",
59 'Cancel', 'Close Console', 'Close All')
62 'Cancel', 'Close Console', 'Close All')
60 if reply == 2:
63 if reply == 2: # close All
61 kernel_manager.shutdown_kernel()
64 kernel_manager.shutdown_kernel()
62 #kernel_manager.stop_channels()
65 #kernel_manager.stop_channels()
63 event.accept()
66 event.accept()
64 elif reply == 1:
67 elif reply == 1: # close Console
65 if self._existing:
68 if not self._existing:
66 # I don't have the Kernel, I can shutdown
69 # I have the kernel: don't quit, just close the window
67 event.accept()
68 else:
69 # only destroy the Window, save the Kernel
70 self._app.setQuitOnLastWindowClosed(False)
70 self._app.setQuitOnLastWindowClosed(False)
71 self.deleteLater()
71 event.accept()
72 event.ignore()
73 else:
72 else:
74 event.ignore()
73 event.ignore()
75
74
General Comments 0
You need to be logged in to leave comments. Login now