Очистка кода

This commit is contained in:
Sergey Kalinin 2018-08-03 08:23:19 +03:00
parent 8f1d96aba4
commit 3e6ee19d7f

View File

@ -1,4 +1,4 @@
#des########################################## ##########################################
# Rac GUI # Rac GUI
# Distributed under GNU Public License # Distributed under GNU Public License
# Author: Sergey Kalinin svk@nuk-svk.ru # Author: Sergey Kalinin svk@nuk-svk.ru
@ -17,7 +17,7 @@ set server ""
proc TreePress {tree} { proc TreePress {tree} {
global host server active_cluster infobase global host server active_cluster infobase
set id [$tree selection] set id [$tree selection]
SetGlobalVarFromTreeItems $tree $id SetGlobalVarFromTreeItems $tree $id
set values [$tree item $id -values] set values [$tree item $id -values]
set key [lindex [split $id "::"] 0] set key [lindex [split $id "::"] 0]
@ -377,7 +377,7 @@ proc Run::infobases {tree host values} {
set auth "" set auth ""
} }
set lst [RunCommand "infobase summary --cluster=$active_cluster $auth list $host"] set lst [RunCommand "infobase summary --cluster=$active_cluster $auth list $host"]
puts $lst #puts $lst
foreach info_bases_list $lst { foreach info_bases_list $lst {
foreach i $info_bases_list { foreach i $info_bases_list {
set base_list [split $i ":"] set base_list [split $i ":"]
@ -1247,17 +1247,21 @@ proc Add::profile {tree host values} {
global default active_cluster server agent_user agent_pwd cluster_user cluster_pwd auth global default active_cluster server agent_user agent_pwd cluster_user cluster_pwd auth
global config priv crypto right_extension right_extension_definition_roles \ global config priv crypto right_extension right_extension_definition_roles \
all_modules_extension modules_available_for_extension modules_not_available_for_extension all_modules_extension modules_available_for_extension modules_not_available_for_extension
if {$cluster_user ne "" && $cluster_pwd ne ""} { if {$cluster_user ne "" && $cluster_pwd ne ""} {
set auth "--cluster-user=$cluster_user --cluster-pwd=$cluster_pwd" set auth "--cluster-user=$cluster_user --cluster-pwd=$cluster_pwd"
} else { } else {
set auth "" set auth ""
} }
set var_list {config priv crypto right_extension all_modules_extension } set var_list {config priv crypto right_extension all_modules_extension }
foreach v $var_list {set $v "off"; puts $v} foreach v $var_list {
set $v "off"
}
set var_list {right_extension_definition_roles modules_available_for_extension modules_not_available_for_extension} set var_list {right_extension_definition_roles modules_available_for_extension modules_not_available_for_extension}
foreach v $var_list {set $v 0; puts $v} foreach v $var_list {
set $v 0
}
unset var_list unset var_list
puts ">>>$right_extension_definition_roles"
set frm [AddToplevel [::msgcat::mc "Security profile"] security_grey_64] set frm [AddToplevel [::msgcat::mc "Security profile"] security_grey_64]
@ -1345,7 +1349,9 @@ proc Add::directory {tree host values} {
set auth "" set auth ""
} }
set var_list {allowedRead allowedWrite} set var_list {allowedRead allowedWrite}
foreach v $var_list {set $v "no"; puts $v} foreach v $var_list {
set $v "no"
}
unset var_list unset var_list
set frm [AddToplevel [::msgcat::mc "Virtual directory"] directory_grey_64] set frm [AddToplevel [::msgcat::mc "Virtual directory"] directory_grey_64]
@ -1398,7 +1404,9 @@ proc Add::addin {tree host values} {
set auth "" set auth ""
} }
set var_list {allowedRead allowedWrite} set var_list {allowedRead allowedWrite}
foreach v $var_list {set $v "no"; puts $v} foreach v $var_list {
set $v "no"
}
unset var_list unset var_list
set frm [AddToplevel [::msgcat::mc "Available add-in"] addin_grey_64] set frm [AddToplevel [::msgcat::mc "Available add-in"] addin_grey_64]
@ -1439,7 +1447,9 @@ proc Add::module {tree host values} {
set auth "" set auth ""
} }
set var_list {allowedRead allowedWrite} set var_list {allowedRead allowedWrite}
foreach v $var_list {set $v "no"; puts $v} foreach v $var_list {
set $v "no"
}
unset var_list unset var_list
set frm [AddToplevel [::msgcat::mc "External module"] module_grey_64] set frm [AddToplevel [::msgcat::mc "External module"] module_grey_64]
@ -1480,7 +1490,9 @@ proc Add::com {tree host values} {
set auth "" set auth ""
} }
set var_list {allowedRead allowedWrite} set var_list {allowedRead allowedWrite}
foreach v $var_list {set $v "no"; puts $v} foreach v $var_list {
set $v "no"
}
unset var_list unset var_list
set frm [AddToplevel [::msgcat::mc "COM class"] com_grey_64] set frm [AddToplevel [::msgcat::mc "COM class"] com_grey_64]
@ -1531,7 +1543,9 @@ proc Add::app {tree host values} {
set auth "" set auth ""
} }
set var_list {allowedRead allowedWrite} set var_list {allowedRead allowedWrite}
foreach v $var_list {set $v "no"; puts $v} foreach v $var_list {
set $v "no"
}
unset var_list unset var_list
set frm [AddToplevel [::msgcat::mc "Application"] app_grey_64] set frm [AddToplevel [::msgcat::mc "Application"] app_grey_64]
@ -1571,7 +1585,9 @@ proc Add::inet {tree host values} {
set auth "" set auth ""
} }
set var_list {allowedRead allowedWrite} set var_list {allowedRead allowedWrite}
foreach v $var_list {set $v "no"; puts $v} foreach v $var_list {
set $v "no"
}
unset var_list unset var_list
set frm [AddToplevel [::msgcat::mc "Internet resource"] link_grey_64] set frm [AddToplevel [::msgcat::mc "Internet resource"] link_grey_64]
@ -1625,8 +1641,8 @@ proc Edit {} {
set id [.frm_tree.tree selection] set id [.frm_tree.tree selection]
set values [.frm_tree.tree item $id -values] set values [.frm_tree.tree item $id -values]
set key [lindex [split $id "::"] 0] set key [lindex [split $id "::"] 0]
puts $key #puts $key
puts $values #puts $values
if {$values eq "" || $key eq ""} {return} if {$values eq "" || $key eq ""} {return}
Edit::$key $tree $host $values Edit::$key $tree $host $values
} }
@ -1938,6 +1954,10 @@ proc Edit::profile {tree host values} {
} else { } else {
set auth "" set auth ""
} }
set lst [GetWorkTreeRow]
if {$lst eq ""} {
return
}
set frm [Add::profile $tree $host $values] set frm [Add::profile $tree $host $values]
wm title .add [::msgcat::mc "Edit record"] wm title .add [::msgcat::mc "Edit record"]