chiark / gitweb /
do not show unicode data for island pixmaps
authorIan Jackson <ian@liberator.relativity.greenend.org.uk>
Wed, 24 Jun 2009 17:35:36 +0000 (18:35 +0100)
committerIan Jackson <ian@liberator.relativity.greenend.org.uk>
Wed, 24 Jun 2009 17:35:36 +0000 (18:35 +0100)
pctb/TODO
pctb/dictionary-manager

index b3ab72e7c3082c86f7a34bb0aa553fac91e8c6c2..1e8e4b125173914e0d5ba373286b3b86d8a2a213 100644 (file)
--- a/pctb/TODO
+++ b/pctb/TODO
@@ -1,4 +1,3 @@
-do not show unicode data for island pixmaps
 install/test dictionary upload/approval
 onboard ship island name horizontal trim
 write real uploader
index 81a480ef476a0278f84f6a7bd6a1f85e66899efa..aab8b66d097703ffc7f1474d20fd9abc83576879 100755 (executable)
@@ -274,6 +274,11 @@ proc required/char {} {
     startup_cursor
 }
 
+proc approve_showentry_xinfo/char {w def} {
+    set unic [string2unicodenames $def]
+    label $w -text $unic
+}
+
 #========== PIXMAPS ==========
 
 #---------- pixmap database read and write ----------
@@ -406,6 +411,10 @@ proc required/pixmap {} {
     }
 }
 
+proc approve_showentry_xinfo/pixmap {w def} {
+    label $w -image image/empty
+}
+
 #========== UPLOADS TO DICTIONARY SERVER ==========
 
 proc upload_init {} {
@@ -916,14 +925,7 @@ proc remote-serv/take {yesno file dict} {
 
     must_gets_exactly stdin confirmed
 
-    if {![string compare pixmap $dict]} {
-       set reqkind pixmap
-       debug "DICT PIXMAP"
-    } elseif {[regexp {^(char)([1-9]\d*)$} $dict dummy reqkind rows]} {
-       debug "DICT CHAR rqk=$reqkind r=$rows."
-    } else {
-       error "$dict ?"
-    }
+    manyset [dict2_reqkind_rows reqkind rows]
     
     if {$yesno} {
        read_database $dictdir/master-$dict.txt
@@ -984,6 +986,18 @@ proc regsub-data {exp subspec args} {
     }
 }
 
+proc dict2_reqkind_rows {dict} {
+    if {![string compare pixmap $dict]} {
+       return {pixmap {}}
+       debug "DICT PIXMAP"
+    } elseif {[regexp {^(char)([1-9]\d*)$} $dict dummy reqkind rows]} {
+       debug "DICT CHAR rqk=$reqkind r=$rows."
+       return [list $reqkind rows]
+    } else {
+       error "$dict ?"
+    }
+}
+
 proc chop_counted {var} {
     upvar 1 $var val
     global data
@@ -1018,8 +1032,18 @@ proc approve_compare {fd1 fd2} {
     return [string compare $sv1 $sv2]
 }
 
+proc string2unicodenames {str} {
+    return [exec perl -e {
+       use Unicode::CharName qw(uname);
+       $ARGV[0] =~ s/^ //;
+       foreach $_ (split //,$ARGV[0]) {
+           print uname(ord),"\n" or die $!
+       }
+    } " $str"]
+}
+
 proc approve_showentry {ix file specdata} {
-    global approve_ixes
+    global approve_ixes reqkind
     
     approve_decompose_data $specdata
 
@@ -1043,14 +1067,8 @@ proc approve_showentry {ix file specdata} {
     image create photo approve/$ix -data $ppm
     label $wb-image -image approve/$ix -bd 2 -relief sunken
 
-    set unic [exec perl -e {
-       use Unicode::CharName qw(uname);
-       $ARGV[0] =~ s/^ //;
-       foreach $_ (split //,$ARGV[0]) {
-           print uname(ord),"\n" or die $!
-       }
-    } " $def"]
-    label $wb-unicode -text $unic
+    manyset [dict2_reqkind_rows $dict] reqkind
+    approve_showentry_xinfo/$reqkind $wb-xinfo $def
 
     if {$ix} {
        label $wb-div -bd 1 -relief sunken -image image/empty
@@ -1061,7 +1079,7 @@ proc approve_showentry {ix file specdata} {
     button $wb-act.rej -text Reject -command [list approve_reject $ix]
     pack $wb-act.rej
 
-    grid $wb-def $wb-image $wb-unicode $wb-act $wb-inf -padx 3
+    grid $wb-def $wb-image $wb-xinfo $wb-act $wb-inf -padx 3
     grid configure $wb-image -ipadx 3 -ipady 3 -sticky w
 
     lappend approve_ixes $ix