The Qt MainWindow for the QtConsole
This is a tabbed pseudo-terminal of IPython sessions, with a menu bar for common actions.
Create a tabbed MainWindow for managing IPython FrontendWidgets
app : reference to QApplication parent
confirm_exit : bool, optional
new_frontend_factory : callable
slave_frontend_factory : callable
Add action to menu as well as self
So that when the menu bar is invisible, its actions are still available.
If defer_shortcut is True, set the shortcut context to widget-only, where it will avoid conflict with shortcuts already bound to the widgets themselves.
insert a tab with a given frontend in the tab bar, and give it a name
Forward the close event to every tabs contained by the windows
Called when you need to try to close a tab.
It takes the number of the tab to be closed as argument, or a reference to the widget inside this tab
create a new frontend attached to the same kernel as the current tab
create a new frontend and attach it to a new tab
Try to return the frontend that owns the kernel attached to the given widget/tab.
Only finds frontend owned by the current application. Selection based on port of the kernel might be inaccurate if several kernel on different ip use same port number.
This function does the conversion tabNumber/widget if needed. Might return None if no master widget (non local kernel) Will crash IPython if more than 1 masterWidget
When asList set to True, always return a list of widget(s) owning the kernel. The list might be empty or containing several Widget.
return all the frontends that do not own the kernel attached to the given widget/tab.
Only find frontends owned by the current application. Selection based on connection file of the kernel.
This function does the conversion tabNumber/widget if needed.
constantly increasing counter for kernel IDs
Clean “All Magics...” menu and repopulate it with display_data
display_data : dict,
Update the list of magics in the “All Magics...” Menu
Request the kernel with the list of available magics and populate the menu with the list received back
update visibility of the tabBar depending of the number of tab
0 or 1 tab, tabBar hidden 2+ tabs, tabBar visible
send a self.close if number of tab ==0
need to be called explicitly, or be connected to tabInserted/tabRemoved