src/eric7/WebBrowser/QtHelp/QtHelpDocumentationConfigurationDialog.py

branch
eric7
changeset 9221
bf71ee032bb4
parent 9209
b99e7fd55fd3
child 9473
3f23dbf37dbe
--- a/src/eric7/WebBrowser/QtHelp/QtHelpDocumentationConfigurationDialog.py	Wed Jul 13 11:16:20 2022 +0200
+++ b/src/eric7/WebBrowser/QtHelp/QtHelpDocumentationConfigurationDialog.py	Wed Jul 13 14:55:47 2022 +0200
@@ -11,7 +11,7 @@
 from PyQt6.QtWidgets import QDialog, QDialogButtonBox, QAbstractButton
 
 from .Ui_QtHelpDocumentationConfigurationDialog import (
-    Ui_QtHelpDocumentationConfigurationDialog
+    Ui_QtHelpDocumentationConfigurationDialog,
 )
 
 from .QtHelpDocumentationSettings import QtHelpDocumentationSettings
@@ -23,10 +23,11 @@
     """
     Class implementing a dialog to manage the QtHelp documentation database.
     """
+
     def __init__(self, engine, parent=None):
         """
         Constructor
-        
+
         @param engine reference to the Qt help engine
         @type QHelpEngineCore
         @param parent reference to the parent widget (defaults to None)
@@ -34,74 +35,65 @@
         """
         super().__init__(parent)
         self.setupUi(self)
-        
+
         self.__engine = engine
-        
-        self.__settings = QtHelpDocumentationSettings.readSettings(
-            self.__engine)
-        
+
+        self.__settings = QtHelpDocumentationSettings.readSettings(self.__engine)
+
         self.documentationSettingsWidget.documentationSettingsChanged.connect(
-            self.__documentationSettingsChanged)
-        self.documentationSettingsWidget.setDocumentationSettings(
-            self.__settings)
-        
-        self.filterSettingsWidget.setAvailableComponents(
-            self.__settings.components())
-        self.filterSettingsWidget.setAvailableVersions(
-            self.__settings.versions())
+            self.__documentationSettingsChanged
+        )
+        self.documentationSettingsWidget.setDocumentationSettings(self.__settings)
+
+        self.filterSettingsWidget.setAvailableComponents(self.__settings.components())
+        self.filterSettingsWidget.setAvailableVersions(self.__settings.versions())
         self.filterSettingsWidget.readSettings(self.__engine.filterEngine())
-    
+
     @pyqtSlot(QtHelpDocumentationSettings)
     def __documentationSettingsChanged(self, settings):
         """
         Private slot to handle a change of the QtHelp documentation
         configuration.
-        
+
         @param settings reference to the documentation settings object
         @type QtHelpDocumentationSettings
         """
         self.__settings = settings
-        
-        self.filterSettingsWidget.setAvailableComponents(
-            self.__settings.components())
-        self.filterSettingsWidget.setAvailableVersions(
-            self.__settings.versions())
-    
+
+        self.filterSettingsWidget.setAvailableComponents(self.__settings.components())
+        self.filterSettingsWidget.setAvailableVersions(self.__settings.versions())
+
     @pyqtSlot(QAbstractButton)
     def on_buttonBox_clicked(self, button):
         """
         Private slot called by a button of the button box clicked.
-        
+
         @param button button that was clicked
         @type QAbstractButton
         """
-        if button == self.buttonBox.button(
-                QDialogButtonBox.StandardButton.Apply):
+        if button == self.buttonBox.button(QDialogButtonBox.StandardButton.Apply):
             self.__applyConfiguration()
-            
-            self.__settings = QtHelpDocumentationSettings.readSettings(
-                self.__engine)
-            
+
+            self.__settings = QtHelpDocumentationSettings.readSettings(self.__engine)
+
             self.filterSettingsWidget.setAvailableComponents(
-                self.__settings.components())
-            self.filterSettingsWidget.setAvailableVersions(
-                self.__settings.versions())
-            self.filterSettingsWidget.readSettings(
-                self.__engine.filterEngine())
-        elif button == self.buttonBox.button(
-                QDialogButtonBox.StandardButton.Ok):
+                self.__settings.components()
+            )
+            self.filterSettingsWidget.setAvailableVersions(self.__settings.versions())
+            self.filterSettingsWidget.readSettings(self.__engine.filterEngine())
+        elif button == self.buttonBox.button(QDialogButtonBox.StandardButton.Ok):
             self.__applyConfiguration()
             self.accept()
-    
+
     def __applyConfiguration(self):
         """
         Private method to apply the current QtHelp documentation configuration.
         """
         changed = QtHelpDocumentationSettings.applySettings(
-            self.__engine, self.__settings)
-        changed |= self.filterSettingsWidget.applySettings(
-            self.__engine.filterEngine())
-        
+            self.__engine, self.__settings
+        )
+        changed |= self.filterSettingsWidget.applySettings(self.__engine.filterEngine())
+
         if changed:
             # In order to update the filter combobox and index widget according
             # to the new filter configuration.

eric ide

mercurial