add update filemenu

This commit is contained in:
Semjon Kerner 2021-02-14 19:10:11 +01:00
parent 4845c593f7
commit e47789c8ea
3 changed files with 10 additions and 2 deletions

View File

@ -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)

View File

@ -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

View File

@ -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()