~mdw
/
tripe
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
mon/tripemon.in: Update peer IP address displays when the address changes.
[tripe]
/
mon
/
tripemon.in
diff --git
a/mon/tripemon.in
b/mon/tripemon.in
index
d96601f
..
15fff2c
100644
(file)
--- 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)
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):
"""
def _update(me):
"""
@@
-1615,6
+1616,7
@@
class MonitorWindow (MyWindow):
'???', 'green', '???', 'green'])
peer.win = WindowSlot(lambda: PeerWindow(peer))
me.hook(peer.pinghook, me._ping)
'???', '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):
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'
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)
def setstatus(me, status):
"""Update the message in the status bar."""
me.status.pop(0)