Skip to content

Commit

Permalink
Add Game Title ID registry checks on GUI startup
Browse files Browse the repository at this point in the history
  • Loading branch information
rlaphoenix committed Aug 26, 2023
1 parent 8ef40cf commit c7fff1f
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions nton/gui/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,15 @@ def ensure_dependencies(window: QMainWindow) -> None:
QMessageBox.StandardButton.Ok
)
sys.exit(1)
if not Files.game_title_ids.exists():
QMessageBox.critical(
window,
"Corrupt Installation",
f"Could not Game Title ID registry which should be pre-bundled with NTON.<br/><br/>"
"If this continues to happen <a href='https://github.com/rlaphoenix/nton/issues'>Create an Issue</a>.",
QMessageBox.StandardButton.Ok
)
sys.exit(1)
while not Files.keys.is_file():
QMessageBox.critical(
window,
Expand All @@ -80,6 +89,10 @@ def ensure_dependencies(window: QMainWindow) -> None:
QMessageBox.StandardButton.Ok
)

# TODO: Add GUI menu bar option to update Game Title ID registry, then warn if outdated
# if Files.game_title_ids.stat().st_mtime + (60 * 24 * 30) < time.time():
# log.warning("Game Title ID registry is quite old, I recommend updating it with `nton update-game-ids`")


def setup_logic(window: QMainWindow) -> None:
# menu bar actions
Expand Down

0 comments on commit c7fff1f

Please sign in to comment.