def __init__(self, parent, widget): # Do not pass parent, because is a sublayout QtGui.QVBoxLayout.__init__(self) # Layout self.setSpacing(1) self.addWidget(widget) # Create checkbox widget if not self.DISABLE_SYSTEM_DEFAULT: t = translate('shell', 'Use system default') self._check = QtGui.QCheckBox(t, parent) self._check.stateChanged.connect(self.onCheckChanged) self.addWidget(self._check) # The actual value of this shell config attribute self._value = '' # A buffered version, so that clicking the text box does not # remove the value at once self._bufferedValue = ''
def __init__(self, parent=None): QtGui.QDialog.__init__(self, parent) self.setWindowTitle('Install miniconda') self.setModal(True) self.resize(500, 500) text = 'This will download and install miniconda on your computer.' self._label = QtGui.QLabel(text, self) self._scipystack = QtGui.QCheckBox('Also install scientific packages', self) self._scipystack.setChecked(True) self._path = QtGui.QLineEdit(default_conda_dir, self) self._progress = QtGui.QProgressBar(self) self._outputLine = QtGui.QLabel(self) self._output = QtGui.QPlainTextEdit(self) self._output.setReadOnly(True) self._button = QtGui.QPushButton('Install', self) self._outputLine.setSizePolicy(QtGui.QSizePolicy.Ignored, QtGui.QSizePolicy.Fixed) vbox = QtGui.QVBoxLayout(self) self.setLayout(vbox) vbox.addWidget(self._label, 0) vbox.addWidget(self._path, 0) vbox.addWidget(self._scipystack, 0) vbox.addWidget(self._progress, 0) vbox.addWidget(self._outputLine, 0) vbox.addWidget(self._output, 1) vbox.addWidget(self._button, 0) self._button.clicked.connect(self.go) self.addOutput('Waiting to start installation.\n') self._progress.setVisible(False) self.lineFromStdOut.connect(self.setStatus)