home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1998 October
/
PCWorld_1998-10_cd.bin
/
software
/
prehled
/
komix
/
DATA.Z
/
mtversionm.tcl
< prev
next >
Wrap
Text File
|
1997-11-26
|
4KB
|
186 lines
#---------------------------------------------------------------------------
#
# (c) Cayenne Software Inc. 1997
#
# File: @(#)mtversionm.tcl /main/titanic/15
# Author: <generated>
# Description:
#---------------------------------------------------------------------------
# SccsId = @(#)mtversionm.tcl /main/titanic/15 26 Nov 1997 Copyright 1997 Cayenne Software Inc.
# Start user added include file section
# End user added include file section
Class MTVersionMenuProcs : {Object} {
constructor
method destructor
}
constructor MTVersionMenuProcs {class this} {
set this [Object::constructor $class $this $name]
# Start constructor user section
# End constructor user section
return $this
}
method MTVersionMenuProcs::destructor {this} {
# Start destructor user section
# End destructor user section
}
proc MTVersionMenuProcs::merge {} {
set parentObj [[.main currentObj] repObj]
set warning "Merge not (completely) successful for object "
set reload 0
busy {
foreach obj [.main selectedObjSet] {
if [[$obj repObj] merge] {
set reload 1
} else {
wmtkwarning "$warning '[$obj label]'."
if [[$obj repObj] isA MTContainer] {
# reload because some underlaying
# elements can be succeeded
set reload 1
}
}
}
}
if {$reload == 1} {
MTFileMenuProcs::reload
}
.main setCurrentContextVars
}
proc MTVersionMenuProcs::import {} {
set parentObj [[.main currentObj] repObj]
set warning "Merge not (completely) successful for object "
set reload 0
busy {
foreach obj [.main selectedObjSet] {
if [[$obj repObj] import] {
set reload 1
} else {
wmtkwarning "$warning '[$obj label]'."
if [[$obj repObj] isA MTContainer] {
# reload because some underlaying
# elements can be succeeded
set reload 1
}
}
}
}
if {$reload == 1} {
MTFileMenuProcs::reload
}
}
proc MTVersionMenuProcs::overwrite {} {
set parentObj [[.main currentObj] repObj]
busy {
foreach obj [.main selectedObjSet] {
if [[$obj repObj] overwrite] {
[$obj repObj] delete
$obj delete
}
}
}
.main setCurrentContextVars
MTFileMenuProcs::reload
}
proc MTVersionMenuProcs::createMergeLink {} {
set selObjs [.main selectedObjSet]
if {[llength $selObjs] == 1} {
set selObj [lindex $selObjs 0]
set selMergeObj [$selObj repObj]
set fromName [[$selMergeObj fromRepObj] versionName]
set toName [[$selMergeObj toRepObj] versionName]
set title "Link From '$fromName' To '$toName'"
} else {
set title "Links"
foreach selObj $selObjs {
lappend selMergeObj [$selObj repObj]
}
set selObj $selObjs
}
require mtmergedia.tcl
MTMergeDialog new .main.mergeDialog
.main.mergeDialog mtVersion $selMergeObj
.main.mergeDialog title $title
.main.mergeDialog browsObject $selObj
.main.mergeDialog popUp
}
proc MTVersionMenuProcs::compare {} {
require vbversionm.tcl
set selObj [lindex [.main selectedObjSet] 0]
set selMergeObj [$selObj repObj]
set version1 [$selMergeObj fromRepObj]
set version2 [$selMergeObj toRepObj]
VBVersionMenuProcs::doCompare $version1 $version2
}
proc MTVersionMenuProcs::startVersionBrowser {} {
set message "Starting Version Browser"
set curObj [[.main selectedMergeObjSet] fromRepObj]
# Go down to obj level and start version browser
set clientContext [ClientContext::global]
set levelIds [$clientContext currentLevelIdString]
set loopObj $curObj
set objs {}
while {[$loopObj parent] != ""} {
set loopObj [$loopObj parent]
set objs "$loopObj $objs"
}
set curLevel [$clientContext currentLevelId]
set start 0
foreach obj $objs {
if {$obj == [$clientContext currentFile]} {
# do not add file level to clientcontext
break
}
if {$start == 1} {
$clientContext downLevelId $obj
}
if {$obj == $curLevel} {
# start leveling down after currentLevel
set start 1
}
}
set id [$curObj identity]
set script "SystemUtilities::fork otk vbrowser"
set script "$script -c [list [get_comm_name]] -v $id"
set endScript ""
.main startCommand tcl "$script" "$endScript" "$message" {0 0} 0
# Reset clientContext
$clientContext setLevelIds $levelIds
}
# Do not delete this line -- regeneration end marker