Esempio n. 1
0
    def checkCompatibility(self):
	report = ''

	totalMemory = self.mainEngine.compatibility.totalMemory
	minmemory = long(self.version.minmemory)
	memory = long(self.version.memory)

	report += 'Memory (RAM):\n'
	report += 'You have %s memory. ' % hrS(totalMemory)
	report += '%s requires at least %s of memory. Recommended is %s.\n\n' % (self.version.name, hrS(minmemory), hrS(memory))

	if totalMemory < minmemory:
	    report += '!!! '
	    report += 'YOU DO NOT HAVE ENOUGH MEMORY. (%s) It is strongly recommended not to install.' % hrS(totalMemory)
	elif totalMemory > memory:
	    report += 'It is OK to use %s safely.' % self.version.name
	else:
	    report += 'You have enough memory to run under minimal conditions but you may have problems during your usage. It is recommended to add memory to your computer.'
	report += '\n------------------------------------\n'

	archBit = self.mainEngine.compatibility.architectureBit
	archType = self.mainEngine.compatibility.architectureName
	
	report += 'CPU Architecture:\n'
	report += 'Your CPU has %d-bit (%s) architecture. ' % (archBit, archType)
	report += '%s is prepared for %s architectures.\n\n' % (self.version.name, self.version.type)

	if self.version.type=='64-bit':
	    if archBit==32:
		report += '!!! '
		report += 'Your architecture is NOT COMPATIBLE with %s. It is STRONGLY recommended NOT to install.' % self.version.name
	    elif archBit==64:
		report += 'It is safe to use %s with your computer.'  % self.version.name
	elif self.version.type == '32-bit':
	    # reserved for future architecture designs.
	    report += 'It is safe to use %s with your computer.'  % self.version.name
	report += '\n------------------------------------\n'

	minspace = long(self.version.minspace)
	space = long(self.version.space)
	size = self.mainEngine.config.size

	report += 'Free Space:\n'
	report += 'Your have reserved %s of free space for installation. ' % hrS(size)
	report += '%s requires %s of free space (recommended %s).\n\n' % (self.version.name, hrS(minspace), hrS(space))

	if size < minspace:
	    report += '!!! '
	    report += 'You DO NOT HAVE ENOUGH free space reserved. (%s) It is strongly recommended not to install if you do not have any free space.' % hrS(size)
	elif size > space:
	    report += 'It is OK to use %s safely.' % self.version.name
	else:
	    report += 'It is OK to use %s. However it is better to reserve more free space for future usage.'
	
	if report:
	    QtGui.QMessageBox.information(self, 'Compatibility Report', report, QtGui.QMessageBox.Ok)
Esempio n. 2
0
    def onSubmit(self):
	errorText=''
	
	if not self.version:  # TODO: other limitations?
	    errorText += 'Please choose a version.\n'

	elif not self.mirror:
	    errorText += 'Please choose a mirror.\n'

	else:
	    if long(self.version.minspace) > self.mainEngine.config.size:
		errorText += 'You have reserved %s for installation but %s requires %s of space (recommended %s). Go back and increase installation size.\n' % (hrS(self.mainEngine.config.size), self.version.name, hrS(self.version.minspace), hrS(self.version.space))

	    archBit = self.mainEngine.compatibility.architectureBit

	    if self.version.type=='64-bit' and archBit==32:
		errorText += '%s is an 64-bit operating system and will not work on your %d-bit architecture. Try installing a 32-bit alternative.'  %(self.version.name, archBit)

	if errorText:
	    QtGui.QMessageBox.warning(self, 'Warning', errorText, QtGui.QMessageBox.Ok)
	    return False
	
	self.mainEngine.version = self.version
	self.mainEngine.ftpDownloader.setMirror(self.mirror)

	return True
Esempio n. 3
0
    def versionChanged(self, index):
	if self.gui.comboVersion.currentIndex() > -1:
	    self.version = self.getVersionByName(self.gui.comboVersion.currentText())
	    self.gui.lblSize.setText('%s' % hrS(self.version.size))
	    self.populateMirrors(self.version)