home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1998 October
/
PCWorld_1998-10_cd.bin
/
software
/
prehled
/
komix
/
DATA.Z
/
vbversionm.tcl
< prev
next >
Wrap
Text File
|
1997-11-27
|
6KB
|
227 lines
#---------------------------------------------------------------------------
#
# (c) Cayenne Software Inc. 1997
#
# File: @(#)vbversionm.tcl /main/titanic/20
# Author: <generated>
# Description:
#---------------------------------------------------------------------------
# SccsId = @(#)vbversionm.tcl /main/titanic/20 27 Nov 1997 Copyright 1997 Cayenne Software Inc.
# Start user added include file section
# End user added include file section
Class VBVersionMenuProcs : {Object} {
constructor
method destructor
}
constructor VBVersionMenuProcs {class this name} {
set this [Object::constructor $class $this $name]
# Start constructor user section
# End constructor user section
return $this
}
method VBVersionMenuProcs::destructor {this} {
# Start destructor user section
# End destructor user section
}
proc VBVersionMenuProcs::compare {} {
set objs [.main selectedObjSet]
set target [lindex $objs 0]
set source [lindex $objs 1]
if {$source == ""} {
if {[$target isA PhaseVersion] ||
[$target isA ConfigVersion] ||
[$target isA SystemVersion]} {
set name Merge
VBProcs::selectOther VBVersionMenuProcs::compare $name
} else {
set name Compare
VBProcs::selectOther VBVersionMenuProcs::compare $name 1
}
return
}
VBVersionMenuProcs::doCompare $source $target
}
proc VBVersionMenuProcs::doCompare {version1 version2} {
set type mtool
if {[$version1 isA Graph] || [$version1 isA Matrix]} {
set script "[quoteIf [m4_path_name bin udmcmp$EXE_EXT]] \
[$version1 identity] [$version2 identity]"
set endScript ""
set message "Starting Compare Version"
} elseif [$version1 isA ExternalFileVersion] {
set script "[m4_var get M4_diff] "
set endScript ""
foreach version "$version1 $version2" {
set tmpFile [args_file {}]
case "[$version status]" in {
{backGround} {
$version activate
$version downLoadFrozenContents $tmpFile
$version deactivate
}
{frozen reused} {
$version downLoadFrozenContents $tmpFile
}
{frozen reused} {
$version synchWithFileSystem
}
{default} {
copy_text_file [$version path \
[$version currentContext]] $tmpFile
}
}
append script "$tmpFile "
append endScript "BasicFS::removeFile $tmpFile ;"
}
set message "Starting Compare"
} elseif [$version1 isA RemoteFile] {
set script "[m4_var get M4_diff] "
set endScript ""
foreach version "$version1 $version2" {
set tmpFile [args_file {}]
case "[$version status]" in {
{backGround} {
$version activate
$version downLoad $tmpFile
$version deactivate
}
{default} {
$version downLoad $tmpFile
}
}
append script "$tmpFile "
append endScript [list BasicFS::removeFile $tmpFile ]
append endScript " ;"
}
set message "Starting Compare"
} elseif {[$version1 isA PhaseVersion] ||
[$version1 isA ConfigVersion] ||
[$version1 isA SystemVersion]} {
set cc [[ClientContext::global] currentLevelIdString]
set fc $cc/[$version1 identity]
set tc $cc/[$version2 identity]
set script "SystemUtilities::fork otk mtmerge"
set script "$script -c [list [get_comm_name]] -fc $fc -tc $tc"
set endScript ""
set message "Starting Merge Tool"
set type tcl
} else {
wmtkerror "Sorry, don't know how to compare [$version1 objType]"
return
}
.main startCommand $type \
"$script" "$endScript" "$message" {0 0} 0
}
proc VBVersionMenuProcs::mergeLink {} {
set selVersions [.main selectedVersionSet]
set to [lindex $selVersions 0]
set from [lindex $selVersions 1]
if {$from == ""} {
VBProcs::selectOther VBVersionMenuProcs::mergeLink MergeLink
return
}
set title "MergeLink From '[[$from version] versionName]' To '[[$to version] versionName]'"
require mergedialo.tcl
MergeDialog new .main.mergeDialog
.main.mergeDialog from $from
.main.mergeDialog to $to
.main.mergeDialog title $title
.main.mergeDialog popUp
}
proc VBVersionMenuProcs::deleteMergeLink {} {
set selVersions [.main selectedVersionSet]
set to [lindex $selVersions 0]
set from [lindex $selVersions 1]
if {$from == ""} {
set title "Deleting MergeLink"
VBProcs::selectOther VBVersionMenuProcs::deleteMergeLink $title 1
return
}
set link [query "from == [$from version]" [$to version].mergeLinks]
if {$link == ""} {
wmtkerror "Merge Link not found"
return
}
set title "Confirm MergeLink From '[[$from version] versionName]' To '[[$to version] versionName]' Delete"
require deletemerg.tcl
DeleteMergeDialog new .main.deleteMergeDialog
.main.deleteMergeDialog to $to
.main.deleteMergeDialog from $from
.main.deleteMergeDialog title $title
.main.deleteMergeDialog popUp
}
proc VBVersionMenuProcs::freeze {} {
BrowserProcs::freezeObjects [.main selectedObjSet]
.main updateView
}
proc VBVersionMenuProcs::unFreeze {} {
# working on the selectedSet 'selectedObjSet'
BrowserProcs::unfreezeObjects
.main updateView
}
proc VBVersionMenuProcs::new {} {
set obj [lindex [.main selectedObjSet] 0]
if [$obj isA CustomFileVersion] {
set custlvlV [$obj getParent CustomLevelVersion]
append script " $custlvlV derive $obj"
.main startCommand tcl "$script" "" "" {1 0} 1
} else {
# working on the selectedSet 'selectedObjSet'
[[.main infoView] getParentVersionObj] newObjects
}
VBViewMenuProcs::updateView
}
proc VBVersionMenuProcs::delete {} {
set version [lindex [.main selectedObjSet] 0]
set parent [lindex [VBProcs::getOwners $version] 0]
# working on the selectedSet 'selectedObjSet'
BrowserProcs::removeVersion $parent \
"[[.main infoView] versionable]" "[.main selectedObjSet]" \
VBVersionMenuProcs::updateAfterDelete
}
proc VBVersionMenuProcs::updateAfterDelete {} {
VBViewMenuProcs::updateView
}
proc VBVersionMenuProcs::select {} {
busy {
set newVersion [[.main selectedVersionSet] version]
[[.main infoView] getParentVersionObj] selectVersion $newVersion
.main updateView
}
}
# Do not delete this line -- regeneration end marker