1
0
Fork 0
mirror of synced 2024-06-02 02:34:40 +12:00

InstallDialog: Offer to install prerequisites on native platforms

This commit is contained in:
loathingKernel 2023-12-07 13:28:21 +02:00
parent e70583cf99
commit b20be46752
No known key found for this signature in database
GPG key ID: CE0C72D0B53821FD

View file

@ -297,6 +297,16 @@ class InstallDialog(QDialog):
self.reject_close = False
self.close()
@staticmethod
def same_platform(download: InstallDownloadModel) -> bool:
platform = download.igame.platform
if pf.system() == "Windows":
return platform == "Windows" or platform == "Win32"
elif pf.system() == "Dariwn":
return platform == "Mac"
else:
return False
@pyqtSlot(InstallDownloadModel)
def on_worker_result(self, download: InstallDownloadModel):
self.__download = download
@ -314,7 +324,8 @@ class InstallDialog(QDialog):
self.ui.install_size_text.setStyleSheet("font-style: normal; font-weight: bold")
self.ui.verify_button.setEnabled(self.options_changed)
self.ui.cancel_button.setEnabled(True)
if pf.system() == "Windows" or ArgumentsSingleton().debug:
# Offer to install prerequisites only on same platforms or debug mode
if self.same_platform(download) or ArgumentsSingleton().debug:
if download.igame.prereq_info and not download.igame.prereq_info.get("installed", False):
self.advanced.ui.install_prereqs_check.setEnabled(True)
self.advanced.ui.install_prereqs_label.setEnabled(True)