home *** CD-ROM | disk | FTP | other *** search
- #---------------------------------------------------------------------------
- #
- # (c) Cayenne Software Inc. 1996
- #
- # File: @(#)csclientno.tcl /main/titanic/11
- # Author: <generated>
- # Description:
- #---------------------------------------------------------------------------
- # SccsId = @(#)csclientno.tcl /main/titanic/11 5 Nov 1997 Copyright 1996 Cayenne Software Inc.
-
- # Start user added include file section
- # End user added include file section
-
- require "csprocessn.tcl"
-
- Class CSClientNode : {CSProcessNode} {
- constructor
- method destructor
- method context
- method removeEntry
- method doRemove
- method simplifyCommandLine
- method doUpdate
- attribute client
- }
-
- constructor CSClientNode {class this name i_client} {
- set this [CSProcessNode::constructor $class $this $name]
- $this client $i_client
- # Start constructor user section
-
- $this process $i_client
- $this label [$i_client owner]@[$i_client host]
- $this hasChildren 0
-
- $this canDelete 1
-
- if {[$i_client host] == [ORB::currentHost] &&
- [$i_client pid] == [ORB::currentProcessId]} {
- $this icon rep_clself_16
- $this activeIcon rep_clself_16
- } else {
- $this icon rep_client_16
- $this activeIcon rep_client_16
- }
-
- # Allow clients to be dropped in the lock list of the
- # Lock Management window, to initialize the "Set Lock..."
- # dialog with this client's host, pid and user.
- #
- $this conversionSet "CSCLIENTNODE context"
-
- # End constructor user section
- return $this
- }
-
- method CSClientNode::destructor {this} {
- # Start destructor user section
- # End destructor user section
- $this CSProcessNode::destructor
- }
-
- method CSClientNode::context {this} {
- set client [$this client]
- set cmd [$client commandLine]
-
- set object ""
- if {[string first ude.tcl $cmd] != -1} {
- set cmdLen [llength $cmd]
- incr cmdLen -1
- set object [lindex $cmd $cmdLen]
- }
-
- return [list [$client host] [$client pid] [$client owner] $object]
- }
-
- method CSClientNode::removeEntry {this} {
- set dlg [YesNoWarningDialog new [$this view].removeclientconfirm \
- -title "Confirm Client Registration Delete" \
- -message "Are you sure you want to delete the registration of client\
- '[$this name]'?" \
- -yesPressed "$this doRemove" \
- -helpPressed "[$this view] helpOnName deleteClientNode"]
-
- $dlg delCancelButton
- $dlg popUp
- }
-
- method CSClientNode::doRemove {this} {
- set view [$this view]
- [[$this client] server] disconnect [$this client]
- [$this parent] update 1
- $view selectionChanged
- }
-
- method CSClientNode::simplifyCommandLine {this cmdLine} {
- if [lempty $cmdLine] {
- return ""
- }
-
- protect_backslashes cmdLine {
- # Try to show "M4_home" instead of actual path.
- #
- set m4home [m4_var get M4_home]
- if $win95 {
- set m4homeName {%M4_home%}
- } else {
- set m4homeName {$M4_home}
- }
-
- set newCmdLine ""
- foreach part $cmdLine {
- protect_backslashes {m4home} {
- regsub -all $m4home $part $m4homeName part
- }
- if [string length $newCmdLine] {
- append newCmdLine " "
- }
- append newCmdLine $part
- }
- set cmdLine $newCmdLine
- }
-
- return $cmdLine
- }
-
- method CSClientNode::doUpdate {this {rebuild 1}} {
- $this CSProcessNode::doUpdate $rebuild
-
- set info [$this info]
- set client [$this client]
-
- $info addHeader "Client"
- set cmdLine [$this simplifyCommandLine [$client commandLine]]
- $info addItem "Of Server" [[$client server] name]
- if {$cmdLine != ""} {
- $info addItem "Command Line" $cmdLine
- }
- }
-
- # Do not delete this line -- regeneration end marker
-
-