1
0
mirror of https://bitbucket.org/svk28/rac-gui synced 2024-12-04 18:46:52 +00:00

Исправлено зависание программы при начальном запуске и вводе пути до rac в windows.

This commit is contained in:
Sergey Kalinin 2018-08-06 08:44:13 +03:00
parent 521e301dfd
commit 4b3a7d3596
3 changed files with 16 additions and 6 deletions

View File

@ -2378,3 +2378,4 @@ proc Del::inet {tree host profile_name} {

View File

@ -1,4 +1,4 @@
::msgcat::mcset ru "Show where is a RAC comand" "Укажите путь до rac"
::msgcat::mcset ru "Show where is a RAC command" "Укажите путь до rac"
::msgcat::mcset ru "Infobases" "Информационные базы"
::msgcat::mcset ru "Infobase" "Информационная база"
::msgcat::mcset ru "Authorization" "Авторизация"
@ -111,3 +111,4 @@
::msgcat::mcset ru "Session lock mode management" "Режим блокировки сеансов"
::msgcat::mcset ru "External session management required" "Внешнее управление сеансами"

View File

@ -25,12 +25,17 @@ 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]
::msgcat::mclocale $default(locale)
::msgcat::mcload [file join $dir(lib) msg]
# Код проверки наличия rac и правильности указания пути в конфиге
# если программа не найдена то будет выведен диалог для указанием корректного пути
# и этот путь будет записан в пользовательский конфиг
if {[file exists $rac_cmd] == 0} {
set rac_cmd [tk_getOpenFile -initialdir $env(HOME) -parent . \
-title [::msgcat::mc "Show where is a RAC comand"] -initialfile rac]
set rac_cmd "[tk_getOpenFile -initialdir $env(HOME) -parent . \
-title [::msgcat::mc "Show where is a RAC command"] -initialfile rac]"
if {$rac_cmd eq ""} {exit}
file copy [file join $dir(work) rac_gui.cfg] [file join $dir(work) rac_gui.cfg.bak]
set orig_file [open [file join $dir(work) rac_gui.cfg.bak] "r"]
set file [open [file join $dir(work) rac_gui.cfg] "w"]
@ -44,12 +49,15 @@ if {[file exists $rac_cmd] == 0} {
close $file
close $orig_file
#return "$host:$port"
file delete [file join $dir(work) 1c_srv.cfg.bak]
file delete [file join $dir(work) rac_gui.cfg.bak]
if {$tcl_platform(platform) == "windows"} {
tk_messageBox -message "[::msgcat::mc "Reexecute the programm"]!" \
-icon info -type ok
exit
}
} else {
puts "Found $rac_cmd"
}
::msgcat::mclocale $default(locale)
::msgcat::mcload [file join $dir(lib) msg]
set cluster_user ""
set cluster_pwd ""