diff --git a/fishy/gui/main_gui.py b/fishy/gui/main_gui.py index 903e3f2..e5fa2b8 100644 --- a/fishy/gui/main_gui.py +++ b/fishy/gui/main_gui.py @@ -55,6 +55,8 @@ def _create(gui: 'GUI'): dark_mode_var.set(int(config.get('dark_mode', True))) filemenu.add_checkbutton(label="Dark Mode", command=_toggle_mode, variable=dark_mode_var) + if config.get("dont_ask_update", False): + filemenu.add_command(label="Update", command=helper.update) menubar.add_cascade(label="Options", menu=filemenu) diff --git a/fishy/helper/__init__.py b/fishy/helper/__init__.py index 3f2be7d..272a0af 100644 --- a/fishy/helper/__init__.py +++ b/fishy/helper/__init__.py @@ -1,4 +1,4 @@ from .auto_update import auto_upgrade, upgrade_avail, versions from .config import Config from .helper import open_web, initialize_uid, install_thread_excepthook, unhandled_exception_logging, manifest_file, \ - create_shortcut_first, check_addon, restart, create_shortcut, not_implemented + create_shortcut_first, check_addon, restart, create_shortcut, not_implemented, update diff --git a/fishy/helper/helper.py b/fishy/helper/helper.py index 46aae46..99cab4a 100644 --- a/fishy/helper/helper.py +++ b/fishy/helper/helper.py @@ -76,7 +76,6 @@ def install_thread_excepthook(): If using psyco, call psycho.cannotcompile(threading.Thread.run) since this replaces a new-style class method. """ - import sys run_old = threading.Thread.run # noinspection PyBroadException @@ -168,3 +167,10 @@ def get_documents(): def restart(): os.execl(sys.executable, *([sys.executable] + sys.argv)) + + +def update(): + from .config import config + + config.delete("dont_ask_update") + restart()