4958 self.blackDiffFormattingAct.triggered.connect( |
4958 self.blackDiffFormattingAct.triggered.connect( |
4959 lambda: self.__performFormatWithBlack(BlackFormattingAction.Diff) |
4959 lambda: self.__performFormatWithBlack(BlackFormattingAction.Diff) |
4960 ) |
4960 ) |
4961 self.actions.append(self.blackDiffFormattingAct) |
4961 self.actions.append(self.blackDiffFormattingAct) |
4962 |
4962 |
|
4963 self.blackConfigureAct = EricAction( |
|
4964 self.tr("Configure"), |
|
4965 self.tr("Configure"), |
|
4966 0, |
|
4967 0, |
|
4968 self.blackFormattingGrp, |
|
4969 "project_black_configure", |
|
4970 ) |
|
4971 self.blackConfigureAct.setStatusTip( |
|
4972 self.tr( |
|
4973 "Enter the parameters for formatting the project sources with 'Black'." |
|
4974 ) |
|
4975 ) |
|
4976 self.blackConfigureAct.setWhatsThis( |
|
4977 self.tr( |
|
4978 "<b>Configure</b>" |
|
4979 "<p>This shows a dialog to enter the parameters for formatting the" |
|
4980 " project sources with 'Black'.</p>" |
|
4981 ) |
|
4982 ) |
|
4983 self.blackConfigureAct.triggered.connect(self.__configureBlack) |
|
4984 self.actions.append(self.blackConfigureAct) |
|
4985 |
4963 ################################################################### |
4986 ################################################################### |
4964 ## Project - embedded environment actions |
4987 ## Project - embedded environment actions |
4965 ################################################################### |
4988 ################################################################### |
4966 |
4989 |
4967 self.embeddedEnvironmentGrp = createActionGroup(self) |
4990 self.embeddedEnvironmentGrp = createActionGroup(self) |
6707 project=self, |
6730 project=self, |
6708 action=action, |
6731 action=action, |
6709 ) |
6732 ) |
6710 formattingDialog.exec() |
6733 formattingDialog.exec() |
6711 |
6734 |
|
6735 @pyqtSlot() |
|
6736 def __configureBlack(self): |
|
6737 """ |
|
6738 Private slot to enter the parameters for formatting the project sources with |
|
6739 'Black'. |
|
6740 """ |
|
6741 from CodeFormatting.BlackConfigurationDialog import BlackConfigurationDialog |
|
6742 |
|
6743 dlg = BlackConfigurationDialog(withProject=True, onlyProject=True) |
|
6744 if dlg.exec() == QDialog.DialogCode.Accepted: |
|
6745 dlg.getConfiguration() |
|
6746 # The data is saved to the project as a side effect. |
|
6747 |
6712 ######################################################################### |
6748 ######################################################################### |
6713 ## Below are methods implementing the 'Embedded Environment' support |
6749 ## Below are methods implementing the 'Embedded Environment' support |
6714 ######################################################################### |
6750 ######################################################################### |
6715 |
6751 |
6716 def __showContextMenuEnvironment(self): |
6752 def __showContextMenuEnvironment(self): |