From 03dae994ae05a36d5c8bb443f5f59dbb396ca80c Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Thu, 12 Feb 1998 13:32:41 +0000 Subject: [PATCH] Updated configuration system. --- client.tcl | 21 ++++-- explain.tcl | 13 +++- irtdb.tcl | 237 +++++++++++++---------------------------------------------- setup.tcl | 188 ++++++++++++++++++++++++++--------------------- 4 files changed, 186 insertions(+), 273 deletions(-) diff --git a/client.tcl b/client.tcl index a2ff277..9d8ff83 100644 --- a/client.tcl +++ b/client.tcl @@ -4,7 +4,10 @@ # Sebastian Hammer, Adam Dickmeiss # # $Log: client.tcl,v $ -# Revision 1.103 1998-01-30 13:30:50 adam +# Revision 1.104 1998-02-12 13:32:41 adam +# Updated configuration system. +# +# Revision 1.103 1998/01/30 13:30:50 adam # Name of target database is irtdb.tcl instead of clientrc.tcl. # # Revision 1.102 1997/11/19 13:19:54 adam @@ -583,13 +586,20 @@ foreach target [array names profile] { set profile($target,comstack) [lindex $profile($target) 6] set profile($target,databases) [lindex $profile($target) 7] set profile($target,timeDefine) $timedef - - incr profile(Default,windowNumber) + set profile($target,windowNumber) 1 } unset profile($target) } } +# Assign unique ID's to each target's window number +set wno 1 +foreach n [array names profile *,windowNumber] { + set profile($n) $wno + incr wno +} +set profile(Default,windowNumber) $wno + # These globals describe the current query type. They are set to the # first query type. set queryButtonsFind [lindex $queryButtons 0] @@ -1418,7 +1428,7 @@ proc close-target {} { configure-disable-e .top.target.m 1 configure-disable-e .top.target.m 2 if {[tk4]} { - .top.rset.m delete 2 last + .top.rset.m delete 1 last } else { .top.rset.m delete 1 last } @@ -3963,6 +3973,7 @@ irmenu .top.service.m.present irmenu .top.service.m.dblist +# Init: Definition of Set menu. menubutton .top.rset -text Set -menu .top.rset.m irmenu .top.rset.m .top.rset.m add command -label Load -command {load-set} @@ -4149,7 +4160,7 @@ if {[file exists ${libdir}/setup.tcl]} { } # Init: Uncomment this line if you wan't to enable logging. -ir-log-init all +ir-log-init all irtcl irtcl.log # Init: If hostid is a valid target, a new connection will be established # immediately. diff --git a/explain.tcl b/explain.tcl index d3049e0..5853c40 100644 --- a/explain.tcl +++ b/explain.tcl @@ -1,3 +1,14 @@ +# IR toolkit for tcl/tk +# (c) Index Data 1995-1998 +# See the file LICENSE for details. +# Sebastian Hammer, Adam Dickmeiss +# +# Explain Driver +# +# $Log: explain.tcl,v $ +# Revision 1.3 1998-02-12 13:32:42 adam +# Updated configuration system. +# # Procedure explain-search # Issue search request with explain-attribute set and specific @@ -75,7 +86,7 @@ proc explain-present-response {target zz category finish response fresponse} { proc explain-check-0 {target finish} { show-status Explaining 1 0 show-message CategoryList - explain-search-request $target z39.categoryList CategoryList $finish \ + explain-search-request $target z39.categoryList TargetInfo $finish \ explain-check-5 explain-check-fail } diff --git a/irtdb.tcl b/irtdb.tcl index 63b4a8a..2dc5b03 100644 --- a/irtdb.tcl +++ b/irtdb.tcl @@ -23,9 +23,9 @@ set profile(BIBSYS,smallSetUpperBound) 0 set profile(BIBSYS,targetInfoName) {} set profile(BIBSYS,timeDefine) 878567355 set profile(BIBSYS,timeLastExplain) {} -set profile(BIBSYS,timeLastInit) 884958341 +set profile(BIBSYS,timeLastInit) 887288330 set profile(BIBSYS,welcomeMessage) {} -set profile(BIBSYS,windowNumber) 6 +set profile(BIBSYS,windowNumber) 1 set {profile(Bell Laboratories Library Network,authentication)} {} set {profile(Bell Laboratories Library Network,comstack)} tcpip set {profile(Bell Laboratories Library Network,databases)} {ir-explain-1 books gils netlib ls-lr z39dbs acc1 acc2 acc3 factbook books} @@ -49,10 +49,10 @@ set {profile(Bell Laboratories Library Network,recentNews)} {} set {profile(Bell Laboratories Library Network,smallSetUpperBound)} 0 set {profile(Bell Laboratories Library Network,targetInfoName)} {Lucent Technologies Research Server} set {profile(Bell Laboratories Library Network,timeDefine)} 878567355 -set {profile(Bell Laboratories Library Network,timeLastExplain)} 879263917 -set {profile(Bell Laboratories Library Network,timeLastInit)} 879263917 +set {profile(Bell Laboratories Library Network,timeLastExplain)} 887288368 +set {profile(Bell Laboratories Library Network,timeLastInit)} 887288368 set {profile(Bell Laboratories Library Network,welcomeMessage)} {Salutations - this is Lucent Technologies experimental Z39.50 server. No guarentees, but free and unlimited access!} -set {profile(Bell Laboratories Library Network,windowNumber)} 13 +set {profile(Bell Laboratories Library Network,windowNumber)} 11 set {profile(Bibliothèque Nationale du Québec,authentication)} {} set {profile(Bibliothèque Nationale du Québec,comstack)} tcpip set {profile(Bibliothèque Nationale du Québec,databases)} IRIS @@ -77,14 +77,15 @@ set {profile(Biblioth set {profile(Bibliothèque Nationale du Québec,targetInfoName)} {} set {profile(Bibliothèque Nationale du Québec,timeDefine)} 878567355 set {profile(Bibliothèque Nationale du Québec,timeLastExplain)} {} -set {profile(Bibliothèque Nationale du Québec,timeLastInit)} 878569953 +set {profile(Bibliothèque Nationale du Québec,timeLastInit)} 887288466 set {profile(Bibliothèque Nationale du Québec,welcomeMessage)} {} -set {profile(Bibliothèque Nationale du Québec,windowNumber)} 11 +set {profile(Bibliothèque Nationale du Québec,windowNumber)} 5 set profile(DanBib,authentication) {} set profile(DanBib,comstack) tcpip -set profile(DanBib,databases) {danbib DANBIBV2} +set profile(DanBib,databases) DANBIBV2 set profile(DanBib,description) {Danish Union Catalogue} set profile(DanBib,host) ir.dbc.bib.dk +set profile(DanBib,idAuthentication) {} set profile(DanBib,largeSetLowerBound) 2 set profile(DanBib,maxResultSets) {} set profile(DanBib,maxResultSize) {} @@ -93,7 +94,7 @@ set profile(DanBib,maximumRecordSize) 50000 set profile(DanBib,mediumSetPresentNumber) 0 set profile(DanBib,multipleDatabases) 0 set profile(DanBib,namedResultSets) 1 -set profile(DanBib,port) 1804 +set profile(DanBib,port) 2100 set profile(DanBib,preferredMessageSize) 30000 set profile(DanBib,presentChunk) 4 set profile(DanBib,protocol) Z39 @@ -104,9 +105,9 @@ set profile(DanBib,smallSetUpperBound) 0 set profile(DanBib,targetInfoName) {} set profile(DanBib,timeDefine) 878567355 set profile(DanBib,timeLastExplain) {} -set profile(DanBib,timeLastInit) {} +set profile(DanBib,timeLastInit) 887289885 set profile(DanBib,welcomeMessage) {} -set profile(DanBib,windowNumber) 10 +set profile(DanBib,windowNumber) 2 set profile(Default,authentication) {} set profile(Default,comstack) tcpip set profile(Default,description) {} @@ -132,7 +133,7 @@ set profile(Default,timeDefine) {} set profile(Default,timeLastExplain) {} set profile(Default,timeLastInit) {} set profile(Default,welcomeMessage) {} -set profile(Default,windowNumber) 21 +set profile(Default,windowNumber) 15 set profile(LOC,authentication) {} set profile(LOC,comstack) tcpip set profile(LOC,databases) {BOOKS NAMES AUTH MAPS MUSIC BIB SERIALS SUBJECTS} @@ -161,7 +162,7 @@ set profile(LOC,targetMaxResultSize) {} set profile(LOC,targetMaxTerms) {} set profile(LOC,timeDefine) 878567355 set profile(LOC,timeLastExplain) {} -set profile(LOC,timeLastInit) 884950921 +set profile(LOC,timeLastInit) 887289405 set profile(LOC,welcomeMessage) {} set profile(LOC,windowNumber) 8 set {profile(OCLC FirstSearch,authentication)} {} @@ -192,14 +193,15 @@ set {profile(OCLC FirstSearch,targetMaxResultSize)} {} set {profile(OCLC FirstSearch,targetMaxTerms)} {} set {profile(OCLC FirstSearch,timeDefine)} {} set {profile(OCLC FirstSearch,timeLastExplain)} {} -set {profile(OCLC FirstSearch,timeLastInit)} 884958174 +set {profile(OCLC FirstSearch,timeLastInit)} 886167890 set {profile(OCLC FirstSearch,welcomeMessage)} {} -set {profile(OCLC FirstSearch,windowNumber)} 20 +set {profile(OCLC FirstSearch,windowNumber)} 10 set profile(Penn,authentication) {} set profile(Penn,comstack) tcpip set profile(Penn,databases) CATALOG set profile(Penn,description) {Penn State's Library} set profile(Penn,host) 128.118.88.200 +set profile(Penn,idAuthentication) {} set profile(Penn,largeSetLowerBound) 2 set profile(Penn,maxResultSets) {} set profile(Penn,maxResultSize) {} @@ -207,7 +209,7 @@ set profile(Penn,maxTerms) {} set profile(Penn,maximumRecordSize) 16384 set profile(Penn,mediumSetPresentNumber) 0 set profile(Penn,multipleDatabases) 0 -set profile(Penn,namedResultSets) 1 +set profile(Penn,namedResultSets) 0 set profile(Penn,port) 210 set profile(Penn,preferredMessageSize) 8192 set profile(Penn,presentChunk) 4 @@ -217,38 +219,14 @@ set profile(Penn,queryRPN) 1 set profile(Penn,recentNews) {} set profile(Penn,smallSetUpperBound) 0 set profile(Penn,targetInfoName) {} +set profile(Penn,targetMaxResultSets) {} +set profile(Penn,targetMaxResultSize) {} +set profile(Penn,targetMaxTerms) {} set profile(Penn,timeDefine) 878567355 set profile(Penn,timeLastExplain) {} -set profile(Penn,timeLastInit) {} +set profile(Penn,timeLastInit) 887289434 set profile(Penn,welcomeMessage) {} -set profile(Penn,windowNumber) 1 -set profile(aleph500,authentication) {} -set profile(aleph500,comstack) tcpip -set profile(aleph500,databases) bib01 -set profile(aleph500,description) { } -set profile(aleph500,host) uranus.dtv.dk -set profile(aleph500,largeSetLowerBound) 2 -set profile(aleph500,maxResultSets) {} -set profile(aleph500,maxResultSize) {} -set profile(aleph500,maxTerms) {} -set profile(aleph500,maximumRecordSize) 50000 -set profile(aleph500,mediumSetPresentNumber) 0 -set profile(aleph500,multipleDatabases) 0 -set profile(aleph500,namedResultSets) 1 -set profile(aleph500,port) 9999 -set profile(aleph500,preferredMessageSize) 30000 -set profile(aleph500,presentChunk) 4 -set profile(aleph500,protocol) Z39 -set profile(aleph500,queryCCL) 0 -set profile(aleph500,queryRPN) 1 -set profile(aleph500,recentNews) {} -set profile(aleph500,smallSetUpperBound) 0 -set profile(aleph500,targetInfoName) {} -set profile(aleph500,timeDefine) 878567355 -set profile(aleph500,timeLastExplain) {} -set profile(aleph500,timeLastInit) 879262883 -set profile(aleph500,welcomeMessage) {} -set profile(aleph500,windowNumber) 16 +set profile(Penn,windowNumber) 14 set profile(arcatarget,authentication) {} set profile(arcatarget,comstack) tcpip set profile(arcatarget,databases) {IEI-books IR-Explain-1} @@ -271,20 +249,21 @@ set profile(arcatarget,queryCCL) 0 set profile(arcatarget,queryRPN) 1 set profile(arcatarget,recentNews) {} set profile(arcatarget,smallSetUpperBound) 0 -set profile(arcatarget,targetInfoName) {ARCA } +set profile(arcatarget,targetInfoName) ARCA set profile(arcatarget,targetMaxResultSets) {} set profile(arcatarget,targetMaxResultSize) {} set profile(arcatarget,targetMaxTerms) {} set profile(arcatarget,timeDefine) 878567355 -set profile(arcatarget,timeLastExplain) 884950966 -set profile(arcatarget,timeLastInit) 884950966 +set profile(arcatarget,timeLastExplain) 887289477 +set profile(arcatarget,timeLastInit) 887289477 set profile(arcatarget,welcomeMessage) {buon lavoro} -set profile(arcatarget,windowNumber) 9 +set profile(arcatarget,windowNumber) 6 set profile(author,authentication) {} set profile(author,comstack) tcpip set profile(author,databases) {spain portugal france england belgium} set profile(author,description) {} set profile(author,host) mars.dtv.dk +set profile(author,idAuthentication) {} set profile(author,largeSetLowerBound) 2 set profile(author,maxResultSets) {} set profile(author,maxResultSize) {} @@ -304,72 +283,15 @@ set profile(author,smallSetUpperBound) 0 set profile(author,targetInfoName) {} set profile(author,timeDefine) 878567355 set profile(author,timeLastExplain) {} -set profile(author,timeLastInit) 879777702 +set profile(author,timeLastInit) 887288138 set profile(author,welcomeMessage) {} -set profile(author,windowNumber) 4 -set profile(bacon,authentication) {} -set profile(bacon,comstack) tcpip -set profile(bacon,databases) Default -set profile(bacon,description) {} -set profile(bacon,host) bacon.indexdata.dk -set profile(bacon,largeSetLowerBound) 2 -set profile(bacon,maxResultSets) {} -set profile(bacon,maxResultSize) {} -set profile(bacon,maxTerms) {} -set profile(bacon,maximumRecordSize) 50000 -set profile(bacon,mediumSetPresentNumber) 0 -set profile(bacon,multipleDatabases) 0 -set profile(bacon,namedResultSets) 1 -set profile(bacon,port) 9999 -set profile(bacon,preferredMessageSize) 30000 -set profile(bacon,presentChunk) 4 -set profile(bacon,protocol) Z39 -set profile(bacon,queryCCL) 0 -set profile(bacon,queryRPN) 1 -set profile(bacon,recentNews) {} -set profile(bacon,smallSetUpperBound) 0 -set profile(bacon,targetInfoName) {} -set profile(bacon,timeDefine) 878567355 -set profile(bacon,timeLastExplain) {} -set profile(bacon,timeLastInit) {} -set profile(bacon,welcomeMessage) {} -set profile(bacon,windowNumber) 5 -set profile(burns,authentication) {} -set profile(burns,comstack) tcpip -set profile(burns,databases) Default -set profile(burns,description) { } -set profile(burns,host) burns.fdgroup.co.uk -set profile(burns,idAuthentication) {} -set profile(burns,largeSetLowerBound) 2 -set profile(burns,maxResultSets) {} -set profile(burns,maxResultSize) {} -set profile(burns,maxTerms) {} -set profile(burns,maximumRecordSize) 50000 -set profile(burns,mediumSetPresentNumber) 0 -set profile(burns,multipleDatabases) 0 -set profile(burns,namedResultSets) 1 -set profile(burns,port) 9999 -set profile(burns,preferredMessageSize) 30000 -set profile(burns,presentChunk) 4 -set profile(burns,protocol) Z39 -set profile(burns,queryCCL) 0 -set profile(burns,queryRPN) 1 -set profile(burns,recentNews) { } -set profile(burns,smallSetUpperBound) 0 -set profile(burns,targetInfoName) { } -set profile(burns,targetMaxResultSets) {} -set profile(burns,targetMaxResultSize) {} -set profile(burns,targetMaxTerms) {} -set profile(burns,timeDefine) {} -set profile(burns,timeLastExplain) {} -set profile(burns,timeLastInit) 879415443 -set profile(burns,welcomeMessage) { } -set profile(burns,windowNumber) 18 +set profile(author,windowNumber) 13 set profile(dranet,authentication) {} set profile(dranet,comstack) tcpip set profile(dranet,databases) drewdb set profile(dranet,description) dranet set profile(dranet,host) dranet.dra.com +set profile(dranet,idAuthentication) {} set profile(dranet,largeSetLowerBound) 2 set profile(dranet,maxResultSets) {} set profile(dranet,maxResultSize) {} @@ -387,42 +309,14 @@ set profile(dranet,queryRPN) 1 set profile(dranet,recentNews) {} set profile(dranet,smallSetUpperBound) 0 set profile(dranet,targetInfoName) {} +set profile(dranet,targetMaxResultSets) {} +set profile(dranet,targetMaxResultSize) {} +set profile(dranet,targetMaxTerms) {} set profile(dranet,timeDefine) 878567355 set profile(dranet,timeLastExplain) {} -set profile(dranet,timeLastInit) 884950527 +set profile(dranet,timeLastInit) 887289573 set profile(dranet,welcomeMessage) {} -set profile(dranet,windowNumber) 15 -set profile(gilstest,authentication) {} -set profile(gilstest,comstack) tcpip -set profile(gilstest,databases) Default -set profile(gilstest,description) { } -set profile(gilstest,host) localhost -set profile(gilstest,idAuthentication) {} -set profile(gilstest,largeSetLowerBound) 2 -set profile(gilstest,maxResultSets) {} -set profile(gilstest,maxResultSize) {} -set profile(gilstest,maxTerms) {} -set profile(gilstest,maximumRecordSize) 50000 -set profile(gilstest,mediumSetPresentNumber) 0 -set profile(gilstest,multipleDatabases) 0 -set profile(gilstest,namedResultSets) 1 -set profile(gilstest,port) 9999 -set profile(gilstest,preferredMessageSize) 30000 -set profile(gilstest,presentChunk) 4 -set profile(gilstest,protocol) Z39 -set profile(gilstest,queryCCL) 0 -set profile(gilstest,queryRPN) 1 -set profile(gilstest,recentNews) { } -set profile(gilstest,smallSetUpperBound) 0 -set profile(gilstest,targetInfoName) { } -set profile(gilstest,targetMaxResultSets) {} -set profile(gilstest,targetMaxResultSize) {} -set profile(gilstest,targetMaxTerms) {} -set profile(gilstest,timeDefine) {} -set profile(gilstest,timeLastExplain) {} -set profile(gilstest,timeLastInit) 879779577 -set profile(gilstest,welcomeMessage) { } -set profile(gilstest,windowNumber) 19 +set profile(dranet,windowNumber) 4 set profile(libris,authentication) {} set profile(libris,comstack) tcpip set profile(libris,databases) libr @@ -447,9 +341,9 @@ set profile(libris,smallSetUpperBound) 0 set profile(libris,targetInfoName) {} set profile(libris,timeDefine) 878567355 set profile(libris,timeLastExplain) {} -set profile(libris,timeLastInit) {} +set profile(libris,timeLastInit) 887285394 set profile(libris,welcomeMessage) {} -set profile(libris,windowNumber) 12 +set profile(libris,windowNumber) 3 set profile(madison,authentication) {} set profile(madison,comstack) tcpip set profile(madison,databases) madison @@ -474,62 +368,37 @@ set profile(madison,smallSetUpperBound) 0 set profile(madison,targetInfoName) {} set profile(madison,timeDefine) 878567355 set profile(madison,timeLastExplain) {} -set profile(madison,timeLastInit) {} +set profile(madison,timeLastInit) 887289602 set profile(madison,welcomeMessage) {} -set profile(madison,windowNumber) 3 -set profile(x,authentication) {} -set profile(x,comstack) tcpip -set profile(x,description) { } -set profile(x,host) {} -set profile(x,largeSetLowerBound) 2 -set profile(x,maxResultSets) {} -set profile(x,maxResultSize) {} -set profile(x,maxTerms) {} -set profile(x,maximumRecordSize) 50000 -set profile(x,mediumSetPresentNumber) 0 -set profile(x,multipleDatabases) 0 -set profile(x,namedResultSets) 1 -set profile(x,port) 210 -set profile(x,preferredMessageSize) 30000 -set profile(x,presentChunk) 4 -set profile(x,protocol) Z39 -set profile(x,queryCCL) 0 -set profile(x,queryRPN) 1 -set profile(x,recentNews) { } -set profile(x,smallSetUpperBound) 0 -set profile(x,targetInfoName) { } -set profile(x,timeDefine) {} -set profile(x,timeLastExplain) {} -set profile(x,timeLastInit) {} -set profile(x,welcomeMessage) { } -set profile(x,windowNumber) 17 +set profile(madison,windowNumber) 7 set profile(ztest9999,authentication) {} set profile(ztest9999,comstack) tcpip -set profile(ztest9999,databases) Default +set profile(ztest9999,databases) Z_TDBS.ztdb_z_tdb_name set profile(ztest9999,description) {YAZ server on localhost} +set profile(ztest9999,descripton) Z_TDBS.ztdb_description set profile(ztest9999,host) localhost set profile(ztest9999,largeSetLowerBound) 2 -set profile(ztest9999,maxResultSets) {} -set profile(ztest9999,maxResultSize) {} -set profile(ztest9999,maxTerms) {} +set profile(ztest9999,maxResultSets) 0 +set profile(ztest9999,maxResultSize) 0 +set profile(ztest9999,maxTerms) 0 set profile(ztest9999,maximumRecordSize) 50000 set profile(ztest9999,mediumSetPresentNumber) 0 -set profile(ztest9999,multipleDatabases) 1 -set profile(ztest9999,namedResultSets) 1 +set profile(ztest9999,multipleDatabases) 0 +set profile(ztest9999,namedResultSets) 0 set profile(ztest9999,port) 9999 set profile(ztest9999,preferredMessageSize) 30000 set profile(ztest9999,presentChunk) 4 set profile(ztest9999,protocol) Z39 set profile(ztest9999,queryCCL) 0 set profile(ztest9999,queryRPN) 1 -set profile(ztest9999,recentNews) {} +set profile(ztest9999,recentNews) {strings { language {text Z_TDBS.ztdb_news} } } set profile(ztest9999,smallSetUpperBound) 0 -set profile(ztest9999,targetInfoName) {} +set profile(ztest9999,targetInfoName) Z_TDBS.ztdb_z_tdb_name set profile(ztest9999,timeDefine) 878567355 -set profile(ztest9999,timeLastExplain) {} -set profile(ztest9999,timeLastInit) 880111094 -set profile(ztest9999,welcomeMessage) {} -set profile(ztest9999,windowNumber) 7 +set profile(ztest9999,timeLastExplain) 886683092 +set profile(ztest9999,timeLastInit) 886683092 +set profile(ztest9999,welcomeMessage) Z_TDBS.ztdb_welcome_message +set profile(ztest9999,windowNumber) 9 set queryTypes {Simple phrase} set queryButtons {{{I 3} {I 0} {I 0}} {{I 0} {I 1} {I 0}}} set queryInfo {{{Title {1=4}} {Author {1=1}} {Subject {1=21}} {Any {1=1016}} {Query 1=1016 2=102} {Title-rank 1=4 2=102} {Date/time 1=1012} {Title-regular 1=4 2=3 4=2 5=102} {Ranked 1=1016 2=102 3=3 4=1 6=1}} {{Title 1=4 4=1 6=2} {Author 1=1003 4=1 6=2} {ISBN 1=7} {ISSN 1=8} {Year 1=30 4=4 6=2} {Any {}}}} diff --git a/setup.tcl b/setup.tcl index 98a033b..3d6e060 100644 --- a/setup.tcl +++ b/setup.tcl @@ -3,8 +3,13 @@ # See the file LICENSE for details. # Sebastian Hammer, Adam Dickmeiss # +# Configuration Driver +# # $Log: setup.tcl,v $ -# Revision 1.3 1998-01-30 13:30:50 adam +# Revision 1.4 1998-02-12 13:32:42 adam +# Updated configuration system. +# +# Revision 1.3 1998/01/30 13:30:50 adam # Name of target database is irtdb.tcl instead of clientrc.tcl. # # Revision 1.2 1997/11/19 11:20:57 adam @@ -71,57 +76,77 @@ proc protocol-setup-action {target} { delete-target-hotlist $target } +proc target-setup-delete {target category dir} { + + if {![string compare $target Default]} return + set a [alert "Are you sure you want to delete the target \ +definition $target ?"] + if {$a} { + target-setup $target $category $dir + } +} + proc target-setup {target category dir} { + global profile settingsChanged + + set w .setup-$profile($target,windowNumber) - set w .setup100 if {$dir} { - target-setup-leave-$category $target + target-setup-leave-$category $target $w } - if {$dir == 2} { + if {$dir == 3} { + foreach n [array names profile $target,*] { + unset profile($n) + } + set settingsChanged 1 + cascade-target-list + delete-target-hotlist $target + destroy $w + return + } elseif {$dir == 2} { protocol-setup-action $target destroy $w return - } - incr category $dir - if {[winfo exists $w]} { - destroy $w.top - destroy $w.bot } else { - toplevel $w - wm geometry $w 430x400 + incr category $dir + if {[winfo exists $w]} { + destroy $w.top + destroy $w.bot + } else { + toplevelG $w + wm geometry $w 430x370 + } + if {$target == ""} { + set target Default + } + top-down-window $w + bottom-buttons $w \ + [list {Ok} [list target-setup $target $category 2] \ + {Previous} [list target-setup $target $category -1] \ + {Next} [list target-setup $target $category 1] \ + {Delete} [list target-setup-delete $target $category 3] \ + {Cancel} [list destroy $w]] 0 + if {$category == 0} { + $w.bot.2 configure -state disabled + } + if {$category == 2} { + $w.bot.4 configure -state disabled + } + target-setup-enter-$category $target $w } - if {$target == ""} { - set target Default - } - top-down-window $w - bottom-buttons $w [list \ - {Ok} [list target-setup $target $category 2] \ - {Previous} [list target-setup $target $category -1] \ - {Next} [list target-setup $target $category 1] \ - {Cancel} [list destroy $w]] 0 - if {$category == 0} { - $w.bot.2 configure -state disabled - } - if {$category == 2} { - $w.bot.4 configure -state disabled - } - target-setup-enter-$category $target } -proc target-setup-leave-0 {target} { +proc target-setup-leave-0 {target w} { global profileS - set w .setup100 set y $w.top.hostport } -proc target-setup-enter-0 {target} { +proc target-setup-enter-0 {target w} { global profileS - set w .setup100 - wm title $w "$target - Initial Information" # host/port/id . . . @@ -146,12 +171,34 @@ proc target-setup-enter-0 {target} { $y.idAuthentication.entry configure -textvariable \ profileS($target,idAuthentication) - # bottom + # databases + + frame $w.top.name -relief ridge -border 2 + pack $w.top.name -pady 2 -padx 2 -side bottom -fill both -expand yes + + label $w.top.name.label -text "Databases" + pack $w.top.name.label -side top -fill x + + frame $w.top.name.buttons -border 2 + pack $w.top.name.buttons -side right - set y $w.top.bottom + button $w.top.name.buttons.add -text "Add" -command \ + [list target-setup-db-add $target $w] + button $w.top.name.buttons.remove -text "Remove" -state disabled \ + -command [list target-setup-db-remove $target $w] + button $w.top.name.buttons.configure -text "Configure" -state disabled + pack $w.top.name.buttons.add -side top -fill x + pack $w.top.name.buttons.remove -side top -fill x + pack $w.top.name.buttons.configure -side top -fill x - frame $y - pack $y -side bottom -fill both -expand yes + scrollbar $w.top.name.scroll -orient vertical -border 1 + listbox $w.top.name.list -border 1 -height 5 -yscrollcommand \ + [list $w.top.name.scroll set] + pack $w.top.name.list -side left -padx 2 -pady 2 -fill both -expand yes + pack $w.top.name.scroll -side right -padx 2 -pady 2 -fill y + $w.top.name.scroll config -command [list $w.top.name.list yview] + + target-setup-dblist-update $target $w # misc. dates . . . @@ -193,12 +240,12 @@ proc target-setup-enter-0 {target} { radiobutton $y.mosi -text "MOSI" -anchor w\ -variable profileS($target,comstack) -value mosi pack $y.label $y.tcpip $y.mosi -padx 2 -side top -fill x + } -proc target-setup-leave-1 {target} { +proc target-setup-leave-1 {target w} { global profileS - set w .setup100 set y $w.top.nr set profileS($target,targetInfoName) \ @@ -213,11 +260,9 @@ proc target-setup-leave-1 {target} { set y $w.top.rs } -proc target-setup-enter-1 {target} { +proc target-setup-enter-1 {target w} { global profileS - set w .setup100 - wm title $w "$target - Target Information" # Name, Recent News . . . @@ -310,7 +355,7 @@ proc target-setup-2-dbselect {menu e} { $menu configure -text $e } -proc target-setup-leave-2 {target} { +proc target-setup-leave-2 {target w} { global profileS } @@ -345,7 +390,7 @@ proc target-setup-db-add-action {target wp} { lappend profileS($target,databases) $db destroy $w - target-setup-dblist-update $target + target-setup-dblist-update $target $wp } proc target-setup-db-remove {target wp} { @@ -354,7 +399,8 @@ proc target-setup-db-remove {target wp} { set w .setup100 set y $w.top.name - set db [$y.data cget -text] + set db [$wp.top.name.list get active] + set a [alert "Are you sure you want to remove the database ${db}?"] if {$a} { set i [lsearch -exact $profileS($target,databases) $db] @@ -362,7 +408,7 @@ proc target-setup-db-remove {target wp} { set profileS($target,databases) \ [lreplace $profileS($target,databases) $i $i] } - target-setup-dblist-update $target + target-setup-dblist-update $target $wp if {![llength $profileS($target,databases)]} { unset profileS($target,databases) puts removed @@ -370,61 +416,37 @@ proc target-setup-db-remove {target wp} { } } -proc target-setup-dblist-update {target} { +proc target-setup-dblist-update {target w} { global profileS - set w .setup100 set y $w.top.name - set no 0 + $w.top.name.list delete 0 end if {[info exists profileS($target,databases)]} { - set databaseList $profileS($target,databases) - $y.data configure -text [lindex $databaseList 0] - $y.data.m delete 0 100 - foreach d $databaseList { - $y.data.m add command -label $d -command \ - [list target-setup-2-dbselect $y.data $d] - incr no + foreach db $profileS($target,databases) { + $w.top.name.list insert end $db } - } - if {$no == 0} { - $y.remove configure -state disabled + $w.top.name.buttons.remove configure -state normal + $w.top.name.list see 0 + $w.top.name.list select set 0 } else { - $y.remove configure -state normal + $w.top.name.buttons.remove configure -state disabled } } -proc target-setup-enter-2 {target} { - global profileS +proc target-setup-add {target w} { - set w .setup100 - wm title $w "$target - Database Information" - - frame $w.top.name -border 2 - pack $w.top.name -pady 2 -padx 2 -side top -fill x - - label $w.top.name.label -text "Database Name" - - pack $w.top.name.label -side left - menubutton $w.top.name.data -menu $w.top.name.data.m -relief raised - irmenu $w.top.name.data.m - - pack $w.top.name.data -side left - - button $w.top.name.add -text "Add" -command \ - [list target-setup-db-add $target $w] - pack $w.top.name.add -side right +} - button $w.top.name.remove -text "Remove" -command \ - [list target-setup-db-remove $target $w] - pack $w.top.name.remove -side right +proc target-setup-enter-2 {target w} { + global profileS + wm title $w "$target - Other Information (not yet completed)" + frame $w.top.data -relief ridge -border 2 pack $w.top.data -pady 2 -padx 2 -side top -fill x - target-setup-dblist-update $target - frame $w.top.data.avRecordSize frame $w.top.data.maxRecordSize -- 1.7.10.4