home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1997 November
/
PCWorld_1997-11_cd.bin
/
software
/
programy
/
komix
/
DATA.Z
/
comparepha.tcl
< prev
next >
Wrap
Text File
|
1996-11-28
|
4KB
|
134 lines
#---------------------------------------------------------------------------
#
# (c) Westmount Technology 1994
#
# File: @(#)comparepha.tcl /main/hindenburg/1
# Author: <generated>
# Description:
#---------------------------------------------------------------------------
# SccsId = @(#)comparepha.tcl /main/hindenburg/1 28 Nov 1996 Copyright 1994 Westmount Technology
# Start user added include file section
# End user added include file section
Class ComparePhaseDlg : {TemplateDialog} {
method destructor
constructor
method ok
method popUp
attribute dbObj
}
method ComparePhaseDlg::destructor {this} {
# Start destructor user section
# End destructor user section
}
constructor ComparePhaseDlg {class this name} {
set this [TemplateDialog::constructor $class $this $name]
$this config \
-modal yes \
-cancelPressed {%this delete} \
-okPressed {
%this ok
%this delete
}
interface DlgColumn $this.top {
DlgRow row {
VerRadioGroup type {
}
}
Label phaseLab {
text "Phase:"
}
OptionMenu phase {
}
}
return $this
}
method ComparePhaseDlg::ok {this} {
if {[isCommand $this.top.row.col.what] &&
"[$this.top.row.col.what selected]" == "Selected Objects"} {
set tmpFile [args_file {}]
set fid [open $tmpFile w]
foreach obj [$wmttoolObj selectedObjSet] {
if {[$obj isA SystemVersion] ||
[$obj isA FileVersion] ||
[$obj isA SystemFileReference] ||
[$obj isA ExternalLink]} {
puts $fid "[$obj identity]"
}
}
close $fid
set selectedSet "-f $tmpFile"
} else {
set selectedSet ""
}
# Determine the previous phase-version
set prevPhaseV [[$this dbObj] prevPhaseV]
set phaseName [$this.top.phase selected]
if {"$phaseName" != "[[$prevPhaseV phase] name]"} {
set id [lsearch -exact "[$this.top.phase entrySet]" "$phaseName"]
set phaseType [lindex [lindex ${BrowserProcs::phases} $id] 1]
set confV [[$this dbObj] getParent ConfigVersion]
set prevPhaseV [$confV findPhaseVersion "$phaseName" "$phaseType"]
}
if [$prevPhaseV isNil] {
wmtkmessage "PhaseVersion '$phaseName' does not exist"
return
}
set script "[quoteIf [m4_path_name bin compare_phase$EXE_EXT]] \
-p [$prevPhaseV identity] \
-d [string tolower [string index [$this.top.row.type selected] 0]] \
$selectedSet"
$wmttoolObj startCommand mtool \
"$script" "" "Starting 'Compare Phase'" {0 0} 0
}
method ComparePhaseDlg::popUp {this} {
if {! [isCommand [$this dbObj]]} {
return
}
set entrySet {Systems Files Components}
if [[$this dbObj] isA PhaseVersion] {
$this.top.row.type config \
-entrySet $entrySet \
-selected Systems
} else {
$this.top.row.type config \
-entrySet [lrange $entrySet 1 end] \
-selected Files
}
if {! [lempty [$wmttoolObj selectedObjSet]]} {
interface DlgColumn $this.top.row.col {
Label lab {
text "Compare For:"
}
VerRadioGroup what {
entrySet {AllObjects "Selected Objects"}
selected "Selected Objects"
}
}
}
set entrySet ""
foreach phase ${BrowserProcs::phases} {
lappend entrySet [lindex $phase 0]
}
$this.top.phase config \
-entrySet $entrySet \
-selected [[[[$this dbObj] prevPhaseV] phase] name]
$this TemplateDialog::popUp
}
# Do not delete this line -- regeneration end marker