16 proc InitDefaultToolbar {} {
17 foreach {tbicon status} {
18 newdb 0 open 0 save 0 closedb 0
19 finder 0 bkm 0 gprev 0 gnext 0
20 newgame 0 copy 0 paste 0
21 boardsearch 0 headersearch 0 materialsearch 0
22 switcher 0 glist 0 pgn 0 tmt 0 maint 0 eco 0 tree 0 crosstab 0 engine 0
24 set ::toolbar_state($tbicon) $status
28 proc InitWinsDefaultGeometry {} {
29 global winWidth winHeight
36 set winWidth(.helpWin) 50
37 set winHeight(.helpWin) 32
40 set winWidth(.statsWin) 60
41 set winHeight(.statsWin) 13
44 set winWidth(.spellcheckWin) 55
45 set winHeight(.spellcheckWin) 25
48 set winWidth(.ccWindow) 10
49 set winHeight(.ccWindow) 20
52 set ::docking::layout_list(1) {}
53 set ::docking::layout_list(2) {{MainWindowGeometry 540x650+0+0} {{.pw vertical {}} {TNotebook .nb .fdockmain}}}
54 set ::docking::layout_list(3) {{MainWindowGeometry 1024x532+0+0} {{.pw vertical {}} {TPanedwindow {{.pw.pw0 horizontal 413} {TNotebook .nb .fdockmain} {TPanedwindow {{.pw.pw0.pw1 vertical 270} {TNotebook .tb2 {.fdockanalysisWin1 .fdockpgnWin}} {TNotebook .tb3 .fdockglistWin1}}}}}}}
55 set ::docking::layout_list(auto) {{MainWindowGeometry 1024x532+0+0} {{.pw vertical {}} {TPanedwindow {{.pw.pw0 horizontal 413} {TNotebook .nb .fdockmain} {TPanedwindow {{.pw.pw0.pw1 vertical 270} {TNotebook .tb2 {.fdockanalysisWin1 .fdockpgnWin}} {TNotebook .tb3 .fdockglistWin1}}}}}}}
58 proc InitDefaultStats {} {
60 array set ::windows::stats::display {
84 for {
set year [
clock format [
clock seconds] -format {%Y}]} \
85 { $year>2008 && ![
info exists ::windows::stats::display([subst {y$year}])] } \
87 set ::windows::stats::display([subst {y$year}]) 1
91 proc InitDefaultFonts {} {
94 set fontOptions(Regular) [list Tahoma 10 normal roman]
95 set fontOptions(Menu) [list system 9 normal roman]
96 set fontOptions(Small) [list Tahoma 8 normal roman]
97 set fontOptions(Tiny) [list Arial 7 normal roman]
98 set fontOptions(Fixed) [list courier 9 normal roman]
100 set fontOptions(Regular) [list system 11 normal roman]
101 set fontOptions(Menu) [list menu 14 normal roman]
102 set fontOptions(Small) [list system 10 normal roman]
103 set fontOptions(Tiny) [list system 9 normal roman]
104 set fontOptions(Fixed) [list Monaco 10 normal roman]
106 set fontOptions(Regular) [list {DejaVu Sans} 10 normal roman]
107 set fontOptions(Menu) [list {DejaVu Sans} 10 normal roman]
108 set fontOptions(Small) [list {DejaVu Sans} 9 normal roman]
109 set fontOptions(Tiny) [list {DejaVu Sans} 8 normal roman]
110 set fontOptions(Fixed) [list {DejaVu Sans Mono} 10 normal roman]
114 proc InitDefaultGListLayouts {} {
115 set ::glist_Layouts {RatingDate DateEvent Full}
116 set ::glist_ColOrder(RatingDate) {{7} {1} {2} {3} {4} {5} {6} {23} {22} {8} {9} {10} {11} {12} {13} {14} {15} {16} {0}}
117 set ::glist_ColWidth(RatingDate) {{50} {50} {50} {120} {40} {120} {40} {80} {200} {30} {200} {30} {20} {20} {20} {20} {35} {50} {30} {100} {40} {40} {50} {140}}
118 set ::glist_ColAnchor(RatingDate) {{e} {c} {c} {w} {c} {w} {c} {w} {w} {e} {w} {c} {c} {c} {c} {c} {c} {c} {c} {c} {c} {c} {c} {w}}
119 set ::glist_Sort(RatingDate) { {22} {-} {7} {-} }
120 set ::glist_FindBar(RatingDate) 0
121 set ::glist_ColOrder(DateEvent) {7 3 4 5 6 1 23 8 9 10 0}
122 set ::glist_ColWidth(DateEvent) {50 50 50 120 40 120 40 80 145 30 112 30 20 20 20 20 35 50 30 100 40 40 50 153}
123 set ::glist_ColAnchor(DateEvent) {{e} {c} {c} {w} {c} {w} {c} {w} {w} {e} {w} {c} {c} {c} {c} {c} {c} {c} {c} {c} {c} {c} {c} {w}}
124 set ::glist_Sort(DateEvent) {7 - 8 - 9 -}
125 set ::glist_FindBar(DateEvent) 0
126 set ::glist_ColOrder(Full) {20 7 3 4 5 6 1 2 23 8 19 10 9 16 17 22 21 18 11 12 13 14 15 0}
127 set ::glist_ColWidth(Full) {50 50 39 120 40 120 40 70 200 30 200 30 20 20 20 20 35 119 30 78 40 40 50 155}
128 set ::glist_ColAnchor(Full) {{e} {c} {c} {w} {c} {w} {c} {w} {w} {e} {w} {c} {c} {c} {c} {c} {c} {c} {c} {c} {c} {c} {c} {w}}
129 set ::glist_Sort(Full) {0 +}
130 set ::glist_FindBar(Full) 0
140 set boardfile_dark "LightWood3-d"
141 set boardfile_lite "LightWood3-l"
147 set boardStyle Merida1
148 if { $macOS } {
set boardStyle Merida}
158 set whitecolor "\#ffffff"
159 set blackcolor "\#000000"
160 set whiteborder "\#000000"
161 set blackborder "\#ffffff"
162 set highcolor "\#b0d0e0"
163 set bestcolor "\#bebebe"
164 set buttoncolor "\#b0c0d0"
168 set ::markColor green
176 set autoResizeBoard 1
186 set ::lookTheme "default"
187 set ::ThemePackageFile ""
190 set optionsAutoSave 1
194 set locale(numeric) ".,"
197 set translatePieces 1
201 set highlightLastMove 1
202 set highlightLastMoveWidth 2
203 set highlightLastMoveColor "grey"
204 set highlightLastMovePattern {}
210 set askToReplaceMoves 1
221 set moveEntry(AutoExpand) 0
222 set moveEntry(Coord) 1
230 set ::tactics::analysisTime 3
232 set ::tacgame::threshold 0.9
233 set ::tacgame::blunderwarning false
234 set ::tacgame::blunderwarningvalue 0.0
235 set ::tacgame::levelMin 1200
236 set ::tacgame::levelMax 2200
237 set ::tacgame::levelFixed 1500
238 set ::tacgame::randomLevel 0
239 set ::tacgame::isLimitedAnalysisTime 1
240 set ::tacgame::showblunder 1
241 set ::tacgame::showblundervalue 1
242 set ::tacgame::showblunderfound 1
243 set ::tacgame::showmovevalue 1
244 set ::tacgame::showevaluation 1
245 set ::tacgame::isLimitedAnalysisTime 1
246 set ::tacgame::analysisTime 10
247 set ::tacgame::openingType new
248 set ::tacgame::chosenOpening 0
251 set analysisCommand ""
253 set analysisChoices {wcrafty.exe}
255 set analysisChoices {crafty}
259 set tree(order) frequency
262 set ::tree::mask::recentMask {}
266 set ::pgn::showColor 1
267 set ::pgn::indentVars 1
268 set ::pgn::indentComments 1
269 set ::pgn::symbolicNags 1
270 set ::pgn::moveNumberSpaces 0
271 set ::pgn::shortHeader 1
272 set ::pgn::boldMainLine 1
273 set ::pgn::columnFormat 0
274 set ::pgn::stripMarks 0
275 set ::pgn::showPhoto 1
276 set pgnColor(Header) "\#00008b"
277 set pgnColor(Main) "\#000000"
278 set pgnColor(Var) "\#0000ee"
279 set pgnColor(Nag) "\#ee0000"
280 set pgnColor(Comment) "\#008b00"
281 set pgnColor(Current) lightSteelBlue
282 set pgnColor(Background) "\#ffffff"
285 set ::fics::use_timeseal 0
286 set ::fics::timeseal_exec "timeseal"
287 set ::fics::port_fics 5000
288 set ::fics::port_timeseal 5001
290 set ::fics::password ""
291 set ::fics::usedefaultvars 1
292 set ::fics::findopponent(initTime) 15
293 set ::fics::findopponent(incTime) 20
294 set ::fics::findopponent(rated) "rated"
295 set ::fics::findopponent(color) ""
296 set ::fics::findopponent(limitrating) 1
297 set ::fics::findopponent(rating1) 1500
298 set ::fics::findopponent(rating2) 3000
299 set ::fics::findopponent(manual) "auto"
300 set ::fics::findopponent(formula) ""
301 set ::fics::consolebg black
302 set ::fics::consolefg LimeGreen
303 set ::fics::consoleheight 10
304 set ::fics::consolewidth 40
305 set ::fics::colseeking coral
306 set ::fics::colgame grey70
307 set ::fics::colgameresult SlateBlue1
308 set ::fics::colficspercent khaki1
309 set ::fics::colficshelpnext blue
310 set ::fics::server_ip "0.0.0.0"
311 set ::fics::premoveEnabled 1
312 set ::fics::playing 0
315 set ::pinfo::wikipAPI "http://de.wikipedia.org/w/api.php?action=query&format=xml"
317 set ::pinfo::wikipurl "http://toolserver.org/~apper/pd/person/pnd-redirect"
319 set ::pinfo::SeeAlsoPND2WP "http://ws.gbv.de/seealso/pnd2wikipedia/?format=seealso&id="
321 set ::pinfo::dnburl "http://d-nb.info/gnd"
325 set ::novag::referee "OFF"
328 set ::sergame::isOpening 0
329 set ::sergame::chosenOpening 0
330 set ::sergame::chosenEngine 0
331 set ::sergame::useBook 1
332 set ::sergame::bookToUse ""
333 set ::sergame::startFromCurrent 0
334 set ::sergame::coachIsWatching 0
335 set ::sergame::timeMode "timebonus"
336 set ::sergame::depth 3
337 set ::sergame::movetime 0
338 set ::sergame::nodes 10000
339 set ::sergame::ponder 0
340 set ::uci::uciInfo(wtime3) [
expr 5 * 60 * 1000]
341 set ::uci::uciInfo(winc3) [
expr 10 * 1000]
342 set ::uci::uciInfo(btime3) [
expr 5 * 60 * 1000]
343 set ::uci::uciInfo(binc3) [
expr 10 * 1000]
346 set initialDir(base) "."
347 set initialDir(pgn) "."
348 set initialDir(book) "."
349 set initialDir(html) "."
350 set initialDir(tex) "."
351 set initialDir(stm) "."
352 set initialDir(report) "."
353 set initialDir(tablebase1) ""
354 set initialDir(tablebase2) ""
355 set initialDir(tablebase3) ""
356 set initialDir(tablebase4) ""
360 set pgnStyle(Comments) 1
364 set autoplayDelay 5000
369 set blunderThreshold 1.0
372 array set geometry {}
377 set startup(finder) 0
382 set gameInfo(photos) 1
383 set gameInfo(hideNextMove) 0
384 set gameInfo(showMaterial) 0
385 set gameInfo(showFEN) 0
386 set gameInfo(showMarks) 1
388 set gameInfo(fullComment) 0
389 set gameInfo(showTB) 0
390 if {[
sc_info tb]} {
set gameInfo(showTB) 2}
394 array set twinSettings {
414 array set twinSettingsDefaults [
array get twinSettings]
438 array set optableDefaults [
array get optable]
445 MostFrequentOpponents 6
449 MostFrequentEcoCodes 6
455 array set preportDefaults [
array get preport]
459 array set informant {}
460 set informant("!?") 0.5
461 set informant("?") 1.5
462 set informant("??") 3.0
463 set informant("?!") 0.5
464 set informant("+=") 0.5
465 set informant("+/-") 1.5
466 set informant("+-") 3.0
467 set informant("++-") 5.5
470 set exportFlags(comments) 1
471 set exportFlags(indentc) 0
472 set exportFlags(vars) 1
473 set exportFlags(indentv) 0
474 set exportFlags(column) 0
475 set exportFlags(append) 0
476 set exportFlags(symbols) 0
477 set exportFlags(htmldiag) 0
478 set exportFlags(stripMarks) 0
479 set exportFlags(convertNullMoves) 0
480 set default_exportStartFile(PGN) {}
481 set default_exportEndFile(PGN) {}
483 set default_exportStartFile(LaTeX) {\documentclass[10pt,twocolumn]{article}
484 % This is a LaTeX file generated by Scid.
485 % You must have the "chess12" package installed to typeset this file.
490 \usepackage[T1]{fontenc}
492 \setlength{\columnsep}{7mm}
493 \setlength{\parindent}{0pt}
495 % Macros for variations and diagrams:
496 \newenvironment{variation}{\begin{quote}}{\end{quote}}
497 \newenvironment{diagram}{\begin{nochess}}{$$\showboard$$\end{nochess}}
501 set default_exportEndFile(LaTeX) {\end{document}
505 set default_exportStartFile(HTML) {<html>
507 <title>Scid export</title>
510 table { page-break-inside: avoid; }
514 <body bgcolor="#ffffff">
517 set default_exportEndFile(HTML) {</body>
521 foreach type {PGN HTML LaTeX} {
522 set exportStartFile($type) $default_exportStartFile($type)
523 set exportEndFile($type) $default_exportEndFile($type)
536 if {$autoRaise} {
raise $w}
550 set email(logfile) [
file join $scidLogDir "scidmail.log"]
551 set email(oldlogfile) [
file join $scidUserDir "scidmail.log"]
553 set email(smproc) "/usr/lib/sendmail"
554 set email(server) localhost
558 if {[
file readable $email(oldlogfile)] && ![
file readable $email(logfile)]} {
559 catch {
file rename $email(oldlogfile) $email(logfile)}
563 set ::utils::sound::soundFolder [
file nativename [
file join $::scidShareDir sounds]]
564 set ::utils::sound::announceNew 0
565 set ::utils::sound::announceForward 0
566 set ::utils::sound::announceBack 0
569 set spellCheckFile [
file join $scidShareDir "spelling.ssp"]
572 set ::book::lastBook ""
580 set engines(sort) Time
590 proc scidConfigFile {type} {
593 foreach {cfgtype fname} {
594 options "options.dat"
595 engines "engines.dat"
596 engines.bak "engines.dat"
597 recentfiles "recent.dat"
598 history "history.dat"
599 bookmarks "bookmarks.dat"
600 reports "reports.dat"
601 optrainer "optrainer.dat"
602 resolvers "resolvers.dat"
603 xfccstate "xfccstate.dat"
604 correspondence "correspondence.dat"
605 ExtHardware "hardware.dat"
606 treecache "treecache.dat"
608 if { $type == $cfgtype } {
609 return [
file nativename [
file join $scidConfigDir $fname]]
613 return -code error "No such config file type: $type"
621 if {[
file exists $optionsFile] && [
catch {source $optionsFile}]} {
622 tk_messageBox -message $::errorInfo
629 proc ConvertOldOptionVariables {} {
631 doColorPgn ::pgn::showColor
632 pgnIndentVars ::pgn::indentVars
633 pgnIndentComments ::pgn::indentComments
634 pgnShortHeader ::pgn::shortHeader
635 pgnMoveFont ::pgn::boldMainLine
636 pgnMoveNumSpace ::pgn::moveNumberSpaces
637 pgnStripMarks ::pgn::stripMarks
638 pgnSymbolicNags ::pgn::symbolicNags
639 pgnColumn ::pgn::columnFormat
642 foreach {old new} $oldNewNames {
643 if {[
info exists ::$old]} {
644 set $new [
set ::$old]
650 proc options.write {} {
653 if {[catch {open [scidConfigFile options] w} optionF]} {
654 tk_messageBox -title "Scid: Unable to write file" -type ok -icon warning \
655 -message "Unable to write options file: [scidConfigFile options]\n$optionF"
657 puts $optionF "# Scid options file"
658 puts $optionF "# Version: $scidVersion"
659 puts $optionF "# This file contains commands in the Tcl language format."
660 puts $optionF "# If you edit this file, you must preserve valid its Tcl"
661 puts $optionF "# format or it will not set your Scid options properly."
663 foreach i {boardSize boardStyle language ::pgn::showColor \
664 ::pgn::indentVars ::pgn::indentComments ::pgn::showPhoto \
665 ::pgn::shortHeader ::pgn::boldMainLine ::pgn::stripMarks \
666 ::pgn::symbolicNags ::pgn::moveNumberSpaces ::pgn::columnFormat \
667 tree(order) optionsAutoSave ::tree::mask::recentMask \
668 ecoFile suggestMoves showVarPopup showVarArrows \
669 blunderThreshold autoplayDelay animateDelay boardCoords \
670 moveEntry(AutoExpand) moveEntry(Coord) \
671 translatePieces arrowLastMove highlightLastMove highlightLastMoveWidth highlightLastMoveColor \
672 glossOfDanger askToReplaceMoves locale(numeric) \
673 spellCheckFile autoRaise autoIconify windowsDock showGameInfo \
674 exportFlags(comments) exportFlags(vars) \
675 exportFlags(indentc) exportFlags(indentv) \
676 exportFlags(column) exportFlags(symbols) \
677 exportFlags(htmldiag) exportFlags(convertNullMoves) \
678 email(smtp) email(smproc) email(server) \
679 email(from) email(bcc) \
680 gameInfo(photos) gameInfo(hideNextMove) gameInfo(wrap) \
681 gameInfo(fullComment) gameInfo(showMarks) \
682 gameInfo(showMaterial) gameInfo(showFEN) gameInfo(showTB) \
683 engineCoach1 engineCoach2 scidBooksDir scidBasesDir ::book::lastBook \
684 ::utils::sound::soundFolder ::utils::sound::announceNew \
685 ::utils::sound::announceForward ::utils::sound::announceBack \
686 ::tacgame::threshold ::tacgame::blunderwarning ::tacgame::blunderwarningvalue \
687 ::tacgame::levelMin ::tacgame::levelMax ::tacgame::levelFixed ::tacgame::randomLevel \
688 ::tacgame::isLimitedAnalysisTime ::tacgame::showblunder ::tacgame::showblundervalue \
689 ::tacgame::showblunderfound ::tacgame::showmovevalue ::tacgame::showevaluation \
690 ::tacgame::isLimitedAnalysisTime ::tacgame::analysisTime ::tacgame::openingType ::tacgame::chosenOpening \
691 ::sergame::chosenOpening ::sergame::chosenEngine ::sergame::useBook ::sergame::bookToUse \
692 ::sergame::startFromCurrent ::sergame::coachIsWatching ::sergame::timeMode \
693 ::sergame::depth ::sergame::movetime ::sergame::nodes ::sergame::ponder ::sergame::isOpening \
694 ::uci::uciInfo(wtime3) ::uci::uciInfo(winc3) ::uci::uciInfo(btime3) ::uci::uciInfo(binc3) \
695 boardfile_lite boardfile_dark \
696 FilterMaxMoves FilterMinMoves FilterStepMoves FilterMaxElo FilterMinElo FilterStepElo \
697 FilterMaxYear FilterMinYear FilterStepYear FilterGuessELO lookTheme ThemePackageFile autoResizeBoard } {
698 puts $optionF "set $i [list [set $i]]"
701 foreach i [lsort [array names menuColor]] {
702 puts $optionF "set menuColor($i) [list $menuColor($i)]"
704 foreach i [lsort [array names menuBarColor]] {
705 puts $optionF "set menuBarColor($i) [list $menuBarColor($i)]"
708 foreach i [lsort [array names winWidth]] {
709 puts $optionF "set winWidth($i) [expr $winWidth($i)]"
710 puts $optionF "set winHeight($i) [expr $winHeight($i)]"
713 foreach i [lsort [array names winX]] {
714 puts $optionF "set winX($i) [expr $winX($i)]"
715 puts $optionF "set winY($i) [expr $winY($i)]"
718 puts $optionF "set analysisCommand [list $analysisCommand]"
719 puts $optionF "set analysisChoices [list $analysisChoices]"
721 foreach i {lite dark whitecolor blackcolor highcolor bestcolor \
722 whiteborder blackborder borderwidth \
723 pgnColor(Header) pgnColor(Main) pgnColor(Var) \
724 pgnColor(Nag) pgnColor(Comment) pgnColor(Background) \
725 pgnColor(Current) } {
726 puts $optionF "set $i [list [set $i]]"
729 foreach i [lsort [array names optable]] {
730 puts $optionF "set optable($i) [list $optable($i)]"
732 foreach i [lsort [array names ::windows::stats::display]] {
733 puts $optionF "set ::windows::stats::display($i) [list $::windows::stats::display($i)]"
735 foreach i [lsort [array names startup]] {
736 puts $optionF "set startup($i) [list $startup($i)]"
738 foreach i [lsort [array names toolbar_state]] {
739 puts $optionF "set toolbar_state($i) [list $toolbar_state($i)]"
741 foreach i [lsort [array names twinSettings]] {
742 puts $optionF "set twinSettings($i) [list $twinSettings($i)]"
745 foreach i {Regular Menu Small Tiny Fixed} {
746 puts $optionF "set fontOptions($i) [list $fontOptions($i)]"
749 foreach type [array names initialDir] {
750 puts $optionF "set initialDir($type) [list $initialDir($type)]"
753 foreach type {PGN HTML LaTeX} {
754 puts $optionF "set exportStartFile($type) [list $exportStartFile($type)]"
755 puts $optionF "set exportEndFile($type) [list $exportEndFile($type)]"
758 foreach i [lsort [array names informant]] {
759 puts $optionF "set informant($i) [list $informant($i)]"
764 foreach i { use_timeseal timeseal_exec port_fics port_timeseal login password usedefaultvars premoveEnabled \
765 consolebg consolefg consoleheight consolewidth colseeking colgame colgameresult colficspercent server_ip } {
766 puts $optionF "set ::fics::$i [list [set ::fics::$i]]"
768 foreach i [lsort [array names ::fics::profileVars]] {
769 puts $optionF "set ::fics::profileVars($i) [list $::fics::profileVars($i)]"
773 foreach i { wikipurl dnburl SeeAlsoPND2WP wikipAPI} {
774 puts $optionF "set ::pinfo::$i [list [set ::pinfo::$i]]"
778 foreach i { referee } {
779 puts $optionF "set ::novag::$i [list [set ::novag::$i]]"
783 ::docking::layout_save "auto"
784 foreach slot {1 2 3 auto} {
785 puts $optionF "set ::docking::layout_list($slot) [list $::docking::layout_list($slot)]"
787 foreach wnd [array names ::winGeometry] {
788 if {[winfo exists $wnd]} {
789 ::win::saveWinGeometry $wnd
791 if {$::winGeometry($wnd) ne ""} {
792 puts $optionF "set ::winGeometry($wnd) $::winGeometry($wnd)"
797 # Save var that was added with options.save()
798 if {[info exists ::autosave_opt]} {
800 puts $optionF "set ::autosave_opt [list $::autosave_opt]"
801 foreach {var} $::autosave_opt {
803 puts $optionF "set $var [list $a]"
808 set ::statusBar "Options were saved to: [scidConfigFile options]"
813 proc options.autoSaveHack {} {
816 puts $optionF "set ::optionsAutoSave $::optionsAutoSave"
825 proc options.save {varname} {
826 if {![
info exists ::autosave_opt] || [lsearch -exact $::autosave_opt $varname] == -1} {
827 lappend ::autosave_opt $varname
830 proc options.save_cancel {varname} {
831 set idx [lsearch -exact $::autosave_opt $varname]
833 set ::autosave_opt [
lreplace $::autosave_opt $idx $idx]