home *** CD-ROM | disk | FTP | other *** search
- #---------------------------------------------------------------------------
- #
- # (c) Cadre Technologies Inc. 1996
- #
- # File: %W%
- # Author: edri
- # Description: Instantiation of the Repository Tool and its views.
- #---------------------------------------------------------------------------
- # SccsId = %W% %G% Copyright 1996 Cadre Technologies Inc.
-
- OtkRegister::extGui
-
- source [m4_path_name tcl libocl.tcl]
-
- require platform.tcl
- require procs.tcl
- require systemutil.tcl
- require messagehdl.tcl
- require options.tcl
-
- # Options common to tool and views.
- #
- set reptoolOptions(-caller) {caller arg "" "caller of this tool"}
- set reptoolOptions(-levelPath) {levelPath arg "" "level path to use"}
- set reptoolOptions(-levelPathIds) {levelPathIds arg "" "level path ids to use"}
-
- if [catch {Options::parse reptool reptoolOptions argv} argError] {
- puts stderr $argError
- exit 1
- }
-
- if [lempty $argv] {
- # Main tool should be started.
- #
- require reptool.tcl
-
- # Don't need client context in main tool, but save it for views.
- #
- set levelPath [m4_var get M4_levelpath]
- m4_var set M4_levelpath ""
-
- set levelPathIds [m4_var get M4_levelpath_ids]
- m4_var set M4_levelpath_ids ""
-
- set repTool RepTool
- sourceOptional u_reptool
-
- RepTool new .main \
- -caller $caller \
- -levelPath $levelPath \
- -levelPathIds $levelPathIds
-
- } else {
- # The view specified by $argv should be started.
- # Allow unique abbreviations of the Tcl file name.
- #
- set tool [lindex $argv 0]
- switch -glob -- $tool {
- co* { set tool corpmanvie.tcl }
- u* { set tool userenvvie.tcl }
- lo* { set tool lockmanvie.tcl }
- cs* { set tool csconfigvi.tcl }
- }
- require $tool
-
- # Call this here now, so that otk does not get the error (and then
- # refuses to start up).
- #
- catch {ClientContext::global} contextError
-
- # Read level path from environment if not yet set.
- #
- if {$levelPath == "" && [m4_var get M4_levelpath] != ""} {
- set levelPath [m4_var get M4_levelpath]
- }
- if {$levelPathIds == "" && [m4_var get M4_levelpath_ids] != ""} {
- set levelPathIds [m4_var get M4_levelpath_ids]
- }
-
- # Sourced view file defines a static proc repToolClass which returns the
- # class name of the view.
- #
- set repTool [[info commands *::repToolClass]]
- sourceOptional u_reptool
-
- $repTool new .main \
- -caller $caller \
- -levelPath $levelPath \
- -levelPathIds $levelPathIds \
- -contextError $contextError
- }
-
- .main popUp
- .main ready
-