eric6/VirtualEnv/VirtualenvConfigurationDialog.py

branch
maintenance
changeset 8176
31965986ecd1
parent 8043
0acf98cd089a
parent 8143
2c730d5fd177
child 8273
698ae46f40a4
equal deleted inserted replaced
8153:e01ae92db699 8176:31965986ecd1
89 self.__versionRe = re.compile(r""".*?(\d+\.\d+\.\d+).*""") 89 self.__versionRe = re.compile(r""".*?(\d+\.\d+\.\d+).*""")
90 90
91 self.__virtualenvFound = False 91 self.__virtualenvFound = False
92 self.__pyvenvFound = False 92 self.__pyvenvFound = False
93 self.__condaFound = False 93 self.__condaFound = False
94 self.buttonBox.button(QDialogButtonBox.Ok).setEnabled(False) 94 self.buttonBox.button(
95 QDialogButtonBox.StandardButton.Ok).setEnabled(False)
95 96
96 self.__mandatoryStyleSheet = "QLineEdit {border: 2px solid;}" 97 self.__mandatoryStyleSheet = "QLineEdit {border: 2px solid;}"
97 self.targetDirectoryPicker.setStyleSheet(self.__mandatoryStyleSheet) 98 self.targetDirectoryPicker.setStyleSheet(self.__mandatoryStyleSheet)
98 self.nameEdit.setStyleSheet(self.__mandatoryStyleSheet) 99 self.nameEdit.setStyleSheet(self.__mandatoryStyleSheet)
99 self.condaTargetDirectoryPicker.setStyleSheet( 100 self.condaTargetDirectoryPicker.setStyleSheet(
125 (self.__virtualenvFound or self.__pyvenvFound) and 126 (self.__virtualenvFound or self.__pyvenvFound) and
126 bool(self.targetDirectoryPicker.text()) and 127 bool(self.targetDirectoryPicker.text()) and
127 bool(self.nameEdit.text()) 128 bool(self.nameEdit.text())
128 ) 129 )
129 enable &= self.targetDirectoryPicker.text() != self.__envBaseDir 130 enable &= self.targetDirectoryPicker.text() != self.__envBaseDir
130 self.buttonBox.button(QDialogButtonBox.Ok).setEnabled(enable) 131 self.buttonBox.button(
132 QDialogButtonBox.StandardButton.Ok).setEnabled(enable)
131 elif self.condaButton.isChecked(): 133 elif self.condaButton.isChecked():
132 enable = ( 134 enable = (
133 bool(self.condaNameEdit.text()) or 135 bool(self.condaNameEdit.text()) or
134 bool(self.condaTargetDirectoryPicker.text()) 136 bool(self.condaTargetDirectoryPicker.text())
135 ) 137 )
139 bool(self.condaCloneNameEdit.text()) or 141 bool(self.condaCloneNameEdit.text()) or
140 bool(self.condaCloneDirectoryPicker.text()) 142 bool(self.condaCloneDirectoryPicker.text())
141 ) 143 )
142 elif self.condaRequirementsButton.isChecked(): 144 elif self.condaRequirementsButton.isChecked():
143 enable &= bool(self.condaRequirementsFilePicker.text()) 145 enable &= bool(self.condaRequirementsFilePicker.text())
144 self.buttonBox.button(QDialogButtonBox.Ok).setEnabled(enable) 146 self.buttonBox.button(
147 QDialogButtonBox.StandardButton.Ok).setEnabled(enable)
145 else: 148 else:
146 self.buttonBox.button(QDialogButtonBox.Ok).setEnabled(False) 149 self.buttonBox.button(
150 QDialogButtonBox.StandardButton.Ok).setEnabled(False)
147 151
148 def __updateUi(self): 152 def __updateUi(self):
149 """ 153 """
150 Private method to update the UI depending on the selected 154 Private method to update the UI depending on the selected
151 virtual environment creator (virtualenv or pyvenv). 155 virtual environment creator (virtualenv or pyvenv).

eric ide

mercurial