change some variable names to be more informative, add an image to error dialog

This commit is contained in:
Huy Pham 2020-02-05 15:53:14 -08:00
parent 0407645061
commit ee0c63e4a1
9 changed files with 23 additions and 20 deletions

View file

@ -65,17 +65,16 @@ class EmaneModelDialog(Dialog):
self.model = f"emane_{model}"
self.interface = interface
self.config_frame = None
self.error = False
self.has_error = False
try:
self.config = self.app.core.get_emane_model_config(
self.node.id, self.model, self.interface
)
self.draw()
except grpc.RpcError as e:
show_grpc_error(e, self.app, self.app)
self.error = True
self.has_error = True
self.destroy()
if not self.error:
self.draw()
def draw(self):
self.top.columnconfigure(0, weight=1)
@ -228,7 +227,7 @@ class EmaneConfigDialog(Dialog):
dialog = EmaneModelDialog(
self, self.app, self.canvas_node.core_node, model_name
)
if not dialog.error:
if not dialog.has_error:
dialog.show()
def emane_model_change(self, event: tk.Event):