mirror of
https://github.com/norohind/EDMC_SpanshRouter.git
synced 2025-04-21 11:37:36 +03:00
Fixed an issue where the update popup would crash EDMC
This commit is contained in:
parent
b866bc1752
commit
79c7f98850
12
SpanshRouter/SpanshRouter.py
Executable file → Normal file
12
SpanshRouter/SpanshRouter.py
Executable file → Normal file
@ -116,18 +116,6 @@ class SpanshRouter():
|
||||
self.jumpcounttxt_lbl.grid_remove()
|
||||
self.clear_route_btn.grid_remove()
|
||||
|
||||
if self.update_available:
|
||||
update_txt = "New Spansh update available!\n"
|
||||
update_txt += "If you choose to install it, you will have to restart EDMC for it to take effect.\n\n"
|
||||
update_txt += self.spansh_updater.changelogs
|
||||
update_txt += "\n\nInstall?"
|
||||
install_update = confirmDialog.askyesno("SpanshRouter", update_txt)
|
||||
|
||||
if install_update:
|
||||
confirmDialog.showinfo("SpanshRouter", "The update will be installed as soon as you quit EDMC.")
|
||||
else:
|
||||
self.update_available = False
|
||||
|
||||
self.update_gui()
|
||||
|
||||
return self.frame
|
||||
|
17
load.py
17
load.py
@ -2,8 +2,10 @@ import sys
|
||||
is_py2 = sys.version[0] == '2'
|
||||
if is_py2:
|
||||
from SpanshRouter import SpanshRouter
|
||||
import tkMessageBox as confirmDialog
|
||||
else:
|
||||
from SpanshRouter.SpanshRouter import SpanshRouter
|
||||
import tkinter.messagebox as confirmDialog
|
||||
|
||||
def plugin_start3(plugin_dir):
|
||||
global spansh_router
|
||||
@ -35,6 +37,21 @@ def journal_entry(cmdr, is_beta, system, station, entry, state):
|
||||
elif entry['event'] == 'FSSDiscoveryScan' and entry['SystemName'] == spansh_router.next_stop:
|
||||
spansh_router.update_route()
|
||||
|
||||
def ask_for_update():
|
||||
global spansh_router
|
||||
if spansh_router.update_available:
|
||||
update_txt = "New Spansh Router update available!\n"
|
||||
update_txt += "If you choose to install it, you will have to restart EDMC for it to take effect.\n\n"
|
||||
update_txt += spansh_router.spansh_updater.changelogs
|
||||
update_txt += "\n\nInstall?"
|
||||
install_update = confirmDialog.askyesno("SpanshRouter", update_txt)
|
||||
|
||||
if install_update:
|
||||
confirmDialog.showinfo("SpanshRouter", "The update will be installed as soon as you quit EDMC.")
|
||||
else:
|
||||
spansh_router.update_available = False
|
||||
|
||||
def plugin_app(parent):
|
||||
global spansh_router
|
||||
spansh_router.init_gui(parent)
|
||||
parent.master.after_idle(ask_for_update)
|
||||
|
Loading…
x
Reference in New Issue
Block a user