destroy any mobility player dialog before joinning a different session, pass in old_session_id to Menuaction.cleanup_old_session() so that the old session is deleted rather than the new one
This commit is contained in:
parent
b0087bbde1
commit
b6f68e0b06
2 changed files with 11 additions and 4 deletions
|
@ -121,6 +121,8 @@ class CoreClient:
|
||||||
self.emane_config = None
|
self.emane_config = None
|
||||||
self.service_configs.clear()
|
self.service_configs.clear()
|
||||||
self.file_configs.clear()
|
self.file_configs.clear()
|
||||||
|
for mobility_player in self.mobility_players.values():
|
||||||
|
mobility_player.handle_close()
|
||||||
self.mobility_players.clear()
|
self.mobility_players.clear()
|
||||||
# clear streams
|
# clear streams
|
||||||
if self.handling_throughputs:
|
if self.handling_throughputs:
|
||||||
|
@ -408,7 +410,7 @@ class CoreClient:
|
||||||
session_id = self.session_id
|
session_id = self.session_id
|
||||||
try:
|
try:
|
||||||
response = self.client.delete_session(session_id)
|
response = self.client.delete_session(session_id)
|
||||||
logging.info("deleted session result: %s", response)
|
logging.info("deleted session(%s) result: %s", session_id, response)
|
||||||
except grpc.RpcError as e:
|
except grpc.RpcError as e:
|
||||||
self.app.after(0, show_grpc_error, e)
|
self.app.after(0, show_grpc_error, e)
|
||||||
|
|
||||||
|
|
|
@ -32,10 +32,10 @@ class MenuAction:
|
||||||
self.app = app
|
self.app = app
|
||||||
self.canvas = app.canvas
|
self.canvas = app.canvas
|
||||||
|
|
||||||
def cleanup_old_session(self):
|
def cleanup_old_session(self, session_id):
|
||||||
logging.info("cleaning up old session")
|
logging.info("cleaning up old session")
|
||||||
self.app.core.stop_session()
|
self.app.core.stop_session()
|
||||||
self.app.core.delete_session()
|
self.app.core.delete_session(session_id)
|
||||||
|
|
||||||
def prompt_save_running_session(self, quitapp: bool = False):
|
def prompt_save_running_session(self, quitapp: bool = False):
|
||||||
"""
|
"""
|
||||||
|
@ -49,7 +49,12 @@ class MenuAction:
|
||||||
callback = None
|
callback = None
|
||||||
if quitapp:
|
if quitapp:
|
||||||
callback = self.app.quit
|
callback = self.app.quit
|
||||||
task = BackgroundTask(self.app, self.cleanup_old_session, callback)
|
task = BackgroundTask(
|
||||||
|
self.app,
|
||||||
|
self.cleanup_old_session,
|
||||||
|
callback,
|
||||||
|
(self.app.core.session_id,),
|
||||||
|
)
|
||||||
task.start()
|
task.start()
|
||||||
elif quitapp:
|
elif quitapp:
|
||||||
self.app.quit()
|
self.app.quit()
|
||||||
|
|
Loading…
Add table
Reference in a new issue