# Sebastian Hammer, Adam Dickmeiss
#
# $Log: client.tcl,v $
-# Revision 1.50 1995-06-21 11:04:48 adam
+# Revision 1.52 1995-06-22 13:14:59 adam
+# Feature: SUTRS. Setting getSutrs implemented.
+# Work on display formats.
+# Preferred record syntax can be set by the user.
+#
+# Revision 1.51 1995/06/21 11:11:00 adam
+# Bug fix: libdir undefined in about-origin.
+#
+# Revision 1.50 1995/06/21 11:04:48 adam
# Uses GNU autoconf 2.3.
# Install procedure implemented.
# boook bitmaps moved to sub directory bitmaps.
set displayFormat 1
set popupMarcdf 0
set textWrap word
+set recordSyntax USMARC
set delayRequest {}
set queryTypes {Simple}
set formats [glob -nocomplain ${libdir}/formats/*.tcl]
foreach f $formats {
if {[file readable $f]} {
- source $f
- set l [expr [string length $f] - 5]
- lappend displayFormats [string range $f 8 $l]
+ source $f
+ set l [string length $f]
+ set f [string range $f [string length "${libdir}/formats/"] \
+ [expr $l - 5]]
+ lappend displayFormats $f
}
}
}
}
proc dputs {m} {
- puts $m
+# puts $m
}
proc set-display-format {f} {
.bot.a.status configure -text "Reformatting"
}
update idletasks
- add-title-lines 0 10000 1
+ add-title-lines -1 10000 1
if {!$busy} {
.bot.a.status configure -text "Ready"
}
proc about-origin {} {
set w .about-origin-w
+ global libdir
if {[winfo exists $w]} {
destroy $w
set recordType [z39.$sno recordType $no]
wm title $w "$recordType record #$no"
- set ffunc [lindex $displayFormats $df]
- set ffunc "display-$ffunc"
-
- $ffunc $sno $no $w.top.record 0
-
if {$new} {
bind $w.top.record <Return> {destroy .full-marc}
incr i
}
}
+ set ffunc [lindex $displayFormats $df]
+ set ffunc "display-$ffunc"
+
+ $ffunc $sno $no $w.top.record 0
}
proc update-target-hotlist {target base} {
show-status Ready 0 {}
return
}
-# z39 options search present scan namedResultSets triggerResourceCtrl
set hostid $target
.top.target.m disable 0
.top.target.m enable 1
global busy
global cancelFlag
global delayRequest
+ global recordSyntax
set target $hostid
if {[lindex $profile($target) 9] == 1} {
z39.$setNo queryType ccl
}
+ dputs Setting
+ dputs $recordSyntax
+ z39.$setNo preferredRecordSyntax $recordSyntax
z39 callback {search-response}
z39.$setNo search $query
show-status {Searching} 1 0
global displayFormat
global lastSetNo
- if {$setno == 0} {
+ if {$setno == -1} {
set setno $lastSetNo
} else {
set lastSetNo $setno
.data.record delete 0.0 end
}
set ffunc [lindex $displayFormats $displayFormat]
+ dputs "ffunc=$ffunc"
set ffunc "display-$ffunc"
for {set i 0} {$i < $no} {incr i} {
set o [expr $i + $offset]
global textWrap
global displayFormat
global popupMarcdf
+ global recordSyntax
set windowGeometry(.) [wm geometry .]
puts $f "set textWrap $textWrap"
puts $f "set displayFormat $displayFormat"
puts $f "set popupMarcdf $popupMarcdf"
+ puts $f "set recordSyntax $recordSyntax"
foreach n [array names windowGeometry] {
puts -nonewline $f "set \{windowGeometry($n)\} \{"
puts -nonewline $f $windowGeometry($n)
global queryButtons
global queryInfo
- if {![file writeable "${libdir}/clientrc.tcl"]} {
+ if {![file writable "${libdir}/clientrc.tcl"]} {
return
}
set f [open "${libdir}/clientrc.tcl" w]
.top.options.m add cascade -label "Query" -menu .top.options.m.query
.top.options.m add cascade -label "Format" -menu .top.options.m.formats
.top.options.m add cascade -label "Wrap" -menu .top.options.m.wrap
+.top.options.m add cascade -label "Syntax" -menu .top.options.m.syntax
menu .top.options.m.query
.top.options.m.query add cascade -label "Select" \
.top.options.m.wrap add radiobutton -label "None" \
-value none -variable textWrap -command {set-wrap none}
+menu .top.options.m.syntax
+.top.options.m.syntax add radiobutton -label "USMARC" \
+ -value USMARC -variable recordSyntax
+.top.options.m.syntax add radiobutton -label "UNIMARC" \
+ -value UNIMARC -variable recordSyntax
+.top.options.m.syntax add radiobutton -label "UKMARC" \
+ -value UKMARC -variable recordSyntax
+.top.options.m.syntax add radiobutton -label "DANMARC" \
+ -value DANMARC -variable recordSyntax
+.top.options.m.syntax add radiobutton -label "FINMARC" \
+ -value FINMARC -variable recordSyntax
+.top.options.m.syntax add radiobutton -label "NORMARC" \
+ -value NORMARC -variable recordSyntax
+.top.options.m.syntax add radiobutton -label "PICAMARC" \
+ -value PICAMARC -variable recordSyntax
+.top.options.m.syntax add separator
+.top.options.m.syntax add radiobutton -label "SUTRS" \
+ -value SUTRS -variable recordSyntax
+
menubutton .top.help -text "Help" -menu .top.help.m
menu .top.help.m