From: Ian Jackson Date: Sun, 8 Aug 2010 17:28:24 +0000 (+0100) Subject: where-vessels: smash flags X-Git-Tag: 6.6.2~15 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?p=ypp-sc-tools.db-live.git;a=commitdiff_plain;h=25bfdb659114a00e7bea79c97d7372e97d99bbe5 where-vessels: smash flags --- diff --git a/yarrg/where-vessels b/yarrg/where-vessels index 5cc498b..c601375 100755 --- a/yarrg/where-vessels +++ b/yarrg/where-vessels @@ -449,10 +449,19 @@ proc show-report-decode {code} { default { report-set own "?? $notown" } } - if {[string length $xabbrev]} { - report-set xabbrev "Notes flags: $xabbrev" + global smash_xabbrev_map + if {[llength $smash_xabbrev_map]} { + if {[string length $xabbrev]} { + report-set xabbrev "(Flags: $xabbrev)" + } else { + report-set xabbrev "(No flags)" + } } else { - report-set xabbrev "No flags in notes" + if {[string length $xabbrev]} { + report-set xabbrev "Notes flags: $xabbrev" + } else { + report-set xabbrev "No flags in notes" + } } } @@ -578,6 +587,9 @@ proc smash-code {code} { 4 { set lockown 33 } } + global smash_xabbrev_map + set xabbrev [string map $smash_xabbrev_map $xabbrev] + return [join [list $inport $smsize $subclass $lockown $xabbrev] _] } @@ -593,6 +605,14 @@ proc smash-prepare {} { } set smash_sizemap($size) $mapto } + + global smash_xabbrev_a smash_xabbrev_b smash_xabbrev_map + set smash_xabbrev_map {} + foreach a [split $smash_xabbrev_a ""] b [split $smash_xabbrev_b ""] { + if {![string length $a]} continue + lappend smash_xabbrev_map $a $b + } + debug "SMASH-PREPAE xabbrev_map=[list $smash_xabbrev_map]" } proc make-smasher {sma label ekind} { @@ -623,6 +643,18 @@ proc make-smashers {} { make-radio-smasher owner Owner smash_owner \ {Show Yours? {For you} Lock Hide} 2 3 + + set cw [make-smasher xabbrev "Flags" frame] + foreach ix {1 3} ab {a b} { + set vn smash_xabbrev_$ab + global $vn + set $vn {} + entry $cw.$ix -textvariable $vn -width 14 + trace add variable $vn write [list redraw-needed $vn] + } + set ix 0 + foreach str {y/ / /d} { label $cw.$ix -text $str; incr ix 2 } + eval pack [lsort [winfo children $cw]] -side left } #---------- filtering ----------