home *** CD-ROM | disk | FTP | other *** search
- #---------------------------------------------------------------------------
- #
- # (c) Cayenne Software Inc. 1997
- #
- # File: @(#)contchange.tcl /main/hindenburg/2
- # Author: <generated>
- # Description: VCM integration file
- #---------------------------------------------------------------------------
- # SccsId = @(#)contchange.tcl /main/hindenburg/2 18 Mar 1997 Copyright 1997 Cayenne Software Inc.
-
- # Start user added include file section
- # End user added include file section
-
-
- # This dialog has two parts in a radio group:
- # the first allows explicit selection of a working
- # project version, the second specifies that ObjecTeam
- # should always use the latest version.
-
- Class ContChangeProjectVersionDialog : {TemplateDialog} {
- constructor
- method destructor
- method createInterface
- method popUp
- method handleOk
-
- # Currently selected version
- #
- attribute currentVersion
-
- # List of working versions.
- #
- attribute workingVersions
-
- # Current system ,used to update its path.
- #
- attribute currentSystem
- }
-
- constructor ContChangeProjectVersionDialog {class this name} {
- set this [TemplateDialog::constructor $class $this $name]
- # Start constructor user section
- $this createInterface
- # End constructor user section
- return $this
- }
-
- method ContChangeProjectVersionDialog::destructor {this} {
- # Start destructor user section
- # End destructor user section
- }
-
-
- # Put elements in the interface.
- #
- method ContChangeProjectVersionDialog::createInterface {this} {
- interface DlgColumn $this.col {
- CheckButton explicit {
- label "Select working version:"
- }
- TextList versions {
- }
- CheckButton latest {
- label "Select latest working version"
- }
- }
-
- $this.col.explicit stateChanged {
- if [%this state] {
- [%this parent].latest state 0
- [%this parent].versions sensitive 1
- } else {
- [%this parent].latest state 1
- [%this parent].versions sensitive 0
- }
- }
-
- $this.col.latest stateChanged {
- if [%this state] {
- [%this parent].explicit state 0
- [%this parent].versions sensitive 0
- } else {
- [%this parent].versions sensitive 1
- [%this parent].explicit state 1
- }
- }
-
- $this title "Change Project Version"
- $this delHelpButton
- $this okPressed "$this handleOk"
- }
-
-
- # Adjust interface based on currentVersion
- # and workingVersions.
- #
- method ContChangeProjectVersionDialog::popUp {this} {
- $this.col.versions entrySet [$this workingVersions]
-
- set m4Versions [m4_var get M4_cont_projects]
- if { [lsearch -exact $m4Versions [$this currentVersion]] == -1 } {
- $this.col.explicit state 0
- $this.col.versions sensitive 0
- $this.col.latest state 1
- } else {
- $this.col.explicit state 1
- $this.col.versions selectedSet [$this currentVersion]
- $this.col.latest state 0
- }
-
- $this TemplateDialog::popUp
- }
-
-
- # If an explicit version was selected
- # put it in M4_cont_projects else remove
- # explicit versions of this project from
- # M4_cont_projects.
- #
- method ContChangeProjectVersionDialog::handleOk {this} {
- # construct list from M4_cont_projects without version specification
- # of current project
- set newList ""
- if { [$this currentVersion] != "" } {
- regsub {\-[^-]*$} [$this currentVersion] "" project
- foreach projectVersion [m4_var get M4_cont_projects] {
- regexp {(.*)-([^-]*)$} $projectVersion \
- dummy selectedProject selectedVersion
- if { $selectedProject != $project } {
- append newList " $projectVersion"
- }
- }
- }
-
- if [$this.col.explicit state] {
- append newList " [lindex [$this.col.versions selectedSet] 0]"
- }
-
- m4_var set M4_cont_projects [string trim $newList]
- [$this currentSystem] updatePath
- .main updateView
- $this delete
- }
-
- # Do not delete this line -- regeneration end marker
-
-