pygui: fixed checking link options when joining a session, fixed stopping a session and deleting wireless links due to logic moved to being a part of wireless edge delete itself

This commit is contained in:
Blake Harnden 2021-01-05 22:44:33 -08:00
parent 3c97f80614
commit acaef00087
2 changed files with 6 additions and 5 deletions

View file

@ -588,16 +588,19 @@ class CanvasEdge(Edge):
return return
if self.link.options.loss == EDGE_LOSS: if self.link.options.loss == EDGE_LOSS:
state = tk.HIDDEN state = tk.HIDDEN
self.src.canvas.addtag_withtag(tags.LOSS_EDGES, self.id) if self.id:
self.src.canvas.addtag_withtag(tags.LOSS_EDGES, self.id)
if self.id2: if self.id2:
self.dst.canvas.addtag_withtag(tags.LOSS_EDGES, self.id2) self.dst.canvas.addtag_withtag(tags.LOSS_EDGES, self.id2)
else: else:
state = tk.NORMAL state = tk.NORMAL
self.src.canvas.dtag(self.id, tags.LOSS_EDGES) if self.id:
self.src.canvas.dtag(self.id, tags.LOSS_EDGES)
if self.id2: if self.id2:
self.dst.canvas.dtag(self.id2, tags.LOSS_EDGES) self.dst.canvas.dtag(self.id2, tags.LOSS_EDGES)
if self.manager.show_loss_links.state() == tk.HIDDEN: if self.manager.show_loss_links.state() == tk.HIDDEN:
self.src.canvas.itemconfigure(self.id, state=state) if self.id:
self.src.canvas.itemconfigure(self.id, state=state)
if self.id2: if self.id2:
self.dst.canvas.itemconfigure(self.id2, state=state) self.dst.canvas.itemconfigure(self.id2, state=state)

View file

@ -285,8 +285,6 @@ class CanvasManager:
# clear wireless edges # clear wireless edges
for edge in self.wireless_edges.values(): for edge in self.wireless_edges.values():
edge.delete() edge.delete()
edge.src.wireless_edges.remove(edge)
edge.dst.wireless_edges.remove(edge)
self.wireless_edges.clear() self.wireless_edges.clear()
self.clear_throughputs() self.clear_throughputs()