From 1d2a36c98282e6ec6ac3ec0068d1864c0b64c549 Mon Sep 17 00:00:00 2001 From: eknauel Date: Tue, 27 Sep 2005 16:34:02 +0000 Subject: [PATCH] Viewer for host-info part of darcs patch Thu Sep 22 18:43:55 EEST 2005 Martin Gasbichler --- scheme/network-viewer.scm | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/scheme/network-viewer.scm b/scheme/network-viewer.scm index 0064a7a..5052297 100644 --- a/scheme/network-viewer.scm +++ b/scheme/network-viewer.scm @@ -100,4 +100,35 @@ (make-info-viewer make-protocol-info-select-list)) (register-plugin! - (make-view-plugin make-protocol-info-viewer protocol-info?)) \ No newline at end of file + (make-view-plugin make-protocol-info-viewer protocol-info?)) + +(define (make-host-info-select-list hi num-lines) + (make-select-list + (append + (list + (make-unmarked-text-element + (cons 'name (host-info:name hi)) + #t + (format #f "Name: ~a" (host-info:name hi))) + (make-unmarked-text-element + (cons 'text "") #f "Aliases:")) + (map (lambda (alias) + (make-unmarked-text-element + (cons 'alias alias) #t + (format #f " ~a" alias))) + (host-info:aliases hi)) + (list + (make-unmarked-text-element + (cons 'text "") #f "Addresses:")) + (map (lambda (address) + (make-unmarked-text-element + (cons 'address address) #t + (format #f " ~a" address))) + (host-info:addresses hi))) + num-lines)) + +(define make-host-info-viewer + (make-info-viewer make-host-info-select-list)) + +(register-plugin! + (make-view-plugin make-host-info-viewer host-info?))