# eric4.Preferences.ShortcutsDialog

Module implementing a dialog for the configuration of eric4s keyboard shortcuts.

### Global Attributes

None

### Classes

ShortcutsDialog | Class implementing a dialog for the configuration of eric4s keyboard shortcuts.

### Functions

None

## ShortcutsDialog

Class implementing a dialog for the configuration of eric4s keyboard shortcuts.

### Derived from

QDialog, Ui_ShortcutsDialog

### Class Attributes

noCheckRole
objectNameRole
objectTypeRole

### 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_clearSearchButton_clicked | Private slot called by a click of the clear search button.
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.

#### ShortcutsDialog (Constructor)

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

Constructor

parent
  The parent widget of this dialog. (QWidget)
name
  The name of this dialog. (QString)
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 (QString)

Returns:
  reference to the category item (QTreeWidgetItem)

#### ShortcutsDialog.__generateShortcutItem

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

Private method to generate a keyboard shortcut item.

category
  reference to the category item (QTreeWidgetItem)
action
  reference to the keyboard action (E4Action)
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 E4Action)

#### 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_clearSearchButton_clicked

on_clearSearchButton_clicked()

Private slot called by a click of the clear search button.

#### 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 (QString)

#### 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