home *** CD-ROM | disk | FTP | other *** search
- #---------------------------------------------------------------------------
- #
- # (c) Cayenne Software Inc. 1996
- #
- # File: @(#)lockfiltdi.tcl /main/titanic/5
- # Author: <generated>
- # Description:
- #---------------------------------------------------------------------------
- # SccsId = @(#)lockfiltdi.tcl /main/titanic/5 22 Jul 1997 Copyright 1996 Cadre Technologies Inc.
-
- # Start user added include file section
- # End user added include file section
-
- require "reptooldia.tcl"
-
- Class LockFiltDialog : {RepToolDialog} {
- constructor
- method destructor
- method setObject
- method setClient
- method setFields
- method getFields
- method ok
- method cancel
- method apply
- method clear
- attribute cacheLocksEnabled
- }
-
- constructor LockFiltDialog {class this name view} {
- set this [RepToolDialog::constructor $class $this $name $view]
- # Start constructor user section
-
- $this cacheLocksEnabled 0
- if {[m4_var get M4_reptool_cachelocks] == "1"} {
- $this cacheLocksEnabled 1
- }
-
- interface DlgColumn $this.gui {
- verStretchFactor 0
- DlgRow t {
- NamedGroup t {
- label "Lock Types"
- DlgColumn t {
- CheckButton read {
- label "Read Locks"
- }
- CheckButton write {
- label "Write Locks"
- }
- }
- }
- NamedGroup h {
- label "Hanging Locks"
- CheckButton hanging {
- label "Select Only Hanging Locks"
- }
- }
- }
- NamedGroup a {
- label "Lock Attributes"
- DlgRow a {
- DlgColumn a {
- 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 { 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."
- }
- }
- }
- }
- }
-
- # Don't allow both buttons to be deselected.
- # (Easiest fix for bug 111587)
- #
- $this.gui.t.t.t.read stateChanged "
- set readState \[$this.gui.t.t.t.read state]
- set writeState \[$this.gui.t.t.t.write state]
- if {\$readState == \"0\" && \$writeState == \"0\"} {
- $this.gui.t.t.t.read state 1
- }
- "
- $this.gui.t.t.t.write stateChanged "
- set readState \[$this.gui.t.t.t.read state]
- set writeState \[$this.gui.t.t.t.write state]
- if {\$readState == \"0\" && \$writeState == \"0\"} {
- $this.gui.t.t.t.write state 1
- }
- "
-
- $this.gui.a.a.dropZone view [$this view]
- $this.gui.a.a.dropZone droppedObject "$this setObject"
- $this.gui.a.a.dropZone droppedClient "$this setClient"
- if $win95 {
- $this.gui.a.a.dropZone columnCount 15
- }
-
- if [$this cacheLocksEnabled] {
- interface CheckButton $this.gui.t.t.t.cache_n {
- label "Normal Cache Locks"
- }
- interface CheckButton $this.gui.t.t.t.cache_r {
- label "MustRefresh Cache Locks"
- }
- interface CheckButton $this.gui.t.t.t.cache_s {
- label "Save Cache Locks"
- }
- }
-
- $this config \
- -title "Change Lock Filter" \
- -modal 0 \
- -okPressed { %this ok } \
- -helpPressed "[$this view] helpOnName changeLockFilter"
-
- PushButton new $this.apply \
- -label "Apply" \
- -activated "$this apply"
-
- PushButton new $this.clear \
- -label "Clear" \
- -activated "$this clear"
-
- $this setFields
-
- # End constructor user section
- return $this
- }
-
- method LockFiltDialog::destructor {this} {
- # Start destructor user section
- # End destructor user section
- $this RepToolDialog::destructor
- }
-
- method LockFiltDialog::setObject {this objId} {
- $this.gui.a.a.a.object.object text $objId
- }
-
- method LockFiltDialog::setClient {this context} {
- $this.gui.a.a.a.host.host text [lindex $context 0]
- $this.gui.a.a.a.pid.pid intValue [lindex $context 1]
- $this.gui.a.a.a.user.user text [lindex $context 2]
- }
-
- method LockFiltDialog::setFields {this} {
- set f [[$this view] filter]
-
- set lockType [$f lockType]
- if {[string first a $lockType] != -1} {
- set readState 1
- set writeState 1
- set cacheNState 1
- set cacheRState 1
- set cacheSState 1
- } else {
- set readState 0
- set writeState 0
- set cacheNState 0
- set cacheRState 0
- set cacheSState 0
- }
- if {[string first r $lockType] != -1} {
- set readState 1
- }
- if {[string first w $lockType] != -1} {
- set writeState 1
- }
- if {[string first c $lockType] != -1} {
- set cacheNState 1
- }
- if {[string first f $lockType] != -1} {
- set cacheRState 1
- }
- if {[string first s $lockType] != -1} {
- set cacheSState 1
- }
-
- $this.gui.t.h.hanging state [$f lockHanging]
-
- $this.gui.t.t.t.read state $readState
- $this.gui.t.t.t.write state $writeState
-
- if [$this cacheLocksEnabled] {
- $this.gui.t.t.t.cache_n state $cacheNState
- $this.gui.t.t.t.cache_r state $cacheRState
- $this.gui.t.t.t.cache_s state $cacheSState
- }
-
- $this.gui.a.a.a.object.object text [$f lockObject]
- $this.gui.a.a.a.host.host text [$f lockHost]
- $this.gui.a.a.a.user.user text [$f lockUser]
- if {[$f lockPid] != ""} {
- $this.gui.a.a.a.pid.pid intValue [$f lockPid]
- } else {
- $this.gui.a.a.a.pid.pid intValue -1
- }
- $this.gui.a.a.a.reason.reason text [$f lockReason]
- }
-
- method LockFiltDialog::getFields {this} {
- set f [[$this view] filter]
-
- set lockType ""
- if [$this.gui.t.t.t.read state] {
- append lockType r
- }
- if [$this.gui.t.t.t.write state] {
- append lockType w
- }
-
- if [$this cacheLocksEnabled] {
- if [$this.gui.t.t.t.cache_n state] {
- append lockType c
- }
- if [$this.gui.t.t.t.cache_r state] {
- append lockType f
- }
- if [$this.gui.t.t.t.cache_s state] {
- append lockType s
- }
- }
-
- if {$lockType == "rwcfs"} {
- set lockType a
- }
-
- $f lockType $lockType
- $f lockHanging [$this.gui.t.h.hanging state]
- $f lockObject [$this.gui.a.a.a.object.object text]
- $f lockHost [$this.gui.a.a.a.host.host text]
- $f lockUser [$this.gui.a.a.a.user.user text]
-
- if {[$this.gui.a.a.a.pid.pid text] == ""} {
- $f lockPid -1
- } else {
- $f lockPid [$this.gui.a.a.a.pid.pid intValue]
- }
-
- $f lockReason [$this.gui.a.a.a.reason.reason text]
-
- $f changed
- }
-
- method LockFiltDialog::ok {this} {
- $this apply
- [[$this view] filter] save
- }
-
- method LockFiltDialog::cancel {this} {
- [[$this view] filter] load
- $this setFields
- [$this view] update
- }
-
- method LockFiltDialog::apply {this} {
- $this getFields
- [$this view] update
- }
-
- method LockFiltDialog::clear {this} {
- [[$this view] filter] clear
- $this setFields
- }
-
- # Do not delete this line -- regeneration end marker
-
-