From 7949d1098cb5fa411ce76297d4b9e43be8438a0d Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Wed, 6 Sep 2017 21:22:04 +0100 Subject: [PATCH] mon/tripemon.in: Update peer IP address displays when the address changes. This affects both the main MonitorWindow and individual PeerWindows. --- mon/tripemon.in | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mon/tripemon.in b/mon/tripemon.in index d96601fb..15fff2c8 100644 --- a/mon/tripemon.in +++ b/mon/tripemon.in @@ -1364,6 +1364,7 @@ class PeerWindow (TrivialWindow): def change(me): """Update the display in response to a notification.""" me.e['Interface'].set_text(me.peer.ifname) + me.e['Address'].set_text(me.peer.addr) def _update(me): """ @@ -1615,6 +1616,7 @@ class MonitorWindow (MyWindow): '???', 'green', '???', 'green']) peer.win = WindowSlot(lambda: PeerWindow(peer)) me.hook(peer.pinghook, me._ping) + me.hook(peer.changehook, lambda: me._change(peer)) me.apchange() def delpeer(me, peer): @@ -1755,6 +1757,10 @@ class MonitorWindow (MyWindow): me.listmodel[p.i][textcol] = '%.1f ms' % ps.tlast me.listmodel[p.i][colourcol] = 'black' + def _change(me, p): + """Hook: notified when the peer changes state.""" + me.listmodel[p.i][1] = p.addr + def setstatus(me, status): """Update the message in the status bar.""" me.status.pop(0) -- 2.11.0