home *** CD-ROM | disk | FTP | other *** search
- #---------------------------------------------------------------------------
- #
- # (c) Cayenne Software Inc. 1997
- #
- # File: @(#)vssysdialo.tcl /main/titanic/4
- # Author: <generated>
- # Description:
- #---------------------------------------------------------------------------
- # SccsId = @(#)vssysdialo.tcl /main/titanic/4 21 May 1997 Copyright 1997 Cayenne Software Inc.
-
- # Start user added include file section
- # End user added include file section
-
-
- # This class provides basic functionality for dialogs that result
- # in VS files being processed.
-
- Class VSSysDialog : {Object} {
- constructor
- method destructor
- method processFiles
- method selectionDescription
-
- # Indicates whether the browser view must be updated after this action.
- #
- attribute needsUpdate
-
- # The selected files.
- #
- attribute selectedFiles
-
- # This script is evaluated for each selected file.
- #
- attribute vsMethod
- }
-
- constructor VSSysDialog {class this name} {
- set this [Object::constructor $class $this $name]
- $this needsUpdate 1
- # Start constructor user section
- # End constructor user section
- return $this
- }
-
- method VSSysDialog::destructor {this} {
- # Start destructor user section
- # End destructor user section
- }
-
-
- # Process the selected files: evaluate vsMethod for
- # each selectedFile.
- #
- method VSSysDialog::processFiles {this} {
- busy {
- vsCommandHandler suspendOutput
- set allOk 1
- set someOk 0
-
- foreach file [$this selectedFiles] {
- if { ![eval [$this vsMethod]] } {
- set allOk 0
- break
- }
- set someOk 1
- }
-
- vsCommandHandler showOutput
-
- if { [$this needsUpdate] && $someOk } {
- .main updateView
- }
- wmtkmessage ""
-
- # if there were no errors delete the dialog
- if $allOk {
- $this delete
- }
- }
- }
-
-
- # Return description of the selected files.
- #
- method VSSysDialog::selectionDescription {this} {
- if { [llength [$this selectedFiles]] > 1 } {
- return "selected objects"
- }
-
- set selectedFile [lindex [$this selectedFiles] 0]
- return [file tail [$selectedFile path]]
- }
-
- # Do not delete this line -- regeneration end marker
-
-