chiark
/
gitweb
/
~yarrgweb
/
ypp-sc-tools.db-live.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Support --screenshots-file as alternative spelling
[ypp-sc-tools.db-live.git]
/
pctb
/
dictionary-manager
diff --git
a/pctb/dictionary-manager
b/pctb/dictionary-manager
index 53174ed25cd57e7167b17cfad75100f54d4ed64f..d9d3dab0a3d47ed4a3235426429c67a8b9b3f8cc 100755
(executable)
--- a/
pctb/dictionary-manager
+++ b/
pctb/dictionary-manager
@@
-94,6
+94,13
@@
proc bgerror {m} {
exit 16
}
exit 16
}
+proc execpnm_createphoto {photoname args} {
+ set tmpfile ./_dictimage.tmp
+ eval exec $args > $tmpfile
+ image create photo $photoname -file $tmpfile
+ file delete $tmpfile
+}
+
#---------- display core ----------
set mul 6
#---------- display core ----------
set mul 6
@@
-145,6
+152,7
@@
static unsigned char csr_bits[] = {
button .pe.ok -text OK
pack .pe.grid .pe.ok -side left
button .pe.ok -text OK
pack .pe.grid .pe.ok -side left
+ bind .pe.ok <Key-Return> { .pe.ok invoke }
pack .d.mi .d.ctx -side top -anchor w
pack .d -fill x -padx 2 -pady 2
pack .d.mi .d.ctx -side top -anchor w
pack .d -fill x -padx 2 -pady 2
@@
-249,7
+257,7
@@
proc write_database {} {
proc select_database {dbname_spec} {
global dbname
set dbname $dbname_spec
proc select_database {dbname_spec} {
global dbname
set dbname $dbname_spec
- read_database "./
#local-$dbname#
.txt"
+ read_database "./
_local-$dbname
.txt"
}
proc do_database_update {im def} {
}
proc do_database_update {im def} {
@@
-366,7
+374,9
@@
proc pixmap_select {ncol} {
if {$col==$ncol} continue
.pe.grid.l$col selection clear 0 end
}
if {$col==$ncol} continue
.pe.grid.l$col selection clear 0 end
}
- pixmap_maybe_ok
+ if {[pixmap_maybe_ok]} {
+ focus .pe.ok
+ }
}
proc pixmap_maybe_ok {} {
global alloptions pixmap_selcol pixmap_selrow
}
proc pixmap_maybe_ok {} {
global alloptions pixmap_selcol pixmap_selrow
@@
-382,8
+392,10
@@
proc pixmap_maybe_ok {} {
if {$nsel==1} {
debug "MAYBE_OK YES col=$pixmap_selcol row=$pixmap_selrow."
.pe.ok configure -state normal -command pixmap_ok
if {$nsel==1} {
debug "MAYBE_OK YES col=$pixmap_selcol row=$pixmap_selrow."
.pe.ok configure -state normal -command pixmap_ok
+ return 1
} else {
.pe.ok configure -state disabled -command {}
} else {
.pe.ok configure -state disabled -command {}
+ return 0
}
}
proc pixmap_ok {} {
}
}
proc pixmap_ok {} {
@@
-417,8
+429,7
@@
proc required/pixmap {} {
if {![string length $ppml]} break
append ppm $ppml "\n"
}
if {![string length $ppml]} break
append ppm $ppml "\n"
}
- set data [exec pnmscale 2 << $ppm]
- image create photo image/main -data $data
+ execpnm_createphoto image/main pnmscale 2 << $ppm
set alloptions [exec ./database-info-fetch $unk_what]
set alloptions [exec ./database-info-fetch $unk_what]
@@
-452,7
+463,7
@@
proc required/pixmap {} {
pixmap_maybe_ok
helptext {
pixmap_maybe_ok
helptext {
- {{Indicate the meaning of this image
, and click OK
.}}
+ {{Indicate the meaning of this image
; then click OK or hit Return
.}}
}
}
}
}
@@
-695,11
+706,9
@@
proc char_read_pgm {f} {
append o $ointerl
}
append o $ointerl
}
- debug "DATA1 $o"
- set tmpfile ./#dictimage#.tmp
- exec pnmscale 1 << $o >$tmpfile
- image create photo image/main -file $tmpfile
- file delete $tmpfile
+# debug "DATA1 $o"
+
+ execpnm_createphoto image/main pnmscale 1 << $o
}
#---------- character set editor display ----------
}
#---------- character set editor display ----------
@@
-731,7
+740,7
@@
proc startup_cursor {} {
global glyphsdone unk_l unk_r
set cur_already [expr {[llength $glyphsdone]/5-1}]
global glyphsdone unk_l unk_r
set cur_already [expr {[llength $glyphsdone]/5-1}]
- set cur_mode
1
;# one of: 0 1 already text
+ set cur_mode
0
;# one of: 0 1 already text
set cur_0 $unk_l
set cur_1 [expr {$unk_r+1}]
set cur_0 $unk_l
set cur_1 [expr {$unk_r+1}]
@@
-1059,9
+1068,14
@@
proc remote-serv/take {yesno file dict} {
manyset [dict2_reqkind_rows $dict] reqkind rows
if {$yesno} {
manyset [dict2_reqkind_rows $dict] reqkind rows
if {$yesno} {
- read_database $dictdir/master-$dict.txt
+ set fnbase $dictdir/master-$dict.txt
+ read_database $fnbase
set database($key) $val
write_database
set database($key) $val
write_database
+
+ exec gzip -1 < $fnbase > $fnbase.gz.new
+ exec mv -f -- $fnbase.gz.new $fnbase.gz
+
set desc approve
} else {
set desc reject
set desc approve
} else {
set desc reject
@@
-1198,9
+1212,7
@@
proc approve_showentry {ix file specdata} {
set image [exec pgmtoppm {#008-white} << $image | pnmnoraw]
append image "\n"
}
set image [exec pgmtoppm {#008-white} << $image | pnmnoraw]
append image "\n"
}
- set image [exec pnmscale 2 << $image]
-
- image create photo approve/$ix -data $image
+ execpnm_createphoto approve/$ix pnmscale 3 << $image
label $wb-image -image approve/$ix -bd 2 -relief flat -bg black
manyset [dict2_reqkind_rows $dict] reqkind
label $wb-image -image approve/$ix -bd 2 -relief flat -bg black
manyset [dict2_reqkind_rows $dict] reqkind
@@
-1249,6
+1261,8
@@
proc approve_check_server {} {
proc approve_confirm {} {
global approve_ixes approve_entryhow
proc approve_confirm {} {
global approve_ixes approve_entryhow
+ .ok configure -state disabled
+ update idletasks
approve_check_server
foreach ix $approve_ixes {
set how $approve_entryhow($ix)
approve_check_server
foreach ix $approve_ixes {
set how $approve_entryhow($ix)
@@
-1283,6
+1297,7
@@
proc approve_fetch_list {} {
set approve_list [lsort -command approve_compare $approve_list]
approve_show_page 0
set approve_list [lsort -command approve_compare $approve_list]
approve_show_page 0
+ .ok configure -state normal
}
proc main/approve {} {
}
proc main/approve {} {