update coretk gui to allow proper cancel when there is an attempt to exit a running session

This commit is contained in:
Blake Harnden 2019-12-20 11:56:48 -08:00
parent 396a948bb9
commit 9f3a3cef28

View file

@ -48,24 +48,21 @@ class MenuAction:
:return: nothing :return: nothing
""" """
logging.info(
"menuaction.py: clean_nodes_links_and_set_configuration() Exiting the program"
)
try: try:
if not self.app.core.is_runtime(): if not self.app.core.is_runtime():
self.app.core.delete_session() self.app.core.delete_session()
if quitapp: if quitapp:
self.app.quit() self.app.quit()
else: else:
result = messagebox.askyesnocancel("stop", "Stop the running session?") result = messagebox.askyesnocancel("Exit", "Stop the running session?")
if result: if result is True:
self.app.statusbar.progress_bar.start(5) self.app.statusbar.progress_bar.start(5)
thread = threading.Thread( thread = threading.Thread(
target=self.cleanup_old_session, args=([quitapp]) target=self.cleanup_old_session, args=([quitapp])
) )
thread.daemon = True thread.daemon = True
thread.start() thread.start()
elif quitapp: elif result is False and quitapp:
self.app.quit() self.app.quit()
except grpc.RpcError: except grpc.RpcError:
logging.exception("error deleting session") logging.exception("error deleting session")