##// END OF EJS Templates
simplified close message
MinRK -
Show More
@@ -48,20 +48,24 b' class MainWindow(QtGui.QMainWindow):'
48 """ Reimplemented to prompt the user and close the kernel cleanly.
48 """ Reimplemented to prompt the user and close the kernel cleanly.
49 """
49 """
50 kernel_manager = self._frontend.kernel_manager
50 kernel_manager = self._frontend.kernel_manager
51 # closeall =
51 if kernel_manager and kernel_manager.channels_running:
52 if kernel_manager and kernel_manager.channels_running:
52 title = self.window().windowTitle()
53 title = self.window().windowTitle()
53 reply = QtGui.QMessageBox.question(self, title,
54 reply = QtGui.QMessageBox.question(self, title,
54 "Closing console. Shutdown kernel as well?\n"+
55 "Close just this console, or shutdown the kernel and close "+
55 "'Yes' will close the kernel and all connected consoles.",
56 "all windows attached to it?", "Cancel",
56 QtGui.QMessageBox.Yes, QtGui.QMessageBox.No, QtGui.QMessageBox.Cancel)
57 'Close Console', 'Close All')
57 if reply == QtGui.QMessageBox.Yes:
58 print reply
59 if reply == 2:
58 kernel_manager.shutdown_kernel()
60 kernel_manager.shutdown_kernel()
59 #kernel_manager.stop_channels()
61 #kernel_manager.stop_channels()
60 event.accept()
62 event.accept()
61 elif reply == QtGui.QMessageBox.No:
63 elif reply == 1:
62 if self._existing:
64 if self._existing:
65 # I don't have the Kernel, I can shutdown
63 event.accept()
66 event.accept()
64 else:
67 else:
68 # only destroy the Window, save the Kernel
65 self.destroy()
69 self.destroy()
66 event.ignore()
70 event.ignore()
67 else:
71 else:
General Comments 0
You need to be logged in to leave comments. Login now