Добавлен вывод текущей версии в диалог о программе

This commit is contained in:
Sergey Kalinin 2019-09-16 15:24:24 +03:00
parent a4c325d161
commit a32447dc05
4 changed files with 24 additions and 28 deletions

View File

@ -406,16 +406,21 @@ proc SetRacCommand {} {
} }
proc ShowHelpDialog {} { proc ShowHelpDialog {} {
global default dir global default dir racgui_version racgui_release
set frm [AddToplevel [::msgcat::mc "About"] help_grey_64] set frm [AddToplevel [::msgcat::mc "About"] help_grey_64]
wm title .add [::msgcat::mc "About"] wm title .add [::msgcat::mc "About"]
ttk::label $frm.lbl_version -text "[::msgcat::mc "Version"]: $racgui_version"
ttk::label $frm.lbl_release -text "[::msgcat::mc "Release"]: $racgui_release"
text $frm.txt -wrap word text $frm.txt -wrap word
ttk::scrollbar $frm.hsb -orient horizontal -command [list $frm.t xview] ttk::scrollbar $frm.hsb -orient horizontal -command [list $frm.t xview]
ttk::scrollbar $frm.vsb -orient vertical -command [list $frm.t yview] ttk::scrollbar $frm.vsb -orient vertical -command [list $frm.t yview]
text $frm.t -xscrollcommand [list $frm.hsb set] -yscrollcommand [list $frm.vsb set] text $frm.t -xscrollcommand [list $frm.hsb set] -yscrollcommand [list $frm.vsb set]
grid $frm.t -row 0 -column 0 -sticky nsew grid $frm.lbl_version -row 0 -column 0 -sticky nsew -padx 5 -pady 2
grid $frm.vsb -row 0 -column 1 -sticky nsew grid $frm.lbl_release -row 1 -column 0 -sticky nsew -padx 5 -pady 2
grid $frm.hsb -row 1 -column 0 -sticky nsew grid $frm.t -row 2 -column 0 -sticky nsew
grid $frm.vsb -row 2 -column 1 -sticky nsew
grid $frm.hsb -row 3 -column 0 -sticky nsew
grid columnconfigure $frm 0 -weight 1 grid columnconfigure $frm 0 -weight 1
grid rowconfigure $frm 0 -weight 1 grid rowconfigure $frm 0 -weight 1
@ -2577,24 +2582,3 @@ proc Del::app {tree host profile_name} {
proc Del::inet {tree host profile_name} { proc Del::inet {tree host profile_name} {
Del::acl $host inet [GetWorkTreeItems "name"] $profile_name Del::acl $host inet [GetWorkTreeItems "name"] $profile_name
} }

View File

@ -123,4 +123,3 @@ pack $frm_tree $frm_work -side left -expand true -fill both
.panel add $frm_tree -weight 1 .panel add $frm_tree -weight 1
.panel add $frm_work -weight 1 .panel add $frm_work -weight 1

View File

@ -146,3 +146,5 @@
::msgcat::mcset ru "Connected at" "Подключено в" ::msgcat::mcset ru "Connected at" "Подключено в"
::msgcat::mcset ru "Session number" "Номер сессии" ::msgcat::mcset ru "Session number" "Номер сессии"
::msgcat::mcset ru "About" "О программе" ::msgcat::mcset ru "About" "О программе"
::msgcat::mcset ru "Version" "Версия"
::msgcat::mcset ru "Release" "Выпуск"

View File

@ -15,6 +15,19 @@ exec wish "$0" -- "$@"
# #
###################################################### ######################################################
# определим текущую версию и релиз
set f [open $argv0 "RDONLY"]
while {[gets $f line] >=0} {
if [regexp -nocase -all -- {version: ([0-9]+?.[0-9]+?.[0-9]+?)} $line match v1] {
set racgui_version $v1
}
if [regexp -nocase -all -- {release: ([0-9]+?)} $line match v1] {
set racgui_release $v1
}
}
close $f
package require msgcat package require msgcat
# Устанавливаем текущий каталог # Устанавливаем текущий каталог
@ -112,5 +125,3 @@ if [file exists [file join $dir(work) 1c_srv_new.cfg]] {
set servers_list "" set servers_list ""
} }