# eric6.Preferences.ShortcutsDialog

Module implementing a dialog for the configuration of eric6's keyboard shortcuts.

### Global Attributes

None

### Classes

ShortcutsDialog | Class implementing a dialog for the configuration of eric6's keyboard shortcuts.

### Functions

None

## ShortcutsDialog

Class implementing a dialog for the configuration of eric6's keyboard shortcuts.

### Signals

updateShortcuts()
  emitted when the user pressed the dialogs OK button

### Derived from

QDialog, Ui_ShortcutsDialog

### Class Attributes

noCheckRole
objectNameRole
objectTypeRole

### Class Methods

None

### Methods

ShortcutsDialog | Constructor
__checkShortcut | Private method to check a keysequence for uniqueness.
__generateCategoryItem | Private method to generate a category item.
__generateShortcutItem | Private method to generate a keyboard shortcut item.
__resizeColumns | Private method to resize the list columns.
__resort | Private method to resort the tree.
__saveCategoryActions | Private method to save the actions for a category.
__shortcutChanged | Private slot to handle the shortcutChanged signal of the shortcut dialog.
on_actionButton_toggled | Private slot called, when the action radio button is toggled.
on_buttonBox_accepted | Private slot to handle the OK button press.
on_searchEdit_textChanged | Private slot called, when the text in the search edit changes.
on_shortcutButton_toggled | Private slot called, when the shortcuts radio button is toggled.
on_shortcutsList_itemChanged | Private slot to handle the edit of a shortcut key.
on_shortcutsList_itemClicked | Private slot to handle a click in the shortcuts list.
on_shortcutsList_itemDoubleClicked | Private slot to handle a double click in the shortcuts list.
populate | Public method to populate the dialog.

### Static Methods

None

#### ShortcutsDialog (Constructor)

ShortcutsDialog(parent=None, name=None, modal=False)

Constructor

parent
  The parent widget of this dialog. (QWidget)
name
  The name of this dialog. (string)
modal
  Flag indicating a modal dialog. (boolean)

#### ShortcutsDialog.__checkShortcut

__checkShortcut(keysequence, objectType, origTopItem)

Private method to check a keysequence for uniqueness.

keysequence
  the keysequence to check (QKeySequence)
objectType
  type of the object (string). Entries with the same object type are not checked for uniqueness.
origTopItem
  refrence to the parent of the item to be checked (QTreeWidgetItem)

Returns:
  flag indicating uniqueness (boolean)

#### ShortcutsDialog.__generateCategoryItem

__generateCategoryItem(title)

Private method to generate a category item.

title
  title for the item (string)

Returns:
  reference to the category item (QTreeWidgetItem)

#### ShortcutsDialog.__generateShortcutItem

__generateShortcutItem(category, action, noCheck=False, objectType="")

Private method to generate a keyboard shortcut item.

category
  reference to the category item (QTreeWidgetItem)
action
  reference to the keyboard action (E5Action)
noCheck=
  flag indicating that no uniqueness check should be performed (boolean)
objectType=
  type of the object (string). Objects of the same type are not checked for duplicate shortcuts.

#### ShortcutsDialog.__resizeColumns

__resizeColumns()

Private method to resize the list columns.

#### ShortcutsDialog.__resort

__resort()

Private method to resort the tree.

#### ShortcutsDialog.__saveCategoryActions

__saveCategoryActions(category, actions)

Private method to save the actions for a category.

category
  reference to the category item (QTreeWidgetItem)
actions
  list of actions for the category (list of E5Action)

#### ShortcutsDialog.__shortcutChanged

__shortcutChanged(keysequence, altKeysequence, noCheck, objectType)

Private slot to handle the shortcutChanged signal of the shortcut dialog.

keysequence
  the keysequence of the changed action (QKeySequence)
altKeysequence
  the alternative keysequence of the changed action (QKeySequence)
noCheck
  flag indicating that no uniqueness check should be performed (boolean)
objectType
  type of the object (string).

#### ShortcutsDialog.on_actionButton_toggled

on_actionButton_toggled(checked)

Private slot called, when the action radio button is toggled.

checked
  state of the action radio button (boolean)

#### ShortcutsDialog.on_buttonBox_accepted

on_buttonBox_accepted()

Private slot to handle the OK button press.

#### ShortcutsDialog.on_searchEdit_textChanged

on_searchEdit_textChanged(txt)

Private slot called, when the text in the search edit changes.

txt
  text of the search edit (string)

#### ShortcutsDialog.on_shortcutButton_toggled

on_shortcutButton_toggled(checked)

Private slot called, when the shortcuts radio button is toggled.

checked
  state of the shortcuts radio button (boolean)

#### ShortcutsDialog.on_shortcutsList_itemChanged

on_shortcutsList_itemChanged(itm, column)

Private slot to handle the edit of a shortcut key.

itm
  reference to the item changed (QTreeWidgetItem)
column
  column changed (integer)

#### ShortcutsDialog.on_shortcutsList_itemClicked

on_shortcutsList_itemClicked(itm, column)

Private slot to handle a click in the shortcuts list.

itm
  the list item that was clicked (QTreeWidgetItem)
column
  the list item was clicked in (integer)

#### ShortcutsDialog.on_shortcutsList_itemDoubleClicked

on_shortcutsList_itemDoubleClicked(itm, column)

Private slot to handle a double click in the shortcuts list.

itm
  the list item that was double clicked (QTreeWidgetItem)
column
  the list item was double clicked in (integer)

#### ShortcutsDialog.populate

populate()

Public method to populate the dialog.

Up