src/eric7/Project/Project.py

branch
eric7
changeset 9337
073b872fce59
parent 9323
6ae7193558ac
child 9343
7180fb8677e5
diff -r c94f53ab789a -r 073b872fce59 src/eric7/Project/Project.py
--- a/src/eric7/Project/Project.py	Mon Sep 19 16:44:08 2022 +0200
+++ b/src/eric7/Project/Project.py	Mon Sep 19 19:44:38 2022 +0200
@@ -4960,6 +4960,29 @@
         )
         self.actions.append(self.blackDiffFormattingAct)
 
+        self.blackConfigureAct = EricAction(
+            self.tr("Configure"),
+            self.tr("Configure"),
+            0,
+            0,
+            self.blackFormattingGrp,
+            "project_black_configure",
+        )
+        self.blackConfigureAct.setStatusTip(
+            self.tr(
+                "Enter the parameters for formatting the project sources with 'Black'."
+            )
+        )
+        self.blackConfigureAct.setWhatsThis(
+            self.tr(
+                "<b>Configure</b>"
+                "<p>This shows a dialog to enter the parameters for formatting the"
+                " project sources with 'Black'.</p>"
+            )
+        )
+        self.blackConfigureAct.triggered.connect(self.__configureBlack)
+        self.actions.append(self.blackConfigureAct)
+
         ###################################################################
         ## Project - embedded environment actions
         ###################################################################
@@ -6709,6 +6732,19 @@
                 )
                 formattingDialog.exec()
 
+    @pyqtSlot()
+    def __configureBlack(self):
+        """
+        Private slot to enter the parameters for formatting the project sources with
+        'Black'.
+        """
+        from CodeFormatting.BlackConfigurationDialog import BlackConfigurationDialog
+
+        dlg = BlackConfigurationDialog(withProject=True, onlyProject=True)
+        if dlg.exec() == QDialog.DialogCode.Accepted:
+            dlg.getConfiguration()
+            # The data is saved to the project as a side effect.
+
     #########################################################################
     ## Below are methods implementing the 'Embedded Environment' support
     #########################################################################

eric ide

mercurial