def driveChanged(self, index): free = self.freeSpaceOnDrive() self.gui.lblDriveFreeSpace.setText("%s free" % (humanReadableSize(free))) self.updateProgressBarRange() percentage = math.floor((self.defaultSize - self.minSize) * 100 / (free - self.minSize) * 1.0) self.gui.sizeSlider.setValue(percentage)
def driveChanged(self, index): free = self.freeSpaceOnDrive() self.gui.lblDriveFreeSpace.setText('%s free' % (humanReadableSize(free))) self.updateProgressBarRange() percentage = math.floor((self.defaultSize - self.minSize) * 100 / (free - self.minSize) * 1.0) self.gui.sizeSlider.setValue(percentage)
def onSubmit(self): # TODO: 'Not enough free space' warnings errorText = '' username = self.gui.txtUsername.text() password = self.gui.txtPassword.text() retypePassword = self.gui.txtRetypePassword.text() if self.getSelectedDrive().FreeSpace < self.installationSize: errorText += 'You do not have enough (%s required) free space on current drive.\n' % humanReadableSize( self.size) else: if not username: # TODO: other limitations? errorText += 'Please enter a username.\n' if not password: errorText += 'Please enter a password.\n' if not retypePassword: errorText += 'Please retype the password.\n' else: if password != retypePassword: errorText += 'Passwords do not match. Be careful.' if errorText: QtGui.QMessageBox.warning(self, 'Warning', errorText, QtGui.QMessageBox.Ok) #return False # TODO: re-activate ASAP. self.mainEngine.config.username = username self.mainEngine.config.password = password self.mainEngine.config.drive = self.getSelectedDrive() self.mainEngine.config.size = long(self.installationSize) return True
def onSubmit(self): # TODO: 'Not enough free space' warnings errorText = "" username = self.gui.txtUsername.text() password = self.gui.txtPassword.text() retypePassword = self.gui.txtRetypePassword.text() if self.getSelectedDrive().FreeSpace < self.installationSize: errorText += "You do not have enough (%s required) free space on current drive.\n" % humanReadableSize( self.size ) else: if not username: # TODO: other limitations? errorText += "Please enter a username.\n" if not password: errorText += "Please enter a password.\n" if not retypePassword: errorText += "Please retype the password.\n" else: if password != retypePassword: errorText += "Passwords do not match. Be careful." if errorText: QtGui.QMessageBox.warning(self, "Warning", errorText, QtGui.QMessageBox.Ok) # return False # TODO: re-activate ASAP. self.mainEngine.config.username = username self.mainEngine.config.password = password self.mainEngine.config.drive = self.getSelectedDrive() self.mainEngine.config.size = long(self.installationSize) return True