# eric7.EricWidgets.EricToolBarDialog

Module implementing a toolbar configuration dialog.

### Global Attributes

None

### Classes

EricToolBarDialog | Class implementing a toolbar configuration dialog.
EricToolBarItem | Class storing data belonging to a toolbar entry of the toolbar dialog.

### Functions

None

## EricToolBarDialog

Class implementing a toolbar configuration dialog.

### Derived from

QDialog, Ui_EricToolBarDialog

### Class Attributes

ActionIdRole
WidgetActionRole

### Class Methods

None

### Methods

EricToolBarDialog | Constructor
__resetCurrentToolbar | Private method to revert all changes made to the current toolbar.
__restoreCurrentToolbar | Private methdo to restore the current toolbar to the given list of actions.
__restoreCurrentToolbarToDefault | Private method to set the current toolbar to its default configuration.
__saveToolBars | Private method to save the configured toolbars.
__setupButtons | Private slot to set the buttons state.
__toolbarComboBox_currentIndexChanged | Private slot called upon a selection of the current toolbar.
on_actionsTree_currentItemChanged | Private slot called, when the currently selected action changes.
on_buttonBox_clicked | Private slot called, when a button of the button box was clicked.
on_downButton_clicked | Private slot used to move an action down in the list.
on_leftButton_clicked | Private slot to delete an action from the list.
on_newButton_clicked | Private slot to create a new toolbar.
on_removeButton_clicked | Private slot to remove a custom toolbar.
on_renameButton_clicked | Private slot to rename a custom toolbar.
on_rightButton_clicked | Private slot to add an action to the list.
on_toolbarActionsList_currentItemChanged | Private slot to handle a change of the current item.
on_upButton_clicked | Private slot used to move an action up in the list.

### Static Methods

None

#### EricToolBarDialog (Constructor)

EricToolBarDialog(toolBarManager, parent=None)

Constructor

toolBarManager
  reference to a toolbar manager object (EricToolBarManager)
parent
  reference to the parent widget (QWidget)

#### EricToolBarDialog.__resetCurrentToolbar

__resetCurrentToolbar()

Private method to revert all changes made to the current toolbar.

#### EricToolBarDialog.__restoreCurrentToolbar

__restoreCurrentToolbar(actions)

Private methdo to restore the current toolbar to the given list of actions.

actions
  list of actions to set for the current toolbar (list of QAction)

#### EricToolBarDialog.__restoreCurrentToolbarToDefault

__restoreCurrentToolbarToDefault()

Private method to set the current toolbar to its default configuration.

#### EricToolBarDialog.__saveToolBars

__saveToolBars()

Private method to save the configured toolbars.

Raises RuntimeError:
  raised to indicate an invalid action

#### EricToolBarDialog.__setupButtons

__setupButtons()

Private slot to set the buttons state.

#### EricToolBarDialog.__toolbarComboBox_currentIndexChanged

__toolbarComboBox_currentIndexChanged(index)

Private slot called upon a selection of the current toolbar.

index
  index of the new current toolbar (integer)

#### EricToolBarDialog.on_actionsTree_currentItemChanged

on_actionsTree_currentItemChanged(current, previous)

Private slot called, when the currently selected action changes.

current
  reference to the current item (QTreeWidgetItem)
previous
  reference to the previous current item (QTreeWidgetItem)

#### EricToolBarDialog.on_buttonBox_clicked

on_buttonBox_clicked(button)

Private slot called, when a button of the button box was clicked.

button
  reference to the button clicked (QAbstractButton)

#### EricToolBarDialog.on_downButton_clicked

on_downButton_clicked()

Private slot used to move an action down in the list.

#### EricToolBarDialog.on_leftButton_clicked

on_leftButton_clicked()

Private slot to delete an action from the list.

#### EricToolBarDialog.on_newButton_clicked

on_newButton_clicked()

Private slot to create a new toolbar.

#### EricToolBarDialog.on_removeButton_clicked

on_removeButton_clicked()

Private slot to remove a custom toolbar.

#### EricToolBarDialog.on_renameButton_clicked

on_renameButton_clicked()

Private slot to rename a custom toolbar.

#### EricToolBarDialog.on_rightButton_clicked

on_rightButton_clicked()

Private slot to add an action to the list.

#### EricToolBarDialog.on_toolbarActionsList_currentItemChanged

on_toolbarActionsList_currentItemChanged(current, previous)

Private slot to handle a change of the current item.

current
  reference to the current item (QListWidgetItem)
previous
  reference to the previous current item (QListWidgetItem)

#### EricToolBarDialog.on_upButton_clicked

on_upButton_clicked()

Private slot used to move an action up in the list.

Up

## EricToolBarItem

Class storing data belonging to a toolbar entry of the toolbar dialog.

### Derived from

None

### Class Attributes

None

### Class Methods

None

### Methods

EricToolBarItem | Constructor

### Static Methods

None

#### EricToolBarItem (Constructor)

EricToolBarItem(toolBarId, actionIDs, default)

Constructor

toolBarId
  id of the toolbar object (integer)
actionIDs
  list of action IDs belonging to the toolbar (list of integer)
default
  flag indicating a default toolbar (boolean)

Up