##// END OF EJS Templates
UI: expose confirm_restart via menu checkbox...
Paul Ivanov -
Show More
@@ -552,6 +552,15 b' class MainWindow(QtGui.QMainWindow):'
552
552
553 self.kernel_menu.addSeparator()
553 self.kernel_menu.addSeparator()
554
554
555 self.confirm_restart_kernel_action = QtGui.QAction("Confirm kernel restart",
556 self,
557 checkable=True,
558 checked=self.active_frontend.confirm_restart,
559 triggered=self.toggle_confirm_restart_active_frontend
560 )
561
562 self.add_menu_action(self.kernel_menu, self.confirm_restart_kernel_action)
563
555 def _make_dynamic_magic(self,magic):
564 def _make_dynamic_magic(self,magic):
556 """Return a function `fun` that will execute `magic` on active frontend.
565 """Return a function `fun` that will execute `magic` on active frontend.
557
566
@@ -832,6 +841,16 b' class MainWindow(QtGui.QMainWindow):'
832 def interrupt_kernel_active_frontend(self):
841 def interrupt_kernel_active_frontend(self):
833 self.active_frontend.request_interrupt_kernel()
842 self.active_frontend.request_interrupt_kernel()
834
843
844 def toggle_confirm_restart_active_frontend(self):
845 widget = self.active_frontend
846 widget.confirm_restart = not widget.confirm_restart
847 # XXX: whenever tabs are switched, the checkbox may not be
848 # representative of the state of the active widget. The next line
849 # ensures that at least after toggling, the checkbox represents the
850 # state this widget is in.
851 self.confirm_restart_kernel_action.setChecked(widget.confirm_restart)
852
853
835 def cut_active_frontend(self):
854 def cut_active_frontend(self):
836 widget = self.active_frontend
855 widget = self.active_frontend
837 if widget.can_cut():
856 if widget.can_cut():
General Comments 0
You need to be logged in to leave comments. Login now