diff -r 6df1aeaa4529 -r ef86a77942f2 src/eric7/VirtualEnv/VirtualenvManagerWidgets.py --- a/src/eric7/VirtualEnv/VirtualenvManagerWidgets.py Wed Oct 26 11:50:03 2022 +0200 +++ b/src/eric7/VirtualEnv/VirtualenvManagerWidgets.py Wed Oct 26 17:28:33 2022 +0200 @@ -39,6 +39,7 @@ IsCondaRole = Qt.ItemDataRole.UserRole + 2 IsRemoteRole = Qt.ItemDataRole.UserRole + 3 ExecPathRole = Qt.ItemDataRole.UserRole + 4 + DescriptionRole = Qt.ItemDataRole.UserRole + 5 def __init__(self, manager, parent=None): """ @@ -160,6 +161,7 @@ isConda, isRemote, execPath, + description, ) = dlg.getData() self.__manager.addVirtualEnv( @@ -170,6 +172,7 @@ isConda, isRemote, execPath, + description, ) @pyqtSlot() @@ -198,6 +201,7 @@ selectedItem.data(0, VirtualenvManagerWidget.IsCondaRole), selectedItem.data(0, VirtualenvManagerWidget.IsRemoteRole), selectedItem.data(0, VirtualenvManagerWidget.ExecPathRole), + selectedItem.data(0, VirtualenvManagerWidget.DescriptionRole), baseDir=self.envBaseDirectoryPicker.text(), ) if dlg.exec() == QDialog.DialogCode.Accepted: @@ -209,6 +213,7 @@ isConda, isRemote, execPath, + description, ) = dlg.getData() if venvName != oldVenvName: self.__manager.renameVirtualEnv( @@ -220,6 +225,7 @@ isConda, isRemote, execPath, + description, ) else: self.__manager.setVirtualEnv( @@ -230,6 +236,7 @@ isConda, isRemote, execPath, + description, ) @pyqtSlot() @@ -298,6 +305,14 @@ """ self.__updateButtons() + selectedItems = self.venvList.selectedItems() + if len(selectedItems) == 1: + self.descriptionEdit.setPlainText( + selectedItems[0].data(0, VirtualenvManagerWidget.DescriptionRole) + ) + else: + self.descriptionEdit.clear() + @pyqtSlot() def __refresh(self): """ @@ -354,6 +369,11 @@ VirtualenvManagerWidget.ExecPathRole, environments[venvName]["exec_path"], ) + itm.setData( + 0, + VirtualenvManagerWidget.DescriptionRole, + environments[venvName]["description"], + ) # show remote environments with underlined font if environments[venvName]["is_remote"]: