global csrh gotsh ctxh
if {[winfo exists .d]} return
+
+ frame .privacy -bd 2 -relief groove
+ pack .privacy -side top -padx 2 -pady 2 -fill x
+
+ upload_init_widgets
- frame .d
+ frame .d -bd 2 -relief groove -pady 2 -padx 2
image create bitmap image/main
label .d.mi -image image/main -borderwidth 0
frame .d.mi.csr_1 -bg white -width 1
frame .d.pe
frame .d.pe.grid
+
button .d.pe.ok -text OK
pack .d.pe.grid .d.pe.ok -side left
pack .d.mi .d.ctx -side top
- pack .d
+ pack .d -fill x -padx 2 -pady 2
- frame .help
- pack .help
+ frame .help -bd 2 -relief groove
+ pack .help -pady 2 -padx 2
}
proc resize_widgets_core {} {
set x 0; foreach c $l {
set w .help.at${x}x${y}
label $w -text $c
- grid $w -row $y -column $x -padx 5
+ grid $w -row $y -column $x -padx 5 -sticky w
incr x
}
incr y
place forget .d.mi.csr_1
pack forget .d.csr .d.got
- pack .d.pe -side top -before .d.mi -pady 10
+ pack .d.pe -side top -before .d.mi -pady 2
+ #-pady 2 -fill x
eval destroy [winfo children .d.pe.grid]
set col 0; foreach {colname coldesc rows} $alloptions {
pixmap_maybe_ok
helptext {
- {{Indicate the correct parse of this image, and click OK.}}
+ {{Indicate the meaning of this image, and click OK.}}
+ }
+}
+
+#========== UPLOADS TO DICTIONARY SERVER ==========
+
+proc upload_init_widgets {} {
+ global privacy_setting
+
+ set privacy_setting [upload_status]
+
+ label .privacy.warn -text " Privacy "
+ if {$privacy_setting} {
+ .privacy.warn configure -background yellow -foreground black
}
+ label .privacy.overall -text " Upload new dictionary entry:"
+ label .privacy.reference -text " See README.privacy."
+
+ pack .privacy.warn .privacy.overall -side left
+
+ foreach {setting string} {
+ 0 {No}
+ 1 {Yes, anonymously}
+ 2 {Yes, quoting my pirate name.}
+ } {
+ radiobutton .privacy.o$setting -text $string \
+ -value $setting -variable privacy_setting
+ pack .privacy.o$setting -side left
+ if {$setting > $privacy_setting} {
+ .privacy.o$setting configure -state disabled
+ }
+ }
+ pack .privacy.reference -side left
+
+ if {!$privacy_setting} {
+ foreach w [winfo children .privacy] {
+ $w configure -state disabled
+ }
+ }
+}
+
+proc upload_status {} {
+ # returns 0, 1, 2 for none, anon, with pirate name
+ global env
+
+ if {![info exists env(YPPSC_PCTB_DICT_SUBMIT)]} { debug a; return 0 }
+ if {![string compare 0 $env(YPPSC_PCTB_DICT_SUBMIT)]} { debug b; return 0 }
+
+ if {![info exists env(YPPSC_PIRATE)]} { return 1 }
+ if {![string length $env(YPPSC_PIRATE)]} { return 1 }
+
+ return 2
}
#========== CHARACTER SET ==========
bind_key space { othercursor }
bind_leftright_q cur_$z1 0 [expr {$cols-1}]
if {[llength $glyphsdone]} {
- bind_key Tab { set cur_mode already; recursor }
+ bind_key BackSpace { set cur_mode already; recursor }
} else {
- bind_key Tab {}
+ bind_key BackSpace {}
}
bind_key Return {
if {$cur_0 != $cur_1} {
{{<- ->} {move cursor, adjusting area to define}}
{Space {switch to moving other cursor}}
{Return {confirm location, enter letter(s)}}
- {Tab {switch to correcting earlier ocr}}
+ {Backspace {switch to correcting earlier ocr}}
{Q {quit and abandon OCR run}}
}
}
set rmax [lindex $glyphsdone [expr {$cur_already*4}]]
place .d.csr.csr -x [expr {$rmax*$mul-3}]
bind_key Return {}
- bind_key space {}
bind_leftright_q cur_already 0 [expr {[llength $glyphsdone]/4-1}]
- bind_key Tab { bind_key Delete {}; set cur_mode 1; recursor }
+ bind_key space { bind_key Delete {}; set cur_mode 1; recursor }
bind_key Delete {
RETURN_RESULT DELETE [lrange $glyphsdone \
[expr $cur_already*4] \
helptext {
{{<- ->} {move cursor, selecting glyph to correct}}
{Del {clear this glyph from the recognition database}}
- {Tab {switch to selecting area to define as new glyph}}
+ {Space {switch to selecting area to define as new glyph}}
{Q {quit and abandon OCR run}}
}
}
}
set argv [lrange $argv $ai end]
-debug [exec printenv]
main/$mainkind