# eric7.Preferences.ConfigurationDialog

Module implementing a dialog for the configuration of eric.

### Global Attributes

None

### Classes

ConfigurationDialog | Class for the dialog variant.
ConfigurationMode | Class defining the various modes of the configuration widget.
ConfigurationPageItem | Class implementing a QTreeWidgetItem holding the configuration page data.
ConfigurationWidget | Class implementing a dialog for the configuration of eric.
ConfigurationWindow | Main window class for the standalone dialog.

### Functions

None

## ConfigurationDialog

Class for the dialog variant.

### Signals

mainPasswordChanged(str, str)
  emitted after the main password has been changed with the old and the new password
preferencesChanged()
  emitted after settings have been changed

### Derived from

QDialog

### Class Attributes

None

### Class Methods

None

### Methods

ConfigurationDialog | Constructor
__mainPasswordChanged | Private slot to handle the change of the main password.
__preferencesChanged | Private slot to handle a change of the preferences.
accept | Public method to accept the dialog.
getConfigurationPageName | Public method to get the page name of the current page.
getExpandedEntries | Public method to get a list of expanded entries.
setPreferences | Public method called to store the selected values into the preferences storage.
showConfigurationPageByName | Public slot to show a named configuration page.

### Static Methods

None

#### ConfigurationDialog (Constructor)

ConfigurationDialog(parent=None, name=None, modal=False, fromEric=True, displayMode=ConfigurationMode.DEFAULTMODE, expandedEntries=None, )

Constructor

parent (QWidget (optional))
  reference to the parent widget (defaults to None)
name (str (optional))
  name of the dialog (defaults to None)
modal (bool (optional))
  flag indicating a modal dialog (defaults to False)
fromEric (bool (optional))
  flag indicating a dialog generation from within the eric IDE (defaults to True)
displayMode (ConfigurationMode (optional))
  mode of the configuration dialog (defaults to ConfigurationMode.DEFAULTMODE)
expandedEntries (list of str (optional))
  list of entries to be shown expanded (defaults to None)

#### ConfigurationDialog.__mainPasswordChanged

__mainPasswordChanged(oldPassword, newPassword)

Private slot to handle the change of the main password.

oldPassword (str)
  current password
newPassword (str)
  new password

#### ConfigurationDialog.__preferencesChanged

__preferencesChanged()

Private slot to handle a change of the preferences.

#### ConfigurationDialog.accept

accept()

Public method to accept the dialog.

#### ConfigurationDialog.getConfigurationPageName

getConfigurationPageName()

Public method to get the page name of the current page.

Return:
  page name of the current page

Return Type:
  str

#### ConfigurationDialog.getExpandedEntries

getExpandedEntries()

Public method to get a list of expanded entries.

Return:
  list of expanded entries

Return Type:
  list of str

#### ConfigurationDialog.setPreferences

setPreferences()

Public method called to store the selected values into the preferences storage.

#### ConfigurationDialog.showConfigurationPageByName

showConfigurationPageByName(pageName)

Public slot to show a named configuration page.

pageName (str)
  name of the configuration page to show

Up

## ConfigurationMode

Class defining the various modes of the configuration widget.

### Derived from

enum.Enum

### Class Attributes

DEFAULTMODE
EDITORMODE
HEXEDITORMODE
MICROPYTHONMODE
PDFVIEWERMODE
PIPMANAGERMODE
SHELLMODE
TRAYSTARTERMODE
WEBBROWSERMODE

### Class Methods

None

### Methods

None

### Static Methods

None

Up

## ConfigurationPageItem

Class implementing a QTreeWidgetItem holding the configuration page data.

### Derived from

QTreeWidgetItem

### Class Attributes

None

### Class Methods

None

### Methods

ConfigurationPageItem | Constructor
getPageName | Public method to get the name of the associated configuration page.

### Static Methods

None

#### ConfigurationPageItem (Constructor)

ConfigurationPageItem(parent, text, pageName, iconFile)

Constructor

parent (QTreeWidget or QTreeWidgetItem)
  parent widget of the item
text (str)
  text to be displayed
pageName (str)
  name of the configuration page
iconFile (str)
  file name of the icon to be shown

#### ConfigurationPageItem.getPageName

getPageName()

Public method to get the name of the associated configuration page.

Return:
  name of the configuration page

Return Type:
  str

Up

## ConfigurationWidget

Class implementing a dialog for the configuration of eric.

### Signals

accepted()
  emitted to indicate acceptance of the changes
mainPasswordChanged(str, str)
  emitted after the main password has been changed with the old and the new password
preferencesChanged()
  emitted after settings have been changed
rejected()
  emitted to indicate rejection of the changes

### Derived from

QWidget

### Class Attributes

None

### Class Methods

None

### Methods

ConfigurationWidget | Constructor
__createInterfaceLightPageWithSidebars | Private method to create the interface configuration page in light mode.
__importConfigurationPage | Private method to import a configuration page module.
__initLexers | Private method to initialize the dictionary of preferences lexers.
__initPage | Private method to initialize a configuration page.
__resizeConfigStack | Private method to resize the stack of configuration pages.
__searchChildItems | Private method to enable child items based on a search string.
__searchTextChanged | Private slot to handle a change of the search text.
__setupUi | Private method to perform the general setup of the configuration widget.
__showConfigurationPage | Private slot to show a selected configuration page.
accept | Public slot to accept the buttonBox accept signal.
calledFromEric | Public method to check, if invoked from within eric.
getConfigurationPageName | Public method to get the page name of the current page.
getExpandedEntries | Public method to get a list of expanded entries.
getLexers | Public method to get a reference to the lexers dictionary.
getPage | Public method to get a reference to the named page.
isUsingWebEngine | Public method to get an indication, if QtWebEngine is being used.
on_applyButton_clicked | Private slot called to apply the settings of the current page.
on_buttonBox_clicked | Private slot called by a button of the button box clicked.
on_configList_itemCollapsed | Private slot handling a list entry being collapsed.
on_configList_itemExpanded | Private slot handling a list entry being expanded.
on_resetButton_clicked | Private slot called to reset the settings of the current page.
resizeEvent | Protected method to handle the resizing of the widget.
setPreferences | Public method called to store the selected values into the preferences storage.
showConfigurationPageByName | Public slot to show a named configuration page.

### Static Methods

None

#### ConfigurationWidget (Constructor)

ConfigurationWidget(parent=None, fromEric=True, displayMode=ConfigurationMode.DEFAULTMODE, expandedEntries=None, withApply=True, )

Constructor

parent (QWidget (optional))
  reference to the parent widget (defaults to None)
fromEric (bool (optional))
  flag indicating a dialog generation from within the eric IDE (defaults to True)
displayMode (ConfigurationMode (optional))
  mode of the configuration dialog (defaults to ConfigurationMode.DEFAULTMODE)
expandedEntries (list of str (optional))
  list of entries to be shown expanded (defaults to None)
withApply (bool (optional))
  flag indicating to show the 'Apply' button (defaults to True)

#### ConfigurationWidget.__createInterfaceLightPageWithSidebars

__createInterfaceLightPageWithSidebars(_configDlg)

Private method to create the interface configuration page in light mode.

_configDlg (ConfigurationWidget)
  reference to the configuration dialog (unused)

Return:
  reference to the configuration page

Return Type:
  InterfaceLightPage

#### ConfigurationWidget.__importConfigurationPage

__importConfigurationPage(name)

Private method to import a configuration page module.

name (str)
  name of the configuration page module

Return:
  reference to the configuration page module

Return Type:
  Module

#### ConfigurationWidget.__initLexers

__initLexers()

Private method to initialize the dictionary of preferences lexers.

#### ConfigurationWidget.__initPage

__initPage(pageData)

Private method to initialize a configuration page.

pageData (list)
  data structure for the page to initialize

Return:
  reference to the initialized page

Return Type:
  ConfigurationPageBase

#### ConfigurationWidget.__resizeConfigStack

__resizeConfigStack()

Private method to resize the stack of configuration pages.

#### ConfigurationWidget.__searchChildItems

__searchChildItems(parent, text)

Private method to enable child items based on a search string.

parent (QTreeWidgetItem)
  reference to the parent item
text (str)
  text to search for

Return:
  flag indicating an enabled child item

Return Type:
  bool

#### ConfigurationWidget.__searchTextChanged

__searchTextChanged(text)

Private slot to handle a change of the search text.

text (str)
  text to search for

#### ConfigurationWidget.__setupUi

__setupUi(withApply=True)

Private method to perform the general setup of the configuration widget.

withApply (bool (optional))
  flag indicating to show the 'Apply' button (defaults to True)

#### ConfigurationWidget.__showConfigurationPage

__showConfigurationPage(itm)

Private slot to show a selected configuration page.

itm (QTreeWidgetItem)
  reference to the selected item

#### ConfigurationWidget.accept

accept()

Public slot to accept the buttonBox accept signal.

#### ConfigurationWidget.calledFromEric

calledFromEric()

Public method to check, if invoked from within eric.

Return:
  flag indicating invocation from within eric

Return Type:
  bool

#### ConfigurationWidget.getConfigurationPageName

getConfigurationPageName()

Public method to get the page name of the current page.

Return:
  page name of the current page

Return Type:
  str

#### ConfigurationWidget.getExpandedEntries

getExpandedEntries()

Public method to get a list of expanded entries.

Return:
  list of expanded entries

Return Type:
  list of str

#### ConfigurationWidget.getLexers

getLexers()

Public method to get a reference to the lexers dictionary.

Return:
  reference to the lexers dictionary

Return Type:
  dict

#### ConfigurationWidget.getPage

getPage(pageName)

Public method to get a reference to the named page.

pageName (str)
  name of the configuration page

Return:
  reference to the page or None, indicating page was not loaded yet

Return Type:
  ConfigurationPageBase

#### ConfigurationWidget.isUsingWebEngine

isUsingWebEngine()

Public method to get an indication, if QtWebEngine is being used.

Return:
  flag indicating the use of QtWebEngine

Return Type:
  bool

#### ConfigurationWidget.on_applyButton_clicked

on_applyButton_clicked()

Private slot called to apply the settings of the current page.

#### ConfigurationWidget.on_buttonBox_clicked

on_buttonBox_clicked(button)

Private slot called by a button of the button box clicked.

button (QAbstractButton)
  button that was clicked

#### ConfigurationWidget.on_configList_itemCollapsed

on_configList_itemCollapsed(item)

Private slot handling a list entry being collapsed.

item (QTreeWidgetItem)
  reference to the collapsed item

#### ConfigurationWidget.on_configList_itemExpanded

on_configList_itemExpanded(item)

Private slot handling a list entry being expanded.

item (QTreeWidgetItem)
  reference to the expanded item

#### ConfigurationWidget.on_resetButton_clicked

on_resetButton_clicked()

Private slot called to reset the settings of the current page.

#### ConfigurationWidget.resizeEvent

resizeEvent(_evt)

Protected method to handle the resizing of the widget.

_evt (QResizeEvent)
  reference to the event object (unused)

#### ConfigurationWidget.setPreferences

setPreferences()

Public method called to store the selected values into the preferences storage.

#### ConfigurationWidget.showConfigurationPageByName

showConfigurationPageByName(pageName, setCurrent=True)

Public slot to show a named configuration page.

pageName (str)
  name of the configuration page to show
setCurrent (bool)
  flag indicating to set the current item

Up

## ConfigurationWindow

Main window class for the standalone dialog.

### Derived from

EricMainWindow

### Class Attributes

None

### Class Methods

None

### Methods

ConfigurationWindow | Constructor
accept | Public slot called by the Ok button.
showConfigurationPageByName | Public slot to show a named configuration page.

### Static Methods

None

#### ConfigurationWindow (Constructor)

ConfigurationWindow(parent=None)

Constructor

parent (QWidget)
  reference to the parent widget

#### ConfigurationWindow.accept

accept()

Public slot called by the Ok button.

#### ConfigurationWindow.showConfigurationPageByName

showConfigurationPageByName(pageName)

Public slot to show a named configuration page.

pageName (str)
  name of the configuration page to show

Up