home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 2000 December
/
PCWorld_2000-12_cd.bin
/
Komunikace
/
Comanche
/
plugins
/
test
/
test.tcl
< prev
Wrap
Text File
|
2000-11-02
|
3KB
|
90 lines
# edit /etc/resolv.conf for nameserver (dns) settings
# 12/29/1999 Stew Benedict stewb@earthlink.net
class nameserversPlugIn {
inherit basePlugIn
variable nameserversXuiPP
variable domainEntry
variable nameserver1Entry
variable nameserver2Entry
variable nameserver3Entry
variable nameserversNodeId
constructor {} {
set nameserversXuiPP [::libgui::createXuiFromFile $::test::pp]
}
method init { args }
method _inquiryForRightPaneContent { node }
method _inquiryForPropertyPages { node }
method _receivedPropertyPages { node xuiPropertyPages}
}
# args contains the options that are passed to the plugIn at initialization
# time.
#
# -namespace contains the name of the name space server
body nameserversPlugIn::init {args} {
# We are hooking to the root node
# The ::plugInUtils::addNode syntaxis is the following
# ::plugInUtils::addNode caller namespace parentNode
# where
# caller: Name of the object that is adding the node (the plugIn object)
# namespace: Namespace where we are adding the node
# parentNode: Parent node
#
# The list of available icons is in view/images.tcl
array set options $args
set namespace $options(-namespace)
set parentNode [[ $namespace getRootNode] getId]
set nameserversNode [::plugInUtils::addNode $this $namespace $parentNode \
-classes {nameservers leaf} \
-openIcon network \
-closedIcon network \
-label [mesg::get nameservers_settings]]
set nameserversNodeId [$nameserversNode getId]
}
body nameserversPlugIn::_inquiryForRightPaneContent { node } {
global tcl_platform
if {$tcl_platform(platform) == "windows"} {
set result [mesg::get nameservers_right_pane_windows]
} else {
set result [mesg::get nameservers_right_pane]
set inhdl [open /etc/resolv.conf r]
while { [gets $inhdl buff] >= 0 } {
append result " <BR><b>$buff</b>"
}
close $inhdl
}
return $result
}
body nameserversPlugIn::_inquiryForPropertyPages { node } {
global tcl_platform
# if {$tcl_platform(platform) == "windows"} {
# return
# } else {
$nameserversXuiPP.domainEntry setValue "test domain"
$nameserversXuiPP.nameserver1Entry setValue "test nameserver1"
$nameserversXuiPP.nameserver2Entry setValue "test nameserver2"
$nameserversXuiPP.nameserver3Entry setValue "test nameserver3"
#}
return $nameserversXuiPP
}
body nameserversPlugIn::_receivedPropertyPages { node xuiPropertyPages } {
set pp [$xuiPropertyPages getComponentByName nameserversPP]
set newDomain [[$pp getComponentByName domain] getValue]
#catch {exec nameservers $newHostname}
}