# eric6.Preferences.ConfigurationDialog

Module implementing a dialog for the configuration of eric6.

### Global Attributes

None

### Classes

ConfigurationDialog | Class for the dialog variant.
ConfigurationPageItem | Class implementing a QTreeWidgetItem holding the configuration page data.
ConfigurationWidget | Class implementing a dialog for the configuration of eric6.
ConfigurationWindow | Main window class for the standalone dialog.

### Functions

None

## ConfigurationDialog

Class for the dialog variant.

### Signals

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

### Derived from

QDialog

### Class Attributes

DefaultMode
HelpBrowserMode
HexEditorMode
TrayStarterMode
WebBrowserMode

### Class Methods

None

### Methods

ConfigurationDialog | Constructor
__masterPasswordChanged | Private slot to handle the change of the master 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=ConfigurationWidget.DefaultMode, expandedEntries=None)

Constructor

parent
  The parent widget of this dialog. (QWidget)
name
  The name of this dialog. string
modal
  Flag indicating a modal dialog. (boolean)
fromEric=
  flag indicating a dialog generation from within the eric6 ide (boolean)
displayMode=
  mode of the configuration dialog (DefaultMode, HelpBrowserMode, TrayStarterMode, HexEditorMode, WebBrowserMode)
expandedEntries=
  list of entries to be shown expanded (list of strings)

#### ConfigurationDialog.__masterPasswordChanged

__masterPasswordChanged(oldPassword, newPassword)

Private slot to handle the change of the master password.

oldPassword
  current master password (string)
newPassword
  new master password (string)

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

Returns:
  page name of the current page (string)

#### ConfigurationDialog.getExpandedEntries

getExpandedEntries()

Public method to get a list of expanded entries.

Returns:
  list of expanded entries (list of string)

#### 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
  name of the configuration page to show (string)

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
  parent widget of the item (QTreeWidget or QTreeWidgetItem)
text
  text to be displayed (string)
pageName
  name of the configuration page (string)
iconFile
  file name of the icon to be shown (string)

#### ConfigurationPageItem.getPageName

getPageName()

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

Returns:
  name of the configuration page (string)

Up

## ConfigurationWidget

Class implementing a dialog for the configuration of eric6.

### Signals

accepted()
  emitted to indicate acceptance of the changes
masterPasswordChanged(str, str)
  emitted after the master 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

DefaultMode
HelpBrowserMode
HexEditorMode
TrayStarterMode
WebBrowserMode

### Class Methods

None

### Methods

ConfigurationWidget | Constructor
__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.
__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.
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=DefaultMode, expandedEntries=None)

Constructor

parent
  The parent widget of this dialog. (QWidget)
fromEric=
  flag indicating a dialog generation from within the eric6 ide (boolean)
displayMode=
  mode of the configuration dialog (DefaultMode, HelpBrowserMode, TrayStarterMode, HexEditorMode, WebBrowserMode)
expandedEntries=
  list of entries to be shown expanded (list of strings)

Raises RuntimeError:
  raised to indicate an invalid dialog mode

#### ConfigurationWidget.__importConfigurationPage

__importConfigurationPage(name)

Private method to import a configuration page module.

name
  name of the configuration page module (string)

Returns:
  reference to the configuration page 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
  data structure for the page to initialize

Returns:
  reference to the initialized page

#### ConfigurationWidget.__searchChildItems

__searchChildItems(parent, text)

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

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

Returns:
  flag indicating an enabled child item (boolean)

#### ConfigurationWidget.__searchTextChanged

__searchTextChanged(text)

Private slot to handle a change of the search text.

text
  text to search for (string)

#### ConfigurationWidget.__setupUi

__setupUi()

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

#### ConfigurationWidget.__showConfigurationPage

__showConfigurationPage(itm, column)

Private slot to show a selected configuration page.

itm
  reference to the selected item (QTreeWidgetItem)
column
  column that was selected (integer) (ignored)

#### ConfigurationWidget.accept

accept()

Public slot to accept the buttonBox accept signal.

#### ConfigurationWidget.calledFromEric

calledFromEric()

Public method to check, if invoked from within eric.

Returns:
  flag indicating invocation from within eric (boolean)

#### ConfigurationWidget.getConfigurationPageName

getConfigurationPageName()

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

Returns:
  page name of the current page (string)

#### ConfigurationWidget.getExpandedEntries

getExpandedEntries()

Public method to get a list of expanded entries.

Returns:
  list of expanded entries (list of string)

#### ConfigurationWidget.getLexers

getLexers()

Public method to get a reference to the lexers dictionary.

Returns:
  reference to the lexers dictionary

#### ConfigurationWidget.getPage

getPage(pageName)

Public method to get a reference to the named page.

pageName
  name of the configuration page (string)

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

#### ConfigurationWidget.isUsingWebEngine

isUsingWebEngine()

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

Returns:
  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
  button that was clicked (QAbstractButton)

#### ConfigurationWidget.on_configList_itemCollapsed

on_configList_itemCollapsed(item)

Private slot handling a list entry being collapsed.

item
  reference to the collapsed item (QTreeWidgetItem)

#### ConfigurationWidget.on_configList_itemExpanded

on_configList_itemExpanded(item)

Private slot handling a list entry being expanded.

item
  reference to the expanded item (QTreeWidgetItem)

#### ConfigurationWidget.on_resetButton_clicked

on_resetButton_clicked()

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

#### 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
  name of the configuration page to show (string)
setCurrent
  flag indicating to set the current item (boolean)

Up

## ConfigurationWindow

Main window class for the standalone dialog.

### Derived from

E5MainWindow

### 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
  reference to the parent widget (QWidget)

#### ConfigurationWindow.accept

accept()

Public slot called by the Ok button.

#### ConfigurationWindow.showConfigurationPageByName

showConfigurationPageByName(pageName)

Public slot to show a named configuration page.

pageName
  name of the configuration page to show (string)

Up