pygui some cleanup for dialog constructors to avoid passing duplicate parameters in most cases

This commit is contained in:
Blake Harnden 2020-05-04 22:50:59 -07:00
parent 185c6736b3
commit 1d620a0b17
42 changed files with 143 additions and 209 deletions

View file

@ -389,5 +389,5 @@ class CanvasEdge(Edge):
self.canvas.delete_edge(self)
def click_configure(self) -> None:
dialog = LinkConfigurationDialog(self.canvas, self.canvas.app, self)
dialog = LinkConfigurationDialog(self.canvas.app, self)
dialog.show()

View file

@ -720,7 +720,7 @@ class CanvasGraph(tk.Canvas):
selected = self.get_selected(event)
if selected is not None and selected in self.shapes:
shape = self.shapes[selected]
dialog = ShapeDialog(self.app, self.app, shape)
dialog = ShapeDialog(self.app, shape)
dialog.show()
def add_node(self, x: float, y: float) -> CanvasNode:

View file

@ -265,16 +265,16 @@ class CanvasNode:
self.canvas.copy()
def show_config(self):
dialog = NodeConfigDialog(self.app, self.app, self)
dialog = NodeConfigDialog(self.app, self)
dialog.show()
def show_wlan_config(self):
dialog = WlanConfigDialog(self.app, self.app, self)
dialog = WlanConfigDialog(self.app, self)
if not dialog.has_error:
dialog.show()
def show_mobility_config(self):
dialog = MobilityConfigDialog(self.app, self.app, self)
dialog = MobilityConfigDialog(self.app, self)
if not dialog.has_error:
dialog.show()
@ -283,15 +283,15 @@ class CanvasNode:
mobility_player.show()
def show_emane_config(self):
dialog = EmaneConfigDialog(self.app, self.app, self)
dialog = EmaneConfigDialog(self.app, self)
dialog.show()
def show_services(self):
dialog = NodeServiceDialog(self.app, self.app, self)
dialog = NodeServiceDialog(self.app, self)
dialog.show()
def show_config_services(self):
dialog = NodeConfigServiceDialog(self.app, self.app, self)
dialog = NodeConfigServiceDialog(self.app, self)
dialog.show()
def has_emane_link(self, interface_id: int) -> core_pb2.Node:

View file

@ -148,7 +148,7 @@ class Shape:
def shape_complete(self, x: float, y: float):
for component in tags.ABOVE_SHAPE:
self.canvas.tag_raise(component)
s = ShapeDialog(self.app, self.app, self)
s = ShapeDialog(self.app, self)
s.show()
def disappear(self):