home *** CD-ROM | disk | FTP | other *** search
- #---------------------------------------------------------------------------
- #
- # (c) Cayenne Software Inc. 1997
- #
- # File: @(#)msrepchoos.tcl /main/hindenburg/5
- # Author: <generated>
- # Description:
- #---------------------------------------------------------------------------
- # SccsId = @(#)msrepchoos.tcl /main/hindenburg/5 15 May 1997 Copyright 1997 Cayenne Software Inc.
-
- # Start user added include file section
- # End user added include file section
-
-
- Class MsRepChooser : {FileChooser} {
- method destructor
- constructor
- method handleOk
- method hasUml
- attribute repName
- attribute msRep
- attribute root
- attribute repFound
- attribute userName
- attribute password
- }
-
- method MsRepChooser::destructor {this} {
- # Start destructor user section
- set msRep [$this msRep]
- if [llength $msRep] {
- $msRep delete
- }
- set root [$this root]
- if [llength $root] {
- $root delete
- }
- # End destructor user section
- }
-
- constructor MsRepChooser {class this name userName password} {
- set this [FileChooser::constructor $class $this $name]
- $this userName $userName
- $this password $password
- # Start constructor user section
- $this config \
- -okPressed "$this handleOk" \
- -cancelPressed "$this delete" \
- -selectionPolicy SINGLE \
- -filter "*.mdb"
- $this msRep [OleAutoObject new ObjectTeamMsRepUml.MSRepository]
- $this repFound 0
- # End constructor user section
- return $this
- }
-
- method MsRepChooser::handleOk {this} {
- set selectedMdb [lindex [$this selectedSet] 0]
- #$this repName "DBQ=$selectedMdb"
- $this repName $selectedMdb
- set root [$this root]
- if [llength $root] {
- $root delete
- }
- if [catch {set root [[$this msRep] openDB [$this repName]]}] {
- $this repFound 0
- } else {
- $this repFound 1
- }
- $this root $root
- }
-
- method MsRepChooser::hasUml {this} {
- set root [$this root]
- if ![llength $root] {
- return 0
- }
- if [$root hasTypeLib "UML Type Information Model"] {
- return 1
- }
- if [$root hasTypeLib UML] {
- return 1
- }
- return 0
- }
-
- # Do not delete this line -- regeneration end marker
-
-