📄 licmanual.tcl
字号:
# LICMANUAL.TCL - Setup procedures for implementing license configuration page# for manual LM Installation (Email and Phone/Fax)## Copyright 1999-2003 Wind River Systems, Inc## modification history# --------------------# 02e,15may03,bjl changed node locked licensing to use table.# 02d,29apr03,bjl changed to table to accomodate more features.# 02c,05mar02,bwd Modified SETUP to be non-tornado centric# 02b,04feb02,bwd Fixed problem: license info not displayed on phone/email# page on windows 2000# 02a,12jun01,j_w Added for Tornado 2.2# 01l,30oct00,j_w SPR 35775: read setup.log for CD description if no DISK_ID # found when running setup /L from an installed tree# 01k,08jun00,bwd SPR 31613: added codes to populate lmVals values using info# from setup.log if SETUP is not running from the CD# 01j,02jun00,bwd Changed all "dialog ok" to use "dialog ok_with_title"# 01i,26may00,bwd SPR 31386 - display warning if user selects 0 license for# all the products. Do not display this page if reload# existing license file# 01h,23may00,bwd Fixed message# 01g,16may00,bwd SPR 31030 - modified configuration page to display Node# Locked licensing differently# 01f,14feb00,wmd Change all references to prodCode to featureId.# 01e,03feb00,bwd Fixed codes to display only the licensed products that# belong to this host only# 01d,02feb00,bwd Changed setupVals(cmdMode) to use isGUImode# 01c,20jan00,bwd Corrected error message# 01b,14jan00,bwd Added codes to display this page for TEXT MODE# 01a,04jan00,bwd written############################################################################### pageCreate(licManual) - Configure licenses on current host## This procedure will configure license on current host## SYNOPSIS# .tS# pageCreate(licManual)# .tE## PARAMETERS: N/A## RETURNS: N/A## ERRORS: N/A#proc pageCreate(licManual) {} { global ctrlVals setupVals lmVals global valuesReset # initialize arrays if needed if { $valuesReset } { set lmVals(lmLicensedProductNames) {} set lmVals(lmLicensedFeatureIds) {} set lmVals(lmFeaturesRequested) {} lmValsRequestInit } if { $lmVals(reload) } { nextCallback return 0 } # reset values that control the table or user input controls set ctrlVals(inputUpdate) 0 set ctrlVals(tableUpdate) 0 if { [isGUImode] } { # hide the setup bitmap to allow more space on the page controlHide wizardDialog.bitmap 1 # set up constants to be used for control dimensions and spacing set XCOL1 10 set XCOL2 90 set XCOL3 234 set Y 45 set WIDTH 75 set HTHDR 20 set HT 11 set TABLEWIDTHS {80 140 40} if { $setupVals(lmInstType) == "nodeLocked" } { set COL3_HEAD [strTableGet LICMANUAL_NODELOCK] set topMSG [strTableGet LICMANUAL_NODELOCK1] set bottomMSG [strTableGet LICMANUAL_NODELOCK2] } else { # update set COL3_HEAD [strTableGet LICMANUAL_COL3] set topMSG [strTableGet LICMANUAL_UPDATE1] if {$setupVals(ELMUser)} { set bottomMSG [strTableGet LICMANUAL_ELM_UPDATE2] } else { set bottomMSG [strTableGet LICMANUAL_UPDATE2] } } set ctrlVals(volatileFrm) [list \ [list label -name label_1 \ -title $topMSG \ -x $XCOL1 -y 15 -w 300 -h 30] \ [list label -name label_2 \ -title $bottomMSG \ -x $XCOL1 -y 160 -w 300 -h 15] ] lappend ctrlVals(volatileFrm) \ [list label -name col1 \ -title [strTableGet LICMANUAL_COL1] \ -x $XCOL1 -y $Y -w $WIDTH -h $HTHDR] \ [list label -name col2 \ -title [strTableGet LICMANUAL_COL2] \ -x $XCOL2 -y $Y -w $WIDTH -h $HTHDR] \ [list label -name col3 \ -title $COL3_HEAD\ -x $XCOL3 -y $Y -w $WIDTH -h $HTHDR] # Add the edit box controls set newY [expr $Y + $HTHDR + 7] for {set ix 0} {$ix < [llength $lmVals(lmLicensedProductNames)]} {incr ix} { set feature [lindex $lmVals(lmLicensedProductNames) $ix] set featureId [lindex $lmVals(lmLicensedFeatureIds) $ix] # set values for the table if { $setupVals(lmInstType) == "nodeLocked" } { set featureVals [list $feature $featureId "Yes"] lappend tableVals $featureVals } else { set featureVals [list $feature $featureId 0] lappend tableVals $featureVals } } # add table lappend ctrlVals(volatileFrm) \ [list table -name licManualTable \ -columns 3 -border \ -x 10 -y 65 -width 285 -height 52 \ -callback onTableManualEvent \ -initial $tableVals ] if { $setupVals(lmInstType) == "floating" } { lappend ctrlVals(volatileFrm) \ [list label -name tableManualLabel \ -title [strTableGet LICMANUAL_TABLE_FLOATING] \ -x 10 -y 120 -w 295 -h $HT] } else { lappend ctrlVals(volatileFrm) \ [list label -name tableManualLabel \ -title [strTableGet LICMANUAL_TABLE_NODELOCKED] \ -x 10 -y 120 -w 295 -h $HT] } lappend ctrlVals(volatileFrm) \ [list label -name tableManualLabel \ -title [strTableGet LICMANUAL_TABLE_FLOATING] \ -x 10 -y 120 -w 295 -h $HT] \ [list label -name selectedProdLabel \ -title "Selected Product:" \ -x $XCOL1 -y 132 -w 59 -h $HT] \ [list label -name selectedProd \ -title "" \ -x 72 -y 132 -w 233 -h $HT] # add text entry box for floating licenses, # radio choices for node locked licenses if { $setupVals(lmInstType) == "floating" } { lappend ctrlVals(volatileFrm) \ [list label -name allocateLabel \ -title "No. of licenses to be allocated:" \ -x $XCOL1 -y 146 -w 100 -h $HT ] \ [list text -name textManualRequested \ -callback "floatTextManualCB" \ -x [expr $XCOL1 + 102] -y 144 -w 30 -h 12] } else { lappend ctrlVals(volatileFrm) \ [list label -name requestLabel \ -title "Request a node locked license:" \ -x $XCOL1 -y 146 -w 102 -h $HT ] \ [list choice -name yesManualChoice -newgroup -auto \ -title "Yes" \ -x [expr $XCOL1 + 108] -y 144 -w 30 -h 12 \ -callback "nodelockChoiceManualCB"] \ [list choice -name noManualChoice -auto \ -title "No" \ -x [expr $XCOL1 + 138] -y 144 -w 30 -h 12 \ -callback "nodelockChoiceManualCB"] } # Set title if { $setupVals(lmInstOptions) == "onEmail" } { set w [dlgFrmCreate [strTableGet LICMANUAL_TITLE_EMAIL]] } else { set w [dlgFrmCreate [strTableGet LICMANUAL_TITLE_PHONE]] } for {set ix 0} {$ix < [llength $lmVals(lmLicensedProductNames)]} {incr ix} { if { $setupVals(lmInstType) == "nodeLocked" } { # get all the values for the current feature set featureVals [lindex [controlValuesGet $w.licManualTable] $ix] # then get just the first two values, the third value (requested) # will be set here set featureVals [lrange $featureVals 0 1] if { [lindex $lmVals(lmFeaturesRequested) $ix] == 1 } { lappend featureVals "Yes" } else { lappend featureVals "No" } lappend licTableVals $featureVals } else { # get all the values for the current feature set featureVals [lindex [controlValuesGet $w.licManualTable] $ix] # then get just the first two values, the third value (requested) # will be set here set featureVals [lrange $featureVals 0 1] lappend featureVals [lindex $lmVals(lmFeaturesRequested) $ix] lappend licTableVals $featureVals } } controlValuesSet $w.licManualTable $licTableVals controlPropertySet $w.licManualTable -columnwidths $TABLEWIDTHS controlSelectionSet $w.licManualTable 0 controlFocusSet $w.licManualTable controlValuesSet $w.nextButt "&Next >" controlEnable $w.backButt 1 controlEnable $w.nextButt 1 controlEnable $w.cancelButt 1 } else { # TEXT MODE # Set title if { $setupVals(lmInstOptions) == "onEmail" } { printPageTitle [strTableGet LICMANUAL_TITLE_EMAIL] } else { printPageTitle [strTableGet LICMANUAL_TITLE_PHONE] } puts "[strTableGet LICMANUAL_UPDATE1]\n\n" # Set header column 3 if { $setupVals(lmInstType) == "nodeLocked" } { set COL3_L1 "Check to request" set COL3_L2 "a license" } else { set COL3_L1 "No. of licenses" set COL3_L2 "to be allocated" } # print column label puts [format "%-6s %-25s %-25s %20s" \ "item" "Licensed Product" "Feature ID" $COL3_L1] puts [format "%-6s %-25s %-25s %20s" "" "" "" $COL3_L2] for { set i 0 } { $i < 80 } { incr i } { puts -nonewline "-" } puts "\n" # print product names and codes for {set ix 0} {$ix < [llength $lmVals(lmLicensedProductNames)]} {incr ix} { set name [lindex $lmVals(lmLicensedProductNames) $ix] set code [lindex $lmVals(lmLicensedFeatureIds) $ix] if { $setupVals(lmInstType) == "nodeLocked" } { if { $valuesReset } { # set default values set lmVals(lmFeaturesRequested) \ [lreplace $lmVals(lmFeaturesRequested) $ix $ix 1] } } set license [lindex $lmVals(lmFeaturesRequested) $ix] if { $setupVals(lmInstType) == "nodeLocked" } { if { $license == 1 } { set license "x" } else { set license "" } } puts [format "%-6s %-25s %-25s %20s" \ "[expr $ix + 1]" "$name" "$code" "$license"] } puts "\n\n[strTableGet LICMANUAL_TEXT]\n" set totalProd [llength $lmVals(lmLicensedProductNames)] set ret [prompt] switch -regexp -- $ret { "^$" { nextCallback ; return 0 } "^-$" { backCallback ; return 0 } "^[eE][xX][iI][tT]$" { return 0 } "[ ]+" { puts "Error: please select only one item" while {[prompt "Press <Enter> to continue."] != "" } { } pageCreate(licManual) } "^[1-9]+" { if { $ret > $totalProd } { puts [strTableGet 3145_COMP_SELECT_CHANGE_INVALID] while {[prompt "Press <Enter> to continue."] != "" } { } pageCreate(licManual)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -