mirror of
https://github.com/NinjaCheetah/NUSGet.git
synced 2025-04-25 23:21:02 -04:00
Improved error handling and reworded some danger strings
This commit is contained in:
parent
6ad422943b
commit
1c2370b6cb
43
NUSD-Py.py
43
NUSD-Py.py
@ -6,7 +6,7 @@ import pathlib
|
||||
import libWiiPy
|
||||
|
||||
from PySide6.QtWidgets import QApplication, QMainWindow, QMessageBox, QTreeWidgetItem
|
||||
from PySide6.QtCore import QRunnable, Slot, QThreadPool, Signal, QObject, Qt
|
||||
from PySide6.QtCore import QRunnable, Slot, QThreadPool, Signal, QObject
|
||||
|
||||
from qt.py.ui_MainMenu import Ui_MainWindow
|
||||
|
||||
@ -30,12 +30,11 @@ class Worker(QRunnable):
|
||||
@Slot()
|
||||
def run(self):
|
||||
try:
|
||||
self.fn(**self.kwargs)
|
||||
# TODO: Handle errors better than this
|
||||
result = self.fn(**self.kwargs)
|
||||
except ValueError:
|
||||
self.signals.result.emit(1)
|
||||
else:
|
||||
self.signals.result.emit(0)
|
||||
self.signals.result.emit(result)
|
||||
|
||||
|
||||
class MainWindow(QMainWindow, Ui_MainWindow):
|
||||
@ -138,22 +137,29 @@ class MainWindow(QMainWindow, Ui_MainWindow):
|
||||
self.threadpool.start(worker)
|
||||
|
||||
def check_download_result(self, result):
|
||||
if result == 1:
|
||||
msgBox = QMessageBox()
|
||||
msgBox = QMessageBox()
|
||||
msgBox.setIcon(QMessageBox.Icon.Critical)
|
||||
msgBox.setStandardButtons(QMessageBox.StandardButton.Ok)
|
||||
msgBox.setDefaultButton(QMessageBox.StandardButton.Ok)
|
||||
if result == -1:
|
||||
msgBox.setWindowTitle("Invalid Title ID")
|
||||
msgBox.setIcon(QMessageBox.Icon.Critical)
|
||||
msgBox.setText("No title with the provided Title ID could be found!")
|
||||
msgBox.setText("The Title ID you have entered is not in a valid format!")
|
||||
msgBox.setInformativeText("Title IDs must be 16 digit strings of numbers and letters. Please enter a "
|
||||
"correctly formatted Title ID, or select one from the menu on the left.")
|
||||
msgBox.exec()
|
||||
elif result == -2:
|
||||
msgBox.setWindowTitle("Title ID/Version Not Found")
|
||||
msgBox.setText("No title with the provided Title ID or version could be found!")
|
||||
msgBox.setInformativeText("Please make sure that you have entered a valid Title ID or selected one from the"
|
||||
" title database.")
|
||||
msgBox.setStandardButtons(QMessageBox.StandardButton.Ok)
|
||||
msgBox.setDefaultButton(QMessageBox.StandardButton.Ok)
|
||||
" title database, and that the provided version exists for the title you are"
|
||||
" attempting to download.")
|
||||
msgBox.exec()
|
||||
self.ui.download_btn.setEnabled(True)
|
||||
|
||||
def run_nus_download(self, progress_callback):
|
||||
tid = self.ui.tid_entry.text()
|
||||
if tid == "":
|
||||
raise ValueError
|
||||
return -1
|
||||
try:
|
||||
version = int(self.ui.version_entry.text())
|
||||
except ValueError:
|
||||
@ -171,11 +177,14 @@ class MainWindow(QMainWindow, Ui_MainWindow):
|
||||
progress_callback.emit("Downloading title " + tid + " vLatest, please wait...")
|
||||
|
||||
progress_callback.emit(" - Downloading and parsing TMD...")
|
||||
if version is not None:
|
||||
title.load_tmd(libWiiPy.download_tmd(tid, version))
|
||||
else:
|
||||
title.load_tmd(libWiiPy.download_tmd(tid))
|
||||
version = title.tmd.title_version
|
||||
try:
|
||||
if version is not None:
|
||||
title.load_tmd(libWiiPy.download_tmd(tid, version))
|
||||
else:
|
||||
title.load_tmd(libWiiPy.download_tmd(tid))
|
||||
version = title.tmd.title_version
|
||||
except ValueError:
|
||||
return -2
|
||||
|
||||
version_dir = pathlib.Path(os.path.join(title_dir, str(version)))
|
||||
if not version_dir.is_dir():
|
||||
|
@ -31,7 +31,7 @@
|
||||
},
|
||||
"Ticket": true,
|
||||
"WAD Name": "BC-NUS",
|
||||
"Danger": "BC is required for the Wii's backwards compatibility with the GameCube. GameCube games will not run properly if BC is damaged or not present, and BC will need to be reinstalled."
|
||||
"Danger": "BC is required for the Wii's backwards compatibility with the GameCube. GameCube games will not run properly if BC is damaged or not present."
|
||||
},
|
||||
{
|
||||
"Name": "MIOS",
|
||||
@ -41,7 +41,7 @@
|
||||
},
|
||||
"Ticket": true,
|
||||
"WAD Name": "MIOS-NUS",
|
||||
"Danger": "MIOS is required for the Wii's backwards compatibility with the GameCube. GameCube games will not run properly if MIOS is damaged or not present, and MIOS will need to be reinstalled."
|
||||
"Danger": "MIOS is required for the Wii's backwards compatibility with the GameCube. GameCube games will not run properly if MIOS is damaged or not present."
|
||||
},
|
||||
{
|
||||
"Name": "EULA",
|
||||
@ -54,7 +54,7 @@
|
||||
},
|
||||
"Ticket": true,
|
||||
"WAD Name": "EULA-NUS",
|
||||
"Danger": "EULA is required to accept the End User License Agreement required to connect to WiiConnect24. Online services may not work correctly if EULA is damaged or not present, and EULA will need to be reinstalled."
|
||||
"Danger": "\"EULA\" is a hidden channel used to display the End User License Agreement that must be accepted to connect to WiiConnect24. Online services may not work correctly if this channel is damaged or not present."
|
||||
},
|
||||
{
|
||||
"Name": "Region Select",
|
||||
@ -67,7 +67,7 @@
|
||||
},
|
||||
"Ticket": true,
|
||||
"WAD Name": "Region-Select-NUS",
|
||||
"Danger": "Region Select during the Wii's initial setup. It is unlikely to cause functional problems after initial setup, but you will not be able to set up your console again if you factory reset it if Region Select is damaged or not present, and Region Select will need to be reinstalled."
|
||||
"Danger": "\"Region Select\" is a hidden channel used during the Wii's initial setup. It is unlikely to cause functional problems after setup is complete, but you will not be able to set up your console again if it is factory reset if this channel is damaged or not present, and it will need to be reinstalled."
|
||||
}
|
||||
],
|
||||
"IOS": [
|
||||
|
Loading…
x
Reference in New Issue
Block a user