allow continuing on unsupported platform if desired

This commit is contained in:
Brennen Raimer
2019-05-04 15:22:17 -04:00
parent 1c39435ded
commit 9946330fa5
2 changed files with 20 additions and 20 deletions

View File

@@ -111,27 +111,27 @@ class InstallerWizard(QtWidgets.QWizard):
return False
if not platform.system() == 'Windows' or int(platform.release()) < 7:
reply.abort()
process_dialog.cancel()
self._display_error("This toolkit requires Microsoft Windows 7 or newer")
return False
elif not platform.machine() == 'AMD64':
reply.abort()
process_dialog.cancel()
self._display_error("Parts of this toolkit require a 64-bit processor. Please open an issue on Github if you absolutely need it all 32-bit")\
.buttonClicked.connect(lambda: webbrowser.open_new_tab(self._project_page/"issues"))
return False
else:
while reply.isRunning():
QtWidgets.QApplication.instance().processEvents()
QtCore.QThread.currentThread().msleep(100)
if not reply.error():
self.license.setHtml(bytearray(reply.readAll()).decode("utf-8"))
return True
else:
self._display_error(f"Encountered a {QtCore.QMetaEnum.valueToKey(reply.error())} while testing Internet connectivity")
if QtWidgets.QMessageBox.question(self, "", "This toolkit requires Microsoft Windows 7 or newer to be used. Continue anyway?") in (QtWidgets.QMessageBox.No, 0):
reply.abort()
process_dialog.cancel()
return False
if not platform.machine().lower() in ('amd64', 'x86_64'):
if QtWidgets.QMessageBox.question(self, "", "Parts of this toolkit require a 64-bit processor. Continue anyway?") in (QtWidgets.QMessageBox.No, 0):
reply.abort()
process_dialog.cancel()
return False
while reply.isRunning():
QtWidgets.QApplication.instance().processEvents()
QtCore.QThread.currentThread().msleep(100)
if not reply.error():
self.license.setHtml(bytearray(reply.readAll()).decode("utf-8"))
return True
else:
self._display_error(f"Encountered an error while testing Internet connectivity:\n\n{reply.errorString()}")
return False
def _display_error(self, message, details = None):
"""Displays an error message.
@@ -365,7 +365,7 @@ class InstallerWizard(QtWidgets.QWizard):
assert self._download_error.empty()
@QtCore.pyqtSignal(str, int, int)
@QtCore.pyqtSlot(str, int, int)
def track_progress(self, tool_name, bytes_received, bytes_total):
if tool_name not in [tool["name"] for tool in self.__tools__]:
return

View File