chiark / gitweb /
Show owner names in vessel name list
authorIan Jackson <ian@liberator.relativity.greenend.org.uk>
Sun, 10 Jan 2010 14:38:17 +0000 (14:38 +0000)
committerIan Jackson <ian@liberator.relativity.greenend.org.uk>
Sun, 10 Jan 2010 14:38:17 +0000 (14:38 +0000)
yarrg/where-vessels

index b007a67..9b8c772 100755 (executable)
@@ -625,7 +625,7 @@ proc vessel {vin} {
     lappend newnotes [list $vid $realname $owner $xabbrev]
     set kk "$island [join $codel _]"
     upvar #0 found($kk) k
-    lappend k [list $vid $realname]
+    lappend k [list $vid $realname $owner]
  
     debug "CODED $kk $vid $realname"
 }
@@ -1079,8 +1079,20 @@ proc show-report {islandname code} {
     .cp.report.list delete 0 end
 
     foreach entry $k {
-       manyset $entry vid name
-       .cp.report.list insert end $name
+       manyset $entry vid name owner
+       lappend owned($owner) $name
+    }
+
+    foreach owner [lsort [array names owned]] {
+       if {[string length $owner]} {
+           set owndesc "$owner's"
+       } else {
+           set owndesc "Owner unknown"
+       }
+       .cp.report.list insert end "$owndesc:"
+       foreach name $owned($owner) {
+           .cp.report.list insert end " $name"
+       }
     }
 }