From aa341a9746c05f9b2caf15988a4a5fe67466a682 Mon Sep 17 00:00:00 2001 From: raphael60650 Date: Sat, 6 Nov 2021 14:03:45 +0100 Subject: [PATCH] added Help menu to access the wiki or the discord --- source/Gui.py | 12 ++++++++++-- source/definition.py | 2 ++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/source/Gui.py b/source/Gui.py index 6acc845..1ab26d8 100644 --- a/source/Gui.py +++ b/source/Gui.py @@ -1,15 +1,17 @@ from distutils.version import StrictVersion from tkinter import filedialog, ttk, messagebox from tkinter import * +import webbrowser import traceback import requests import zipfile import json -import os -from source.Game import Game, RomAlreadyPatched, InvalidGamePath, InvalidFormat, in_thread, VERSION_FILE_URL +from source.Game import Game, RomAlreadyPatched, InvalidGamePath, InvalidFormat from source.Option import Option +from .definition import * + with open("./translation.json", encoding="utf-8") as f: translation_dict = json.load(f) @@ -132,6 +134,12 @@ class Gui: add_menu_mystuff_command(self.stringvar_mystuff_folder, "MyStuff") + # HELP MENU + self.menu_help = Menu(self.menu_bar, tearoff=0) + self.menu_bar.add_cascade(label=self.translate("Help"), menu=self.menu_help) + self.menu_help.add_command(label="Github Wiki", command=lambda: webbrowser.open(GITHUB_HELP_PAGE_URL)) + self.menu_help.add_command(label="Discord", command=lambda: webbrowser.open(DISCORD_URL)) + # GUI self.frame_language = Frame(self.root) self.frame_language.grid(row=1, column=1, sticky="E") diff --git a/source/definition.py b/source/definition.py index 9eed811..54d4157 100644 --- a/source/definition.py +++ b/source/definition.py @@ -9,6 +9,8 @@ GITHUB_DEV_BRANCH = f"https://raw.githubusercontent.com/{GITHUB_REPOSITORY}/dev/ ZIPBALL_MASTER_BRANCH = f"https://github.com/{GITHUB_REPOSITORY}/zipball/master/" ZIPBALL_DEV_BRANCH = f"https://github.com/{GITHUB_REPOSITORY}/zipball/dev/" VERSION_FILE_URL = GITHUB_MASTER_BRANCH + "version" +GITHUB_HELP_PAGE_URL = f"https://github.com/{GITHUB_REPOSITORY}/wiki/help" +DISCORD_URL = "https://discord.gg/HEYW5v8ZCd" CHUNK_SIZE: int = 524288 # chunk size used to download file