eric7/PipInterface/PipPackagesWidget.py

branch
eric7
changeset 9002
31a7decd3393
parent 9001
a00cd6b55728
child 9003
6bc210cd5726
--- a/eric7/PipInterface/PipPackagesWidget.py	Fri Mar 25 19:16:09 2022 +0100
+++ b/eric7/PipInterface/PipPackagesWidget.py	Sun Mar 27 19:56:41 2022 +0200
@@ -1182,6 +1182,10 @@
             self.tr("Generate Requirements..."),
             self.__generateRequirements)
         self.__pipMenu.addSeparator()
+        self.__showLicensesDialogAct = self.__pipMenu.addAction(
+            self.tr("Show Licenses..."),
+            self.__showLicensesDialog)
+        self.__pipMenu.addSeparator()
         self.__checkVulnerabilityAct = self.__pipMenu.addAction(
             self.tr("Check Vulnerabilities"),
             self.__updateVulnerabilityData)
@@ -1246,8 +1250,11 @@
         self.__cachePurgeAct.setEnabled(enablePipCache)
         
         self.__editVirtualenvConfigAct.setEnabled(enable)
+        
         self.__checkVulnerabilityAct.setEnabled(
             enable & self.vulnerabilityCheckBox.isEnabled())
+        
+        self.__showLicensesDialogAct.setEnabled(enable)
     
     @pyqtSlot()
     def __installPip(self):
@@ -1802,3 +1809,20 @@
             len(self.dependenciesList.selectedItems()) == 1 and
             self.__isPipAvailable()
         )
+    
+    ##################################################################
+    ## Interface to show the licenses dialog below
+    ##################################################################
+    
+    @pyqtSlot()
+    def __showLicensesDialog(self):
+        """
+        Private slot to show a dialog with the licenses of the selected
+        environment.
+        """
+        # TODO: not yet implemented
+        from .PipLicensesDialog import PipLicensesDialog
+        
+        environment = self.environmentsComboBox.currentText()
+        dlg = PipLicensesDialog(self.__pip, environment, self)
+        dlg.exec()

eric ide

mercurial