home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1998 October
/
PCWorld_1998-10_cd.bin
/
software
/
prehled
/
komix
/
DATA.Z
/
s_sysvdbob.tcl
< prev
next >
Wrap
Text File
|
1997-11-24
|
5KB
|
177 lines
#---------------------------------------------------------------------------
#
# (c) Cayenne Software Inc. 1996
#
# File: @(#)s_sysvdbob.tcl /main/titanic/5
# Author: Marcel Bancken
# Description:
#---------------------------------------------------------------------------
# SccsId = @(#)s_sysvdbob.tcl /main/titanic/5 24 Nov 1997 Copyright 1996 Cayenne Software Inc.
method SysVDbObj::activateObject {this} {
set typeSpec [getObjectSpec [.main objectHdlr] CorporateGroupVersion ""]
if {"$typeSpec" != ""} {
set icon [$typeSpec smallIcon]
} else {
set icon ""
}
set headerSpecList {
{Name 25 ascii {increasing 1}}
{Version 8 ascii {increasing 2}}
{Created 30 ascii {none}}
{Comments 50 ascii {none}}
}
foreach corpGV [$this reused] {
set reusedList($corpGV) 1
}
set corpGVList ""
set objectSpecList ""
set srcType [[$this parent] getInfo Type]
foreach corpGV [[.main corporateObj] corporateGroupVersions] {
if [info exists reusedList($corpGV)] continue
set dstType [[[[$corpGV savedGroupVersion] system] phase] type]
if {"$srcType" != "$dstType" &&
("$srcType" == "Implementation" ||
"$dstType" == "Implementation")} continue
lappend corpGVList $corpGV
lappend objectSpecList [list $icon \
[[$corpGV corporateGroup] name] \
[$corpGV versionNumber] \
[$corpGV createTime2String] \
[$corpGV comments] \
]
}
if [lempty $corpGVList] {
wmtkinfo \
"There are no unused CoporateGroups that can be activated\
within this SystemVersion"
return
}
require "browsviewd.tcl"
set box .main.activate
ClassMaker::extend BrowsViewDialog ActivateBrowsViewDialog dbObj
ActivateBrowsViewDialog new $box \
-title "Activate Corporate Group" \
-headerSpecList $headerSpecList \
-objectSpecList $objectSpecList \
-objectList $corpGVList \
-dbObj $this \
-cancelPressed {%this delete} \
-okPressed {
set dbObj [%this dbObj]
set confV [$dbObj getParent ConfigVersion]
set script ""
foreach object [[%this view] selectedSet] {
set corpGV [$object object]
if {"$script" != ""} {
append script " ;"
}
append script " $dbObj reuse $corpGV $confV"
}
.main startCommand tcl \
"$script" "" \
"Activating CorporateGroupVersion(s)..." \
{1 0} 1
%this delete
}
$box popUp
}
method SysVDbObj::copyGroupVersion {this groupV fromSysV fromConfV toConfV} {
# Remove imported object in case of a cut operation
set editPasteCmdBusy [.main undoCommandBusy EditPasteCmd]
if {$editPasteCmdBusy &&
"[[.main undoCommand] operation]" == "cut"} {
$fromSysV cutVersion $groupV
}
set script " $this copy [ORB::nil] -groupVersion \
$groupV $fromSysV $fromConfV $toConfV $editPasteCmdBusy"
if {$this == [[.main currentObj] browsUiObj]} {
set update 1
} else {
set update 0
}
.main startCommand tcl \
"$script" "" \
"Copying definition of [$groupV getInfo Text]" \
[list $update 0] 1
}
method SysVDbObj::deactivateObject {this} {
set corpGVList [$this reused]
if [lempty $corpGVList] {
wmtkinfo \
"There are no CorporateGroups activated within this SystemVersion"
return
}
set typeSpec [getObjectSpec [.main objectHdlr] CorporateGroupVersion ""]
if {"$typeSpec" != ""} {
set icon [$typeSpec smallIcon]
} else {
set icon ""
}
set headerSpecList {
{Name 25 ascii {increasing 1}}
{Version 8 ascii {increasing 2}}
{Created 30 ascii {none}}
{Comments 50 ascii {none}}
}
set objectSpecList ""
foreach corpGV $corpGVList {
lappend objectSpecList [list $icon \
[[$corpGV corporateGroup] name] \
[$corpGV versionNumber] \
[$corpGV createTime2String] \
[$corpGV comments] \
]
}
require "browsviewd.tcl"
set box .main.deactivate
ClassMaker::extend BrowsViewDialog DeactivateBrowsViewDialog dbObj
DeactivateBrowsViewDialog new $box \
-title "Deactivate Corporate Group" \
-headerSpecList $headerSpecList \
-objectSpecList $objectSpecList \
-objectList $corpGVList \
-dbObj $this \
-cancelPressed {%this delete} \
-okPressed {
set dbObj [%this dbObj]
set script ""
foreach object [[%this view] selectedSet] {
set corpGV [$object object]
if {"$script" != ""} {
append script " ;"
}
append script " $dbObj unuse $corpGV"
}
.main startCommand tcl \
"$script" "" \
"Deactivating CorporateGroupVersion(s)..." \
{1 0} 1
%this delete
}
$box popUp
}
method SysVDbObj::groupVersions {this} {
set groupVersions ""
foreach link [$this groupVersionLinks] {
set groupV [$link groupVersion]
$groupV setInfo SystemGroupLink $link
lappend groupVersions $groupV
}
return $groupVersions
}
method SysVDbObj::reused {this} {
return [$this SystemVersion::reused]
}