mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-04-15 08:40:34 +03:00
[748] Enable Automatic Restart
This commit is contained in:
parent
86b5556efb
commit
fee05d3aa5
@ -850,7 +850,7 @@ class AppWindow:
|
|||||||
webbrowser.open("https://github.com/edCD/eDMarketConnector/releases/latest")
|
webbrowser.open("https://github.com/edCD/eDMarketConnector/releases/latest")
|
||||||
if postargs.get('Restart_Req'):
|
if postargs.get('Restart_Req'):
|
||||||
# LANG: Text of Notification Popup for EDMC Restart
|
# LANG: Text of Notification Popup for EDMC Restart
|
||||||
restart_msg = tr.tl('A restart of EDMC is required. EDMC will now shut down.')
|
restart_msg = tr.tl('A restart of EDMC is required. EDMC will now restart.')
|
||||||
restart_box = tk.messagebox.Message(
|
restart_box = tk.messagebox.Message(
|
||||||
title=tr.tl('Restart Required'), # LANG: Title of Notification Popup for EDMC Restart
|
title=tr.tl('Restart Required'), # LANG: Title of Notification Popup for EDMC Restart
|
||||||
message=restart_msg,
|
message=restart_msg,
|
||||||
@ -858,7 +858,7 @@ class AppWindow:
|
|||||||
)
|
)
|
||||||
restart_box.show()
|
restart_box.show()
|
||||||
if restart_box:
|
if restart_box:
|
||||||
app.onexit()
|
app.onexit(restart=True)
|
||||||
|
|
||||||
def set_labels(self):
|
def set_labels(self):
|
||||||
"""Set main window labels, e.g. after language change."""
|
"""Set main window labels, e.g. after language change."""
|
||||||
@ -1862,7 +1862,7 @@ class AppWindow:
|
|||||||
)
|
)
|
||||||
exit_thread.start()
|
exit_thread.start()
|
||||||
|
|
||||||
def onexit(self, event=None) -> None:
|
def onexit(self, event=None, restart: bool=False) -> None:
|
||||||
"""Application shutdown procedure."""
|
"""Application shutdown procedure."""
|
||||||
if sys.platform == 'win32':
|
if sys.platform == 'win32':
|
||||||
shutdown_thread = threading.Thread(
|
shutdown_thread = threading.Thread(
|
||||||
@ -1925,6 +1925,8 @@ class AppWindow:
|
|||||||
self.w.destroy()
|
self.w.destroy()
|
||||||
|
|
||||||
logger.info('Done.')
|
logger.info('Done.')
|
||||||
|
if restart:
|
||||||
|
return os.execv(sys.executable, ['python'] + sys.argv)
|
||||||
|
|
||||||
def drag_start(self, event) -> None:
|
def drag_start(self, event) -> None:
|
||||||
"""Initiate dragging the window."""
|
"""Initiate dragging the window."""
|
||||||
|
@ -814,7 +814,7 @@
|
|||||||
"Restart Required" = "Restart Required";
|
"Restart Required" = "Restart Required";
|
||||||
|
|
||||||
/* EDMarketConnector.py: Text of Notification Popup for EDMC Restart; */
|
/* EDMarketConnector.py: Text of Notification Popup for EDMC Restart; */
|
||||||
"A restart of EDMC is required. EDMC will now shut down." = "A restart of EDMC is required. EDMC will now shut down.";
|
"A restart of EDMC is required. EDMC will now restart." = "A restart of EDMC is required. EDMC will now restart.";
|
||||||
|
|
||||||
/* myNotebook.py: Can't Paste Images or Files in Text; */
|
/* myNotebook.py: Can't Paste Images or Files in Text; */
|
||||||
"Cannot paste non-text content." = "Cannot paste non-text content.";
|
"Cannot paste non-text content." = "Cannot paste non-text content.";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user