2018-05-16 11:17:27 +00:00
|
|
|
#!/bin/sh
|
|
|
|
# Tcl ignores the next line -*- tcl -*- \
|
|
|
|
exec wish "$0" -- "$@"
|
|
|
|
|
|
|
|
######################################################
|
|
|
|
# Rac GUI
|
|
|
|
# Distributed under GNU Public License
|
|
|
|
# Author: Sergey Kalinin svk@nuk-svk.ru
|
|
|
|
# Home page: https://bitbucket.org/svk28/rac-gui
|
|
|
|
######################################################
|
|
|
|
|
2018-05-20 15:03:02 +00:00
|
|
|
#source [file join [pwd] 1c_srv.cfg]
|
2018-05-16 11:17:27 +00:00
|
|
|
|
|
|
|
set dir(root) [pwd]
|
|
|
|
|
2018-05-20 15:03:02 +00:00
|
|
|
set dir(work) [file join $env(HOME) .rac_gui]
|
|
|
|
if {[file exists $dir(work)] == 0 } {
|
|
|
|
file mkdir $dir(work)
|
|
|
|
}
|
|
|
|
|
|
|
|
if {[file exists [file join $dir(work) rac_gui.cfg]] ==0} {
|
|
|
|
file copy [file join [pwd] rac_gui.cfg] [file join $dir(work) rac_gui.cfg]
|
|
|
|
}
|
|
|
|
|
|
|
|
source [file join $dir(work) rac_gui.cfg]
|
|
|
|
|
2018-05-16 11:17:27 +00:00
|
|
|
set dir(msg) "[file join $dir(root) msgs]"
|
|
|
|
set dir(lib) "[file join $dir(root) lib]"
|
|
|
|
|
|
|
|
## SETTINGS ENVIRONMENT LANGUAGE ##
|
|
|
|
if [info exists env(LANG)] {
|
|
|
|
set locale $env(LANG)
|
|
|
|
} else {
|
|
|
|
set locale $locale
|
|
|
|
}
|
|
|
|
|
|
|
|
::msgcat::mclocale $locale
|
|
|
|
::msgcat::mcload $dir(msg)
|
|
|
|
|
|
|
|
## LOAD FILE ##
|
|
|
|
# Load modules but maain.tcl must last loaded
|
|
|
|
foreach modFile [lsort [glob -nocomplain [file join $dir(lib) *.tcl]]] {
|
|
|
|
if {[file tail $modFile] ne "gui.tcl"} {
|
|
|
|
source $modFile
|
|
|
|
puts "Loaded module $modFile"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
source [file join $dir(lib) gui.tcl]
|
|
|
|
|
|
|
|
puts "$rac_cmd $dir(lib)"
|
2018-05-20 15:03:02 +00:00
|
|
|
source [file join $dir(work) rac_gui.cfg]
|
|
|
|
|
|
|
|
if [file exists [file join $dir(work) 1c_srv.cfg]] {
|
|
|
|
set f [open [file join $dir(work) 1c_srv.cfg] "RDONLY"]
|
|
|
|
while {[gets $f line] >=0} {
|
|
|
|
#puts $line
|
|
|
|
.frm_tree.tree insert {} end -id "server::$line" -text "$line" -values "$line"
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
#Add::main_server
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#.frm_tree.tree insert {} end -id "server::$host" -text "$host" -values "$host:$port"
|
2018-05-17 08:16:14 +00:00
|
|
|
#.frm_tree.tree insert {} end -id "$host" -text "$host" -values "$host"
|
|
|
|
|
|
|
|
#RunCommand $host "cluster list $host $port"
|
2018-05-16 11:17:27 +00:00
|
|
|
|