--- Smbshare.tcl Mon May 18 02:10:37 1998 +++ Smbshare.tcl.my Thu May 21 15:41:47 1998 @@ -126,6 +126,22 @@ } +## function to unmount mounted volumes +proc smbshare.unmountvol {filename} { + global smbdir + + set smbumount $smbdir/smbumount + set filename [tilde $filename] + + ## make sure the needed parameters are set + if {[string compare $filename ""] == 0} {return} + + if {[debug]} {puts "execing: $smbumount $filename"} + catch {exec $smbumount $filename} result + + puts $result +} + ## function to build window to mount volumes proc smbshare.mountwindow {server} { @@ -217,9 +233,12 @@ #message $w.fframe.file -width 200 -relief sunken -text "" entry $w.fframe.file -width 20 -relief sunken -textvariable file \ -exportselection 0 - label $w.fframe.label -text "Mount Point: " + label $w.fframe.label -text "Un/Mount Point: " button $w.mount -text "Mount" -command \ "smbshare.mountvol $guestflag \"$username\" \"$password\" \"$machine\" \$file" + button $w.unmount -text "Unmount" -command \ + "smbshare.unmountvol \$file" + button $w.cancel -text "Close" -command "destroy $w" pack $w.lframe.volumes -side left @@ -232,6 +251,7 @@ pack $w.fframe pack $w.cancel -side left -anchor s -padx 10 -pady 10 pack $w.mount -side right -anchor s -padx 10 -pady 10 + pack $w.unmount -side right -anchor s -padx 1 -pady 10 bind $w.fframe.file "$w.mount invoke"