mirror of
https://github.com/fishyboteso/fishyboteso.git
synced 2024-08-30 18:32:13 +00:00
add update filemenu
This commit is contained in:
parent
4845c593f7
commit
e47789c8ea
@ -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)
|
||||
|
||||
|
@ -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
|
||||
|
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user