replace tkinter errormessage with custom create error dialog
This commit is contained in:
parent
9216683902
commit
0407645061
15 changed files with 132 additions and 56 deletions
|
@ -17,8 +17,10 @@ class SessionOptionsDialog(Dialog):
|
|||
def __init__(self, master: "Application", app: "Application"):
|
||||
super().__init__(master, app, "Session Options", modal=True)
|
||||
self.config_frame = None
|
||||
self.has_error = False
|
||||
self.config = self.get_config()
|
||||
self.draw()
|
||||
if not self.has_error:
|
||||
self.draw()
|
||||
|
||||
def get_config(self):
|
||||
try:
|
||||
|
@ -26,7 +28,8 @@ class SessionOptionsDialog(Dialog):
|
|||
response = self.app.core.client.get_session_options(session_id)
|
||||
return response.config
|
||||
except grpc.RpcError as e:
|
||||
show_grpc_error(e)
|
||||
self.has_error = True
|
||||
show_grpc_error(e, self.app, self.app)
|
||||
self.destroy()
|
||||
|
||||
def draw(self):
|
||||
|
@ -53,5 +56,5 @@ class SessionOptionsDialog(Dialog):
|
|||
response = self.app.core.client.set_session_options(session_id, config)
|
||||
logging.info("saved session config: %s", response)
|
||||
except grpc.RpcError as e:
|
||||
show_grpc_error(e)
|
||||
show_grpc_error(e, self.top, self.app)
|
||||
self.destroy()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue