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