# eric6.WebBrowser.TabManager.TabManagerWidget

Module implementing a window for managing the web browser tabs.

### Global Attributes

None

### Classes

TabManagerWidget | Class implementing a window for managing the web browser tabs.

### Functions

None

## TabManagerWidget

Class implementing a window for managing the web browser tabs.

### Signals

groupTypeChanged(int)
  emitted when the 'Group By' value was changed

### Derived from

QWidget

### Class Attributes

GroupByDomain
GroupByHost
GroupByWindow
WebBrowserRole
WebWindowRole
_tldExtractor

### Class Methods

None

### Methods

TabManagerWidget | Constructor
__createEmptyItem | Private method to create an empty tree item.
__customContextMenuRequested | Private slot to show the context menu.
__groupByDomainName | Private method to group the tree items by domain name.
__groupByWindow | Private method to group the tree items by window.
__isBrowserSelected | Private slot to check, if any browser entry is selected.
__itemDoubleClicked | Private slot to handle double clicking a tree item.
__makeWebBrowserViewConnections | Private method to create the signal connections to the web view.
__processActions | Private slot to process the actions.
__refreshTree | Private slot to referesh the tree.
__setGroupType | Private method to set the 'Group By' type.
bookmarkSelectedBrowsers | Public method to bookmark the selected browsers.
changeGroupType | Public slot to change the 'Group By' type.
closeSelectedBrowsers | Public method to close the selected browsers.
createStatusBarIcon | Public method to create a status bar icon.
delayedRefreshTree | Public slot to do a delyed refresh of the tree.
domainFromUrl | Public method to extract the domain from an URL.
mainWindowCreated | Public method to act on the creation of a new web browser window.
raiseTabManager | Public slot to show the tab manager.

### Static Methods

None

#### TabManagerWidget (Constructor)

TabManagerWidget(mainWindow, parent=None, defaultWidget=False)

Constructor

mainWindow (WebBrowserWindow)
  reference to the main window
parent (QWidget)
  reference to the parent widget
defaultWidget (bool)
  flag indicating the default widget

#### TabManagerWidget.__createEmptyItem

__createEmptyItem(parent=None, addToTree=True)

Private method to create an empty tree item.

parent (QTreeWidgetItem or QTreeWidget)
  reference to the parent item
addToTree (bool)
  flag indicating to add the item to the tree

Returns:
  created item

Return Type:
  QTreeWidgetItem

#### TabManagerWidget.__customContextMenuRequested

__customContextMenuRequested(pos)

Private slot to show the context menu.

pos (QPoint)
  position the menu should be shown at

#### TabManagerWidget.__groupByDomainName

__groupByDomainName(useHostName=False)

Private method to group the tree items by domain name.

useHostName (bool)
  flag indicating to use the host name

#### TabManagerWidget.__groupByWindow

__groupByWindow()

Private method to group the tree items by window.

#### TabManagerWidget.__isBrowserSelected

__isBrowserSelected()

Private slot to check, if any browser entry is selected.

Returns:
  flag indicating the existence of a selected entry

Return Type:
  bool

#### TabManagerWidget.__itemDoubleClicked

__itemDoubleClicked(itm, column)

Private slot to handle double clicking a tree item.

itm (QTreeWidgetItem)
  reference to the item having been double clicked
column (int)
  column of the double click

#### TabManagerWidget.__makeWebBrowserViewConnections

__makeWebBrowserViewConnections(view)

Private method to create the signal connections to the web view.

view (WebBrowserView)
  reference to the web view

#### TabManagerWidget.__processActions

__processActions(act)

Private slot to process the actions.

act (QAction)
  reference to the action that triggered

#### TabManagerWidget.__refreshTree

__refreshTree()

Private slot to referesh the tree.

#### TabManagerWidget.__setGroupType

__setGroupType(groupType)

Private method to set the 'Group By' type.

groupType (int (0 - 2))
  'Group By' type to be set

#### TabManagerWidget.bookmarkSelectedBrowsers

bookmarkSelectedBrowsers(browsersDict)

Public method to bookmark the selected browsers.

browsersDict (dict with WebBrowserWindow as key and list of WebBrowserView)
  dictionary containing the browsers per window as value

#### TabManagerWidget.changeGroupType

changeGroupType(act)

Public slot to change the 'Group By' type.

act (QAction)
  reference to the action that was triggered

#### TabManagerWidget.closeSelectedBrowsers

closeSelectedBrowsers(browsersDict)

Public method to close the selected browsers.

browsersDict (dict with WebBrowserWindow as key and list of WebBrowserView)
  dictionary containing the browsers per window as value

#### TabManagerWidget.createStatusBarIcon

createStatusBarIcon()

Public method to create a status bar icon.

Returns:
  generated icon

Return Type:
  E5ClickableLabel

#### TabManagerWidget.delayedRefreshTree

delayedRefreshTree(page=None)

Public slot to do a delyed refresh of the tree.

page (WebBrowserPage)
  reference to the web page

#### TabManagerWidget.domainFromUrl

domainFromUrl(url, useHostName=False)

Public method to extract the domain from an URL.

url (QUrl)
  URL to extract the domain from
useHostName (bool)
  flag indicating to use the host name

Returns:
  domain name

Return Type:
  str

#### TabManagerWidget.mainWindowCreated

mainWindowCreated(mainWin, refresh=True)

Public method to act on the creation of a new web browser window.

mainWin (WebBrowserWindow)
  reference to the web browser window
refresh (bool)
  flag indicating to refresh the widget

#### TabManagerWidget.raiseTabManager

raiseTabManager(icon)

Public slot to show the tab manager.

icon (E5ClickableLabel or QAction)
  reference to the clicked icon

Up