home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1998 October
/
PCWorld_1998-10_cd.bin
/
software
/
prehled
/
komix
/
DATA.Z
/
setlockdia.tcl
< prev
next >
Wrap
Text File
|
1997-07-22
|
5KB
|
192 lines
#---------------------------------------------------------------------------
#
# (c) Cadre Technologies Inc. 1996
#
# File: @(#)setlockdia.tcl /main/titanic/6
# Author: <generated>
# Description:
#---------------------------------------------------------------------------
# SccsId = @(#)setlockdia.tcl /main/titanic/6 22 Jul 1997 Copyright 1996 Cadre Technologies Inc.
# Start user added include file section
require "lockbrtabl.tcl"
# End user added include file section
require "reptooldia.tcl"
Class SetLockDialog : {RepToolDialog} {
constructor
method destructor
method setObject
method setClient
method ok
method cancel
}
constructor SetLockDialog {class this name view} {
set this [RepToolDialog::constructor $class $this $name $view]
# Start constructor user section
interface DlgColumn $this.gui {
DlgRow type {
Label l { text "Lock Type" }
OptionMenu type {
horStretchFactor 100
entrySet {
writeLock
readLock
}
}
}
DlgRow attr {
DlgColumn attr {
DlgRow object {
Label l { text "Object Id" }
SingleLineText object {
columnCount 35
}
}
DlgRow host {
Label l { text "Host" }
SingleLineText host {
columnCount 35
}
}
DlgRow user {
Label l { text "User" }
SingleLineText user {
columnCount 35
}
}
DlgRow pid {
Label l { text "Process Id" }
IntField pid {
intValue -1
columnCount 35
}
}
DlgRow reason {
Label l { text "Reason" }
SingleLineText reason {
columnCount 35
}
}
}
LockBrTable dropZone {
mode ICON
selectionPolicy BROWSE
selectionChanged { %this selectedSet {} }
BrowsObject o {
largeIcon rep_lock_32
label "Drop\nbrowser\nor client\nobjects\nhere."
}
}
}
}
$this.gui.attr.dropZone view [$this view]
if $win95 {
$this.gui.attr.dropZone columnCount 15
}
$this config \
-title "New Lock" \
-okPressed { %this ok } \
-cancelPressed { %this cancel } \
-helpPressed { [%this view] helpOnName newLock }
# End constructor user section
return $this
}
method SetLockDialog::destructor {this} {
# Start destructor user section
# End destructor user section
$this RepToolDialog::destructor
}
method SetLockDialog::setObject {this objId} {
$this.gui.attr.attr.object.object text $objId
}
method SetLockDialog::setClient {this context} {
$this.gui.attr.attr.host.host text [lindex $context 0]
$this.gui.attr.attr.pid.pid intValue [lindex $context 1]
$this.gui.attr.attr.user.user text [lindex $context 2]
set levelPath [lindex $context 3]
if {$levelPath != ""} {
set path [LevelPath new $levelPath]
set obj [$path nameAt [$path depth]]
if [catch {ORB::decodeObjectId $obj}] {
# The path is a path with object names.
# Use client context to resolve it into object ids.
#
set cc [ClientContext::global]
$cc notifyDisable
if ![catch {
set old [$cc currentLevelIdString]
$cc setLevelPath $levelPath
set objectId [[$cc currentLevelId] identity]
$cc setLevelIds $old
}] {
$this setObject $objectId
}
$cc notifyEnable
} else {
# The path is a path with object ids.
#
$this setObject $obj
}
}
}
method SetLockDialog::ok {this} {
[$this view] setLockPoppedUp 0
set new [LockDescription new]
# Only set those fields of the description that have been entered in
# the dialog. Let setLock give error if description is incomplete.
#
set objId [$this.gui.attr.attr.object.object text]
if {$objId != "" && $objId != [[ORB::nil] identity]} {
$new setObject $objId
}
$new addType [LockFilter::lock2descType \
[$this.gui.type.type selected]]
set host [$this.gui.attr.attr.host.host text]
if {$host != ""} {
$new setHost $host
}
set user [$this.gui.attr.attr.user.user text]
if {$user != ""} {
$new setUser $user
}
set pid [$this.gui.attr.attr.pid.pid intValue]
if {$pid != "" && $pid != -1} {
$new setPid $pid
}
set reason [$this.gui.attr.attr.reason.reason text]
if {$reason != ""} {
$new setReason $reason
}
[[$this view] rep] setLock $new
[$this view] update
}
method SetLockDialog::cancel {this} {
[$this view] setLockPoppedUp 0
}
# Do not delete this line -- regeneration end marker