##// END OF EJS Templates
fx tab name and already existing kernel before application launch...
Matthias BUSSONNIER -
Show More
@@ -231,7 +231,7 b' class MainWindow(QtGui.QMainWindow):'
231
231
232 """
232 """
233 if not name:
233 if not name:
234 name=str('no Name '+str(self.tabWidget.count()))
234 name=str('kernel '+str(self.tabWidget.count()))
235 self.tabWidget.addTab(frontend,name)
235 self.tabWidget.addTab(frontend,name)
236 self.updateTabBarVisibility()
236 self.updateTabBarVisibility()
237 frontend.exit_requested.connect(self.closeTab)
237 frontend.exit_requested.connect(self.closeTab)
@@ -823,20 +823,21 b' class IPythonQtConsoleApp(BaseIPythonApplication):'
823 self.kernel_manager.start_channels()
823 self.kernel_manager.start_channels()
824
824
825 def createTabWithNewFrontend(self):
825 def createTabWithNewFrontend(self):
826 """ Create new tab attached to new kernel, launched on localhost.
827 """
826 kernel_manager = QtKernelManager(
828 kernel_manager = QtKernelManager(
827 shell_address=(self.ip, self.shell_port),
829 shell_address=(LOCALHOST,0 ),
828 sub_address=(self.ip, self.iopub_port),
830 sub_address=(LOCALHOST, 0),
829 stdin_address=(self.ip, self.stdin_port),
831 stdin_address=(LOCALHOST, 0),
830 hb_address=(self.ip, self.hb_port),
832 hb_address=(LOCALHOST, 0),
831 config=self.config
833 config=self.config
832 )
834 )
833 # start the kernel
835 # start the kernel
834 if not self.existing:
836 kwargs = dict(ip=LOCALHOST, ipython=not self.pure)
835 kwargs = dict(ip=self.ip, ipython=not self.pure)
837 kwargs['extra_arguments'] = self.kernel_argv
836 kwargs['extra_arguments'] = self.kernel_argv
838 kernel_manager.start_kernel(**kwargs)
837 kernel_manager.start_kernel(**kwargs)
838 kernel_manager.start_channels()
839 kernel_manager.start_channels()
839 local_kernel = (not self.existing) or self.ip in LOCAL_IPS
840 local_kernel = (not False) or self.ip in LOCAL_IPS
840 widget = self.widget_factory(config=self.config,
841 widget = self.widget_factory(config=self.config,
841 local_kernel=local_kernel)
842 local_kernel=local_kernel)
842 widget.kernel_manager = kernel_manager
843 widget.kernel_manager = kernel_manager
@@ -846,16 +847,16 b' class IPythonQtConsoleApp(BaseIPythonApplication):'
846 self.window.addTabWithFrontend(widget)
847 self.window.addTabWithFrontend(widget)
847
848
848 def createTabAttachedToCurrentTabKernel(self):
849 def createTabAttachedToCurrentTabKernel(self):
849 currentWidget=self.window.tabWidget.currentWidget()
850 currentWidget = self.window.tabWidget.currentWidget()
850 currentWidgetIndex=self.window.tabWidget.indexOf(currentWidget)
851 currentWidgetIndex = self.window.tabWidget.indexOf(currentWidget)
851 ckm=currentWidget.kernel_manager;
852 currentWidget.kernel_manager = currentWidget.kernel_manager;
852 cwname=self.window.tabWidget.tabText(currentWidgetIndex);
853 currentWidgetName = self.window.tabWidget.tabText(currentWidgetIndex);
853 kernel_manager = QtKernelManager(
854 kernel_manager = QtKernelManager(
854 shell_address=ckm.shell_address,
855 shell_address = currentWidget.kernel_manager.shell_address,
855 sub_address=ckm.sub_address,
856 sub_address = currentWidget.kernel_manager.sub_address,
856 stdin_address=ckm.stdin_address,
857 stdin_address = currentWidget.kernel_manager.stdin_address,
857 hb_address=ckm.hb_address,
858 hb_address = currentWidget.kernel_manager.hb_address,
858 config=self.config
859 config = self.config
859 )
860 )
860 kernel_manager.start_channels()
861 kernel_manager.start_channels()
861 local_kernel = (not self.existing) or self.ip in LOCAL_IPS
862 local_kernel = (not self.existing) or self.ip in LOCAL_IPS
@@ -864,7 +865,7 b' class IPythonQtConsoleApp(BaseIPythonApplication):'
864 widget._confirm_exit=True;
865 widget._confirm_exit=True;
865 widget._may_close=False;
866 widget._may_close=False;
866 widget.kernel_manager = kernel_manager
867 widget.kernel_manager = kernel_manager
867 self.window.addTabWithFrontend(widget,name=str('('+cwname+') slave'))
868 self.window.addTabWithFrontend(widget,name=str('('+currentWidgetName+') slave'))
868
869
869 def init_qt_elements(self):
870 def init_qt_elements(self):
870 # Create the widget.
871 # Create the widget.
General Comments 0
You need to be logged in to leave comments. Login now