| 1 | /*:VRX         Main
 | 
|---|
| 2 | */
 | 
|---|
| 3 | /*  Main
 | 
|---|
| 4 | */
 | 
|---|
| 5 | Main:
 | 
|---|
| 6 | /*
 | 
|---|
| 7 |     Samba Connections GUI for OS/2 based systems
 | 
|---|
| 8 |     Copyright (C) 2007-2016 by Alexander Taylor and Herwig Bauernfeind
 | 
|---|
| 9 |     Derived works must contain this copyright notice.
 | 
|---|
| 10 | 
 | 
|---|
| 11 |     This program is free software: you can redistribute it and/or modify
 | 
|---|
| 12 |     it under the terms of the GNU General Public License as published by
 | 
|---|
| 13 |     the Free Software Foundation, either version 3 of the License, or
 | 
|---|
| 14 |     (at your option) any later version.
 | 
|---|
| 15 | 
 | 
|---|
| 16 |     This program is distributed in the hope that it will be useful,
 | 
|---|
| 17 |     but WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
|---|
| 18 |     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 | 
|---|
| 19 |     GNU General Public License for more details.
 | 
|---|
| 20 | 
 | 
|---|
| 21 |     You should have received a copy of the GNU General Public License
 | 
|---|
| 22 |     along with this program.  If not, see <http://www.gnu.org/licenses/>.
 | 
|---|
| 23 | */
 | 
|---|
| 24 | /*  Process the arguments.
 | 
|---|
| 25 |     Get the parent window.
 | 
|---|
| 26 | */
 | 
|---|
| 27 |     parse source . calledAs .
 | 
|---|
| 28 |     parent = ""
 | 
|---|
| 29 |     argCount = arg()
 | 
|---|
| 30 |     argOff = 0
 | 
|---|
| 31 |     if( calledAs \= "COMMAND" )then do
 | 
|---|
| 32 |         if argCount >= 1 then do
 | 
|---|
| 33 |             parent = arg(1)
 | 
|---|
| 34 |             argCount = argCount - 1
 | 
|---|
| 35 |             argOff = 1
 | 
|---|
| 36 |         end
 | 
|---|
| 37 |     end; else do
 | 
|---|
| 38 |         call VROptions 'ImplicitNames'
 | 
|---|
| 39 |         call VROptions 'NoEchoQuit'
 | 
|---|
| 40 |     end
 | 
|---|
| 41 |     InitArgs.0 = argCount
 | 
|---|
| 42 |     if( argCount > 0 )then do i = 1 to argCount
 | 
|---|
| 43 |         InitArgs.i = arg( i + argOff )
 | 
|---|
| 44 |     end
 | 
|---|
| 45 |     drop calledAs argCount argOff
 | 
|---|
| 46 | 
 | 
|---|
| 47 | /*  Load the windows
 | 
|---|
| 48 | */
 | 
|---|
| 49 |     call VRInit
 | 
|---|
| 50 |     parse source . . spec
 | 
|---|
| 51 |     _VREPrimaryWindowPath = ,
 | 
|---|
| 52 |         VRParseFileName( spec, "dpn" ) || ".VRW"
 | 
|---|
| 53 |     _VREPrimaryWindow = ,
 | 
|---|
| 54 |         VRLoad( parent, _VREPrimaryWindowPath )
 | 
|---|
| 55 |     drop parent spec
 | 
|---|
| 56 |     if( _VREPrimaryWindow == "" )then do
 | 
|---|
| 57 |         call VRMessage "", "Cannot load window:" VRError(), ,
 | 
|---|
| 58 |             "Error!"
 | 
|---|
| 59 |         _VREReturnValue = 32000
 | 
|---|
| 60 |         signal _VRELeaveMain
 | 
|---|
| 61 |     end
 | 
|---|
| 62 | 
 | 
|---|
| 63 | /*  Process events
 | 
|---|
| 64 | */
 | 
|---|
| 65 |     call Init
 | 
|---|
| 66 |     signal on halt
 | 
|---|
| 67 |     do while( \ VRGet( _VREPrimaryWindow, "Shutdown" ) )
 | 
|---|
| 68 |         _VREEvent = VREvent()
 | 
|---|
| 69 |         interpret _VREEvent
 | 
|---|
| 70 |     end
 | 
|---|
| 71 | _VREHalt:
 | 
|---|
| 72 |     _VREReturnValue = Fini()
 | 
|---|
| 73 |     call VRDestroy _VREPrimaryWindow
 | 
|---|
| 74 | _VRELeaveMain:
 | 
|---|
| 75 |     call VRFini
 | 
|---|
| 76 | exit _VREReturnValue
 | 
|---|
| 77 | 
 | 
|---|
| 78 | VRLoadSecondary:
 | 
|---|
| 79 |     __vrlsWait = abbrev( 'WAIT', translate(arg(2)), 1 )
 | 
|---|
| 80 |     if __vrlsWait then do
 | 
|---|
| 81 |         call VRFlush
 | 
|---|
| 82 |     end
 | 
|---|
| 83 |     __vrlsHWnd = VRLoad( VRWindow(), VRWindowPath(), arg(1) )
 | 
|---|
| 84 |     if __vrlsHWnd = '' then signal __vrlsDone
 | 
|---|
| 85 |     if __vrlsWait \= 1 then signal __vrlsDone
 | 
|---|
| 86 |     call VRSet __vrlsHWnd, 'WindowMode', 'Modal'
 | 
|---|
| 87 |     __vrlsTmp = __vrlsWindows.0
 | 
|---|
| 88 |     if( DataType(__vrlsTmp) \= 'NUM' ) then do
 | 
|---|
| 89 |         __vrlsTmp = 1
 | 
|---|
| 90 |     end
 | 
|---|
| 91 |     else do
 | 
|---|
| 92 |         __vrlsTmp = __vrlsTmp + 1
 | 
|---|
| 93 |     end
 | 
|---|
| 94 |     __vrlsWindows.__vrlsTmp = VRWindow( __vrlsHWnd )
 | 
|---|
| 95 |     __vrlsWindows.0 = __vrlsTmp
 | 
|---|
| 96 |     do while( VRIsValidObject( VRWindow() ) = 1 )
 | 
|---|
| 97 |         __vrlsEvent = VREvent()
 | 
|---|
| 98 |         interpret __vrlsEvent
 | 
|---|
| 99 |     end
 | 
|---|
| 100 |     __vrlsTmp = __vrlsWindows.0
 | 
|---|
| 101 |     __vrlsWindows.0 = __vrlsTmp - 1
 | 
|---|
| 102 |     call VRWindow __vrlsWindows.__vrlsTmp
 | 
|---|
| 103 |     __vrlsHWnd = ''
 | 
|---|
| 104 | __vrlsDone:
 | 
|---|
| 105 | return __vrlsHWnd
 | 
|---|
| 106 | 
 | 
|---|
| 107 | /*:VRX         __VXREXX____APPENDS__
 | 
|---|
| 108 | */
 | 
|---|
| 109 | __VXREXX____APPENDS__:
 | 
|---|
| 110 | /*
 | 
|---|
| 111 | #append ..\shared\browse.vrs
 | 
|---|
| 112 | #append ..\shared\cltinit.vrs
 | 
|---|
| 113 | #append ..\shared\inittempdir.vrs
 | 
|---|
| 114 | #append ..\shared\nlv.vrs
 | 
|---|
| 115 | #append ..\shared\rexx_md5.vrs
 | 
|---|
| 116 | #append ..\shared\smbtree.vrs
 | 
|---|
| 117 | #append ..\shared\textini.vrs
 | 
|---|
| 118 | #append ..\shared\usercredmem.vrs
 | 
|---|
| 119 | #append ..\shared\rxrpclib.vrs
 | 
|---|
| 120 | */
 | 
|---|
| 121 | return
 | 
|---|
| 122 | /*:VRX         _AboutSambaClientGetInfo
 | 
|---|
| 123 | */
 | 
|---|
| 124 | _AboutSambaClientGetInfo:
 | 
|---|
| 125 |     call VRSet "SW_ABOUT", "Painting", 0
 | 
|---|
| 126 |     BR = ''
 | 
|---|
| 127 | 
 | 
|---|
| 128 |     ok = VRMethod( "CN_About", "RemoveRecord", "All" )
 | 
|---|
| 129 | 
 | 
|---|
| 130 |     /* OS Version */
 | 
|---|
| 131 |     if VRFileExists(SysBootDrive()||"\SYS\INSTALL\INSTALL.FLG" ) then do
 | 
|---|
| 132 |         OS = linein(SysBootDrive()||"\SYS\INSTALL\INSTALL.FLG")
 | 
|---|
| 133 |         OS = subword(OS,1,2) '('translate(word(OS,3))')'
 | 
|---|
| 134 |         ok = stream(SysBootDrive()||"\SYS\INSTALL\INSTALL.FLG",'c','close')
 | 
|---|
| 135 |     end
 | 
|---|
| 136 |     else if VRFileExists(SysBootDrive()||"\ECS\ECS_INST.FLG" ) then do
 | 
|---|
| 137 |         OS = linein(SysBootDrive()||"\ECS\ECS_INST.FLG")
 | 
|---|
| 138 |         OS = subword(OS,1,3)
 | 
|---|
| 139 |         ok = stream(SysBootDrive()||"\ECS\ECS_INST.FLG",'c','close')
 | 
|---|
| 140 |     end
 | 
|---|
| 141 |     else OS = "OS/2 Warp/eComStation 1.x"
 | 
|---|
| 142 | 
 | 
|---|
| 143 |     DummyRH = VRMethod('CN_About', 'AddRecord')
 | 
|---|
| 144 |     ok = VRMethod("CN_ABOUT", "SetFieldData", DummyRH, About.DscFH, "Operating system", About.ValFH, OS)
 | 
|---|
| 145 | 
 | 
|---|
| 146 |     /* Filesystem version */
 | 
|---|
| 147 |     DummyRH = VRMethod('CN_About', 'AddRecord')
 | 
|---|
| 148 |     ok = VRMethod("CN_ABOUT", "SetFieldData", DummyRH, About.DscFH, "File system", About.ValFH, fs.!name' Version 'fs.!version)
 | 
|---|
| 149 |     ABoutStr = "Samba Client Versions:"||BR
 | 
|---|
| 150 |     AboutStr = AboutStr||'0D0A'x||"File system "||'09'x||fs.!name' Version 'fs.!version||BR
 | 
|---|
| 151 |     plugindll. =""
 | 
|---|
| 152 | 
 | 
|---|
| 153 |     /* Plugin */
 | 
|---|
| 154 |     address cmd 'look4dll.exe ndpsmb.dll >'samba.!msg
 | 
|---|
| 155 |     if RC <> 0 then do
 | 
|---|
| 156 |         /* Look4DLL not installed or failed, try fallback search */
 | 
|---|
| 157 |         if rc == 1041 then do   /* look4dll not found, use REXX-based search */
 | 
|---|
| 158 |             pluginpath = _DLLSearch('ndpsmb.dll')
 | 
|---|
| 159 |             if pluginpath <> '' then do
 | 
|---|
| 160 |                 plugindll.0 = 1
 | 
|---|
| 161 |                 plugindll.1 = pluginpath
 | 
|---|
| 162 |             end
 | 
|---|
| 163 |         end
 | 
|---|
| 164 |         else plugindll.0 = 0
 | 
|---|
| 165 |         /* DLL is not in libpath; as a last resort, check some well-known places */
 | 
|---|
| 166 |         if plugindll.0 < 1 then do
 | 
|---|
| 167 |             NDFSDir = value("NDFSDIR",,"OS2ENVIRONMENT")
 | 
|---|
| 168 |             if NDFSDir = "" then do
 | 
|---|
| 169 |                 OSDir = value("OSDIR",,"OS2ENVIRONMENT")
 | 
|---|
| 170 |                 if OSDir == '' then OSDir = SysBootDrive()'\os2'
 | 
|---|
| 171 |                 NDFSDir = OSDir'\dll'
 | 
|---|
| 172 |             end
 | 
|---|
| 173 |             ok = SysFileTree(NDFSDir'\ndpsmb.dll', "plugindll.", 'FOS')
 | 
|---|
| 174 |         end
 | 
|---|
| 175 |     end
 | 
|---|
| 176 |     else do
 | 
|---|
| 177 |         pluginline = linein(samba.!msg)
 | 
|---|
| 178 |         ok = stream(samba.!msg,'c','close')
 | 
|---|
| 179 |         ok = SysFileDelete(samba.!msg)
 | 
|---|
| 180 |         parse var pluginline . 'loaded ' pluginline
 | 
|---|
| 181 |         NDFSDir = VRParseFileName(pluginline,"DP")
 | 
|---|
| 182 |         plugindll.0 = 1
 | 
|---|
| 183 |         plugindll.1 = pluginline
 | 
|---|
| 184 |     end
 | 
|---|
| 185 | 
 | 
|---|
| 186 |     if plugindll.0 > 0 then do
 | 
|---|
| 187 |       do J = 1 to plugindll.0
 | 
|---|
| 188 |         DummyRH.1 = VRMethod('CN_About', 'AddRecord')
 | 
|---|
| 189 |         ok = VRMethod("CN_ABOUT", "SetFieldData", DummyRH.1, About.DscFH, "Plugin file", About.ValFH, plugindll.J)
 | 
|---|
| 190 |         AboutStr = AboutStr||'0D0A'x||"Plugin file "||'09'x||plugindll.J||BR
 | 
|---|
| 191 | 
 | 
|---|
| 192 |         address cmd 'bldlevel.exe 'plugindll.J' >'samba.!msg
 | 
|---|
| 193 | 
 | 
|---|
| 194 |         I = 0
 | 
|---|
| 195 |         Dummy = linein(samba.!msg)
 | 
|---|
| 196 |         say Dummy
 | 
|---|
| 197 |         Dummy = linein(samba.!msg)
 | 
|---|
| 198 |         say Dummy
 | 
|---|
| 199 |         Dummy = linein(samba.!msg)
 | 
|---|
| 200 |         say Dummy
 | 
|---|
| 201 |         do until lines(samba.!msg) = 0
 | 
|---|
| 202 |             I = I + 1
 | 
|---|
| 203 |             line.I = linein(samba.!msg)
 | 
|---|
| 204 |             if pos('has no LAN component-style version string', line.I) > 0 then do
 | 
|---|
| 205 |                 DummyRH = VRMethod('CN_About', 'AddRecord')
 | 
|---|
| 206 |                 ok = VRMethod("CN_ABOUT", "SetFieldData", DummyRH, About.DscFH, "Error", About.ValFH, "Plugin has no LAN component-style version string")
 | 
|---|
| 207 |                 leave
 | 
|---|
| 208 |             end
 | 
|---|
| 209 |             else do
 | 
|---|
| 210 |                 parse var line.I desc':'vers
 | 
|---|
| 211 |                 DummyRH = VRMethod('CN_About', 'AddRecord')
 | 
|---|
| 212 |                 ok = VRMethod("CN_ABOUT", "SetFieldData", DummyRH, About.DscFH, "Plugin "Desc, About.ValFH, strip(Vers))
 | 
|---|
| 213 |                 AboutStr = AboutStr||'0D0A'x||"Plugin "Desc '09'x||strip(Vers)||BR
 | 
|---|
| 214 |             end
 | 
|---|
| 215 |         end
 | 
|---|
| 216 |         line.0 = I
 | 
|---|
| 217 |         ok = stream(samba.!msg,'c','close')
 | 
|---|
| 218 |         ok = SysFileDelete(samba.!msg)
 | 
|---|
| 219 |       end
 | 
|---|
| 220 |     end
 | 
|---|
| 221 |     else do
 | 
|---|
| 222 |         DummyRH = VRMethod('CN_About', 'AddRecord')
 | 
|---|
| 223 |         ok = VRMethod("CN_ABOUT", "SetFieldData", DummyRH, About.DscFH, "Plugin", About.ValFH, "Not found!")
 | 
|---|
| 224 |         AboutStr = AboutStr||'0D0A'x||"Plugin not found!"||BR
 | 
|---|
| 225 |     end
 | 
|---|
| 226 | 
 | 
|---|
| 227 |     /* Commandline utilities */
 | 
|---|
| 228 |     address cmd samba.!smbclientexe' -V >'samba.!msg
 | 
|---|
| 229 |     ClutVer = linein(samba.!msg)
 | 
|---|
| 230 |     ok = stream(samba.!msg,'c','close')
 | 
|---|
| 231 |     ok = SysFileDelete(samba.!msg)
 | 
|---|
| 232 | 
 | 
|---|
| 233 |     DummyRH = VRMethod('CN_About', 'AddRecord')
 | 
|---|
| 234 |     ok = VRMethod("CN_ABOUT", "SetFieldData", DummyRH, About.DscFH, "Commandline utility path", About.ValFH, VRParseFileName(samba.!smbclientexe,"DP"))
 | 
|---|
| 235 | 
 | 
|---|
| 236 |     DummyRH = VRMethod('CN_About', 'AddRecord')
 | 
|---|
| 237 |     ok = VRMethod("CN_ABOUT", "SetFieldData", DummyRH, About.DscFH, "Commandline utilities", About.ValFH, ClutVer)
 | 
|---|
| 238 |     AboutStr = AboutStr||'0D0A'x||"Commandline utilities "||'09'x||ClutVer||BR
 | 
|---|
| 239 | 
 | 
|---|
| 240 |     /* GUI Version */
 | 
|---|
| 241 |     DummyRH = VRMethod('CN_About', 'AddRecord')
 | 
|---|
| 242 |     ok = VRMethod("CN_ABOUT", "SetFieldData", DummyRH, About.DscFH, options.!appname_long, About.ValFH, VRGet("Main", "HintText"))
 | 
|---|
| 243 |     AboutStr = AboutStr||'0D0A'x||"options.!appname_long "||'09'x || VRGet("Main", "HintText")||BR
 | 
|---|
| 244 |     call VRSet "SW_ABOUT", "Painting", 1
 | 
|---|
| 245 | return
 | 
|---|
| 246 | 
 | 
|---|
| 247 | /*:VRX         _AddTemplates
 | 
|---|
| 248 | */
 | 
|---|
| 249 | _AddTemplates:
 | 
|---|
| 250 |     VolTplRH = VRMethod("CN_CURRENT", 'AddRecord', , 'First', 'Volume template', icons.!template )
 | 
|---|
| 251 |     MpTplRH  = VRMethod("CN_CURRENT", 'AddRecord',  VolTplRH, 'First', 'Mountpoint template', icons.!template )
 | 
|---|
| 252 | return
 | 
|---|
| 253 | 
 | 
|---|
| 254 | /*:VRX         _ContainersInit
 | 
|---|
| 255 | */
 | 
|---|
| 256 | _ContainersInit:
 | 
|---|
| 257 |     if options.!debug == 1 then say time()' _ContainersInit started'
 | 
|---|
| 258 |     /* Connection details */
 | 
|---|
| 259 |     CD.StatusFH    = VRMethod( "CN_CONDET", "AddField", "Icon", "Status" )
 | 
|---|
| 260 |     CD.mpointFH    = VRMethod( "CN_CONDET", "AddField", "String", "mpoint" )
 | 
|---|
| 261 |     CD.mpidxFH     = VRMethod( "CN_CONDET", "AddField", "String", "index" )
 | 
|---|
| 262 |     CD.workgrpFH   = VRMethod( "CN_CONDET", "AddField", "String", "workgroup" )
 | 
|---|
| 263 |     CD.serverFH    = VRMethod( "CN_CONDET", "AddField", "String", "server" )
 | 
|---|
| 264 |     CD.shareFH     = VRMethod( "CN_CONDET", "AddField", "String", "share" )
 | 
|---|
| 265 |     CD.userFH      = VRMethod( "CN_CONDET", "AddField", "String", "user" )
 | 
|---|
| 266 |     CD.passwordFH  = VRMethod( "CN_CONDET", "AddField", "String", "password" )
 | 
|---|
| 267 |     CD.spasswordFH = VRMethod( "CN_CONDET", "AddField", "String", "spassword" )
 | 
|---|
| 268 |     CD.masterFH    = VRMethod( "CN_CONDET", "AddField", "String", "master" )
 | 
|---|
| 269 |     CD.mtypeFH     = VRMethod( "CN_CONDET", "AddField", "String", "mastertype" )
 | 
|---|
| 270 |     CD.memlenFH    = VRMethod( "CN_CONDET", "AddField", "String", "memlen" )
 | 
|---|
| 271 |     CD.easupportFH = VRMethod( "CN_CONDET", "AddField", "String", "easupport" )
 | 
|---|
| 272 |     CD.logfileFH   = VRMethod( "CN_CONDET", "AddField", "String", "logfile" )
 | 
|---|
| 273 |     CD.loglevelFH  = VRMethod( "CN_CONDET", "AddField", "String", "loglevel" )
 | 
|---|
| 274 |     CD.rwFH        = VRMethod( "CN_CONDET", "AddField", "String", "readonly" )
 | 
|---|
| 275 |     CD.ctoFH       = VRMethod( "CN_CONDET", "AddField", "String", "cachetimeout" )
 | 
|---|
| 276 |     CD.cldFH       = VRMethod( "CN_CONDET", "AddField", "String", "cachelistings" )
 | 
|---|
| 277 |     CD.kerberos5FH = VRMethod( "CN_CONDET", "AddField", "String", "krb5support")
 | 
|---|
| 278 |     CD.ntlmv1FH    = VRMethod( "CN_CONDET", "AddField", "String", "ntlmv1support")
 | 
|---|
| 279 |     CD.encryptionFH= VRMethod( "CN_CONDET", "AddField", "String", "encryptionsupport")
 | 
|---|
| 280 |     CD.hashFH      = VRMethod( "CN_CONDET", "AddField", "String", "hash" )
 | 
|---|
| 281 | 
 | 
|---|
| 282 |     /* Connection details */
 | 
|---|
| 283 |     ok = VRMethod("CN_CONDET", "SetFieldAttr", cd.mpidxfh ,       "Visible", options.!debug)
 | 
|---|
| 284 |     ok = VRMethod("CN_CONDET", "SetFieldAttr", cd.passwordfh ,    "Visible", options.!debug)
 | 
|---|
| 285 |     ok = VRMethod("CN_CONDET", "SetFieldAttr", cd.spasswordfh ,   "Visible", options.!debug)
 | 
|---|
| 286 |     ok = VRMethod("CN_CONDET", "SetFieldAttr", cd.masterFH ,      "Visible", options.!debug)
 | 
|---|
| 287 |     ok = VRMethod("CN_CONDET", "SetFieldAttr", cd.mtypeFH ,       "Visible", options.!debug)
 | 
|---|
| 288 |     ok = VRMethod("CN_CONDET", "SetFieldAttr", cd.memlenfh ,      "Visible", options.!debug)
 | 
|---|
| 289 |     ok = VRMethod("CN_CONDET", "SetFieldAttr", cd.logfilefh ,     "Visible", options.!debug)
 | 
|---|
| 290 |     ok = VRMethod("CN_CONDET", "SetFieldAttr", cd.loglevelfh ,    "Visible", options.!debug)
 | 
|---|
| 291 |     ok = VRMethod("CN_CONDET", "SetFieldAttr", cd.kerberos5FH,    "Visible", options.!debug)
 | 
|---|
| 292 |     ok = VRMethod("CN_CONDET", "SetFieldAttr", cd.ntlmv1FH,       "Visible", options.!debug)
 | 
|---|
| 293 |     ok = VRMethod("CN_CONDET", "SetFieldAttr", cd.encryptionFH,   "Visible", options.!debug)
 | 
|---|
| 294 |     ok = VRMethod("CN_CONDET", "SetFieldAttr", cd.hashfh ,        "Visible", options.!debug)
 | 
|---|
| 295 | 
 | 
|---|
| 296 |     ok = VRSet("CN_CONDET", "DetailSort", cd.mpointfh )
 | 
|---|
| 297 | 
 | 
|---|
| 298 |     /* NLV columns */
 | 
|---|
| 299 |     ok = VRMethod("CN_CONDET", "SetFieldAttr", cd.statusfh ,      "Title", strip(NLVGetMessage(67),"T",":"))
 | 
|---|
| 300 |     ok = VRMethod("CN_CONDET", "SetFieldAttr", cd.mpointfh ,      "Title", strip(NLVGetMessage(27),"T",":"))
 | 
|---|
| 301 |     ok = VRMethod("CN_CONDET", "SetFieldAttr", cd.workgrpFH   ,   "Title", strip(NLVGetMessage(21),"T",":"))
 | 
|---|
| 302 |     ok = VRMethod("CN_CONDET", "SetFieldAttr", cd.serverFH ,      "Title", strip(NLVGetMessage(19),"T",":"))
 | 
|---|
| 303 |     ok = VRMethod("CN_CONDET", "SetFieldAttr", cd.shareFH ,       "Title", strip(NLVGetMessage(20),"T",":"))
 | 
|---|
| 304 |     ok = VRMethod("CN_CONDET", "SetFieldAttr", cd.userFH ,        "Title", strip(NLVGetMessage(25),"T",":"))
 | 
|---|
| 305 |     ok = VRMethod("CN_CONDET", "SetFieldAttr", cd.ctoFH ,         "Title", strip(NLVGetMessage(130),"T",":"))
 | 
|---|
| 306 |     ok = VRMethod("CN_CONDET", "SetFieldAttr", cd.cldFH ,         "Title", strip(NLVGetMessage(131),"T",":"))
 | 
|---|
| 307 |     ok = VRMethod("CN_CONDET", "SetFieldAttr", cd.easupportFH ,   "Title", strip(NLVGetMessage(68),"T",":"))
 | 
|---|
| 308 |     ok = VRMethod("CN_CONDET", "SetFieldAttr", cd.rwfh ,          "Title", strip(NLVGetMessage(69),"T",":"))
 | 
|---|
| 309 |     ok = VRMethod("CN_CONDET", "SetFieldAttr", cd.kerberos5FH ,   "Title","Kerberos 5 support")
 | 
|---|
| 310 |     ok = VRMethod("CN_CONDET", "SetFieldAttr", cd.ntlmv1FH ,      "Title","NTLMv1 support")
 | 
|---|
| 311 |     ok = VRMethod("CN_CONDET", "SetFieldAttr", cd.encryptionFH ,  "Title","Encryption support")
 | 
|---|
| 312 | 
 | 
|---|
| 313 |     /* SMBTree columns */
 | 
|---|
| 314 |     WorkgroupFH= VRMethod( "CN_smbtree", "AddField", "String", "Workgroup"  )
 | 
|---|
| 315 |     NBFH       = VRMethod( "CN_smbtree", "AddField", "String", "NetBIOS name" )
 | 
|---|
| 316 |     IpFH       = VRMethod( "CN_smbtree", "AddField", "String", "IP"  )
 | 
|---|
| 317 |     MBFH       = VRMethod( "CN_smbtree", "AddField", "String", "Role" )
 | 
|---|
| 318 |     OSFH       = VRMethod( "CN_smbtree", "AddField", "String", "OS" )
 | 
|---|
| 319 |     VersionFH  = VRMethod( "CN_SmbTree", "AddField", "String", "Version" )
 | 
|---|
| 320 |     CommentFH  = VRMethod( "CN_smbtree", "AddField", "String", "Comment" )
 | 
|---|
| 321 |     MacFH      = VRMethod( "CN_smbtree", "AddField", "String", "MAC" )
 | 
|---|
| 322 | 
 | 
|---|
| 323 |     ok = VRMethod("CN_smbtree","SetfieldAttr",IPFH,       "ReadOnly", 1)
 | 
|---|
| 324 |     ok = VRMethod("CN_smbtree","SetfieldAttr",NBFH,       "ReadOnly", 1)
 | 
|---|
| 325 |     ok = VRMethod("CN_smbtree","SetfieldAttr",MBFH,       "ReadOnly", 1)
 | 
|---|
| 326 |     ok = VRMethod("CN_smbtree","SetfieldAttr",WorkGroupFH,"ReadOnly", 1)
 | 
|---|
| 327 |     ok = VRMethod("CN_smbtree","SetfieldAttr",OSFH,       "ReadOnly", 1)
 | 
|---|
| 328 |     ok = VRMethod("CN_smbtree","SetfieldAttr",MacFH,      "ReadOnly", 1)
 | 
|---|
| 329 | 
 | 
|---|
| 330 |     if options.!debug == 1 then say time()' _ContainersInit done'
 | 
|---|
| 331 | return
 | 
|---|
| 332 | /*:VRX         _ContextMenuSelectedSet
 | 
|---|
| 333 | */
 | 
|---|
| 334 | _ContextMenuSelectedSet:
 | 
|---|
| 335 |     /* Fixme: This routine only works for CN_SMBTREE right now */
 | 
|---|
| 336 | 
 | 
|---|
| 337 |     /* Hide all context menu entries */
 | 
|---|
| 338 |     ok = VRSet("Menu_Selected_Remove",           "Visible", 0) /* CN_CONDET */
 | 
|---|
| 339 |     ok = VRSet("Menu_Selected_Retry",            "Visible", 0) /* CN_CONDET */
 | 
|---|
| 340 |     ok = VRSet("Menu_Selected_Connect",          "Visible", 0) /* CN_SMBTREE */
 | 
|---|
| 341 |     ok = VRSet("Menu_Selected_ACLS",             "Visible", 0) /* CN_SMBTREE */
 | 
|---|
| 342 |     ok = VRSet("Menu_Selected_Sep1",             "Visible", 0) /* CN_SMBTREE */
 | 
|---|
| 343 |     ok = VRSet("Menu_Selected_Info",             "Visible", 0) /* CN_SMBTREE */
 | 
|---|
| 344 |     ok = VRSet("Menu_Selected_TimeSync",         "Visible", 0) /* CN_SMBTREE */
 | 
|---|
| 345 |     ok = VRSet("Menu_Selected_Refresh",          "Visible", 0) /* CN_SMBTREE */
 | 
|---|
| 346 |     ok = VRSet("Menu_Selected_Default_Workgroup","Visible", 0) /* CN_SMBTREE */
 | 
|---|
| 347 | 
 | 
|---|
| 348 | 
 | 
|---|
| 349 | /*  ok = VRSet("Menu_Selected_TreeView","Visible",1)
 | 
|---|
| 350 |     ok = VRSet("Menu_Selected_DetailsView","Visible",1)
 | 
|---|
| 351 |  */
 | 
|---|
| 352 | say SMBObj.udatatype
 | 
|---|
| 353 |     select
 | 
|---|
| 354 |         when SMBObj.udatatype = "DISK" then do
 | 
|---|
| 355 |             ok = VRSet("Menu_Selected_Connect", "Visible", 1)
 | 
|---|
| 356 |         end
 | 
|---|
| 357 |         when SMBObj.udatatype = "SERVER" then do
 | 
|---|
| 358 |             ok = VRSet("Menu_Selected_Connect",          "Visible", 1)
 | 
|---|
| 359 |             ok = VRSet("Menu_Selected_Sep1",             "Visible", 1)
 | 
|---|
| 360 |             ok = VRSet("Menu_Selected_Info",             "Visible", 1)
 | 
|---|
| 361 |             ok = VRSet("Menu_Selected_TimeSync",         "Visible", 1)
 | 
|---|
| 362 |             ok = VRSet("Menu_Selected_Refresh",          "Visible", 1)
 | 
|---|
| 363 |         end
 | 
|---|
| 364 |         when SMBObj.udatatype = "WORKGROUP" then do
 | 
|---|
| 365 |             ok = VRSet("Menu_Selected_Connect",          "Visible", 1)
 | 
|---|
| 366 |             ok = VRSet("Menu_Selected_Sep1",             "Visible", 1)
 | 
|---|
| 367 |             ok = VRSet("Menu_Selected_Default_Workgroup","Visible", 1)
 | 
|---|
| 368 |         end
 | 
|---|
| 369 |         when SMBObj.udatatype = "PRINTER" then do
 | 
|---|
| 370 |             call _PrinterInfo
 | 
|---|
| 371 |             /* CALL VRMessage 'Main', NLVGetMessage( 62 ), NLVGetMessage( 5 ), 'E' */
 | 
|---|
| 372 |         end
 | 
|---|
| 373 |         when SMBObj.udatatype = "DIRECTORY" then do
 | 
|---|
| 374 |             ok = VRSet("Menu_Selected_ACLS",             "Visible", 1)
 | 
|---|
| 375 |         end
 | 
|---|
| 376 |         when SMBObj.udatatype = "FILE" then do
 | 
|---|
| 377 |             ok = VRSet("Menu_Selected_ACLS",             "Visible", 1)
 | 
|---|
| 378 |         end
 | 
|---|
| 379 |         otherwise nop /* No other value known */
 | 
|---|
| 380 |     end
 | 
|---|
| 381 | return
 | 
|---|
| 382 | 
 | 
|---|
| 383 | /*:VRX         _CreateSmbConf
 | 
|---|
| 384 | */
 | 
|---|
| 385 | _CreateSmbConf:
 | 
|---|
| 386 |     if options.!debug == 1 then say time()' '||"_CreateSmbConf started"
 | 
|---|
| 387 |     call lineout samba.!smbconf, '# Samba config file created using' options.!appname_long 'ver. 'word(VRGet("Main","Hinttext"),2)
 | 
|---|
| 388 |     call lineout samba.!smbconf, '# from 'value("USER",,'OS2ENVIRONMENT')'@'value("HOSTNAME",,'OS2ENVIRONMENT')
 | 
|---|
| 389 |     call lineout samba.!smbconf, '# Date: 'date()' 'time()
 | 
|---|
| 390 |     call lineout samba.!smbconf, '[global]'
 | 
|---|
| 391 |     if settings.!network <> '' then do
 | 
|---|
| 392 |         call lineout samba.!smbconf, '09'x||'workgroup = 'settings.!network
 | 
|---|
| 393 |     end
 | 
|---|
| 394 |     else do
 | 
|---|
| 395 |         call lineout samba.!smbconf, '09'x||'workgroup = WORKGROUP'
 | 
|---|
| 396 |     end
 | 
|---|
| 397 |     call lineout samba.!smbconf, '09'x||'log level = 0'
 | 
|---|
| 398 |     ok = stream(samba.!smbconf,'c','close')
 | 
|---|
| 399 |     if options.!debug == 1 then say time()' '||"_CreateSmbConf done"
 | 
|---|
| 400 | return
 | 
|---|
| 401 | 
 | 
|---|
| 402 | /*:VRX         _DaemonRunning
 | 
|---|
| 403 | */
 | 
|---|
| 404 | _DaemonRunning: procedure expose fs.
 | 
|---|
| 405 |     ok = PRProcessList(proc)
 | 
|---|
| 406 |     PID = 0
 | 
|---|
| 407 |     do I = 1 to proc.0
 | 
|---|
| 408 |         CurProc = VRParseFileName(proc.i.name,'NE')
 | 
|---|
| 409 |         if CurProc = fs.!prefix"CTL.EXE" then  do
 | 
|---|
| 410 |             PID = proc.i.pid
 | 
|---|
| 411 |             leave
 | 
|---|
| 412 |         end
 | 
|---|
| 413 |     end
 | 
|---|
| 414 | return PID
 | 
|---|
| 415 | 
 | 
|---|
| 416 | /*:VRX         _DelSMBObjectShares
 | 
|---|
| 417 | */
 | 
|---|
| 418 | _DelSMBObjectShares: procedure expose samba. options. SMBObj. rh
 | 
|---|
| 419 |     /* Purpose: Delete shares for a given Object (as handle) */
 | 
|---|
| 420 | 
 | 
|---|
| 421 |     rh = arg(1)
 | 
|---|
| 422 | 
 | 
|---|
| 423 |     ok = VRMethod("CN_smbtree", "GetRecordList", "All", rh.)
 | 
|---|
| 424 | 
 | 
|---|
| 425 |     do J = 1 to rh.0 /* populate shares with valid entries */
 | 
|---|
| 426 |         ParentRH = VRMethod("CN_SMBTREE","GetRecordAttr",rh.J,"Parent")
 | 
|---|
| 427 | 
 | 
|---|
| 428 |         if ParentRH = rh then do /* we found a share belonging to our server */
 | 
|---|
| 429 |             ok = VRMethod("CN_SMBTree", "RemoveRecord", rh.J )
 | 
|---|
| 430 |         end
 | 
|---|
| 431 |     end
 | 
|---|
| 432 |     SmbObj.shares. = ''
 | 
|---|
| 433 |     SmbObj.shares.0 = 0
 | 
|---|
| 434 | return
 | 
|---|
| 435 | 
 | 
|---|
| 436 | /*:VRX         _DialogPopulate
 | 
|---|
| 437 | */
 | 
|---|
| 438 | _DialogPopulate:
 | 
|---|
| 439 | 
 | 
|---|
| 440 |     ok = VRMethod( "CN_SMBTREE", "GetRecordList", "Visible", "rh." )
 | 
|---|
| 441 | 
 | 
|---|
| 442 |     ok = VRMethod("EF_SHARE",   "Reset")
 | 
|---|
| 443 |     ok = VRMethod("EF_SERVER",  "Reset")
 | 
|---|
| 444 |     ok = VRMethod("EF_NETWORK", "Reset")
 | 
|---|
| 445 | 
 | 
|---|
| 446 |     do I = 1 to rh.0
 | 
|---|
| 447 | 
 | 
|---|
| 448 |         Userdata = VRMethod("CN_SMBTREE","GetRecordAttr",rh.I,"Userdata")
 | 
|---|
| 449 |         ResName  = VRMethod("CN_SMBTREE","GetRecordAttr",rh.I,"Caption")
 | 
|---|
| 450 | 
 | 
|---|
| 451 |         parse var ResName  ResName '0D0A'x .
 | 
|---|
| 452 |         ResName = strip(ResName)
 | 
|---|
| 453 |         parse var userdata ResType  '|' .
 | 
|---|
| 454 | 
 | 
|---|
| 455 |         select
 | 
|---|
| 456 |             when ResType = "WORKGROUP" then ok = VRMethod("EF_NETWORK","AddString", ResName)
 | 
|---|
| 457 |             when ResType = "SERVER"    then ok = VRMethod("EF_SERVER", "AddString", ResName)
 | 
|---|
| 458 |             when ResType = "DISK"      then ok = VRMethod("EF_SHARE",  "AddString", ResName)
 | 
|---|
| 459 |             otherwise nop
 | 
|---|
| 460 |         end
 | 
|---|
| 461 |     end
 | 
|---|
| 462 | 
 | 
|---|
| 463 | return
 | 
|---|
| 464 | 
 | 
|---|
| 465 | /*:VRX         _DLLSearch
 | 
|---|
| 466 | */
 | 
|---|
| 467 | _DLLSearch: PROCEDURE
 | 
|---|
| 468 |     PARSE ARG dname
 | 
|---|
| 469 |     _bd = SysBootDrive()
 | 
|---|
| 470 | 
 | 
|---|
| 471 |     IF _bd == '' THEN
 | 
|---|
| 472 |         _bd = FILESPEC('DRIVE', VALUE('COMSPEC',,'OS2ENVIRONMENT'))
 | 
|---|
| 473 |     _csys = _bd'\CONFIG.SYS'
 | 
|---|
| 474 | 
 | 
|---|
| 475 |     CALL SysFileSearch 'LIBPATH=', _csys, 'match.'
 | 
|---|
| 476 |     DO i = 1 TO match.0
 | 
|---|
| 477 |         PARSE UPPER VAR match.i _lead 'LIBPATH=' _lpath
 | 
|---|
| 478 |         IF (_lead == '') & (_lpath <> '') THEN LEAVE
 | 
|---|
| 479 |     END
 | 
|---|
| 480 | 
 | 
|---|
| 481 |     _lpath = SysQueryExtLIBPATH('B') || ';'_lpath';' || SysQueryExtLIBPATH('E')
 | 
|---|
| 482 | 
 | 
|---|
| 483 |     CALL SETLOCAL
 | 
|---|
| 484 |     _testenv = 'TEST_'dname'_LIBPATH'
 | 
|---|
| 485 |     CALL VALUE _testenv, _lpath, 'OS2ENVIRONMENT'
 | 
|---|
| 486 |     location = SysSearchPath( _testenv, dname )
 | 
|---|
| 487 |     CALL ENDLOCAL
 | 
|---|
| 488 | 
 | 
|---|
| 489 | RETURN location
 | 
|---|
| 490 | 
 | 
|---|
| 491 | /*:VRX         _Dynamic
 | 
|---|
| 492 | */
 | 
|---|
| 493 | _Dynamic:
 | 
|---|
| 494 |     dyn_code = arg(1)
 | 
|---|
| 495 |     if options.!debug == 1 then say time()'  Dynamic code: 'dyn_code
 | 
|---|
| 496 |     interpret dyn_code; drop dyn_code
 | 
|---|
| 497 | return
 | 
|---|
| 498 | 
 | 
|---|
| 499 | /*:VRX         _GetSMBObjectProperties
 | 
|---|
| 500 | */
 | 
|---|
| 501 | _GetSMBObjectProperties: procedure expose samba. options. SMBObj. rh icon resname udatatype udatamsg parentrh icons.
 | 
|---|
| 502 |     if options.!debug == 1 then say time()' _GetSMBObjectProperties started'
 | 
|---|
| 503 | 
 | 
|---|
| 504 |     /* Purpose of this subroutine:
 | 
|---|
| 505 |        The current SMB object's frequently used properties should be stored in a stem
 | 
|---|
| 506 |        SMBObj.rh        = recordhandle of the object
 | 
|---|
| 507 |        SMBObj.resname   = resourcename of the object
 | 
|---|
| 508 |        SMBObj.comment   = commentstring of the object
 | 
|---|
| 509 |        SMBObj.icon      = icon of the object
 | 
|---|
| 510 |        SMBObj.udatatype = type of object (WORKGROUP, SERVER, DISK, PRINTER, FILE, DIRECTORY)
 | 
|---|
| 511 |        SMBObj.udatamsg  = arbitrary object related data (Login message, file properties)
 | 
|---|
| 512 |        SMBObj.parentrh  = recordhandle of the object's parent
 | 
|---|
| 513 |        SMBObj.gparentrh = recordhandle of the object's grandparent
 | 
|---|
| 514 | 
 | 
|---|
| 515 |        The stem-less counterparts of these variables are considered deprecated and should be removed wherever possible
 | 
|---|
| 516 |        The _dropdeprecated routine will drop any value in order to make sure the stem actually works
 | 
|---|
| 517 |        If another variable is added to the stem, ensure to also drop it in dropdeprecated otherwise it will not be exported
 | 
|---|
| 518 |      */
 | 
|---|
| 519 |     call _dropdeprecated
 | 
|---|
| 520 | 
 | 
|---|
| 521 |     SMBObj. = ""
 | 
|---|
| 522 |     SMBObj.rh = arg(1)
 | 
|---|
| 523 | 
 | 
|---|
| 524 |     if VRMethod( "CN_SMBTREE", "ValidateRecord", SMBObj.rh) <> 1 | SMBObj.rh = "" then do
 | 
|---|
| 525 |         if options.!debug == 1 then say time()' _GetSMBObjectProperties aborted'
 | 
|---|
| 526 |         return
 | 
|---|
| 527 |     end
 | 
|---|
| 528 | 
 | 
|---|
| 529 |     SMBObj.Icon = VRMethod("CN_SMBTREE", "GetRecordAttr", SMBObj.rh, "Icon")
 | 
|---|
| 530 | 
 | 
|---|
| 531 |     SMBObj.parentrh = VRMethod("CN_SMBTREE", "GetRecordAttr", SMBObj.rh, "Parent")
 | 
|---|
| 532 |     if SMBObj.parentrh = ""
 | 
|---|
| 533 |         then SMBObj.gparentrh = ""
 | 
|---|
| 534 |         else SMBObj.gparentrh = VRMethod("CN_SMBTREE", "GetRecordAttr", SMBObj.parentrh, "Parent")
 | 
|---|
| 535 | 
 | 
|---|
| 536 |     SMBObj.resname  = VRMethod("CN_SMBTREE", "GetRecordAttr", SMBObj.rh, "Caption")
 | 
|---|
| 537 |     parse var SMBObj.resname SMBObj.resname '0D0A'x SMBObj.comment
 | 
|---|
| 538 |     SMBObj.resname = strip(SMBObj.resname)
 | 
|---|
| 539 |     SMBObj.comment = strip(SMBObj.comment)
 | 
|---|
| 540 | 
 | 
|---|
| 541 |     Userdata = VRMethod("CN_SMBTREE", "GetRecordAttr", SMBObj.rh, "Userdata")
 | 
|---|
| 542 |     parse var userdata SMBObj.udatatype '|' SMBObj.udatamsg
 | 
|---|
| 543 |     SMBObj.udatatype = strip(SMBObj.udatatype)
 | 
|---|
| 544 |     SMBObj.udatamsg  = strip(SMBObj.udatamsg)
 | 
|---|
| 545 | 
 | 
|---|
| 546 |     if options.!debug == 1 then do
 | 
|---|
| 547 |         say '  Handle:   "'SMBObj.rh'"'
 | 
|---|
| 548 |         say '  GParentrh "'SMBObj.gparentrh'"'
 | 
|---|
| 549 |         say '  Resource: "'SMBObj.resname'"'
 | 
|---|
| 550 |         say '  Comment:  "'SMBObj.comment'"'
 | 
|---|
| 551 |         say '  Type:     "'SMBObj.udatatype'"'
 | 
|---|
| 552 |         say '  Message:  "'SMBObj.udatamsg'"'
 | 
|---|
| 553 |         say '  Icon:     "'SMBObj.icon'"'
 | 
|---|
| 554 |     end
 | 
|---|
| 555 | 
 | 
|---|
| 556 |     if options.!debug == 1 then say time()' _GetSMBObjectProperties done'
 | 
|---|
| 557 | return
 | 
|---|
| 558 | 
 | 
|---|
| 559 | /*:VRX         _GetSMBObjectShares
 | 
|---|
| 560 | */
 | 
|---|
| 561 | _GetSMBObjectShares: procedure expose samba. options. SMBObj.
 | 
|---|
| 562 |     /* Purpose: Return stem with shares for a given Object (as handle) */
 | 
|---|
| 563 | 
 | 
|---|
| 564 |     rh = arg(1)
 | 
|---|
| 565 | 
 | 
|---|
| 566 |     SmbObj.shares. = ''
 | 
|---|
| 567 |     SmbObj.shares.0 = 0
 | 
|---|
| 568 |     I = 0
 | 
|---|
| 569 |     ok = VRMethod("CN_smbtree", "GetRecordList", "All", rh.)
 | 
|---|
| 570 | 
 | 
|---|
| 571 |     do J = 1 to rh.0 /* populate shares with valid entries */
 | 
|---|
| 572 |         Userdata = VRMethod("CN_SMBTREE","GetRecordAttr",rh.J,"Userdata")
 | 
|---|
| 573 |         ResName  = VRMethod("CN_SMBTREE","GetRecordAttr",rh.J,"Caption")
 | 
|---|
| 574 |         ParentRH = VRMethod("CN_SMBTREE","GetRecordAttr",rh.J,"Parent")
 | 
|---|
| 575 | 
 | 
|---|
| 576 |         parse var ResName  ResName '0D0A'x .
 | 
|---|
| 577 |         ResName = strip(ResName)
 | 
|---|
| 578 |         parse var userdata ResType  '|' .
 | 
|---|
| 579 | 
 | 
|---|
| 580 |         if ParentRH = rh then do /* we found a share belonging to our server */
 | 
|---|
| 581 |             if ResType = "DISK" then do
 | 
|---|
| 582 |                 I = I + 1
 | 
|---|
| 583 |                 SmbObj.shares.I = ResName
 | 
|---|
| 584 |             end
 | 
|---|
| 585 |         end
 | 
|---|
| 586 |     end
 | 
|---|
| 587 |     SmbObj.shares.0 = I
 | 
|---|
| 588 | return
 | 
|---|
| 589 | 
 | 
|---|
| 590 | /*:VRX         _GUIInit
 | 
|---|
| 591 | */
 | 
|---|
| 592 | _GUIInit:
 | 
|---|
| 593 |     if options.!debug == 1 then say time()' _GUIInit started'
 | 
|---|
| 594 |     CALL VRSet 'Main', 'HelpFile', settings.!helpfile
 | 
|---|
| 595 | 
 | 
|---|
| 596 |     /* Main Window */
 | 
|---|
| 597 |     CALL NLVSetText 'Main',        "Caption", 1
 | 
|---|
| 598 | 
 | 
|---|
| 599 |     CALL NLVSetText 'Menu_File',                      "Caption", 80
 | 
|---|
| 600 |     CALL NLVSetText 'Menu_Context',                   "Caption", 81
 | 
|---|
| 601 |     CALL NLVSetText 'Menu_Selected',                  "Caption", 83
 | 
|---|
| 602 |     CALL NLVSetText 'Menu_Help',                      "Caption", 84
 | 
|---|
| 603 | 
 | 
|---|
| 604 |     CALL NLVSetText 'Menu_File_LOAD',                 "Caption", 31
 | 
|---|
| 605 |     CALL NLVSetText 'Menu_File_SAVE',                 "Caption", 30
 | 
|---|
| 606 |     CALL NLVSetText 'Menu_File_LMHosts_Reset',        "Caption", 127
 | 
|---|
| 607 |     CALL NLVSetText 'Menu_File_ucCred_Reset',         "Caption", 128
 | 
|---|
| 608 |     CALL NLVSetText 'Menu_File_Autostart',            "Caption", 35
 | 
|---|
| 609 |     CALL NLVSetText 'Menu_File_Autostart_Activate',   "Caption", 76
 | 
|---|
| 610 |     CALL NLVSetText 'Menu_File_Autostart_Deactivate', "Caption", 77
 | 
|---|
| 611 |     CALL NLVSetText 'Menu_File_Daemon',               "Caption", 126
 | 
|---|
| 612 |     CALL NLVSetText 'Menu_File_Daemon_Start',         "Caption", 76
 | 
|---|
| 613 |     CALL NLVSetText 'Menu_File_Daemon_Stop',          "Caption", 77
 | 
|---|
| 614 |     CALL NLVSetText 'Menu_File_CLOSE',                "Caption", 29
 | 
|---|
| 615 | 
 | 
|---|
| 616 |     CALL NLVSetText 'Menu_Context_DETACH',            "Caption", 11
 | 
|---|
| 617 |     CALL NLVSetText 'Menu_Context_DETACH_ALL',        "Caption", 120
 | 
|---|
| 618 |     CALL NLVSetText 'Menu_Context_REFRESH',           "Caption", 38
 | 
|---|
| 619 |     CALL NLVSetText 'Menu_Context_UNMOUNT',           "Caption", 12
 | 
|---|
| 620 |     CALL NLVSetText 'Menu_Context_EDIT',              "Caption", 32
 | 
|---|
| 621 |     CALL NLVSetText 'Menu_Context_OPEN',              "Caption", 94
 | 
|---|
| 622 |     CALL NLVSetText 'Menu_Context_OPEN_ICON',         "Caption", 95
 | 
|---|
| 623 |     CALL NLVSetText 'Menu_Context_OPEN_TREE',         "Caption", 96
 | 
|---|
| 624 |     CALL NLVSetText 'Menu_Context_OPEN_DETAIL',       "Caption", 97
 | 
|---|
| 625 |     CALL NLVSetText 'Menu_Context_OPEN_SETTINGS',     "Caption", 98
 | 
|---|
| 626 |     CALL NLVSetText 'Menu_Context_OPEN_SPLITVIEW',    "Caption", 99
 | 
|---|
| 627 | 
 | 
|---|
| 628 |     CALL NLVSetText 'Menu_Selected_Connect',          "Caption", 28
 | 
|---|
| 629 |     CALL NLVSetText 'Menu_Selected_Remove',           "Caption", 12
 | 
|---|
| 630 |     CALL NLVSetText 'Menu_Selected_Retry',            "Caption", 90
 | 
|---|
| 631 |     CALL NLVSetText 'Menu_Selected_Info',             "Caption", 92
 | 
|---|
| 632 |     CALL NLVSetText 'Menu_Selected_TimeSync',         "Caption", 129
 | 
|---|
| 633 |     CALL NLVSetText 'Menu_Selected_Refresh',          "Caption", 38
 | 
|---|
| 634 |     CALL NLVSetText 'Menu_Selected_Default_Workgroup',"Caption", 75
 | 
|---|
| 635 | 
 | 
|---|
| 636 |     CALL NLVSetText 'Menu_Help_Extended',             "Caption", 4
 | 
|---|
| 637 |     CALL NLVSetText 'Menu_Help_About',                "Caption", 91
 | 
|---|
| 638 | 
 | 
|---|
| 639 |     /* Left pane */
 | 
|---|
| 640 |     CALL NLVSetText 'DT_CURRENT',                     "Caption", 10
 | 
|---|
| 641 |     CALL NLVSetText 'PB_DETACH',                      "Caption", 11
 | 
|---|
| 642 |     CALL NLVSetText 'PB_UNMOUNT',                     "Caption", 12
 | 
|---|
| 643 | 
 | 
|---|
| 644 |     /* Dialog window */
 | 
|---|
| 645 |     CALL NLVSetText 'DT_MOUNT',                       "Caption", 14
 | 
|---|
| 646 |     CALL NLVSetText 'DT_SERVER',                      "Caption", 19
 | 
|---|
| 647 |     CALL NLVSetText 'DT_SHARE',                       "Caption", 20
 | 
|---|
| 648 |     CALL NLVSetText 'DT_NETWORK',                     "Caption", 21
 | 
|---|
| 649 |     CALL NLVSetText 'CHK_MTYPE',                      "Caption", 23
 | 
|---|
| 650 |     CALL NLVSetText 'DT_USER',                        "Caption", 25
 | 
|---|
| 651 |     CALL NLVSetText 'DT_PASSWORD',                    "Caption", 26
 | 
|---|
| 652 |     CALL NLVSetText 'DT_MPOINT',                      "Caption", 27
 | 
|---|
| 653 |     CALL NLVSetText 'PB_MOUNT',                       "Caption", 28
 | 
|---|
| 654 |     CALL NLVSetText 'PB_EDIT_CANCEL',                 "Caption", 3
 | 
|---|
| 655 |     CALL NLVSetText 'PB_DIALOG_HELP',                 "Caption", 4
 | 
|---|
| 656 |     CALL NLVSetText 'PB_CLEARCRED',                   "Caption", 89
 | 
|---|
| 657 | 
 | 
|---|
| 658 |     IF (mtype.1 \= '' & mtype.2 \= '' & mtype.3 \= '' & mtype.4 \= '') THEN DO
 | 
|---|
| 659 |         CALL VRMethod CB_MOUNT, 'Clear'
 | 
|---|
| 660 |         CALL VRMethod CB_MOUNT, 'AddStringList', 'mtype.'
 | 
|---|
| 661 |     END
 | 
|---|
| 662 | 
 | 
|---|
| 663 |     if (mtype.1 = '' & mtype.2 = '' & mtype.3 = '' & mtype.4 = '') THEN DO /* we do not seem to have an NLV file */
 | 
|---|
| 664 |         /* we fill the array with the list predefined directly in the GUI control */
 | 
|---|
| 665 |         ok = VRMethod( "CB_MOUNT", "GetStringList", "mtype." )
 | 
|---|
| 666 |     end
 | 
|---|
| 667 | 
 | 
|---|
| 668 |     /* SMBTree */
 | 
|---|
| 669 |     CALL NLVSetText 'PB_SMBTREE_CONNECT',             "Caption", 28
 | 
|---|
| 670 |     CALL NLVSetText 'PB_SMBTREE_REFRESH',             "Caption", 38
 | 
|---|
| 671 |     CALL NLVSetText 'PB_SMBTREE_HELP',                "Caption",  4
 | 
|---|
| 672 |     CALL NLVSetText 'CN_SMBTREE',                     "Caption",140
 | 
|---|
| 673 | 
 | 
|---|
| 674 | /** Use AutoSize property instead
 | 
|---|
| 675 |     ok = VRSet("Pict_Throbber","Width",  VRMethod( "Screen", "PixelsToTwips", 32 ))
 | 
|---|
| 676 |     ok = VRSet("Pict_Throbber","Height", VRMethod( "Screen", "PixelsToTwips", 32 ))
 | 
|---|
| 677 | **/
 | 
|---|
| 678 |     /* Condet */
 | 
|---|
| 679 |     CALL NLVSetText 'PB_CONDET_SAVE',     "Caption", 30
 | 
|---|
| 680 |     CALL NLVSetText 'PB_CONDET_LOAD',     "Caption", 31
 | 
|---|
| 681 |     CALL NLVSetText 'PB_CONDET_HELP',"Caption", 4
 | 
|---|
| 682 | 
 | 
|---|
| 683 |     /* Statusbar */
 | 
|---|
| 684 |     call _StatusBarWrapper VRGet("Main", "HintText")
 | 
|---|
| 685 | 
 | 
|---|
| 686 |     /* Common margin around controls */
 | 
|---|
| 687 |     margin = ((VRGet("Main", "InteriorLeft") / 3) * 2) + 2
 | 
|---|
| 688 | 
 | 
|---|
| 689 |     smbwait = "#50"
 | 
|---|
| 690 | 
 | 
|---|
| 691 |     if options.!debug == 1 then say time()' _GUIInit done'
 | 
|---|
| 692 | return
 | 
|---|
| 693 | 
 | 
|---|
| 694 | /*:VRX         _INILoad
 | 
|---|
| 695 | */
 | 
|---|
| 696 | _INILoad:
 | 
|---|
| 697 |     if options.!debug == 1 then say time()' _INILoad started'
 | 
|---|
| 698 | 
 | 
|---|
| 699 |     /* Locate the profile */
 | 
|---|
| 700 |     os2_ini = VALUE('USER_INI',,'OS2ENVIRONMENT')
 | 
|---|
| 701 |     inipath = VRParseFilePath( os2_ini, 'DP')
 | 
|---|
| 702 |     IF inipath == '' THEN inipath = SysBootDrive() || '\OS2'
 | 
|---|
| 703 |     settings.!ini = inipath'\'options.!appname_short'.INI'
 | 
|---|
| 704 |     drop os2_ini inipath
 | 
|---|
| 705 |     if options.!debug == 1 then say '  'options.!appname_long' INIfile = "'settings.!ini'"'
 | 
|---|
| 706 | 
 | 
|---|
| 707 |     settings.!network = ""
 | 
|---|
| 708 |     /* Create default smb.conf if none exists */
 | 
|---|
| 709 |     if \VRFileExists( samba.!smbconf ) then call _CreateSmbConf
 | 
|---|
| 710 | 
 | 
|---|
| 711 |     say _ucInitObj()
 | 
|---|
| 712 |     say _ucChkObj()
 | 
|---|
| 713 | 
 | 
|---|
| 714 |     IF STREAM( settings.!ini, 'C', 'QUERY EXISTS') == '' THEN DO
 | 
|---|
| 715 |         /* First start */
 | 
|---|
| 716 |         if options.!debug == 1 then say "  First start!"
 | 
|---|
| 717 | 
 | 
|---|
| 718 |         advanced.!browseauth = 0
 | 
|---|
| 719 |         advanced.!browseimme = 1
 | 
|---|
| 720 |         advanced.!broadcast  = 0
 | 
|---|
| 721 |         advanced.!special    = 0
 | 
|---|
| 722 |         advanced.!savepassive= 0
 | 
|---|
| 723 |         advanced.!lmhosts    = 1
 | 
|---|
| 724 | 
 | 
|---|
| 725 |         advanced.!miniicons  = 0
 | 
|---|
| 726 | 
 | 
|---|
| 727 |         advanced.!easupport  = 1
 | 
|---|
| 728 |         advanced.!Kerberos5FH = 0
 | 
|---|
| 729 |         advanced.!ntlmv1FH = 1
 | 
|---|
| 730 |         advanced.!encryptionFH = 0
 | 
|---|
| 731 |         advanced.!readonly   = 0
 | 
|---|
| 732 |         advanced.!alwaysmp   = 0
 | 
|---|
| 733 |         advanced.!cachetimeout  = 10
 | 
|---|
| 734 |         advanced.!cachelistings = 32
 | 
|---|
| 735 | 
 | 
|---|
| 736 |         CALL VRSet "Main", 'Height', 7576
 | 
|---|
| 737 |         CALL VRSet "Main", 'Width',  8200
 | 
|---|
| 738 |         CALL VRSet "SPLIT_MAIN", 'Left',  2915
 | 
|---|
| 739 |         CALL VRMethod "Main", 'CenterWindow'
 | 
|---|
| 740 |         call VRSet 'Main',    'Visible', 1
 | 
|---|
| 741 |         call Main_Resize
 | 
|---|
| 742 |     END
 | 
|---|
| 743 |     ELSE DO
 | 
|---|
| 744 |         /* Subsequent start */
 | 
|---|
| 745 |         /* Load window position settings */
 | 
|---|
| 746 |         settings.!x = VRGetIni('Settings', 'X', settings.!ini, 'NoClose')
 | 
|---|
| 747 |         settings.!y = VRGetIni('Settings', 'Y', settings.!ini, 'NoClose')
 | 
|---|
| 748 |         settings.!h = VRGetIni('Settings', 'H', settings.!ini, 'NoClose')
 | 
|---|
| 749 |         settings.!w = VRGetIni('Settings', 'W', settings.!ini, 'NoClose')
 | 
|---|
| 750 |         settings.!s = VRGetIni('Settings', 'S', settings.!ini, 'NoClose')
 | 
|---|
| 751 | 
 | 
|---|
| 752 |         IF settings.!x == '' THEN settings.!x = -1
 | 
|---|
| 753 |         IF settings.!y == '' THEN settings.!y = -1
 | 
|---|
| 754 |         IF settings.!h == '' THEN settings.!h = -1
 | 
|---|
| 755 |         IF settings.!w == '' THEN settings.!w = -1
 | 
|---|
| 756 |         IF settings.!s == '' THEN settings.!s = -1
 | 
|---|
| 757 | 
 | 
|---|
| 758 |         /* Titlebar settings */
 | 
|---|
| 759 |         settings.!curbcolor = VRGetIni('Settings', 'TitleBarBackground', settings.!ini, 'NoClose')
 | 
|---|
| 760 |         settings.!curfcolor = VRGetIni('Settings', 'TitleBarForeground', settings.!ini, 'NoClose')
 | 
|---|
| 761 |         IF (settings.!curbcolor = '' | settings.!curbcolor = '<default>') THEN settings.!curbcolor = 'SystemActiveTitle'
 | 
|---|
| 762 |         IF (settings.!curfcolor = '' | settings.!curfcolor = '<default>') THEN settings.!curfcolor = 'SystemActiveTitleText'
 | 
|---|
| 763 | 
 | 
|---|
| 764 |         /* Load font settings */
 | 
|---|
| 765 |         IF VRFileExists( SysBootDrive() || '\OS2DBCS') == 1
 | 
|---|
| 766 |             THEN default_font = '9.WarpSans Combined'
 | 
|---|
| 767 |             ELSE default_font = '9.WarpSans'
 | 
|---|
| 768 | 
 | 
|---|
| 769 |         settings.!cfont = VRGetIni('Settings', 'ContainerFont', settings.!ini, 'NoClose')
 | 
|---|
| 770 |         settings.!wfont = VRGetIni('Settings', 'WindowFont',    settings.!ini, 'NoClose')
 | 
|---|
| 771 |         IF settings.!cfont  == '' THEN settings.!cfont  = default_font
 | 
|---|
| 772 |         IF settings.!wfont  == '' THEN settings.!wfont  = default_font
 | 
|---|
| 773 | 
 | 
|---|
| 774 |         /* Current page */
 | 
|---|
| 775 |         settings.!curpage = VRGetIni('Settings', 'CurrentPage', settings.!ini, 'NoClose')
 | 
|---|
| 776 |         IF settings.!curpage == '' THEN settings.!curpage = 1
 | 
|---|
| 777 | 
 | 
|---|
| 778 |         /* Global settings */
 | 
|---|
| 779 |         advanced.!browseauth = VRGetIni('Settings', 'BrowseAuth',      settings.!ini, 'NoClose')
 | 
|---|
| 780 |         advanced.!browseimme = VRGetIni('Settings', 'BrowseImme',      settings.!ini, 'NoClose')
 | 
|---|
| 781 |         advanced.!broadcast  = VRGetIni('Settings', 'Broadcast',       settings.!ini, 'NoClose')
 | 
|---|
| 782 |         advanced.!special    = VRGetIni('Settings', 'SpecialShares',   settings.!ini, 'NoClose')
 | 
|---|
| 783 |         advanced.!savepassive= VRGetIni('Settings', 'SavePassive',     settings.!ini, 'NoClose')
 | 
|---|
| 784 |         advanced.!lmhosts    = VRGetIni('Settings', 'LMHosts',         settings.!ini, 'NoClose')
 | 
|---|
| 785 |         advanced.!miniicons  = VRGetIni('Settings', 'MiniIcons',       settings.!ini, 'NoClose')
 | 
|---|
| 786 | 
 | 
|---|
| 787 |         advanced.!easupport  = VRGetIni('Settings', 'EAS',             settings.!ini, 'NoClose')
 | 
|---|
| 788 |         advanced.!readonly   = VRGetIni('Settings', 'ReadOnly',        settings.!ini, 'NoClose')
 | 
|---|
| 789 |         advanced.!alwaysmp   = VRGetIni('Settings', 'AlwaysMP',        settings.!ini, 'NoClose')
 | 
|---|
| 790 |         advanced.!cachetimeout  = VRGetIni('Settings', 'CacheTimeOut', settings.!ini, 'NoClose')
 | 
|---|
| 791 |         advanced.!cachelistings = VRGetIni('Settings', 'CacheListings',settings.!ini, 'NoClose')
 | 
|---|
| 792 | 
 | 
|---|
| 793 |         IF advanced.!browseauth == '' THEN advanced.!browseauth = 0
 | 
|---|
| 794 |         IF advanced.!browseimme == '' THEN advanced.!browseimme = 1
 | 
|---|
| 795 |         IF advanced.!broadcast  == '' THEN advanced.!broadcast  = 0
 | 
|---|
| 796 |         IF advanced.!special    == '' THEN advanced.!special    = 0
 | 
|---|
| 797 |         IF advanced.!savepassive== '' THEN advanced.!savepassive= 0
 | 
|---|
| 798 |         IF advanced.!lmhosts    == '' THEN advanced.!lmhosts    = 1
 | 
|---|
| 799 | 
 | 
|---|
| 800 |         options.!storecreds = VRGetIni('Settings', 'StoreCreds', settings.!ini, 'NoClose')
 | 
|---|
| 801 | say "options.!storecreds = "options.!storecreds
 | 
|---|
| 802 |         IF options.!storecreds == '' then options.!storecreds = 1
 | 
|---|
| 803 | 
 | 
|---|
| 804 | say "options.!storecreds = "options.!storecreds
 | 
|---|
| 805 |         IF _ucChkObj() = 0 then options.!storecreds = 0
 | 
|---|
| 806 | say "options.!storecreds = "options.!storecreds
 | 
|---|
| 807 | 
 | 
|---|
| 808 |         options.!tracmark = VRGetIni('Settings', 'TracMarkup', settings.!ini, 'NoClose')
 | 
|---|
| 809 |         options.!debug = VRGetIni('Settings', 'Debug', settings.!ini)
 | 
|---|
| 810 |         IF options.!debug == '' THEN options.!debug = 0       /* Turn off debug by default for release builds */
 | 
|---|
| 811 |         if options.!debug == 1 then ok = VRRedirectStdIO("ON")
 | 
|---|
| 812 |                                else ok = VRRedirectStdio("OFF")
 | 
|---|
| 813 | 
 | 
|---|
| 814 |         IF advanced.!miniicons  == '' THEN advanced.!miniicons  = 0
 | 
|---|
| 815 | 
 | 
|---|
| 816 |         /* Advanced */
 | 
|---|
| 817 |         IF advanced.!easupport     == '' THEN advanced.!easupport  = 1
 | 
|---|
| 818 |         IF advanced.!readonly      == '' THEN advanced.!readonly   = 0
 | 
|---|
| 819 |         IF advanced.!alwaysmp      == '' THEN advanced.!alwaysmp   = 0
 | 
|---|
| 820 |         IF advanced.!cachetimeout  == '' THEN advanced.!cachetimeout  = 10
 | 
|---|
| 821 |         IF advanced.!cachelistings == '' THEN advanced.!cachelistings = 32
 | 
|---|
| 822 | 
 | 
|---|
| 823 |         /* Apply the settings */
 | 
|---|
| 824 |         ok = VRSet("DT_CURRENT","BACKCOLOR", settings.!curbcolor )
 | 
|---|
| 825 |         ok = VRSet("DT_CURRENT","FORECOLOR", settings.!curfcolor )
 | 
|---|
| 826 | 
 | 
|---|
| 827 |         ok = VRset("CN_CURRENT", "MiniIcons", advanced.!miniicons)
 | 
|---|
| 828 |         ok = VRset("CN_SMBTREE", "MiniIcons", advanced.!miniicons)
 | 
|---|
| 829 |         ok = VRset("CN_CONDET",  "MiniIcons", advanced.!miniicons)
 | 
|---|
| 830 | 
 | 
|---|
| 831 |         IF ( settings.!x >= 0 ) & ( settings.!y >= 0 ) & ( settings.!l >= 0 ) & ( settings.!w >= 0 ) & ( settings.!s >= 0 ) THEN DO
 | 
|---|
| 832 |             CALL VRSet VRWindow(), 'Left',   settings.!x
 | 
|---|
| 833 |             CALL VRSet VRWindow(), 'Top',    settings.!y
 | 
|---|
| 834 |             CALL VRSet VRWindow(), 'Height', settings.!h
 | 
|---|
| 835 |             CALL VRSet VRWindow(), 'Width',  settings.!w
 | 
|---|
| 836 |             CALL VRSet "SPLIT_MAIN", 'Left',  settings.!s
 | 
|---|
| 837 |         END
 | 
|---|
| 838 |         ELSE CALL VRMethod VRWindow(), 'CenterWindow'
 | 
|---|
| 839 | 
 | 
|---|
| 840 |         CALL VRSet "CN_CURRENT", 'Font',       settings.!cfont
 | 
|---|
| 841 |         CALL VRSet "CN_CONDET",  'Font',       settings.!cfont
 | 
|---|
| 842 |         CALL VRSet "CN_SMBTREE", 'Font',       settings.!cfont
 | 
|---|
| 843 | 
 | 
|---|
| 844 |         CALL VRSet 'Main',       'Font',       settings.!wfont
 | 
|---|
| 845 |         CALL VRSet 'Main',       'StatusFont', settings.!wfont
 | 
|---|
| 846 | 
 | 
|---|
| 847 |         ok = VRSet("TDL_1","Selected", settings.!curpage)
 | 
|---|
| 848 |     END
 | 
|---|
| 849 | 
 | 
|---|
| 850 |     if options.!nogui == 1 then CALL VRLoadSecondary "SW_PROGRESS","W"
 | 
|---|
| 851 |     else do
 | 
|---|
| 852 |         if options.!delay > 0 then do
 | 
|---|
| 853 |             /* Set mouse pointer to wait - this operation might take a few seconds */
 | 
|---|
| 854 |             call VRSet VRWindow(), 'Pointer', 'Wait'
 | 
|---|
| 855 |             call Main_Resize
 | 
|---|
| 856 |             ok = SysSleep(options.!delay)
 | 
|---|
| 857 |             options.!delay = 0
 | 
|---|
| 858 |             /* Set mouse pointer to default again */
 | 
|---|
| 859 |             call VRSet VRWindow(), 'Pointer', '<default>'
 | 
|---|
| 860 |         end
 | 
|---|
| 861 |     end
 | 
|---|
| 862 | 
 | 
|---|
| 863 |     /* Look for usable credentials */
 | 
|---|
| 864 |     if options.!storecreds = 1 & _ucChkUc() then do
 | 
|---|
| 865 |         UserCred = _ucGetUc()
 | 
|---|
| 866 |         parse var UserCred '--user='Credentials.!username'%'Credentials.!password
 | 
|---|
| 867 |         if left(Credentials.!password,1)='%' then Credentials.!password = substr(Credentials.!password,2)
 | 
|---|
| 868 |         ok = VRSet("EF_USER",    "Value",Credentials.!username)
 | 
|---|
| 869 |         ok = VRSet("EF_PASSWORD","Value",Credentials.!password)
 | 
|---|
| 870 |         ok = VRSet("CN_SMBTREE","Caption",VRGet("CN_SMBTREE","Caption")||": "Credentials.!username)
 | 
|---|
| 871 |     end
 | 
|---|
| 872 |     else ok = VRSet("CN_SMBTREE","Caption",VRGet("CN_SMBTREE","Caption")||": Guest")
 | 
|---|
| 873 | 
 | 
|---|
| 874 |     /* SambaInit.VRS needs these 2 */
 | 
|---|
| 875 |     ShowHidden = advanced.!special
 | 
|---|
| 876 |     Broadcast  = advanced.!broadcast
 | 
|---|
| 877 | 
 | 
|---|
| 878 |     /* in non debug versions this is normally not visible */
 | 
|---|
| 879 |     if options.!debug == 1 then say '  NLV MessageFile = "'settings.!messages'"'
 | 
|---|
| 880 |     if options.!debug == 1 then say '  NLV HelpFile    = "'settings.!helpfile'"'
 | 
|---|
| 881 | 
 | 
|---|
| 882 |     if options.!debug == 1 then say time()' _INILoad done'
 | 
|---|
| 883 | RETURN
 | 
|---|
| 884 | 
 | 
|---|
| 885 | /*:VRX         _INISave
 | 
|---|
| 886 | */
 | 
|---|
| 887 | _INISave: PROCEDURE EXPOSE settings. options. icons. fs. advanced. cd. samba.
 | 
|---|
| 888 |     if options.!debug == 1 then say time()' '||"SaveSettings started"
 | 
|---|
| 889 | 
 | 
|---|
| 890 |     if advanced.!savepassive then call _PassiveSave
 | 
|---|
| 891 | 
 | 
|---|
| 892 | /* This does not make sense anymore
 | 
|---|
| 893 |     settings.!network = VRGet("EF_NETWORK","Value")
 | 
|---|
| 894 |     CALL VRSetIni 'Settings', 'Network', settings.!network, settings.!ini, 'NoClose'
 | 
|---|
| 895 |  */
 | 
|---|
| 896 | 
 | 
|---|
| 897 |     font = VRGet("CN_CURRENT", 'Font')
 | 
|---|
| 898 |     CALL VRSetIni 'Settings', 'ContainerFont', font, settings.!ini, 'NoClose'
 | 
|---|
| 899 | 
 | 
|---|
| 900 |     font = VRGet('Main', 'Font')
 | 
|---|
| 901 |     CALL VRSetIni 'Settings', 'WindowFont', font, settings.!ini, 'NoClose'
 | 
|---|
| 902 | 
 | 
|---|
| 903 |     settings.!curbcolor = VRGet("DT_CURRENT","BackColor")
 | 
|---|
| 904 |     CALL VRSetIni 'Settings', 'TitleBarBackground', settings.!curbcolor, settings.!ini, 'NoClose'
 | 
|---|
| 905 | 
 | 
|---|
| 906 |     settings.!curfcolor = VRGet("DT_CURRENT","ForeColor")
 | 
|---|
| 907 |     CALL VRSetIni 'Settings', 'TitleBarForeground', settings.!curfcolor, settings.!ini, 'NoClose'
 | 
|---|
| 908 | 
 | 
|---|
| 909 |     /* Global options */
 | 
|---|
| 910 |     CALL VRSetIni 'Settings', 'BrowseAuth',    advanced.!browseauth , settings.!ini, 'NoClose'
 | 
|---|
| 911 |     CALL VRSetIni 'Settings', 'BrowseImme',    advanced.!browseimme , settings.!ini, 'NoClose'
 | 
|---|
| 912 |     CALL VRSetIni 'Settings', 'Broadcast',     advanced.!broadcast  , settings.!ini, 'NoClose'
 | 
|---|
| 913 |     CALL VRSetIni 'Settings', 'SpecialShares', advanced.!special    , settings.!ini, 'NoClose'
 | 
|---|
| 914 |     CALL VRSetIni 'Settings', 'SavePassive',   advanced.!savepassive, settings.!ini, 'NoClose'
 | 
|---|
| 915 |     CALL VRSetIni 'Settings', 'LMHosts',       advanced.!lmhosts    , settings.!ini, 'NoClose'
 | 
|---|
| 916 | 
 | 
|---|
| 917 |     CALL VRSetIni 'Settings', 'StoreCreds',    options.!storecreds  , settings.!ini, 'NoClose'
 | 
|---|
| 918 |     CALL VRSetIni 'Settings', 'Debug',         options.!debug       , settings.!ini, 'NoClose'
 | 
|---|
| 919 |     CALL VRSetIni 'Settings', 'MiniIcons',     advanced.!miniicons  , settings.!ini, 'NoClose'
 | 
|---|
| 920 |     CALL VRSetIni 'Settings', 'TracMarkup',    options.!tracmark    , settings.!ini, 'NoClose'
 | 
|---|
| 921 | 
 | 
|---|
| 922 |     /* Advanced */
 | 
|---|
| 923 |     CALL VRSetIni 'Settings', 'EAS',           advanced.!easupport    , settings.!ini, 'NoClose'
 | 
|---|
| 924 |     CALL VRSetIni 'Settings', 'ReadOnly',      advanced.!readonly     , settings.!ini, 'NoClose'
 | 
|---|
| 925 |     CALL VRSetIni 'Settings', 'AlwaysMP',      advanced.!alwaysmp     , settings.!ini, 'NoClose'
 | 
|---|
| 926 |     CALL VRSetIni 'Settings', 'CacheTimeOut',  advanced.!cachetimeout , settings.!ini, 'NoClose'
 | 
|---|
| 927 |     CALL VRSetIni 'Settings', 'CacheListings', advanced.!cachelistings, settings.!ini, 'NoClose'
 | 
|---|
| 928 | 
 | 
|---|
| 929 |     /* Current page */
 | 
|---|
| 930 |     settings.!curpage = VRget("TDL_1","Selected")
 | 
|---|
| 931 |     CALL VRSetIni 'Settings', 'CurrentPage',   settings.!curpage      , settings.!ini, 'NoClose'
 | 
|---|
| 932 | 
 | 
|---|
| 933 |     /* Save position and size */
 | 
|---|
| 934 |     settings.!l = VRGet("Main",       'Left'  )
 | 
|---|
| 935 |     settings.!t = VRGet("Main",       'Top'   )
 | 
|---|
| 936 |     settings.!h = VRGet("Main",       'Height')
 | 
|---|
| 937 |     settings.!w = VRGet("Main",       'Width' )
 | 
|---|
| 938 |     settings.!s = VRGet("SPLIT_Main", 'Left'  )
 | 
|---|
| 939 | 
 | 
|---|
| 940 |     CALL VRSetIni 'Settings', 'X', settings.!l, settings.!ini, 'NoClose'
 | 
|---|
| 941 |     CALL VRSetIni 'Settings', 'Y', settings.!t, settings.!ini, 'NoClose'
 | 
|---|
| 942 |     CALL VRSetIni 'Settings', 'H', settings.!h, settings.!ini, 'NoClose'
 | 
|---|
| 943 |     CALL VRSetIni 'Settings', 'W', settings.!w, settings.!ini, 'NoClose'
 | 
|---|
| 944 |     CALL VRSetIni 'Settings', 'S', settings.!s, settings.!ini
 | 
|---|
| 945 | 
 | 
|---|
| 946 |     if options.!debug == 1 then say time()' '||"SaveSettings done"
 | 
|---|
| 947 | RETURN
 | 
|---|
| 948 | 
 | 
|---|
| 949 | /*:VRX         _isValidIPAddress
 | 
|---|
| 950 | */
 | 
|---|
| 951 | _isValidIPAddress: procedure
 | 
|---|
| 952 |    ipaddr = arg(1)
 | 
|---|
| 953 |    d. = ''
 | 
|---|
| 954 |    d.0 = 4
 | 
|---|
| 955 |    fail = 0
 | 
|---|
| 956 |    parse var ipaddr d.1 '.' d.2 '.' d.3 '.' d.4
 | 
|---|
| 957 |    do I = 1 to 4
 | 
|---|
| 958 |        if datatype(d.I) = 'NUM' then do
 | 
|---|
| 959 |            if d.I < 0 | d.I > 255 then fail = 1
 | 
|---|
| 960 |        end
 | 
|---|
| 961 |        else fail = 1
 | 
|---|
| 962 |        if fail = 1 then leave
 | 
|---|
| 963 |    end
 | 
|---|
| 964 | return(\fail)
 | 
|---|
| 965 | 
 | 
|---|
| 966 | /*:VRX         _LMHostsRead
 | 
|---|
| 967 | */
 | 
|---|
| 968 | _LMHostsRead:
 | 
|---|
| 969 |     ok = file2stem(samba.!lmhosts,'lmhosts.', 'NoDel')
 | 
|---|
| 970 |     lmname. = "#"
 | 
|---|
| 971 |     lmapp.  = ""
 | 
|---|
| 972 |     lmname.0 = lmhosts.0
 | 
|---|
| 973 |     lmip.0   = lmhosts.0
 | 
|---|
| 974 |     lmapp.0  = lmhosts.0
 | 
|---|
| 975 |     do I = 1 to lmhosts.0
 | 
|---|
| 976 |         if left(lmhosts.I,1) = "#" then iterate
 | 
|---|
| 977 |         parse var lmhosts.I lmip.I ' ' lmname.I '#' lmapp.I
 | 
|---|
| 978 |         lmip.I = strip(lmip.I)
 | 
|---|
| 979 |         lmname.I = strip(lmname.I)
 | 
|---|
| 980 |         if lmapp.I <> "" & left(lmapp.I,1) <> '#' then lmapp.I = '#'lmapp.I
 | 
|---|
| 981 |     end
 | 
|---|
| 982 |     drop lmhosts.
 | 
|---|
| 983 | return
 | 
|---|
| 984 | 
 | 
|---|
| 985 | /*:VRX         _LMHostsReset
 | 
|---|
| 986 | */
 | 
|---|
| 987 | _LMHostsReset:
 | 
|---|
| 988 |     ok = SysFileDelete(samba.!lmhosts)
 | 
|---|
| 989 | 
 | 
|---|
| 990 |     Buttons.1 = NLVGetMessage(2)
 | 
|---|
| 991 |     Buttons.0 = 1
 | 
|---|
| 992 |     if ok = 0 then do
 | 
|---|
| 993 |         id = VRMessage( VRWindow(), NLVGetMessage(118,samba.!lmhosts), NLVGetMessage(127), "Information", "Buttons.", 1, 1 )
 | 
|---|
| 994 |     end
 | 
|---|
| 995 |     else do
 | 
|---|
| 996 |         id = VRMessage( VRWindow(), samba.!lmhosts', RC = 'ok, NLVGetMessage(127), "Error", "Buttons.", 1, 1 )
 | 
|---|
| 997 |     end
 | 
|---|
| 998 | return
 | 
|---|
| 999 | 
 | 
|---|
| 1000 | /*:VRX         _LMHostsUpdate
 | 
|---|
| 1001 | */
 | 
|---|
| 1002 | _LMHostsUpdate:
 | 
|---|
| 1003 |     ok = VRMethod( "CN_SMBTREE", "GetRecordList", "Visible", "rh." )
 | 
|---|
| 1004 |     do I = 1 to rh.0
 | 
|---|
| 1005 |         call _GetSMBObjectProperties rh.I
 | 
|---|
| 1006 |         if SMBObj.udatatype = "SERVER" then do
 | 
|---|
| 1007 |             IP = VRMethod("CN_SMBTREE","GetFieldData",rh.I, IPFH )
 | 
|---|
| 1008 |             Role = VRMethod("CN_SMBTREE","GetFieldData",rh.I, MBFH )
 | 
|---|
| 1009 |             parse var IP T1 '.' T2 '.' T3 '.' T4
 | 
|---|
| 1010 |             if datatype(T1) = "NUM" & datatype(T2) = "NUM" & datatype(T3) = "NUM" & datatype(T4) = "NUM" then do
 | 
|---|
| 1011 |                 FoundName = 0
 | 
|---|
| 1012 |                 /* Don't add localhost and local link IP to LMHosts */
 | 
|---|
| 1013 |                 if T1 = '127' & T2 = '0' & T3 = '0' & T4 = '1' then iterate
 | 
|---|
| 1014 |                 if T1 = '169' & T2 = '254' then iterate
 | 
|---|
| 1015 |                 do J = 1 to lmname.0 /* machine already in LMHosts? */
 | 
|---|
| 1016 |                     if lmname.J = SmbObj.resname then do /* Yes? then update IP */
 | 
|---|
| 1017 |                         lmip.J = IP
 | 
|---|
| 1018 |                         if pos('PDC',Role) > 0 & SMBObj.parentrh <> "" then do
 | 
|---|
| 1019 |                             Domain  = VRMethod("CN_SMBTREE", "GetRecordAttr", SMBObj.parentrh, "Caption")
 | 
|---|
| 1020 |                             lmapp.J = "#DOM:"Domain
 | 
|---|
| 1021 |                         end
 | 
|---|
| 1022 |                         FoundName = 1
 | 
|---|
| 1023 |                         leave
 | 
|---|
| 1024 |                     end
 | 
|---|
| 1025 |                 end
 | 
|---|
| 1026 |                 if FoundName = 0 then do /* New machine for LMhosts - add it */
 | 
|---|
| 1027 |                     new = lmname.0 + 1
 | 
|---|
| 1028 |                     lmname.0 = new
 | 
|---|
| 1029 |                     lmname.new = SmbObj.resname
 | 
|---|
| 1030 |                     lmip.0 = new
 | 
|---|
| 1031 |                     lmip.new = IP
 | 
|---|
| 1032 |                 end
 | 
|---|
| 1033 |             end
 | 
|---|
| 1034 |         end
 | 
|---|
| 1035 |     end
 | 
|---|
| 1036 |     ok = SysFileDelete(samba.!lmhosts)
 | 
|---|
| 1037 |     call lineout samba.!lmhosts,'# Created by 'translate(VRParseFilename(settings.!ini,'N'))' Version 'word(VRGet("Main","Hinttext"),2)' on 'date()' at 'time()
 | 
|---|
| 1038 |     call lineout samba.!lmhosts,'# Syntax:'
 | 
|---|
| 1039 |     call lineout samba.!lmhosts,left('# IP-address',25)||left('NetBIOS-name',16)' [Role]'
 | 
|---|
| 1040 |     do I = 1 to lmname.0
 | 
|---|
| 1041 |         if left(lmname.I,1) = "#" then iterate
 | 
|---|
| 1042 |         call lineout samba.!lmhosts,left(lmip.I,25)||left(lmname.I,16)' 'lmapp.I
 | 
|---|
| 1043 |     end
 | 
|---|
| 1044 |     ok = stream(samba.!lmhosts,'c','close')
 | 
|---|
| 1045 | return
 | 
|---|
| 1046 | 
 | 
|---|
| 1047 | /*:VRX         _LMHostsWrite
 | 
|---|
| 1048 | */
 | 
|---|
| 1049 | _LMHostsWrite:
 | 
|---|
| 1050 | 
 | 
|---|
| 1051 | return
 | 
|---|
| 1052 | 
 | 
|---|
| 1053 | /*:VRX         _LoadOtherFuncs
 | 
|---|
| 1054 | */
 | 
|---|
| 1055 | _LoadOtherFuncs:
 | 
|---|
| 1056 |     IF options.!debug == 1 then say time()' _LoadotherFuncs() started'
 | 
|---|
| 1057 |     SIGNAL ON SYNTAX
 | 
|---|
| 1058 | 
 | 
|---|
| 1059 |     call RxFuncAdd 'SysLoadFuncs', 'REXXUTIL', 'SysLoadFuncs'
 | 
|---|
| 1060 |     call SysLoadFuncs
 | 
|---|
| 1061 | 
 | 
|---|
| 1062 |     call rxfuncadd 'IniLoadFuncs', 'REXXINI', 'IniLoadFuncs'
 | 
|---|
| 1063 |     call IniLoadFuncs
 | 
|---|
| 1064 | 
 | 
|---|
| 1065 |     call RxFuncAdd 'PRLoadFuncs',  'PR1UTIL', 'PRLoadFuncs'
 | 
|---|
| 1066 |     call PRLoadFuncs
 | 
|---|
| 1067 | 
 | 
|---|
| 1068 |     call RxFuncAdd 'RxuInit',      'RXU',     'RxuInit'
 | 
|---|
| 1069 |     call RxuInit
 | 
|---|
| 1070 | 
 | 
|---|
| 1071 |     SIGNAL OFF SYNTAX
 | 
|---|
| 1072 |     IF options.!debug == 1 then say time()' _LoadotherFuncs() done'
 | 
|---|
| 1073 | return
 | 
|---|
| 1074 | 
 | 
|---|
| 1075 | SYNTAX:
 | 
|---|
| 1076 |     IF options.!debug == 1 then say time()' _LoadotherFuncs() error handler entered.'
 | 
|---|
| 1077 |     Fatal = 1
 | 
|---|
| 1078 |     parse source . . InVXIDE
 | 
|---|
| 1079 |     if left(InVXIDE,length(Tempdir)+5) = TempDir||'__tmp'
 | 
|---|
| 1080 |         then xxx = "VX-REXX IDE: "strip(translate(word(sourceline(SIGL-1),4),'  ',"',"))
 | 
|---|
| 1081 |         else xxx = 'A'
 | 
|---|
| 1082 |     call VRMessage 'Main', xxx' REXX function library DLL is missing or unloadable!', options.!appname_long "fatal error", "E"
 | 
|---|
| 1083 |     IF options.!debug == 1 then say time()' _LoadotherFuncs() error handler finished, program will be terminated.'
 | 
|---|
| 1084 | signal Quit
 | 
|---|
| 1085 | 
 | 
|---|
| 1086 | /*:VRX         _ParseCommandLine
 | 
|---|
| 1087 | */
 | 
|---|
| 1088 | _ParseCommandLine:
 | 
|---|
| 1089 |     if options.!debug == 1 then say time()' _ParseCommandLine() started'
 | 
|---|
| 1090 |     CmdLine = VRGet("Application","Commandline")
 | 
|---|
| 1091 |     upCmdLine = translate(CmdLine)
 | 
|---|
| 1092 |     if options.!debug == 1 then say '  Commandline = "'CmdLine'"'
 | 
|---|
| 1093 | 
 | 
|---|
| 1094 |     ForceNDFS = 0
 | 
|---|
| 1095 |     if wordpos('-NDFS',upCmdLine) > 0 then do
 | 
|---|
| 1096 |         if options.!debug == 1 then say "  NDFS switch detected"
 | 
|---|
| 1097 |         CmdLine = delWord(CmdLine,wordpos('-NDFS',upCmdLine),1)
 | 
|---|
| 1098 |         upCmdLine = translate(CmdLine)
 | 
|---|
| 1099 |         ForceNDFS = 1
 | 
|---|
| 1100 |         CALL VRSet "Menu_File_Autostart","Visible", 0
 | 
|---|
| 1101 |     end
 | 
|---|
| 1102 | 
 | 
|---|
| 1103 |     if wordpos('-AUTOCLOSE',upCmdLine) > 0 then do
 | 
|---|
| 1104 |         options.!autoclose = 1
 | 
|---|
| 1105 |         if options.!debug == 1 then say "  AutoClose switch detected"
 | 
|---|
| 1106 |         CmdLine = delWord(CmdLine,wordpos('-AUTOCLOSE',upCmdLine),1)
 | 
|---|
| 1107 |         upCmdLine = translate(CmdLine)
 | 
|---|
| 1108 |     end
 | 
|---|
| 1109 |     if wordpos('-NOGUI',upCmdLine) > 0 then do
 | 
|---|
| 1110 |         options.!nogui = 1
 | 
|---|
| 1111 |         options.!autoclose = 1
 | 
|---|
| 1112 |         if options.!debug == 1 then say "  -NOGUI switch detected"
 | 
|---|
| 1113 |         CmdLine = delWord(CmdLine,wordpos('-NOGUI',upCmdLine),1)
 | 
|---|
| 1114 |         upCmdLine = translate(CmdLine)
 | 
|---|
| 1115 |     end
 | 
|---|
| 1116 | 
 | 
|---|
| 1117 |     if wordpos('-TIMESYNC',upCmdLine) > 0 then do
 | 
|---|
| 1118 |         options.!timesync = 1
 | 
|---|
| 1119 |         if options.!debug == 1 then say "  -TIMESYNC switch detected"
 | 
|---|
| 1120 |         dwpos = wordpos('-TIMESYNC',upCmdLine)
 | 
|---|
| 1121 |         if dwpos = words(upCmdLine) then do /* TIMESYNC was last parm - assume automatic */
 | 
|---|
| 1122 |             options.!timesrv = ""
 | 
|---|
| 1123 |             CmdLine = delWord(CmdLine,wordpos('-TIMESYNC',upCmdLine),1)
 | 
|---|
| 1124 |         end
 | 
|---|
| 1125 |         else do
 | 
|---|
| 1126 |             options.!timesrv = word(upCmdLine,dwpos+1)
 | 
|---|
| 1127 |             if left(options.!timesrv,1) = "-" then do /* other parameter detected */
 | 
|---|
| 1128 |                 options.!timesrv = ""
 | 
|---|
| 1129 |                 CmdLine = delWord(CmdLine,wordpos('-TIMESYNC',upCmdLine),1)
 | 
|---|
| 1130 |             end
 | 
|---|
| 1131 |             else do /* seems we have a timeserver - IP or name - no further check */
 | 
|---|
| 1132 |                 CmdLine = delWord(CmdLine,wordpos('-TIMESYNC',upCmdLine),2)
 | 
|---|
| 1133 |             end
 | 
|---|
| 1134 |         end
 | 
|---|
| 1135 |         upCmdLine = translate(CmdLine)
 | 
|---|
| 1136 |     end
 | 
|---|
| 1137 | 
 | 
|---|
| 1138 |     if wordpos('-DELAY',upCmdLine) > 0 then do
 | 
|---|
| 1139 |         if options.!debug == 1 then say "  DELAY switch detected"
 | 
|---|
| 1140 |         dwpos = wordpos('-DELAY',upCmdLine)
 | 
|---|
| 1141 |         if dwpos = words(upCmdLine) then do /* DELAY was last parm - assume 60 seconds */
 | 
|---|
| 1142 |             options.!delay = 60
 | 
|---|
| 1143 |             CmdLine = delWord(CmdLine,dwpos,1)
 | 
|---|
| 1144 |         end
 | 
|---|
| 1145 |         else do
 | 
|---|
| 1146 |             options.!delay = word(upCmdLine,dwpos+1)
 | 
|---|
| 1147 |             if datatype(options.!delay) <> "NUM" then do /* No number of seconds specified */
 | 
|---|
| 1148 |                 options.!delay = 60
 | 
|---|
| 1149 |                 CmdLine = delWord(CmdLine,dwpos,1)
 | 
|---|
| 1150 |             end
 | 
|---|
| 1151 |             else do
 | 
|---|
| 1152 |                 CmdLine = delWord(CmdLine,dwpos,2)
 | 
|---|
| 1153 |             end
 | 
|---|
| 1154 |         end
 | 
|---|
| 1155 |         upCmdLine = translate(CmdLine)
 | 
|---|
| 1156 |         if options.!debug == 1 then say "  DELAY set to "options.!delay" seconds."
 | 
|---|
| 1157 |     end
 | 
|---|
| 1158 | 
 | 
|---|
| 1159 |     Profile = strip(CmdLine,,'"')
 | 
|---|
| 1160 |     if Profile <> "" then do
 | 
|---|
| 1161 |         Profile = strip(VRParseFilename(Profile,"DPNE"))
 | 
|---|
| 1162 |         options.!autoload   = 1
 | 
|---|
| 1163 |         if options.!debug == 1 then say '  Profile = "'Profile'"'
 | 
|---|
| 1164 |         if \VRFileExists(Profile) then do
 | 
|---|
| 1165 |             CALL VRMessage 'Main', NLVGetMessage( 102, Profile ), NLVGetMessage( 1 ), 'E'
 | 
|---|
| 1166 |             /* Disable all switches in case of an error */
 | 
|---|
| 1167 |             options.!autoload  = 0
 | 
|---|
| 1168 |             options.!autoclose = 0
 | 
|---|
| 1169 |             options.!nogui     = 0
 | 
|---|
| 1170 |             options.!delay     = 0
 | 
|---|
| 1171 |         end
 | 
|---|
| 1172 |     end
 | 
|---|
| 1173 |     if options.!debug == 1 then say time()' _ParseCommandLine done'
 | 
|---|
| 1174 | return
 | 
|---|
| 1175 | 
 | 
|---|
| 1176 | /*:VRX         _PassiveLoad
 | 
|---|
| 1177 | */
 | 
|---|
| 1178 | _PassiveLoad:
 | 
|---|
| 1179 |     if options.!debug == 1 then say time()' '||"_PassiveLoad started"
 | 
|---|
| 1180 | 
 | 
|---|
| 1181 |     do cnt = 1 to 255
 | 
|---|
| 1182 |         resdata = VRGetIni( "PassiveConnections", cnt, settings.!ini )
 | 
|---|
| 1183 |         if resdata = "" then leave
 | 
|---|
| 1184 | 
 | 
|---|
| 1185 |         parse var resdata p_mpoint resource rwFlag
 | 
|---|
| 1186 |         if options.!debug == 1 then do
 | 
|---|
| 1187 |             say '  Connection 'cnt', resdata  ="'resdata'"'
 | 
|---|
| 1188 |         end
 | 
|---|
| 1189 | 
 | 
|---|
| 1190 | /*      vfs.!drive      = FILESPEC('DRIVE', node )
 | 
|---|
| 1191 |         vfs.!mountpoint = STRIP( node, 'T', '\') */
 | 
|---|
| 1192 | 
 | 
|---|
| 1193 |         /* In case we only have a volume we reattach the backslash, otherwise restore will fail */
 | 
|---|
| 1194 |         if vfs.!drive = vfs.!mountpoint then vfs.!mountpoint = vfs.!mountpoint||'\'
 | 
|---|
| 1195 | 
 | 
|---|
| 1196 |         p_mpidx = ""
 | 
|---|
| 1197 | 
 | 
|---|
| 1198 |         call ParseResParmString
 | 
|---|
| 1199 | 
 | 
|---|
| 1200 |         p_rw = rwFlag
 | 
|---|
| 1201 | 
 | 
|---|
| 1202 |         /* Create the hash string */
 | 
|---|
| 1203 |         hashstr = p_mpoint' 'translate(p_workgroup)' 'translate(p_server)' 'translate(p_share)' 'p_user' 'p_spassword' 'p_easupport' 'p_rw
 | 
|---|
| 1204 | 
 | 
|---|
| 1205 |         /* A truncated, useless entry - skip it */
 | 
|---|
| 1206 |         if p_server = "" & p_share = ""& p_workgroup = "" then iterate
 | 
|---|
| 1207 | 
 | 
|---|
| 1208 |         md5.cnt = rexx_md5(hashstr)
 | 
|---|
| 1209 |         md5.0   = cnt
 | 
|---|
| 1210 | 
 | 
|---|
| 1211 |         /* Passive connection already restored - skip the dupe one */
 | 
|---|
| 1212 |         PassiveDupe = 0
 | 
|---|
| 1213 |         do X = 1 to md5.0-1
 | 
|---|
| 1214 |             if md5.cnt = md5.X then PassiveDupe = 1
 | 
|---|
| 1215 |         end
 | 
|---|
| 1216 |         if PassiveDupe = 1 then iterate /* do not add record for a duplicate passive connection */
 | 
|---|
| 1217 | 
 | 
|---|
| 1218 |         /* Everything is ok, let's add a new entry */
 | 
|---|
| 1219 |         cd.lastrh = VRMethod("CN_CONDET","AddRecord")
 | 
|---|
| 1220 | 
 | 
|---|
| 1221 |         /* Fill columns now */
 | 
|---|
| 1222 |         ok = VRMethod("CN_CONDET", "SetFieldData",  cd.lastrh, cd.mpointFH,    p_mpoint)
 | 
|---|
| 1223 |         ok = VRMethod("CN_CONDET", "SetFieldData",  cd.lastrh, cd.mpidxfh,     p_mpidx)
 | 
|---|
| 1224 |         ok = VRMethod("CN_CONDET", "SetFieldData",  cd.lastrh, cd.workgrpFH  , p_workgroup)
 | 
|---|
| 1225 |         ok = VRMethod("CN_CONDET", "SetFieldData",  cd.lastrh, cd.serverfh,    p_server)
 | 
|---|
| 1226 |         ok = VRMethod("CN_CONDET", "SetFieldData",  cd.lastrh, cd.sharefh,     p_share)
 | 
|---|
| 1227 |         ok = VRMethod("CN_CONDET", "SetFieldData",  cd.lastrh, cd.userfh,      p_user)
 | 
|---|
| 1228 |         ok = VRMethod("CN_CONDET", "SetFieldData",  cd.lastrh, cd.passwordfh,  p_password)
 | 
|---|
| 1229 |         ok = VRMethod("CN_CONDET", "SetFieldData",  cd.lastrh, cd.spasswordfh, p_spassword)
 | 
|---|
| 1230 |         ok = VRMethod("CN_CONDET", "SetFieldData",  cd.lastrh, cd.ctoFH,       p_cachetimeout)
 | 
|---|
| 1231 |         ok = VRMethod("CN_CONDET", "SetFieldData",  cd.lastrh, cd.cldFH,       p_cachelistings)
 | 
|---|
| 1232 |         ok = VRMethod("CN_CONDET", "SetFieldData",  cd.lastrh, cd.masterfh,    p_master)
 | 
|---|
| 1233 |         ok = VRMethod("CN_CONDET", "SetFieldData",  cd.lastrh, cd.mtypefh,     p_mtype)
 | 
|---|
| 1234 |         ok = VRMethod("CN_CONDET", "SetFieldData",  cd.lastrh, cd.easupportfh, p_easupport)
 | 
|---|
| 1235 |         ok = VRMethod("CN_CONDET", "SetFieldData",  cd.lastrh, cd.rwfh,        p_rw)
 | 
|---|
| 1236 |         ok = VRMethod("CN_CONDET", "SetFieldData",  cd.lastrh, cd.hashfh,      md5.cnt)
 | 
|---|
| 1237 |         ok = VRMethod("CN_CONDET", "SetFieldData",  cd.lastrh, cd.statusfh,    icons.!passive)
 | 
|---|
| 1238 |         ok = VRMethod("CN_CONDET", "SetRecordAttr", cd.lastrh, "Icon",         icons.!passive)
 | 
|---|
| 1239 | 
 | 
|---|
| 1240 | /*      Obsolete fields:
 | 
|---|
| 1241 |         ok = VRMethod("CN_CONDET", "SetFieldData",  cd.lastrh, cd.memlenfh,    p_memlen)
 | 
|---|
| 1242 |         ok = VRMethod("CN_CONDET", "SetFieldData",  cd.lastrh, cd.logfilefh,   p_logfile)
 | 
|---|
| 1243 |         ok = VRMethod("CN_CONDET", "SetFieldData",  cd.lastrh, cd.loglevelfh,  p_loglevel) */
 | 
|---|
| 1244 |     end
 | 
|---|
| 1245 |     if options.!debug == 1 then say time()' '||"_PassiveLoad done"
 | 
|---|
| 1246 | return
 | 
|---|
| 1247 | /*:VRX         _PassiveSave
 | 
|---|
| 1248 | */
 | 
|---|
| 1249 | _PassiveSave:
 | 
|---|
| 1250 |     if options.!debug == 1 then say time()' '||"_PassiveSave started"
 | 
|---|
| 1251 |     ok = VRDelIni( "PassiveConnections", "ALL", settings.!ini )
 | 
|---|
| 1252 | 
 | 
|---|
| 1253 |     ok = SysIni(settings.!ini, 'PassiveConnections', 'DELETE:')
 | 
|---|
| 1254 | 
 | 
|---|
| 1255 |     CALL VRMethod "CN_CONDET", 'GetRecordList', 'All', 'records.'
 | 
|---|
| 1256 |     cnt = 0
 | 
|---|
| 1257 |     DO i = 1 TO records.0
 | 
|---|
| 1258 | 
 | 
|---|
| 1259 |         if VRMethod( "CN_CONDET", "GetFieldData", records.i, CD.StatusFH) = icons.!passive then do
 | 
|---|
| 1260 |             cnt = cnt + 1
 | 
|---|
| 1261 |             resdata = ""
 | 
|---|
| 1262 |             resdata = resdata||VRMethod("CN_CONDET","GetFieldData", records.i, cd.mpointfh)||" "
 | 
|---|
| 1263 |             resdata = resdata||'\\'||VRMethod("CN_CONDET","GetFieldData", records.i, cd.workgrpFH  )
 | 
|---|
| 1264 |             resdata = resdata||':'||VRMethod("CN_CONDET","GetFieldData", records.i, cd.serverfh)
 | 
|---|
| 1265 |             resdata = resdata||'\'||VRMethod("CN_CONDET","GetFieldData", records.i, cd.sharefh)
 | 
|---|
| 1266 |             resdata = resdata||'@'||VRMethod("CN_CONDET","GetFieldData", records.i, cd.userfh)
 | 
|---|
| 1267 |             resdata = resdata||';WORKGROUP='||VRMethod("CN_CONDET","GetFieldData", records.i, cd.workgrpFH  )
 | 
|---|
| 1268 |             resdata = resdata||';SERVER='||VRMethod("CN_CONDET","GetFieldData", records.i, cd.serverfh)
 | 
|---|
| 1269 |             resdata = resdata||';SHARE='||VRMethod("CN_CONDET","GetFieldData", records.i, cd.sharefh)
 | 
|---|
| 1270 |             resdata = resdata||';USER='||VRMethod("CN_CONDET","GetFieldData", records.i, cd.userfh)
 | 
|---|
| 1271 |             resdata = resdata||';PASSWORD='||VRMethod("CN_CONDET","GetFieldData", records.i, cd.passwordfh)
 | 
|---|
| 1272 |             resdata = resdata||';SPASSWORD='||VRMethod("CN_CONDET","GetFieldData", records.i, cd.spasswordfh)
 | 
|---|
| 1273 |             resdata = resdata||';MASTER='||VRMethod("CN_CONDET","GetFieldData", records.i, cd.masterfh)
 | 
|---|
| 1274 |             resdata = resdata||';MASTERTYPE='||VRMethod("CN_CONDET","GetFieldData", records.i, cd.mtypefh)
 | 
|---|
| 1275 | /*          resdata = resdata||';MEMLEN='||VRMethod("CN_CONDET","GetFieldData", records.i, cd.memlenfh)
 | 
|---|
| 1276 |             resdata = resdata||';LOGFILE='||VRMethod("CN_CONDET","GetFieldData", records.i, cd.logfilefh)
 | 
|---|
| 1277 |             resdata = resdata||';LOGLEVEL='||VRMethod("CN_CONDET","GetFieldData", records.i, cd.loglevelfh) */
 | 
|---|
| 1278 |             resdata = resdata||';CTO='||VRMethod("CN_CONDET","GetFieldData", records.i, cd.ctoFH)
 | 
|---|
| 1279 |             resdata = resdata||';CLD='||VRMethod("CN_CONDET","GetFieldData", records.i, cd.cldFH)
 | 
|---|
| 1280 |             resdata = resdata||';EASUPPORT='||VRMethod("CN_CONDET","GetFieldData", records.i, cd.easupportfh)
 | 
|---|
| 1281 |             resdata = resdata||' '||VRMethod("CN_CONDET","GetFieldData", records.i, cd.rwfh)
 | 
|---|
| 1282 |             ok = VRSetIni( "PassiveConnections", cnt, resdata, settings.!ini )
 | 
|---|
| 1283 |         END
 | 
|---|
| 1284 |         else iterate
 | 
|---|
| 1285 |     end
 | 
|---|
| 1286 |     if options.!debug == 1 then say time()' '||"_PassiveSave done"
 | 
|---|
| 1287 | return
 | 
|---|
| 1288 | 
 | 
|---|
| 1289 | /*:VRX         _PrinterInfo
 | 
|---|
| 1290 | */
 | 
|---|
| 1291 | _PrinterInfo:
 | 
|---|
| 1292 |     if \_SMBpdrInstalled() then do
 | 
|---|
| 1293 |         /* SMB.PDR is not installed */
 | 
|---|
| 1294 |         CALL VRMessage 'Main', NLVGetMessage( 104 ), NLVGetMessage( 5 ), 'E'
 | 
|---|
| 1295 |     end
 | 
|---|
| 1296 |     else do /* SMB.pdr is installed */
 | 
|---|
| 1297 |         /* shared queue name */
 | 
|---|
| 1298 |         p_printer = SMBObj.resname
 | 
|---|
| 1299 | 
 | 
|---|
| 1300 |         /* printer server */
 | 
|---|
| 1301 |         capt = VRMethod("CN_SMBTREE", "GetRecordAttr", SMBObj.parentrh, "Caption")
 | 
|---|
| 1302 |         parse var Capt p_prtsrv '0D0A'x .
 | 
|---|
| 1303 |         p_prtsrv = strip(p_prtsrv)
 | 
|---|
| 1304 | 
 | 
|---|
| 1305 |         /* workgroup of the printer server */
 | 
|---|
| 1306 |         Gparrh = VRMethod("CN_SMBTREE", "GetRecordAttr", SMBObj.parentrh, "Parent")
 | 
|---|
| 1307 |         capt = VRMethod("CN_SMBTREE", "GetRecordAttr", GParrh, "Caption")
 | 
|---|
| 1308 |         parse var Capt p_workgroup '0D0A'x .
 | 
|---|
| 1309 | 
 | 
|---|
| 1310 |         /* This is the string we will find in case this resource is already connected */
 | 
|---|
| 1311 |         DescStr = translate(p_prtsrv'#'p_printer'#'p_workgroup'#')
 | 
|---|
| 1312 |         say '"'DescStr'"'
 | 
|---|
| 1313 |         LDescStr = length(DescStr)
 | 
|---|
| 1314 | 
 | 
|---|
| 1315 |         /* Enumerate all SMB ports */
 | 
|---|
| 1316 |         ok = SysIni('SYSTEM','PM_SPOOLER_PORT',"All:",'ports')
 | 
|---|
| 1317 |         if ports.0 = 0 then do
 | 
|---|
| 1318 |             /* No SMB ports installed */
 | 
|---|
| 1319 |             CALL VRMessage 'Main', NLVGetMessage( 105 ), NLVGetMessage( 5 ), 'E'
 | 
|---|
| 1320 |         end
 | 
|---|
| 1321 |         else do
 | 
|---|
| 1322 |             /*  At least 1 SMB port was found - lets check whether it is already connected to our resource */
 | 
|---|
| 1323 |             FoundPort = 0
 | 
|---|
| 1324 |             do I = 1 to ports.0
 | 
|---|
| 1325 |                 if left(ports.i,3) = 'SMB' then do
 | 
|---|
| 1326 |                     say ports.I
 | 
|---|
| 1327 |                     say translate(left(SysIni('SYSTEM','PM_'ports.I,'INITIALIZATION'),LDescStr))
 | 
|---|
| 1328 |                     say DescStr
 | 
|---|
| 1329 |                     if translate(left(SysIni('SYSTEM','PM_'ports.I,'INITIALIZATION'),LDescStr)) = DescStr then do
 | 
|---|
| 1330 |                         OurPort = ports.I
 | 
|---|
| 1331 |                         FoundPort = 1
 | 
|---|
| 1332 |                         leave
 | 
|---|
| 1333 |                     end
 | 
|---|
| 1334 |                 end
 | 
|---|
| 1335 |             end
 | 
|---|
| 1336 |             say 'OurPort = "'OurPort'"'
 | 
|---|
| 1337 |             if Foundport then do
 | 
|---|
| 1338 |                 ok = SysIni('SYSTEM','PM_SPOOLER_PRINTER',"All:",'printer')
 | 
|---|
| 1339 |                 FoundPrinter = 0
 | 
|---|
| 1340 |                 do I = 1 to printer.0
 | 
|---|
| 1341 |                     prtsummary = SysINi('SYSTEM','PM_SPOOLER_PRINTER',printer.i)
 | 
|---|
| 1342 |                     parse var prtsummary port ';'PrinterDriver';'PrinterQueue';' .
 | 
|---|
| 1343 |                     say printer.I' 'prtsummary
 | 
|---|
| 1344 |                     if port = ourPort then do
 | 
|---|
| 1345 |                         PrinterName = SysINi('SYSTEM','PM_SPOOLER_PRINTER_DESCR',printer.i)
 | 
|---|
| 1346 |                         parse var Printername Printername ';' .
 | 
|---|
| 1347 |                         CALL VRMessage 'Main', PrinterName' ('PrinterQueue') prints to port ' Port' connected to \\'p_workgroup'\'p_prtsrv'\'p_printer, NLVGetMessage( 1 ), 'I'
 | 
|---|
| 1348 |                         FoundPrinter = 1
 | 
|---|
| 1349 |                         leave
 | 
|---|
| 1350 |                     end
 | 
|---|
| 1351 |                 end
 | 
|---|
| 1352 |                 if FoundPrinter = 0 then do
 | 
|---|
| 1353 |                     /* Port installed and configured, but not used by any printer */
 | 
|---|
| 1354 |                     CALL VRMessage 'Main', NLVGetMessage( 106 ), NLVGetMessage( 5 ), 'E'
 | 
|---|
| 1355 |                 end
 | 
|---|
| 1356 |             end
 | 
|---|
| 1357 |             else do
 | 
|---|
| 1358 |                 CALL VRMessage 'Main', NLVGetMessage( 62 ), NLVGetMessage( 5 ), 'E'
 | 
|---|
| 1359 |             end
 | 
|---|
| 1360 |         end
 | 
|---|
| 1361 |     end
 | 
|---|
| 1362 | return
 | 
|---|
| 1363 | 
 | 
|---|
| 1364 | /*:VRX         _ShowMsg
 | 
|---|
| 1365 | */
 | 
|---|
| 1366 | _ShowMsg:
 | 
|---|
| 1367 |     /* preliminary implementation - we just do not ignore it anymore -
 | 
|---|
| 1368 |        - ShowMsg from smbmon/smbusers should become a shared library */
 | 
|---|
| 1369 |     call _StatusBarWrapper Msg.Text
 | 
|---|
| 1370 | return
 | 
|---|
| 1371 | 
 | 
|---|
| 1372 | /*:VRX         _SmbConfCreateShadowCopy
 | 
|---|
| 1373 | */
 | 
|---|
| 1374 | _SmbConfCreateShadowCopy:
 | 
|---|
| 1375 |     if options.!debug == 1 then say time()' _SmbConfCreateShadowCopy started'
 | 
|---|
| 1376 |     /* we create a complete version of smb.conf in temporary directory for reading purposes */
 | 
|---|
| 1377 |     /* as we can only determine a default value from this complete version of the file */
 | 
|---|
| 1378 |     /* however it is not desirable to always have a complete copy normally */
 | 
|---|
| 1379 |     ok = SysFileDelete(samba.!shadowsmbconf)
 | 
|---|
| 1380 |     if datatype(log_level) <> "NUM" then log_level = 2
 | 
|---|
| 1381 |     say     '  'samba.!testparmexe' -v -s -d='log_level' 1>'samba.!shadowsmbconf' 2>'TempDir'testparm.stderr'
 | 
|---|
| 1382 |     address cmd samba.!testparmexe' -v -s -d='log_level' 1>'samba.!shadowsmbconf' 2>'TempDir'testparm.stderr'
 | 
|---|
| 1383 |     if options.!debug == 1 then say time()' _SmbConfCreateShadowCopy done'
 | 
|---|
| 1384 | return
 | 
|---|
| 1385 | 
 | 
|---|
| 1386 | /*:VRX         _SMBpdrInstalled
 | 
|---|
| 1387 | */
 | 
|---|
| 1388 | _SMBpdrInstalled: procedure
 | 
|---|
| 1389 |     ok = VRGetINI("PM_PORT_DRIVER","SMB","SYSTEM")
 | 
|---|
| 1390 | return (ok <> "")
 | 
|---|
| 1391 | 
 | 
|---|
| 1392 | /*:VRX         _StemsInit
 | 
|---|
| 1393 | */
 | 
|---|
| 1394 | _StemsInit:
 | 
|---|
| 1395 |     if options.!debug == 1 then say time()' _StemsInit started'
 | 
|---|
| 1396 |     if options.!debug == 1 then say '  initializing options.'
 | 
|---|
| 1397 |     options.!workgroup  = ''
 | 
|---|
| 1398 |     options.!server     = ''
 | 
|---|
| 1399 |     options.!share      = ''
 | 
|---|
| 1400 |     options.!user       = ''
 | 
|---|
| 1401 |     options.!password   = ''
 | 
|---|
| 1402 |     options.!spassword  = ''
 | 
|---|
| 1403 |     options.!master     = ''
 | 
|---|
| 1404 |     options.!mastertype = ''
 | 
|---|
| 1405 |     options.!memlen     = '2'
 | 
|---|
| 1406 |     options.!cachetimeout  = '10'
 | 
|---|
| 1407 |     options.!cachelistings = '32'
 | 
|---|
| 1408 |     options.!easupport  = '1'
 | 
|---|
| 1409 |     options.!readonly   = ''
 | 
|---|
| 1410 |     options.!loglevel   = 0
 | 
|---|
| 1411 |     options.!logfile    = ''
 | 
|---|
| 1412 | 
 | 
|---|
| 1413 |     options.!autoload   = 0
 | 
|---|
| 1414 |     options.!autoclose  = 0
 | 
|---|
| 1415 |     options.!nogui      = 0
 | 
|---|
| 1416 |     options.!autostart  = 0
 | 
|---|
| 1417 |     options.!editmode   = 0
 | 
|---|
| 1418 |     options.!delay      = 0
 | 
|---|
| 1419 |     options.!storecreds = 0
 | 
|---|
| 1420 |     options.!timesync   = 0
 | 
|---|
| 1421 |     options.!timesrv    = ''
 | 
|---|
| 1422 | 
 | 
|---|
| 1423 |     options.!tracmark   = 0
 | 
|---|
| 1424 | 
 | 
|---|
| 1425 |     app_name_msg = NLVGetMessage( 0 )
 | 
|---|
| 1426 |     IF app_name_msg == '' | WORD( app_name_msg, 1 ) == '[Missing' THEN
 | 
|---|
| 1427 |         app_name_msg = 'EVFSGUI EVFSGUI'
 | 
|---|
| 1428 | 
 | 
|---|
| 1429 |     /* These values are used in things like config files, WPS objects, etc.
 | 
|---|
| 1430 |      */
 | 
|---|
| 1431 |     options.!appname_short = TRANSLATE( SUBWORD( app_name_msg, 1, 1 ))
 | 
|---|
| 1432 |     options.!appname_long = SUBWORD( app_name_msg, 2 )
 | 
|---|
| 1433 | 
 | 
|---|
| 1434 |     if options.!debug == 1 then say '  initializing vfs. '
 | 
|---|
| 1435 |     vfs.!drive      = ''
 | 
|---|
| 1436 |     vfs.!mountpoint = ''
 | 
|---|
| 1437 | 
 | 
|---|
| 1438 |     if options.!debug == 1 then say '  initializing advanced. '
 | 
|---|
| 1439 |     advanced.!browseauth = ''
 | 
|---|
| 1440 |     advanced.!browseimme = ''
 | 
|---|
| 1441 |     advanced.!broadcast  = ''
 | 
|---|
| 1442 |     advanced.!special    = ''
 | 
|---|
| 1443 |     advanced.!savepassive= ''
 | 
|---|
| 1444 |     advanced.!miniicons  = ''
 | 
|---|
| 1445 | 
 | 
|---|
| 1446 |     advanced.!easupport  = 1
 | 
|---|
| 1447 |     advanced.!readonly   = ''
 | 
|---|
| 1448 |     advanced.!alwaysmp   = ''
 | 
|---|
| 1449 |     advanced.!cachetimeout  = '10'
 | 
|---|
| 1450 |     advanced.!cachelistings = '32'
 | 
|---|
| 1451 | 
 | 
|---|
| 1452 |     advanced.!smbconfchanged = 0
 | 
|---|
| 1453 | 
 | 
|---|
| 1454 |     /* Obsolete */
 | 
|---|
| 1455 |     advanced.!memlen     = ''
 | 
|---|
| 1456 |     advanced.!loglevel   = '0'
 | 
|---|
| 1457 |     advanced.!logfile    = ''
 | 
|---|
| 1458 | 
 | 
|---|
| 1459 |     if options.!debug == 1 then say '  initializing credentials. '
 | 
|---|
| 1460 |     credentials.!username = ""
 | 
|---|
| 1461 |     credentials.!password = ""
 | 
|---|
| 1462 |     credentials.!entered  = 0
 | 
|---|
| 1463 | 
 | 
|---|
| 1464 |     UserCred = ""
 | 
|---|
| 1465 |     RefreshMode = ""
 | 
|---|
| 1466 | 
 | 
|---|
| 1467 |     if options.!debug == 1 then say '  initializing mtype. '
 | 
|---|
| 1468 |     mtype.0 = 5
 | 
|---|
| 1469 |     mtype.1 = NLVGetMessage( 15 )
 | 
|---|
| 1470 |     mtype.2 = NLVGetMessage( 16 )
 | 
|---|
| 1471 |     mtype.3 = NLVGetMessage( 17 )
 | 
|---|
| 1472 |     mtype.4 = NLVGetMessage( 18 )
 | 
|---|
| 1473 |     mtype.5 = NLVGetMessage(110 )
 | 
|---|
| 1474 | 
 | 
|---|
| 1475 |     call _BrowseIconsInit
 | 
|---|
| 1476 | 
 | 
|---|
| 1477 |     p_workgroup             = "Unknown"
 | 
|---|
| 1478 |     p_server                = "Unknown"
 | 
|---|
| 1479 |     p_share                 = "Unknown"
 | 
|---|
| 1480 | 
 | 
|---|
| 1481 |     if options.!debug == 1 then say time()' _StemsInit done'
 | 
|---|
| 1482 | return
 | 
|---|
| 1483 | /*:VRX         _TabbedDialogSetup
 | 
|---|
| 1484 | */
 | 
|---|
| 1485 | _TabbedDialogSetup:
 | 
|---|
| 1486 |     if options.!debug == 1 then say time()' _TabbedDialogSetup started'
 | 
|---|
| 1487 | 
 | 
|---|
| 1488 |     w = VRLoad( "TDL_1", VRWindowPath(), "SW_DIALOG" )
 | 
|---|
| 1489 |     ok = VRMethod( "TDL_1", "InsertPage", w,"+ "NLVGetMessage(13)" ")
 | 
|---|
| 1490 |     ok = VRMethod( "TDL_1", "SetStatusText", 1, NLVGetMessage(132,"1","2"))
 | 
|---|
| 1491 |     w = VRLoad( "TDL_1", VRWindowPath(), "SW_ADVANCED" )
 | 
|---|
| 1492 |     ok = VRMethod( "TDL_1", "InsertPage", w,"- "NLVGetMessage(40)" ")
 | 
|---|
| 1493 |     ok = VRMethod( "TDL_1", "SetStatusText", 2, NLVGetMessage(132,"2","2"))
 | 
|---|
| 1494 | 
 | 
|---|
| 1495 |     w = VRLoad( "TDL_1", VRWindowPath(), "SW_SMBTREE" )
 | 
|---|
| 1496 |     ok = VRMethod( "TDL_1", "InsertPage", w,"+ "NLVGetMessage(39)" ")
 | 
|---|
| 1497 | 
 | 
|---|
| 1498 |     w = VRLoad( "TDL_1", VRWindowPath(), "SW_CONDET" )
 | 
|---|
| 1499 |     ok = VRMethod( "TDL_1", "InsertPage", w,"+ "NLVGetMessage(63)" ")
 | 
|---|
| 1500 |     w = VRLoad( "TDL_1", VRWindowPath(), "SW_SETTINGS" )
 | 
|---|
| 1501 |     ok = VRMethod( "TDL_1", "InsertPage", w,"+ "NLVGetMessage(47)" ")
 | 
|---|
| 1502 |     w = VRLoad( "TDL_1", VRWindowPath(), "SW_SMBCONF" )
 | 
|---|
| 1503 |     ok = VRMethod( "TDL_1", "InsertPage", w,"- "NLVGetMessage(47)" ")
 | 
|---|
| 1504 |     if options.!debug == 1 then say time()' _TabbedDialogSetup done'
 | 
|---|
| 1505 | return
 | 
|---|
| 1506 | 
 | 
|---|
| 1507 | 
 | 
|---|
| 1508 | /*:VRX         _TabFix
 | 
|---|
| 1509 | */
 | 
|---|
| 1510 | _TabFix:
 | 
|---|
| 1511 |     ok = VRMethod( "TDL_1", "SetTabText", arg(1), " "strip(VRMethod( "TDL_1", "GetTabText", arg(1)))" ")
 | 
|---|
| 1512 | return
 | 
|---|
| 1513 | 
 | 
|---|
| 1514 | /*:VRX         _TabsStrip
 | 
|---|
| 1515 | */
 | 
|---|
| 1516 | _TabsStrip:
 | 
|---|
| 1517 |     ok = VRMethod( "TDL_1", "SetTabText", 1, strip(VRMethod( "TDL_1", "GetTabText", 1)))
 | 
|---|
| 1518 |     ok = VRMethod( "TDL_1", "SetTabText", 2, strip(VRMethod( "TDL_1", "GetTabText", 2)))
 | 
|---|
| 1519 |     ok = VRMethod( "TDL_1", "SetTabText", 3, strip(VRMethod( "TDL_1", "GetTabText", 3)))
 | 
|---|
| 1520 |     ok = VRMethod( "TDL_1", "SetTabText", 4, strip(VRMethod( "TDL_1", "GetTabText", 4)))
 | 
|---|
| 1521 |     ok = VRMethod( "TDL_1", "SetTabText", 5, strip(VRMethod( "TDL_1", "GetTabText", 5)))
 | 
|---|
| 1522 | return
 | 
|---|
| 1523 | 
 | 
|---|
| 1524 | /*:VRX         _TimeSync
 | 
|---|
| 1525 | */
 | 
|---|
| 1526 | _TimeSync:
 | 
|---|
| 1527 |     if options.!debug == 1 then say time()' _TimeSync started, "'options.!timesrv'"'
 | 
|---|
| 1528 |     TimeMsg.1 = NLVGetMessage(141)' 'time()
 | 
|---|
| 1529 |     if options.!timesrv <> '' then do
 | 
|---|
| 1530 |         say     '  'samba.!netexe' time set -S 'options.!timesrv
 | 
|---|
| 1531 |         address cmd samba.!netexe' time set -S 'options.!timesrv
 | 
|---|
| 1532 |     end
 | 
|---|
| 1533 |     else do
 | 
|---|
| 1534 |         say     '  'samba.!netexe' time set'
 | 
|---|
| 1535 |         address cmd samba.!netexe' time set'
 | 
|---|
| 1536 |     end
 | 
|---|
| 1537 |     options.!timesync = ''
 | 
|---|
| 1538 |     TimeMsg.2 = NLVGetMessage(142)' 'time()
 | 
|---|
| 1539 |     TimeMsg.0 = 2
 | 
|---|
| 1540 | 
 | 
|---|
| 1541 |     Buttons.1 = NLVGetMessage(2)
 | 
|---|
| 1542 |     Buttons.0 = 1
 | 
|---|
| 1543 |     id = VRMessageStem( VRWindow(), TimeMsg. , NLVGetMessage(129) , "Information", "Buttons.", 1, 1 )
 | 
|---|
| 1544 |     if options.!debug == 1 then say time()' _TimeSync done'
 | 
|---|
| 1545 | return
 | 
|---|
| 1546 | 
 | 
|---|
| 1547 | /*:VRX         _UpdateObject
 | 
|---|
| 1548 | */
 | 
|---|
| 1549 | _UpdateObject: procedure
 | 
|---|
| 1550 |     Object   = arg(1)
 | 
|---|
| 1551 |     ObjValue = arg(2)
 | 
|---|
| 1552 |     if VRGet(Object,"Value") <> ObjValue then ok = VRset(Object,"Value",ObjValue)
 | 
|---|
| 1553 | return
 | 
|---|
| 1554 | 
 | 
|---|
| 1555 | /*:VRX         _UserCredUpdate
 | 
|---|
| 1556 | */
 | 
|---|
| 1557 | _UserCredUpdate:
 | 
|---|
| 1558 |     if options.!debug == 1 then say time()' _UserCredUpdate started'
 | 
|---|
| 1559 |     credentials.!username = VRGet("EF_USER","Value")
 | 
|---|
| 1560 |     credentials.!password = VRGet("EF_PASSWORD","Value")
 | 
|---|
| 1561 | 
 | 
|---|
| 1562 |     if pos("4OS2", value("COMSPEC",,"OS2ENVIRONMENT")) = 1 | pos(left(credentials.!password,1),'01234567890') > 0
 | 
|---|
| 1563 |         then UserCred = '--user='Credentials.!username'%%'Credentials.!password
 | 
|---|
| 1564 |         else UserCred = '--user='Credentials.!username'%'Credentials.!password
 | 
|---|
| 1565 | 
 | 
|---|
| 1566 |     if options.!storecreds = 1 & \(UserCred   = 'USERCRED'   | UserCred = '' | UserCred = '--user=%' | UserCred = '--user=%%' | UserCred = '-N') then do
 | 
|---|
| 1567 |         ok = _ucSetUc()
 | 
|---|
| 1568 |         ok = VRSet("Pict_PWINMEM","PicturePath","#36")
 | 
|---|
| 1569 |         if options.!debug == 1 then call beep 2400, 10
 | 
|---|
| 1570 |     end
 | 
|---|
| 1571 |     else do
 | 
|---|
| 1572 |         if options.!debug == 1 then call beep 200, 20
 | 
|---|
| 1573 |         ok = VRSet("Pict_PWINMEM","PicturePath","#37")
 | 
|---|
| 1574 |     end
 | 
|---|
| 1575 |     if options.!debug == 1 then say time()' _UserCredUpdate done'
 | 
|---|
| 1576 | return
 | 
|---|
| 1577 | 
 | 
|---|
| 1578 | /*:VRX         CB_client_lanman_auth_Click
 | 
|---|
| 1579 | */
 | 
|---|
| 1580 | CB_client_lanman_auth_Click:
 | 
|---|
| 1581 |     advanced.!smbconfchanged = 1
 | 
|---|
| 1582 | return
 | 
|---|
| 1583 | 
 | 
|---|
| 1584 | /*:VRX         CB_client_NTLMv2_auth_Click
 | 
|---|
| 1585 | */
 | 
|---|
| 1586 | CB_client_NTLMv2_auth_Click:
 | 
|---|
| 1587 |     advanced.!smbconfchanged = 1
 | 
|---|
| 1588 | 
 | 
|---|
| 1589 |     if VRGet("CB_client_NTLMv2_auth","Set") = 0 then do
 | 
|---|
| 1590 |         ok = VRSet("CB_client_lanman_auth","Enabled", 1)
 | 
|---|
| 1591 |         ok = VRSet("CB_client_plaintext_auth","Enabled", 1)
 | 
|---|
| 1592 |     end
 | 
|---|
| 1593 |     else do
 | 
|---|
| 1594 |         ok = VRSet("CB_client_lanman_auth","Enabled", 0)
 | 
|---|
| 1595 |         ok = VRSet("CB_client_lanman_auth","Set", 0)
 | 
|---|
| 1596 |         ok = VRSet("CB_client_plaintext_auth","Enabled", 0)
 | 
|---|
| 1597 |         ok = VRSet("CB_client_plaintext_auth","Set", 0)
 | 
|---|
| 1598 |     end
 | 
|---|
| 1599 | return
 | 
|---|
| 1600 | 
 | 
|---|
| 1601 | /*:VRX         CB_client_plaintext_auth_Click
 | 
|---|
| 1602 | */
 | 
|---|
| 1603 | CB_client_plaintext_auth_Click:
 | 
|---|
| 1604 |     advanced.!smbconfchanged = 1
 | 
|---|
| 1605 | return
 | 
|---|
| 1606 | 
 | 
|---|
| 1607 | /*:VRX         CB_client_use_spnego_Click
 | 
|---|
| 1608 | */
 | 
|---|
| 1609 | CB_client_use_spnego_Click:
 | 
|---|
| 1610 |     advanced.!smbconfchanged = 1
 | 
|---|
| 1611 | return
 | 
|---|
| 1612 | 
 | 
|---|
| 1613 | /*:VRX         CB_client_use_spnego_principal_Click
 | 
|---|
| 1614 | */
 | 
|---|
| 1615 | CB_client_use_spnego_principal_Click:
 | 
|---|
| 1616 |     advanced.!smbconfchanged = 1
 | 
|---|
| 1617 | return
 | 
|---|
| 1618 | 
 | 
|---|
| 1619 | /*:VRX         CB_DEBUG_Click
 | 
|---|
| 1620 | */
 | 
|---|
| 1621 | CB_DEBUG_Click:
 | 
|---|
| 1622 | 
 | 
|---|
| 1623 | return
 | 
|---|
| 1624 | 
 | 
|---|
| 1625 | /*:VRX         CB_ENCRYPTION1_Click
 | 
|---|
| 1626 | */
 | 
|---|
| 1627 | CB_ENCRYPTION1_Click:
 | 
|---|
| 1628 |     if VRGet("CB_ENCRYPTION1","set") then do
 | 
|---|
| 1629 |         ok = VRSet("CB_NTLMv11", "Set", 0)
 | 
|---|
| 1630 |         ok = VRSet("CB_NTLMv11", "Enabled", 0)
 | 
|---|
| 1631 |     end
 | 
|---|
| 1632 |     else do
 | 
|---|
| 1633 |         ok = VRSet("CB_NTLMv11", "Enabled", 1)
 | 
|---|
| 1634 |     end
 | 
|---|
| 1635 | 
 | 
|---|
| 1636 | return
 | 
|---|
| 1637 | 
 | 
|---|
| 1638 | /*:VRX         CB_ENCRYPTION_Click
 | 
|---|
| 1639 | */
 | 
|---|
| 1640 | CB_ENCRYPTION_Click:
 | 
|---|
| 1641 |     if VRGet("CB_ENCRYPTION","set") then do
 | 
|---|
| 1642 |         ok = VRSet("CB_NTLMv1", "Set", 0)
 | 
|---|
| 1643 |         ok = VRSet("CB_NTLMv1", "Enabled", 0)
 | 
|---|
| 1644 |     end
 | 
|---|
| 1645 |     else do
 | 
|---|
| 1646 |         ok = VRSet("CB_NTLMv1", "Enabled", 1)
 | 
|---|
| 1647 |     end
 | 
|---|
| 1648 | return
 | 
|---|
| 1649 | 
 | 
|---|
| 1650 | /*:VRX         CB_KERBEROS51_Click
 | 
|---|
| 1651 | */
 | 
|---|
| 1652 | CB_KERBEROS51_Click:
 | 
|---|
| 1653 |     if VRGet("CB_KERBEROS51","set") then do
 | 
|---|
| 1654 |         ok = VRSet("CB_NTLMv11", "Set", 0)
 | 
|---|
| 1655 |         ok = VRSet("CB_NTLMv11", "Enabled", 0)
 | 
|---|
| 1656 |     end
 | 
|---|
| 1657 |     else do
 | 
|---|
| 1658 |         ok = VRSet("CB_NTLMv11", "Enabled", 1)
 | 
|---|
| 1659 |     end
 | 
|---|
| 1660 | return
 | 
|---|
| 1661 | /*:VRX         CB_KERBEROS5_Click
 | 
|---|
| 1662 | */
 | 
|---|
| 1663 | CB_KERBEROS5_Click:
 | 
|---|
| 1664 |     if VRGet("CB_KERBEROS5","set") then do
 | 
|---|
| 1665 |         ok = VRSet("CB_NTLMv1", "Set", 0)
 | 
|---|
| 1666 |         ok = VRSet("CB_NTLMv1", "Enabled", 0)
 | 
|---|
| 1667 |     end
 | 
|---|
| 1668 |     else do
 | 
|---|
| 1669 |         ok = VRSet("CB_NTLMv1", "Enabled", 1)
 | 
|---|
| 1670 |     end
 | 
|---|
| 1671 | return
 | 
|---|
| 1672 | 
 | 
|---|
| 1673 | /*:VRX         CB_LOGGING_Click
 | 
|---|
| 1674 | */
 | 
|---|
| 1675 | CB_LOGGING_Click:
 | 
|---|
| 1676 |     if VRFileExists(SysBootDrive()'\ndpsmb.dbg') then
 | 
|---|
| 1677 |         ok = SysFileDelete(SysBootDrive()'\ndpsmb.dbg')
 | 
|---|
| 1678 |     else do
 | 
|---|
| 1679 |         call lineout SysBootDrive()'\ndpsmb.dbg','NDPSMB debug flag file'
 | 
|---|
| 1680 |         ok = stream(SysBootDrive()'\ndpsmb.dbg','c','close')
 | 
|---|
| 1681 |     end
 | 
|---|
| 1682 | 
 | 
|---|
| 1683 |     CALL VRSet "CB_LOGGING", "Set", VRFileExists(SysBootDrive()'\ndpsmb.dbg')
 | 
|---|
| 1684 | return
 | 
|---|
| 1685 | 
 | 
|---|
| 1686 | /*:VRX         CB_MOUNT_Change
 | 
|---|
| 1687 | */
 | 
|---|
| 1688 | CB_MOUNT_Change:
 | 
|---|
| 1689 |     if options.!debug == 1 then say time()' '||"CB_MOUNT_Change started"
 | 
|---|
| 1690 | 
 | 
|---|
| 1691 |     mount = VRGet("CB_MOUNT", "Value")
 | 
|---|
| 1692 | 
 | 
|---|
| 1693 |     /* Catch empty mount type error */
 | 
|---|
| 1694 |     if mount = "" then do
 | 
|---|
| 1695 |         if mtype.1 <> "" then ok = VRSet("CB_MOUNT", "Value", mtype.1)
 | 
|---|
| 1696 |         if options.!debug == 1 then say time()' '||"CB_MOUNT_Change aborted"
 | 
|---|
| 1697 |         return
 | 
|---|
| 1698 |     end
 | 
|---|
| 1699 | 
 | 
|---|
| 1700 |     SELECT
 | 
|---|
| 1701 |         WHEN mount == mtype.1 THEN DO
 | 
|---|
| 1702 |             CALL VRSet "DT_SHARE",   "Visible", 1
 | 
|---|
| 1703 |             CALL VRSet "EF_SHARE",   "Visible", 1
 | 
|---|
| 1704 |             CALL VRSet "DT_SERVER",  "Visible", 1
 | 
|---|
| 1705 |             CALL VRSet "EF_SERVER",  "Visible", 1
 | 
|---|
| 1706 |             CALL VRSet "DT_NETWORK", "Visible", 1
 | 
|---|
| 1707 |             CALL VRSet "EF_NETWORK", "Visible", 1
 | 
|---|
| 1708 |             CALL VRSet "CHK_MTYPE",  "Visible", 0
 | 
|---|
| 1709 |             CALL NLVSetText "DT_NETWORK", "Caption", 21
 | 
|---|
| 1710 |         END
 | 
|---|
| 1711 |         WHEN mount == mtype.2 THEN DO
 | 
|---|
| 1712 |             CALL VRSet "DT_SHARE",   "Visible", 0
 | 
|---|
| 1713 |             CALL VRSet "EF_SHARE",   "Visible", 0
 | 
|---|
| 1714 |             CALL VRSet "DT_SERVER",  "Visible", 1
 | 
|---|
| 1715 |             CALL VRSet "EF_SERVER",  "Visible", 1
 | 
|---|
| 1716 |             CALL VRSet "DT_NETWORK", "Visible", 1
 | 
|---|
| 1717 |             CALL VRSet "EF_NETWORK", "Visible", 1
 | 
|---|
| 1718 |             CALL VRSet "CHK_MTYPE",  "Visible", 0
 | 
|---|
| 1719 |             CALL NLVSetText "DT_NETWORK", "Caption", 21
 | 
|---|
| 1720 |         END
 | 
|---|
| 1721 |         WHEN mount == mtype.3 THEN DO
 | 
|---|
| 1722 |             CALL VRSet "DT_SHARE",   "Visible", 0
 | 
|---|
| 1723 |             CALL VRSet "EF_SHARE",   "Visible", 0
 | 
|---|
| 1724 |             CALL VRSet "DT_SERVER",  "Visible", 0
 | 
|---|
| 1725 |             CALL VRSet "EF_SERVER",  "Visible", 0
 | 
|---|
| 1726 |             CALL VRSet "DT_NETWORK", "Visible", 1
 | 
|---|
| 1727 |             CALL VRSet "EF_NETWORK", "Visible", 1
 | 
|---|
| 1728 |             CALL VRSet "CHK_MTYPE",  "Visible", 0
 | 
|---|
| 1729 |             CALL NLVSetText "DT_NETWORK", "Caption", 21
 | 
|---|
| 1730 |         END
 | 
|---|
| 1731 |         WHEN mount == mtype.4 THEN DO
 | 
|---|
| 1732 |             CALL VRSet "DT_SHARE",   "Visible", 0
 | 
|---|
| 1733 |             CALL VRSet "EF_SHARE",   "Visible", 0
 | 
|---|
| 1734 |             CALL VRSet "DT_SERVER",  "Visible", 0
 | 
|---|
| 1735 |             CALL VRSet "EF_SERVER",  "Visible", 0
 | 
|---|
| 1736 |             CALL VRSet "DT_NETWORK", "Visible", 1
 | 
|---|
| 1737 |             CALL VRSet "EF_NETWORK", "Visible", 1
 | 
|---|
| 1738 |             CALL VRSet "CHK_MTYPE",  "Visible", 1
 | 
|---|
| 1739 |             CALL NLVSetText "DT_NETWORK", "Caption", 22
 | 
|---|
| 1740 |         END
 | 
|---|
| 1741 |         WHEN mount == mtype.5 THEN DO
 | 
|---|
| 1742 |             CALL VRSet "DT_SHARE",   "Visible", 0
 | 
|---|
| 1743 |             CALL VRSet "EF_SHARE",   "Visible", 0
 | 
|---|
| 1744 |             CALL VRSet "DT_SERVER",  "Visible", 1
 | 
|---|
| 1745 |             CALL VRSet "EF_SERVER",  "Visible", 1
 | 
|---|
| 1746 |             CALL VRSet "DT_NETWORK", "Visible", 0
 | 
|---|
| 1747 |             CALL VRSet "EF_NETWORK", "Visible", 0
 | 
|---|
| 1748 |             CALL VRSet "CHK_MTYPE",  "Visible", 0
 | 
|---|
| 1749 |             CALL NLVSetText "DT_Server", "Caption", 111
 | 
|---|
| 1750 |         END
 | 
|---|
| 1751 |         OTHERWISE DO
 | 
|---|
| 1752 |             id = VRMessage( "", 'unknown mount type here >>'mount'<< mtype1=>>'mtype.1'<<', "Mount change error", "E", )
 | 
|---|
| 1753 |         END
 | 
|---|
| 1754 |     END
 | 
|---|
| 1755 |     if options.!debug == 1 then say time()' '||"CB_MOUNT_Change done"
 | 
|---|
| 1756 | RETURN
 | 
|---|
| 1757 | 
 | 
|---|
| 1758 | /*:VRX         CB_NTLMV11_Click
 | 
|---|
| 1759 | */
 | 
|---|
| 1760 | CB_NTLMV11_Click:
 | 
|---|
| 1761 |     if VRGet("CB_NTLMV11","set") then do
 | 
|---|
| 1762 |         ok = VRSet("CB_KERBEROS51", "Set", 0)
 | 
|---|
| 1763 |         ok = VRSet("CB_ENCRYPTION1","Set", 0)
 | 
|---|
| 1764 |         ok = VRSet("CB_KERBEROS51", "Enabled", 0)
 | 
|---|
| 1765 |         ok = VRSet("CB_ENCRYPTION1","Enabled", 0)
 | 
|---|
| 1766 |     end
 | 
|---|
| 1767 |     else do
 | 
|---|
| 1768 |         ok = VRSet("CB_KERBEROS51", "Enabled", 1)
 | 
|---|
| 1769 |         ok = VRSet("CB_ENCRYPTION1","Enabled", 1)
 | 
|---|
| 1770 |     end
 | 
|---|
| 1771 | return
 | 
|---|
| 1772 | 
 | 
|---|
| 1773 | /*:VRX         CB_NTLMv1_Click
 | 
|---|
| 1774 | */
 | 
|---|
| 1775 | CB_NTLMv1_Click:
 | 
|---|
| 1776 |     if VRGet("CB_NTLMV1","set") then do
 | 
|---|
| 1777 |         ok = VRSet("CB_KERBEROS5", "Set", 0)
 | 
|---|
| 1778 |         ok = VRSet("CB_ENCRYPTION","Set", 0)
 | 
|---|
| 1779 |         ok = VRSet("CB_KERBEROS5", "Enabled", 0)
 | 
|---|
| 1780 |         ok = VRSet("CB_ENCRYPTION","Enabled", 0)
 | 
|---|
| 1781 |     end
 | 
|---|
| 1782 |     else do
 | 
|---|
| 1783 |         ok = VRSet("CB_KERBEROS5", "Enabled", 1)
 | 
|---|
| 1784 |         ok = VRSet("CB_ENCRYPTION","Enabled", 1)
 | 
|---|
| 1785 |     end
 | 
|---|
| 1786 | return
 | 
|---|
| 1787 | 
 | 
|---|
| 1788 | /*:VRX         CN_CONDET_Click
 | 
|---|
| 1789 | */
 | 
|---|
| 1790 | CN_CONDET_Click:
 | 
|---|
| 1791 |     /* call _StatusBarWrapper VRGet("Main", "HintText") */
 | 
|---|
| 1792 | return
 | 
|---|
| 1793 | 
 | 
|---|
| 1794 | /*:VRX         CN_CONDET_ContextMenu
 | 
|---|
| 1795 | */
 | 
|---|
| 1796 | CN_CONDET_ContextMenu:
 | 
|---|
| 1797 |     rh = VRInfo('Record')
 | 
|---|
| 1798 |     if VRMethod( "CN_CONDET", "ValidateRecord", rh) <> 1 then return
 | 
|---|
| 1799 | 
 | 
|---|
| 1800 |     /* Hide all context menu entries */
 | 
|---|
| 1801 |     ok = VRSet("Menu_Selected_Remove",           "Visible", 0) /* CN_CONDET */
 | 
|---|
| 1802 |     ok = VRSet("Menu_Selected_Retry",            "Visible", 0) /* CN_CONDET */
 | 
|---|
| 1803 |     ok = VRSet("Menu_Selected_Connect",          "Visible", 0) /* CN_SMBTREE */
 | 
|---|
| 1804 |     ok = VRSet("Menu_Selected_Sep1",             "Visible", 0) /* CN_SMBTREE */
 | 
|---|
| 1805 |     ok = VRSet("Menu_Selected_Info",             "Visible", 0) /* CN_SMBTREE */
 | 
|---|
| 1806 |     ok = VRSet("Menu_Selected_TimeSync",         "Visible", 0) /* CN_SMBTREE */
 | 
|---|
| 1807 |     ok = VRSet("Menu_Selected_Refresh",          "Visible", 0) /* CN_SMBTREE */
 | 
|---|
| 1808 |     ok = VRSet("Menu_Selected_Default_Workgroup","Visible", 0) /* CN_SMBTREE */
 | 
|---|
| 1809 | 
 | 
|---|
| 1810 |     /* This is the place to enable specific context menu entries */
 | 
|---|
| 1811 |     ok = VRMethod( "CN_CONDET", "GetRecordList", "All", "records." )
 | 
|---|
| 1812 |     ok = VRSet("Menu_Selected_Remove", "Visible",  (records.0 <> 0))
 | 
|---|
| 1813 |     ok = VRSet("Menu_Selected_Retry",  "Visible",  (records.0 <> 0))
 | 
|---|
| 1814 | 
 | 
|---|
| 1815 |     if VRMethod( "CN_CONDET", "GetFieldData", rh, CD.StatusFH) = icons.!passive then do
 | 
|---|
| 1816 |         ok = VRSet("Menu_Selected_Retry",  "Enabled",1)
 | 
|---|
| 1817 |         ok = VRSet("Menu_Selected_Remove", "Enabled",1)
 | 
|---|
| 1818 |     end
 | 
|---|
| 1819 |     ok = VRMethod( "Menu_Selected", "Popup", , , "", "" )
 | 
|---|
| 1820 | return
 | 
|---|
| 1821 | /*:VRX         CN_CONDET_DragStart
 | 
|---|
| 1822 | */
 | 
|---|
| 1823 | CN_CONDET_DragStart:
 | 
|---|
| 1824 | 
 | 
|---|
| 1825 |     obj = VRInfo( "object" )
 | 
|---|
| 1826 |     ok = VRMethod( "CN_CONDET", "GetRecordList", "SourceOrSelected", "selrec." )
 | 
|---|
| 1827 |     if selrec.0 = 0 then return
 | 
|---|
| 1828 | 
 | 
|---|
| 1829 |     Icon = VRMethod("CN_CONDET", "GetRecordAttr", selrec.1, "Icon")
 | 
|---|
| 1830 | 
 | 
|---|
| 1831 |     if Icon = icons.!printer then do /* Printers not supported at the moment */
 | 
|---|
| 1832 |         call beep 4800,100
 | 
|---|
| 1833 |         CALL VRMessage 'Main', NLVGetMessage( 62 ), NLVGetMessage( 5 ), 'E'
 | 
|---|
| 1834 |     end
 | 
|---|
| 1835 |     else call VRMethod obj, 'StartDrag'
 | 
|---|
| 1836 | return
 | 
|---|
| 1837 | 
 | 
|---|
| 1838 | /*:VRX         CN_CURRENT_Click
 | 
|---|
| 1839 | */
 | 
|---|
| 1840 | CN_CURRENT_Click:
 | 
|---|
| 1841 |     if options.!debug == 1 then say time()' CN_CURRENT_Click started'
 | 
|---|
| 1842 |     /* call _StatusBarWrapper VRGet("Main", "HintText") */
 | 
|---|
| 1843 | 
 | 
|---|
| 1844 |     /* Herwig B. */
 | 
|---|
| 1845 |     CALL VRSet "TM_AUTOCLOSE", "ENABLED", 0
 | 
|---|
| 1846 |     ok = VRSet("Menu_Selected_Default_Workgroup","Visible", 0)
 | 
|---|
| 1847 | 
 | 
|---|
| 1848 |     rh = VRInfo('Record')
 | 
|---|
| 1849 |     if VRMethod( "CN_CURRENT", "ValidateRecord", rh) <> 1 then return
 | 
|---|
| 1850 | 
 | 
|---|
| 1851 |     data = VRMethod("CN_CURRENT", 'GetRecordAttr', rh, 'UserData')
 | 
|---|
| 1852 |     options.currentdata = data
 | 
|---|
| 1853 | 
 | 
|---|
| 1854 |     /* call _StatusBarWrapper data' - 'VRGet("Main", "HintText") */
 | 
|---|
| 1855 | 
 | 
|---|
| 1856 |     PARSE VAR data p_node ';' p_mounts ';' p_string
 | 
|---|
| 1857 | 
 | 
|---|
| 1858 |     if options.!debug == 1 then do
 | 
|---|
| 1859 |         say '  data        = "'data'"'
 | 
|---|
| 1860 |         say '  p_node      = "'p_node'"'
 | 
|---|
| 1861 |         say '  p_mounts    = "'p_mounts'"'
 | 
|---|
| 1862 |         say '  p_string    = "'p_string'"'
 | 
|---|
| 1863 |     end
 | 
|---|
| 1864 | 
 | 
|---|
| 1865 |     if p_string = ""
 | 
|---|
| 1866 |         then infotext = fs.!name' 'fs.!version
 | 
|---|
| 1867 |         else infotext = p_string
 | 
|---|
| 1868 | 
 | 
|---|
| 1869 |     if infotext = "" then infotext = " "
 | 
|---|
| 1870 |     CALL VRSet "CN_CURRENT", "Caption", infotext
 | 
|---|
| 1871 |     CALL VRSet "CN_CURRENT", 'HintText',infotext
 | 
|---|
| 1872 | 
 | 
|---|
| 1873 |     IF p_mounts > 0 THEN DO
 | 
|---|
| 1874 |         CALL VRSet 'PB_UNMOUNT',               'Enabled', 1
 | 
|---|
| 1875 |         CALL VRSet 'MENU_CONTEXT_UNMOUNT',     'Visible', 1
 | 
|---|
| 1876 | 
 | 
|---|
| 1877 |         if pos("*",p_string) > 0 | pos(";",p_string) > 0
 | 
|---|
| 1878 |             then CALL VRSet 'MENU_CONTEXT_EDIT', 'Visible', 0
 | 
|---|
| 1879 |             else CALL VRSet 'MENU_CONTEXT_EDIT', 'Visible', 1
 | 
|---|
| 1880 |     END
 | 
|---|
| 1881 |     ELSE DO
 | 
|---|
| 1882 |         CALL VRSet 'PB_UNMOUNT',               'Enabled', 0
 | 
|---|
| 1883 |         CALL VRSet 'MENU_CONTEXT_UNMOUNT',     'Visible', 0
 | 
|---|
| 1884 |         CALL VRSet 'MENU_CONTEXT_EDIT',        'Visible', 0
 | 
|---|
| 1885 |     END
 | 
|---|
| 1886 | 
 | 
|---|
| 1887 |     parent = VRMethod("CN_CURRENT", 'GetRecordAttr', rh, 'Parent')
 | 
|---|
| 1888 | 
 | 
|---|
| 1889 |     IF parent == '' THEN DO
 | 
|---|
| 1890 |         CALL VRSet 'PB_DETACH',               'Enabled', 1
 | 
|---|
| 1891 |         CALL VRSet 'MENU_CONTEXT_DETACH',     'Visible', 1
 | 
|---|
| 1892 |         CALL VRSet 'MENU_CONTEXT_OPEN',       'Visible', 1
 | 
|---|
| 1893 | /*      CALL VRSet 'MENU_CONTEXT_SEP1',       'Visible', 1 */
 | 
|---|
| 1894 |         CALL VRSet 'MENU_CONTEXT_DETACH_ALL', 'Visible', 1
 | 
|---|
| 1895 | /*      CALL VRSet 'MENU_CONTEXT_SEP2',       'Visible', 1 */
 | 
|---|
| 1896 | 
 | 
|---|
| 1897 |     END
 | 
|---|
| 1898 |     ELSE DO
 | 
|---|
| 1899 |         CALL VRSet 'PB_DETACH',               'Enabled', 0
 | 
|---|
| 1900 |         CALL VRSet 'MENU_CONTEXT_DETACH',     'Visible', 0
 | 
|---|
| 1901 |         CALL VRSet 'MENU_CONTEXT_OPEN',       'Visible', 0
 | 
|---|
| 1902 | /*      CALL VRSet 'MENU_CONTEXT_SEP1',       'Visible', 0 */
 | 
|---|
| 1903 |         CALL VRSet 'MENU_CONTEXT_DETACH_ALL', 'Visible', 0
 | 
|---|
| 1904 | /*      CALL VRSet 'MENU_CONTEXT_SEP2',       'Visible', 0 */
 | 
|---|
| 1905 |     END
 | 
|---|
| 1906 | 
 | 
|---|
| 1907 |     parse var p_string p_workgroup'\\'p_server'\'p_share
 | 
|---|
| 1908 | 
 | 
|---|
| 1909 |     p_workgroup = strip(p_workgroup,'T',':')
 | 
|---|
| 1910 | 
 | 
|---|
| 1911 |     if options.!debug == 1 then do
 | 
|---|
| 1912 |         say '  p_workgroup = "'p_workgroup'"'
 | 
|---|
| 1913 |         say '  p_server    = "'p_server'"'
 | 
|---|
| 1914 |         say '  p_share     = "'p_share'"'
 | 
|---|
| 1915 |     end
 | 
|---|
| 1916 | 
 | 
|---|
| 1917 |     p_server = translate(p_server)
 | 
|---|
| 1918 | 
 | 
|---|
| 1919 |     ok = VRSet("EF_NETWORK","Value", p_workgroup)
 | 
|---|
| 1920 |     if p_workgroup <> "" then do
 | 
|---|
| 1921 |         wgh = _GetMachineHandle(p_workgroup)
 | 
|---|
| 1922 |         if wgh = "" then wgh = _AddWorkGroup(p_workgroup)
 | 
|---|
| 1923 |         call _UpdateObject "EF_SERVER", p_server
 | 
|---|
| 1924 |         mh = _GetMachineHandle(p_server)
 | 
|---|
| 1925 |         if mh = "" & p_server <> "*" then do
 | 
|---|
| 1926 |             mh = _AddSleepingMachine(p_server,'',wgh)
 | 
|---|
| 1927 |             machine = p_server
 | 
|---|
| 1928 |             call _RefreshShares
 | 
|---|
| 1929 |         end
 | 
|---|
| 1930 |         ok = VRSet("EF_Share","Value", p_share)
 | 
|---|
| 1931 |         select
 | 
|---|
| 1932 |             when p_workgroup = "*" then ok = VRSet("CB_MOUNT","Value", mtype.4)
 | 
|---|
| 1933 |             when p_server    = "*" then ok = VRSet("CB_MOUNT","Value", mtype.3)
 | 
|---|
| 1934 |             when p_share     = "*" then ok = VRSet("CB_MOUNT","Value", mtype.2)
 | 
|---|
| 1935 |             otherwise ok = VRSet("CB_MOUNT","Value", mtype.1)
 | 
|---|
| 1936 |         end
 | 
|---|
| 1937 |     end
 | 
|---|
| 1938 |     if options.!debug == 1 then say time()' CN_CURRENT_Click done'
 | 
|---|
| 1939 | RETURN
 | 
|---|
| 1940 | 
 | 
|---|
| 1941 | /*:VRX         CN_CURRENT_ContextMenu
 | 
|---|
| 1942 | */
 | 
|---|
| 1943 | CN_CURRENT_ContextMenu: /* PROCEDURE EXPOSE existrec. options. icons. fs. */
 | 
|---|
| 1944 |     if options.!debug == 1 then say time()' '||"CN_CURRENT_ContextMenu started"
 | 
|---|
| 1945 | 
 | 
|---|
| 1946 |     CALL VRSet "TM_AUTOCLOSE", "ENABLED", 0
 | 
|---|
| 1947 | 
 | 
|---|
| 1948 |     rh = VRInfo('Record')
 | 
|---|
| 1949 | 
 | 
|---|
| 1950 |     /* we have to check whether the record still exists because under certain
 | 
|---|
| 1951 |        circumstances the event routine is executed after the record was already
 | 
|---|
| 1952 |        removed */
 | 
|---|
| 1953 |     if VRMethod( "CN_CURRENT", "ValidateRecord", rh) <> 1 then do
 | 
|---|
| 1954 |         if options.!debug == 1 then say time()' '||"CN_CURRENT_ContextMenu aborted"
 | 
|---|
| 1955 |         return
 | 
|---|
| 1956 |     end
 | 
|---|
| 1957 | 
 | 
|---|
| 1958 |     data = VRMethod("CN_CURRENT", 'GetRecordAttr', rh, 'UserData')
 | 
|---|
| 1959 |     PARSE VAR data p_node ';' p_mounts ';' p_string
 | 
|---|
| 1960 | 
 | 
|---|
| 1961 |     if options.!debug == 1 then do
 | 
|---|
| 1962 |         say '  data =     "'data'"'
 | 
|---|
| 1963 |         say '  p_node =   "'p_node'"'
 | 
|---|
| 1964 |         say '  p_mounts = "'p_mounts'"'
 | 
|---|
| 1965 |         say '  p_string = "'p_string'"'
 | 
|---|
| 1966 |     end
 | 
|---|
| 1967 | /*
 | 
|---|
| 1968 |     infotext = p_node
 | 
|---|
| 1969 |     DO i = 1 TO p_mounts
 | 
|---|
| 1970 |         infotext = infotext ' ['p_string']'
 | 
|---|
| 1971 |     END
 | 
|---|
| 1972 | */
 | 
|---|
| 1973 |     if p_string = ""
 | 
|---|
| 1974 |         then infotext = fs.!name' 'fs.!version
 | 
|---|
| 1975 |         else infotext = p_string
 | 
|---|
| 1976 | 
 | 
|---|
| 1977 |     if infotext = "" then infotext = " "
 | 
|---|
| 1978 |     CALL VRSet "CN_CURRENT", "Caption", infotext
 | 
|---|
| 1979 |     CALL VRSet "CN_CURRENT", 'HintText',infotext
 | 
|---|
| 1980 | 
 | 
|---|
| 1981 |     CALL VRSet 'MENU_CONTEXT_OPEN', 'Visible', 1
 | 
|---|
| 1982 | /*  CALL VRSet 'MENU_CONTEXT_SEP1', 'Visible', 1
 | 
|---|
| 1983 |     CALL VRSet 'MENU_CONTEXT_SEP2', 'Visible', 1
 | 
|---|
| 1984 |     CALL VRSet 'MENU_CONTEXT_SEP3', 'Visible', 1 */
 | 
|---|
| 1985 |     CALL VRSet 'Menu_Context_Open_Default', "Visible", 1
 | 
|---|
| 1986 | 
 | 
|---|
| 1987 |     IF p_mounts > 0 THEN DO
 | 
|---|
| 1988 |         CALL VRSet 'PB_UNMOUNT',               'Enabled', 1
 | 
|---|
| 1989 |         CALL VRSet 'MENU_CONTEXT_UNMOUNT',     'Visible', 1
 | 
|---|
| 1990 | 
 | 
|---|
| 1991 |         if pos("*",p_string) > 0 | pos(";",p_string) > 0 then CALL VRSet 'MENU_CONTEXT_EDIT', 'Visible', 0
 | 
|---|
| 1992 |                                  else CALL VRSet 'MENU_CONTEXT_EDIT', 'Visible', 1
 | 
|---|
| 1993 |     END
 | 
|---|
| 1994 |     ELSE DO
 | 
|---|
| 1995 |         CALL VRSet 'PB_UNMOUNT',               'Enabled', 0
 | 
|---|
| 1996 |         CALL VRSet 'MENU_CONTEXT_UNMOUNT',     'Visible', 0
 | 
|---|
| 1997 |         CALL VRSet 'MENU_CONTEXT_EDIT',        'Visible', 0
 | 
|---|
| 1998 |     END
 | 
|---|
| 1999 | 
 | 
|---|
| 2000 |     parent = VRMethod("CN_CURRENT", 'GetRecordAttr', rh, 'Parent')
 | 
|---|
| 2001 | 
 | 
|---|
| 2002 |     IF parent == '' THEN DO
 | 
|---|
| 2003 |         CALL VRSet 'PB_DETACH',               'Enabled', 1
 | 
|---|
| 2004 |         CALL VRSet 'MENU_CONTEXT_DETACH',     'Visible', 1
 | 
|---|
| 2005 |         CALL VRSet 'MENU_CONTEXT_OPEN',       'Visible', 1
 | 
|---|
| 2006 | /*      CALL VRSet 'MENU_CONTEXT_SEP1',       'Visible', 1 */
 | 
|---|
| 2007 |         CALL VRSet 'MENU_CONTEXT_DETACH_ALL', 'Visible', 1
 | 
|---|
| 2008 | /*      CALL VRSet 'MENU_CONTEXT_SEP2',       'Visible', 1 */
 | 
|---|
| 2009 | /*      CALL VRSet 'MENU_CONTEXT_SEP3',       'Visible', 1 */
 | 
|---|
| 2010 |     END
 | 
|---|
| 2011 |     ELSE DO
 | 
|---|
| 2012 |         CALL VRSet 'PB_DETACH',               'Enabled', 0
 | 
|---|
| 2013 |         CALL VRSet 'MENU_CONTEXT_DETACH',     'Visible', 0
 | 
|---|
| 2014 |         CALL VRSet 'MENU_CONTEXT_OPEN',       'Visible', 0
 | 
|---|
| 2015 | /*      CALL VRSet 'MENU_CONTEXT_SEP1',       'Visible', 0 */
 | 
|---|
| 2016 |         CALL VRSet 'MENU_CONTEXT_DETACH_ALL', 'Visible', 0
 | 
|---|
| 2017 | /*      CALL VRSet 'MENU_CONTEXT_SEP2',       'Visible', 0 */
 | 
|---|
| 2018 | /*      CALL VRSet 'MENU_CONTEXT_SEP3',       'Visible', 0 */
 | 
|---|
| 2019 |     END
 | 
|---|
| 2020 | 
 | 
|---|
| 2021 |     ok = VRMethod( "Menu_Context", "Popup", , , "", "" )
 | 
|---|
| 2022 |     if options.!debug == 1 then say time()' '||"CN_CURRENT_ContextMenu done"
 | 
|---|
| 2023 | return
 | 
|---|
| 2024 | 
 | 
|---|
| 2025 | /*:VRX         CN_CURRENT_DoubleClick
 | 
|---|
| 2026 | */
 | 
|---|
| 2027 | CN_CURRENT_DoubleClick:
 | 
|---|
| 2028 |     if options.!debug == 1 then say time()' '||"CN_CURRENT_DoubleClick started"
 | 
|---|
| 2029 | 
 | 
|---|
| 2030 |     CALL VRSet "TM_AUTOCLOSE", "ENABLED", 0
 | 
|---|
| 2031 | 
 | 
|---|
| 2032 |     rh = VRInfo('Record')
 | 
|---|
| 2033 | 
 | 
|---|
| 2034 |     /* we have to check whether the record still exists because under certain
 | 
|---|
| 2035 |        circumstances the event routine is executed after the record was already
 | 
|---|
| 2036 |        removed */
 | 
|---|
| 2037 |     if VRMethod( "CN_CURRENT", "ValidateRecord", rh) <> 1 then do
 | 
|---|
| 2038 |         if options.!debug == 1 then say time()' '||"CN_CURRENT_DoubleClick aborted"
 | 
|---|
| 2039 |         return
 | 
|---|
| 2040 |     end
 | 
|---|
| 2041 | 
 | 
|---|
| 2042 |     data = VRMethod("CN_CURRENT", 'GetRecordAttr', rh, 'UserData')
 | 
|---|
| 2043 |     PARSE VAR data p_node ';' p_mounts ';' p_string
 | 
|---|
| 2044 | 
 | 
|---|
| 2045 |     if options.!debug == 1 then do
 | 
|---|
| 2046 |         say '  data =     "'data'"'
 | 
|---|
| 2047 |         say '  p_node =   "'p_node'"'
 | 
|---|
| 2048 |         say '  p_mounts = "'p_mounts'"'
 | 
|---|
| 2049 |         say '  p_string = "'p_string'"'
 | 
|---|
| 2050 |     end
 | 
|---|
| 2051 |     call Menu_Context_Open_Default_Click
 | 
|---|
| 2052 | 
 | 
|---|
| 2053 |     if options.!debug == 1 then say time()' '||"CN_CURRENT_DoubleClick done"
 | 
|---|
| 2054 | return
 | 
|---|
| 2055 | 
 | 
|---|
| 2056 | /*:VRX         CN_CURRENT_DragDrop
 | 
|---|
| 2057 | */
 | 
|---|
| 2058 | CN_CURRENT_DragDrop:
 | 
|---|
| 2059 |     if options.!debug == 1 then say time()' CN_CURRENT_DragDrop started'
 | 
|---|
| 2060 |     ok = VRSet("TM_RefreshCurrentDisplay","Enabled", 0)
 | 
|---|
| 2061 |     if options.!debug == 1 then say "  settings.!network = "settings.!network
 | 
|---|
| 2062 | 
 | 
|---|
| 2063 |     p_workgroup = ''
 | 
|---|
| 2064 |     p_server    = ''
 | 
|---|
| 2065 |     p_share     = ''
 | 
|---|
| 2066 | 
 | 
|---|
| 2067 |     srcFile = VRInfo( "SourceFile" )
 | 
|---|
| 2068 |     srcCtn  = VRInfo( "SourceObject" )
 | 
|---|
| 2069 |     srcRec  = VRInfo( "SourceRecord" )
 | 
|---|
| 2070 |     trgCtn  = VRInfo( "TargetObject" )
 | 
|---|
| 2071 |     trgRec  = VRInfo( "TargetRecord" )
 | 
|---|
| 2072 | 
 | 
|---|
| 2073 |     if options.!debug == 1 then do
 | 
|---|
| 2074 |         say '  srcFile     = "'srcFile'"'
 | 
|---|
| 2075 |         say '  srcCtn      = "'srcCtn'"'
 | 
|---|
| 2076 |         if srcCtn <> "" then say '  srcCtn name = "'VRGet(srcCtn,'Name')'"'
 | 
|---|
| 2077 |         say '  srcRec      = "'srcRec'"'
 | 
|---|
| 2078 |         say '  trgCtn      = "'trgCtn'"'
 | 
|---|
| 2079 |         if trgCtn <> "" then say '  trgCtn name = "'VRGet(trgCtn,'Name')'"'
 | 
|---|
| 2080 |         say '  trgRec      = "'trgRec'"'
 | 
|---|
| 2081 |     end
 | 
|---|
| 2082 | 
 | 
|---|
| 2083 |     if srcFile <> "" then do /* A file was dropped onto the container - attempt to load it */
 | 
|---|
| 2084 |         if options.!debug == 1 then say '  Possible profile dropped: "'srcFile'"'
 | 
|---|
| 2085 | 
 | 
|---|
| 2086 |         /* was it really a profile ? */
 | 
|---|
| 2087 |         if translate(VRParseFileName(srcFile,'E')) = translate(fs.!profileext) then do /* Yes - load it! */
 | 
|---|
| 2088 |             options.!autoload = 1
 | 
|---|
| 2089 |             Profile = srcFile
 | 
|---|
| 2090 |             call Menu_File_Load_Click
 | 
|---|
| 2091 |             ok = VRSet("EF_NETWORK","Value",options.!workgroup)
 | 
|---|
| 2092 |         end
 | 
|---|
| 2093 |         else do /* No - barf! */
 | 
|---|
| 2094 |             buttons.0 = 1
 | 
|---|
| 2095 |             buttons.1 = NLVGetMessage(9)
 | 
|---|
| 2096 |             ok = VRMessage('Main', NLVGetMessage(103,srcFile ), NLVGetMessage(5), 'E','buttons.')
 | 
|---|
| 2097 |         end
 | 
|---|
| 2098 |         if options.!debug == 1 then say time()' CN_CURRENT_DragDrop done (load profile)'
 | 
|---|
| 2099 |         return
 | 
|---|
| 2100 |     end
 | 
|---|
| 2101 | 
 | 
|---|
| 2102 |     ok = VRMethod("CB_MOUNT", "GetStringList", "ShareLevels." )
 | 
|---|
| 2103 | 
 | 
|---|
| 2104 |     if VRGet(srcCtn,'Name') = "CN_CONDET" then do
 | 
|---|
| 2105 |         p_mpoint    = VRMethod("CN_CONDET", "GetFieldData", srcRec, CD.MpointFH)
 | 
|---|
| 2106 | 
 | 
|---|
| 2107 |         p_workgroup = VRMethod("CN_CONDET", "GetFieldData", srcRec, cd.workgrpFH  )
 | 
|---|
| 2108 |         p_server    = VRMethod("CN_CONDET", "GetFieldData", srcRec, CD.ServerFH)
 | 
|---|
| 2109 |         p_share     = VRMethod("CN_CONDET", "GetFieldData", srcRec, CD.ShareFH)
 | 
|---|
| 2110 |         p_user      = VRMethod("CN_CONDET", "GetFieldData", srcRec, CD.UserFH)
 | 
|---|
| 2111 |         p_password  = x2c(VRMethod("CN_CONDET", "GetFieldData", srcRec, CD.SpasswordFH))
 | 
|---|
| 2112 | 
 | 
|---|
| 2113 |         ShareLevel = 1
 | 
|---|
| 2114 |         if p_share     = "" then ShareLevel = 2
 | 
|---|
| 2115 |         if p_server    = "" then ShareLevel = 3
 | 
|---|
| 2116 |         if p_workgroup = "" then ShareLevel = 4
 | 
|---|
| 2117 | 
 | 
|---|
| 2118 |         ok = VRSet("CB_MOUNT",  "Selected", Sharelevel )
 | 
|---|
| 2119 |         ok = VRset("CB_MOUNT",  "Value",    mtype.sharelevel)
 | 
|---|
| 2120 | 
 | 
|---|
| 2121 |         call _UpdateObject "EF_SERVER", p_server
 | 
|---|
| 2122 |         ok = VRset("EF_SHARE",    "Value", p_share)
 | 
|---|
| 2123 |         ok = VRset("EF_NETWORK",  "Value", p_workgroup)
 | 
|---|
| 2124 |         ok = VRset("EF_USER",     "Value", p_user)
 | 
|---|
| 2125 |         ok = VRset("EF_PASSWORD", "Value", p_password)
 | 
|---|
| 2126 | 
 | 
|---|
| 2127 |         parse var p_mpoint p_drv '\' p_dir
 | 
|---|
| 2128 | 
 | 
|---|
| 2129 |         p_dir = strip(p_dir,'T','\')
 | 
|---|
| 2130 | 
 | 
|---|
| 2131 |         ok = VRset("CB_DRIVES",    "Value", p_drv)
 | 
|---|
| 2132 |         ok = VRset("EF_DIRECTORY", "Value", p_dir)
 | 
|---|
| 2133 |     end /* Drag from CN_CONDET */
 | 
|---|
| 2134 | 
 | 
|---|
| 2135 |     else do /* Drag from CN_SMBTREE */
 | 
|---|
| 2136 |         call _GetSMBObjectProperties srcRec
 | 
|---|
| 2137 |         select
 | 
|---|
| 2138 |             when SMBObj.udatatype = "WORKGROUP" then do
 | 
|---|
| 2139 |                 say "Workgroup dragged!"
 | 
|---|
| 2140 |                 p_workgroup = SMBObj.resname
 | 
|---|
| 2141 |                 p_server    = ""
 | 
|---|
| 2142 |                 p_share     = ""
 | 
|---|
| 2143 | 
 | 
|---|
| 2144 |                 ShareLevel = 3
 | 
|---|
| 2145 |             end
 | 
|---|
| 2146 |             when SMBObj.udatatype = "SERVER" then do
 | 
|---|
| 2147 |                 say "Server dragged!"
 | 
|---|
| 2148 |                 if SMBObj.parentrh <> "" then do /* detect server without workgroup */
 | 
|---|
| 2149 |                     p_workgroup = VRMethod("CN_SMBTREE", "GetRecordAttr", SMBObj.parentrh, "Caption")
 | 
|---|
| 2150 |                 end
 | 
|---|
| 2151 |                 p_server    = SMBObj.resname
 | 
|---|
| 2152 |                 p_share     = ""
 | 
|---|
| 2153 | 
 | 
|---|
| 2154 |                 ShareLevel = 2
 | 
|---|
| 2155 |             end
 | 
|---|
| 2156 |             when SMBObj.udatatype = "DISK" then do
 | 
|---|
| 2157 |                 say "Shared disk dragged!"
 | 
|---|
| 2158 |                 if SMBObj.gparentrh <> "" then do /* detect share on a server without workgroup */
 | 
|---|
| 2159 |                     p_workgroup = VRMethod("CN_SMBTREE", "GetRecordAttr", SMBObj.gparentrh, "Caption")
 | 
|---|
| 2160 |                 end
 | 
|---|
| 2161 |                 p_server    = VRMethod("CN_SMBTREE", "GetRecordAttr", SMBObj.parentrh,  "Caption")
 | 
|---|
| 2162 |                 parse var p_server p_server '0D0A'x .
 | 
|---|
| 2163 |                 p_share     = SMBObj.resname
 | 
|---|
| 2164 | 
 | 
|---|
| 2165 |                 ShareLevel = 1
 | 
|---|
| 2166 |             end
 | 
|---|
| 2167 |             otherwise nop /* Printer */
 | 
|---|
| 2168 |         end
 | 
|---|
| 2169 |         ok = VRSet("EF_NETWORK","Value",p_workgroup)
 | 
|---|
| 2170 |         call _UpdateObject "EF_SERVER", p_server
 | 
|---|
| 2171 |         ok = VRSet("EF_Share","Value",  p_share)
 | 
|---|
| 2172 |     end /* Drag from CN_SMBTREE */
 | 
|---|
| 2173 | 
 | 
|---|
| 2174 |     if options.!debug == 1 then do
 | 
|---|
| 2175 |         say 'p_workgroup = "'p_workgroup'"'
 | 
|---|
| 2176 |         say 'p_server    = "'p_server'"'
 | 
|---|
| 2177 |         say 'p_share     = "'p_share'"'
 | 
|---|
| 2178 |     end
 | 
|---|
| 2179 | 
 | 
|---|
| 2180 |     ok = VRSet( "CB_MOUNT", "Selected", Sharelevel )
 | 
|---|
| 2181 | 
 | 
|---|
| 2182 |     settings.!network = VRGet("EF_NETWORK","Value")
 | 
|---|
| 2183 |     call CB_MOUNT_Change
 | 
|---|
| 2184 | 
 | 
|---|
| 2185 |     if trgRec = "" then do
 | 
|---|
| 2186 |         ok = VRMethod("CB_DRIVES",  "GetStringList", "freedrives.")
 | 
|---|
| 2187 |         if freedrives.0 > 0
 | 
|---|
| 2188 |             then ok = VRSet("CB_DRIVES","Value", freedrives.1)
 | 
|---|
| 2189 |             else ok = VRSet("CB_DRIVES","Value", "")
 | 
|---|
| 2190 | 
 | 
|---|
| 2191 |         ok = VRSet("EF_DIRECTORY","Value", "")
 | 
|---|
| 2192 |     end
 | 
|---|
| 2193 |     else do
 | 
|---|
| 2194 |         TargetString = VRMethod(trgCtn, "GetRecordAttr", trgRec, "Caption")
 | 
|---|
| 2195 | 
 | 
|---|
| 2196 |         parTrgRH = VRMethod(trgCtn, "GetRecordAttr", trgRec, "Parent")
 | 
|---|
| 2197 | 
 | 
|---|
| 2198 |         do while parTrgRH <> ""
 | 
|---|
| 2199 |             partrgCapt = VRMethod(trgCtn, "GetRecordAttr", partrgRH, "Caption")
 | 
|---|
| 2200 |             TargetString = partrgCapt||'\'||TargetString
 | 
|---|
| 2201 |             parTrgRH = VRMethod(trgCtn, "GetRecordAttr", partrgRH , "Parent")
 | 
|---|
| 2202 |         end
 | 
|---|
| 2203 |         say 'TargetString = "'TargetString'"'
 | 
|---|
| 2204 |         ok = VRSet("CB_DRIVES","Value", left(TargetString,2))
 | 
|---|
| 2205 |         ok = VRSet("EF_DIRECTORY","Value", substr(TargetString,4))
 | 
|---|
| 2206 |     end
 | 
|---|
| 2207 | 
 | 
|---|
| 2208 |     window = VRLoadSecondary( "SW_MOUNTPOINT", "W" )
 | 
|---|
| 2209 |     if VRGet("CB_DRIVES","Value") = "" then return
 | 
|---|
| 2210 | 
 | 
|---|
| 2211 |     window = VRLoadSecondary( "SW_LOGIN", "W" )
 | 
|---|
| 2212 |     if credentials.!entered = 1 then call PB_MOUNT_CLICK
 | 
|---|
| 2213 | 
 | 
|---|
| 2214 |     if VRGet(srcCtn,'Name') = "CN_CONDET" & VRMethod( "CN_CONDET", "ValidateRecord", srcRec) = 1 then do
 | 
|---|
| 2215 |         if VRMethod("CN_CONDET", "GetRecordAttr", srcRec, "Icon") = icons.!passive then ok = VRMethod( "CN_CONDET", "RemoveRecord", srcRec)
 | 
|---|
| 2216 |     end
 | 
|---|
| 2217 |     if options.!debug == 1 then say time()' CN_CURRENT_DragDrop done'
 | 
|---|
| 2218 | return
 | 
|---|
| 2219 | /*:VRX         CN_SMBTREE_Click
 | 
|---|
| 2220 | */
 | 
|---|
| 2221 | CN_SMBTREE_Click:
 | 
|---|
| 2222 |     if options.!debug == 1 then say time()' CN_SMBTREE_Click started'
 | 
|---|
| 2223 |     /* call _StatusBarWrapper VRGet("Main", "HintText") */
 | 
|---|
| 2224 | 
 | 
|---|
| 2225 |     call _dropdeprecated
 | 
|---|
| 2226 |     call _GetSmbObjectProperties VRInfo('Record')
 | 
|---|
| 2227 |     call _ContextMenuSelectedSet
 | 
|---|
| 2228 | 
 | 
|---|
| 2229 |     call _StatusBarWrapper SMBObj.udatamsg
 | 
|---|
| 2230 | 
 | 
|---|
| 2231 |     if options.!debug == 1 then say time()' CN_SMBTREE_Click done'
 | 
|---|
| 2232 | return
 | 
|---|
| 2233 | /*:VRX         CN_SMBTREE_ContextMenu
 | 
|---|
| 2234 | */
 | 
|---|
| 2235 | CN_SMBTREE_ContextMenu:
 | 
|---|
| 2236 |     if options.!debug == 1 then say time()' CN_SMBTREE_ContextMenu started'
 | 
|---|
| 2237 |     call _dropdeprecated
 | 
|---|
| 2238 |     RH = VRInfo('Record')
 | 
|---|
| 2239 |     if RH <> "" then do
 | 
|---|
| 2240 |         call _GetSmbObjectProperties RH
 | 
|---|
| 2241 |         call _ContextMenuSelectedSet
 | 
|---|
| 2242 | 
 | 
|---|
| 2243 |         BrowsePath = _browsebuildpath(SMBObj.rh)
 | 
|---|
| 2244 | 
 | 
|---|
| 2245 |         call _BrowseResetObject(SmbObj.rh)
 | 
|---|
| 2246 | 
 | 
|---|
| 2247 |         parse var browsepath '\\'machine'\'sharename '\' browsepath
 | 
|---|
| 2248 | 
 | 
|---|
| 2249 |         ok = VRMethod( "Menu_Selected", "Popup", , , "", "PositionOnItem" )
 | 
|---|
| 2250 |     end
 | 
|---|
| 2251 | 
 | 
|---|
| 2252 |     if options.!debug == 1 then say time()' CN_SMBTREE_ContextMenu done'
 | 
|---|
| 2253 | return
 | 
|---|
| 2254 | /*:VRX         CN_SMBTREE_DoubleClick
 | 
|---|
| 2255 | */
 | 
|---|
| 2256 | CN_SMBTREE_DoubleClick:
 | 
|---|
| 2257 |     if options.!debug == 1 then say time()' CN_SMBTREE_DoubleClick started'
 | 
|---|
| 2258 | 
 | 
|---|
| 2259 |     call _dropdeprecated
 | 
|---|
| 2260 |     call _GetSmbObjectProperties VRInfo('Record')
 | 
|---|
| 2261 | 
 | 
|---|
| 2262 | /*  if options.!debug == 1 then say time()' CN_SMBTREE_DoubleClick done'
 | 
|---|
| 2263 | return */
 | 
|---|
| 2264 |     /* Enable last 2 lines for 2.0.x (to disable on the fly browsing) */
 | 
|---|
| 2265 | 
 | 
|---|
| 2266 |     if options.!debug == 1 then say '  Browsing "'SMBObj.udatatype'"'
 | 
|---|
| 2267 | 
 | 
|---|
| 2268 |     If SMBObj.udatatype = "DIRECTORY" then do
 | 
|---|
| 2269 |         BrowsePath = _browsebuildpath(SMBObj.rh)
 | 
|---|
| 2270 | 
 | 
|---|
| 2271 |         call _BrowseResetObject(SmbObj.rh)
 | 
|---|
| 2272 | 
 | 
|---|
| 2273 |         parse var browsepath '\\'machine'\'sharename '\' browsepath
 | 
|---|
| 2274 |         browsepath = browsepath'\*'
 | 
|---|
| 2275 | 
 | 
|---|
| 2276 |         call _BrowseDirectory
 | 
|---|
| 2277 |     end
 | 
|---|
| 2278 | 
 | 
|---|
| 2279 |     If SMBObj.udatatype = "FILE" then do
 | 
|---|
| 2280 |         BrowsePath = _browsebuildpath(SMBObj.rh)
 | 
|---|
| 2281 |         call _BrowseResetObject(SmbObj.rh)
 | 
|---|
| 2282 | 
 | 
|---|
| 2283 |         parse var browsepath '\\'machine'\'sharename '\' browsepath
 | 
|---|
| 2284 | 
 | 
|---|
| 2285 |         OpenOk = _browseobjectopen(machine,sharename,browsepath)
 | 
|---|
| 2286 | 
 | 
|---|
| 2287 |         if \OpenOK then do
 | 
|---|
| 2288 |             say "  Not connected - trying to connect"
 | 
|---|
| 2289 |             ok = VRMethod( "CN_SMBTREE", "SetRecordAttr", sharerh, "Selected", 1)
 | 
|---|
| 2290 |             call PB_SMBTREE_CONNECT_Click
 | 
|---|
| 2291 |             ok = VRMethod( "CN_SMBTREE", "SetRecordAttr", SMBObj.rh, "Selected", 1)
 | 
|---|
| 2292 | 
 | 
|---|
| 2293 |             OpenOk = _browseobjectopen(machine,sharename,browsepath)
 | 
|---|
| 2294 | 
 | 
|---|
| 2295 |             if \OpenOk then do
 | 
|---|
| 2296 |                 say "  Not connected - cannot open - aborting!"
 | 
|---|
| 2297 |             end
 | 
|---|
| 2298 |         end
 | 
|---|
| 2299 |     end
 | 
|---|
| 2300 | 
 | 
|---|
| 2301 |     if SMBObj.udatatype = "DISK" then do
 | 
|---|
| 2302 |         machine  = VRMethod("CN_SMBTREE","GetRecordAttr",SMBObj.parentrh,"Caption")
 | 
|---|
| 2303 |         parse var machine machine '0D0A'x .
 | 
|---|
| 2304 |         machine = strip(machine)
 | 
|---|
| 2305 | 
 | 
|---|
| 2306 |         call _BrowseResetObject(SmbObj.rh)
 | 
|---|
| 2307 | 
 | 
|---|
| 2308 |         sharename = SMBObj.resname
 | 
|---|
| 2309 |         BrowsePath = ""
 | 
|---|
| 2310 | 
 | 
|---|
| 2311 |         call _BrowseDirectory
 | 
|---|
| 2312 |     end
 | 
|---|
| 2313 |     if options.!debug == 1 then say time()' CN_SMBTREE_DoubleClick done'
 | 
|---|
| 2314 | return
 | 
|---|
| 2315 | /*:VRX         CN_SMBTREE_DragFile
 | 
|---|
| 2316 | */
 | 
|---|
| 2317 | CN_SMBTREE_DragFile:
 | 
|---|
| 2318 |     if options.!debug == 1 then say time()' CN_SMBTREE_DragFile started'
 | 
|---|
| 2319 | 
 | 
|---|
| 2320 |     obj = VRInfo( "object" )
 | 
|---|
| 2321 | 
 | 
|---|
| 2322 |     ok = VRMethod( "CN_SMBTREE", "GetRecordList", "SourceOrSelected", "SelRH." )
 | 
|---|
| 2323 |     if SelRH.0 = 0 then do
 | 
|---|
| 2324 |         if options.!debug == 1 then say time()' CN_SMBTREE_DragStart aborted'
 | 
|---|
| 2325 |         return
 | 
|---|
| 2326 |     end
 | 
|---|
| 2327 | 
 | 
|---|
| 2328 |     call _dropdeprecated
 | 
|---|
| 2329 |     call _GetSMBObjectProperties SelRH.1
 | 
|---|
| 2330 | 
 | 
|---|
| 2331 |     select
 | 
|---|
| 2332 |         when SMBObj.udatatype = "WORKGROUP" | SMBObj.udatatype = "SERVER" | SMBObj.udatatype = "DISK" then do
 | 
|---|
| 2333 |             call VRMethod obj, 'StartDrag'
 | 
|---|
| 2334 |         end
 | 
|---|
| 2335 |         when SMBObj.udatatype = "PRINTER" then do
 | 
|---|
| 2336 |             CALL VRMessage 'Main', NLVGetMessage( 62 ), NLVGetMessage( 5 ), 'E'
 | 
|---|
| 2337 |         end
 | 
|---|
| 2338 |         otherwise nop /* FILE DIRECTORY */
 | 
|---|
| 2339 |     end
 | 
|---|
| 2340 | 
 | 
|---|
| 2341 |     if options.!debug == 1 then say time()' CN_SMBTREE_DragFile done'
 | 
|---|
| 2342 | return
 | 
|---|
| 2343 | 
 | 
|---|
| 2344 | /*:VRX         CN_SMBTREE_DragStart
 | 
|---|
| 2345 | */
 | 
|---|
| 2346 | CN_SMBTREE_DragStart:
 | 
|---|
| 2347 |     if options.!debug == 1 then say time()' CN_SMBTREE_DragStart started'
 | 
|---|
| 2348 | 
 | 
|---|
| 2349 |     obj = VRInfo( "object" )
 | 
|---|
| 2350 | 
 | 
|---|
| 2351 |     ok = VRMethod( "CN_SMBTREE", "GetRecordList", "SourceOrSelected", "SelRH." )
 | 
|---|
| 2352 |     if SelRH.0 = 0 then do
 | 
|---|
| 2353 |         if options.!debug == 1 then say time()' CN_SMBTREE_DragStart aborted'
 | 
|---|
| 2354 |         return
 | 
|---|
| 2355 |     end
 | 
|---|
| 2356 | 
 | 
|---|
| 2357 |     call _dropdeprecated
 | 
|---|
| 2358 |     call _GetSMBObjectProperties SelRH.1
 | 
|---|
| 2359 | 
 | 
|---|
| 2360 |     select
 | 
|---|
| 2361 |         when SMBObj.udatatype = "WORKGROUP" | SMBObj.udatatype = "SERVER" | SMBObj.udatatype = "DISK" then do
 | 
|---|
| 2362 |             call VRMethod obj, 'StartDrag'
 | 
|---|
| 2363 |         end
 | 
|---|
| 2364 |         when SMBObj.udatatype = "PRINTER" then do
 | 
|---|
| 2365 |             CALL VRMessage 'Main', NLVGetMessage( 62 ), NLVGetMessage( 5 ), 'E'
 | 
|---|
| 2366 |         end
 | 
|---|
| 2367 |         otherwise nop /* FILE DIRECTORY */
 | 
|---|
| 2368 |     end
 | 
|---|
| 2369 | 
 | 
|---|
| 2370 |     if options.!debug == 1 then say time()' CN_SMBTREE_DragStart done'
 | 
|---|
| 2371 | return
 | 
|---|
| 2372 | /*:VRX         CreateObject
 | 
|---|
| 2373 | */
 | 
|---|
| 2374 | CreateObject: procedure
 | 
|---|
| 2375 |     Parse Arg Class, Title, Location, Setup, Collision
 | 
|---|
| 2376 |     /* say 'Creating ['Title']' */
 | 
|---|
| 2377 | say Setup
 | 
|---|
| 2378 |     rc = SysCreateObject( Class, Title, Location, Setup, Collision )
 | 
|---|
| 2379 |     If rc <> 1 Then do
 | 
|---|
| 2380 |         Msg.Text = ' > failed to create ['Title' | 'Class'] at location ['Location']'
 | 
|---|
| 2381 |         Msg.Type = 'Error'
 | 
|---|
| 2382 |         say Msg.Text
 | 
|---|
| 2383 |     end
 | 
|---|
| 2384 | return rc
 | 
|---|
| 2385 | /*:VRX         DT_STATUSBAR_ContextMenu
 | 
|---|
| 2386 | */
 | 
|---|
| 2387 | DT_STATUSBAR_ContextMenu:
 | 
|---|
| 2388 |     call _StatusBarWrapper VRGet("Main", "HintText")
 | 
|---|
| 2389 | return
 | 
|---|
| 2390 | 
 | 
|---|
| 2391 | /*:VRX         EF_PASSWORD1_KeyPress
 | 
|---|
| 2392 | */
 | 
|---|
| 2393 | EF_PASSWORD1_KeyPress:
 | 
|---|
| 2394 |     if options.!debug == 1 then say time()' EF_PASSWORD1_KeyPress started'
 | 
|---|
| 2395 |     obj = VRInfo( "Object" )
 | 
|---|
| 2396 |     keystr = VRGet( obj, "KeyString" )
 | 
|---|
| 2397 | /*  say keystr */
 | 
|---|
| 2398 |     select
 | 
|---|
| 2399 |         when keystr = "{Enter}" then call PB_LOGIN_OK_Click
 | 
|---|
| 2400 |         when keystr = "{Newline}" then call PB_LOGIN_OK_Click
 | 
|---|
| 2401 |         when keystr  = "{Esc}" then call PB_LOGIN_CANCEL_Click
 | 
|---|
| 2402 |         otherwise nop
 | 
|---|
| 2403 |     end
 | 
|---|
| 2404 |     if options.!debug == 1 then say time()' EF_PASSWORD1_KeyPress done'
 | 
|---|
| 2405 | return
 | 
|---|
| 2406 | 
 | 
|---|
| 2407 | /*:VRX         EF_PASSWORD_Change
 | 
|---|
| 2408 | */
 | 
|---|
| 2409 | EF_PASSWORD_Change:
 | 
|---|
| 2410 |     Now = VRGet("EF_PASSWORD","value")
 | 
|---|
| 2411 |     if Now = "" | Now = LastPassword then return
 | 
|---|
| 2412 |     ok = SysSleep(1)
 | 
|---|
| 2413 |     LastPassword = Now
 | 
|---|
| 2414 |     if Now <> VRGet("EF_PASSWORD","value") then return
 | 
|---|
| 2415 |     call _UserCredUpdate
 | 
|---|
| 2416 | return
 | 
|---|
| 2417 | 
 | 
|---|
| 2418 | /*:VRX         EF_SERVER_Change
 | 
|---|
| 2419 | */
 | 
|---|
| 2420 | EF_SERVER_Change:
 | 
|---|
| 2421 |     if options.!debug == 1 then say time()' EF_SERVER_Change started'
 | 
|---|
| 2422 |     Now = VRGet("EF_SERVER","value")
 | 
|---|
| 2423 | 
 | 
|---|
| 2424 |     if Now = "" | Now = LastServer then return
 | 
|---|
| 2425 |     ok = SysSleep(2)
 | 
|---|
| 2426 |     if Now <> VRGet("EF_SERVER","value") then return
 | 
|---|
| 2427 | 
 | 
|---|
| 2428 |     IF options.!editmode = 1 then return
 | 
|---|
| 2429 | 
 | 
|---|
| 2430 |     /* Do nothing for incomplete IP addresses */
 | 
|---|
| 2431 |     if strip(translate(VRGet("EF_SERVER","value"),copies(' ',11),'01234567890.')) = "" then do /* got an IP address */
 | 
|---|
| 2432 |         if \_IsValidIPAddress(VRGet("EF_SERVER","value")) then return /* it is invalid or incomplete */
 | 
|---|
| 2433 |     end
 | 
|---|
| 2434 | 
 | 
|---|
| 2435 |     /* do nothing if a workgroup was mounted */
 | 
|---|
| 2436 |     if VRGet("EF_SERVER","value") = "*" then return
 | 
|---|
| 2437 | 
 | 
|---|
| 2438 |     machine = VRGet("EF_SERVER","value")
 | 
|---|
| 2439 |     ok = VRSet("EF_SHARE","Value", "")
 | 
|---|
| 2440 |     ok = VRMethod("EF_SHARE","Reset")
 | 
|---|
| 2441 | 
 | 
|---|
| 2442 |     rh = _GetMachineHandle(machine)
 | 
|---|
| 2443 |     if rh <> "" then do
 | 
|---|
| 2444 |         call _GetSMBObjectProperties rh
 | 
|---|
| 2445 |         if SMBObj.parentrh = ""
 | 
|---|
| 2446 |             then ok = VRSet("EF_NETWORK","Value", "") /* The workgroup might be unknown at this moment */
 | 
|---|
| 2447 |             else ok = VRSet("EF_NETWORK","Value", VRMethod("CN_SMBTREE","GetRecordAttr",SMBObj.parentRH,"Caption"))
 | 
|---|
| 2448 | 
 | 
|---|
| 2449 |         call _GetSMBObjectShares SMBObj.rh
 | 
|---|
| 2450 | 
 | 
|---|
| 2451 |         if SMBObj.shares.0 > 0 then do
 | 
|---|
| 2452 |             ok = VRMethod("EF_SHARE",   "AddStringList", "SMBObj.shares.")
 | 
|---|
| 2453 |         end
 | 
|---|
| 2454 |     end
 | 
|---|
| 2455 |     else do
 | 
|---|
| 2456 |         call _RefreshWorkgroups
 | 
|---|
| 2457 |         smbtree.!machine = _AddSleepingMachine(machine,"","")
 | 
|---|
| 2458 |         call _UserCredUpdate
 | 
|---|
| 2459 |         call _RefreshShares
 | 
|---|
| 2460 |         ok = VRSet( "CN_smbtree", "Painting", 1  )
 | 
|---|
| 2461 | 
 | 
|---|
| 2462 |         ok = VRSet("Main", 'Pointer', '<default>' )
 | 
|---|
| 2463 |         ok = VRSet("CN_smbtree","Enabled", 1)
 | 
|---|
| 2464 |         ok = VRSet("TM_Throbber","Enabled", 0)
 | 
|---|
| 2465 |         ok = VRSet("Pict_Throbber","Visible", 0)
 | 
|---|
| 2466 |     end
 | 
|---|
| 2467 | 
 | 
|---|
| 2468 |     LastServer = VRGet("EF_SERVER","value")
 | 
|---|
| 2469 |     if options.!debug == 1 then say time()' EF_SERVER_Change done'
 | 
|---|
| 2470 | return
 | 
|---|
| 2471 | 
 | 
|---|
| 2472 | /*:VRX         EF_USER1_KeyPress
 | 
|---|
| 2473 | */
 | 
|---|
| 2474 | EF_USER1_KeyPress:
 | 
|---|
| 2475 |     if options.!debug == 1 then say time()' EF_USER1_KeyPress started'
 | 
|---|
| 2476 |     obj = VRInfo( "Object" )
 | 
|---|
| 2477 |     keystr = VRGet( obj, "KeyString" )
 | 
|---|
| 2478 |     say keystr
 | 
|---|
| 2479 |     select
 | 
|---|
| 2480 |         when keystr = "{Enter}" then ok = VRMethod( "EF_Password1", "SetFocus" )
 | 
|---|
| 2481 |         when keystr = "{Newline}" then ok = VRMethod( "EF_Password1", "SetFocus" )
 | 
|---|
| 2482 |         when keystr  = "{Esc}" then call PB_LOGIN_CANCEL_Click
 | 
|---|
| 2483 |         otherwise nop
 | 
|---|
| 2484 |     end
 | 
|---|
| 2485 |     if options.!debug == 1 then say time()' EF_USER1_KeyPress done'
 | 
|---|
| 2486 | return
 | 
|---|
| 2487 | 
 | 
|---|
| 2488 | /*:VRX         EF_USER_Change
 | 
|---|
| 2489 | */
 | 
|---|
| 2490 | EF_USER_Change:
 | 
|---|
| 2491 |     Now = VRGet("EF_USER","value")
 | 
|---|
| 2492 |     if Now = "" | Now = LastUser  then return
 | 
|---|
| 2493 |     ok = SysSleep(1)
 | 
|---|
| 2494 |     LastUser = Now
 | 
|---|
| 2495 |     if Now <> VRGet("EF_USER","value") then return
 | 
|---|
| 2496 |     call _UserCredUpdate
 | 
|---|
| 2497 | return
 | 
|---|
| 2498 | 
 | 
|---|
| 2499 | /*:VRX         EF_WINS_SERVER_Change
 | 
|---|
| 2500 | */
 | 
|---|
| 2501 | EF_WINS_SERVER_Change:
 | 
|---|
| 2502 |     advanced.!smbconfchanged = 1
 | 
|---|
| 2503 | return
 | 
|---|
| 2504 | 
 | 
|---|
| 2505 | /*:VRX         Fini
 | 
|---|
| 2506 | */
 | 
|---|
| 2507 | Fini:
 | 
|---|
| 2508 |     window = VRWindow()
 | 
|---|
| 2509 |     call VRSet window, "Visible", 0
 | 
|---|
| 2510 |     drop window
 | 
|---|
| 2511 | return 0
 | 
|---|
| 2512 | 
 | 
|---|
| 2513 | /*:VRX         GetChildren
 | 
|---|
| 2514 | */
 | 
|---|
| 2515 | GetChildren: PROCEDURE EXPOSE existrec. exc options. icons. fs. cd. samba.
 | 
|---|
| 2516 |     if options.!debug == 1 then say time()' GetChildren started'
 | 
|---|
| 2517 |     PARSE ARG node, parec
 | 
|---|
| 2518 | 
 | 
|---|
| 2519 |     CALL _Dynamic "CALL "fs.!prefix"RxGetMount node, 'info.', 'points.', 'res.'"
 | 
|---|
| 2520 | 
 | 
|---|
| 2521 |     IF info.2 > 0 THEN icon = icons.!active
 | 
|---|
| 2522 |                   ELSE icon = icons.!passive
 | 
|---|
| 2523 | 
 | 
|---|
| 2524 |     rh = VRMethod("CN_CURRENT", 'AddRecord', parec, 'Last', info.0, icon )
 | 
|---|
| 2525 |     IF rh == '' | datatype(res.0) <> "NUM" THEN RETURN
 | 
|---|
| 2526 | 
 | 
|---|
| 2527 |     exc = exc + 1
 | 
|---|
| 2528 |     existrec.exc = rh
 | 
|---|
| 2529 |     userdata = node';'info.2
 | 
|---|
| 2530 |     DO i = 1 TO res.0
 | 
|---|
| 2531 |         userdata = ParseResourceData( userdata, res.i )
 | 
|---|
| 2532 |     END
 | 
|---|
| 2533 |     if userdata = "UNKNOWN" then ok = VRMethod("CN_CURRENT", 'RemoveRecord', rh)
 | 
|---|
| 2534 |     else do
 | 
|---|
| 2535 |         CALL VRMethod "CN_CURRENT", 'SetRecordAttr', rh, 'UserData', userdata
 | 
|---|
| 2536 |         if options.currentdata = userdata then ok = VRMethod("CN_CURRENT", 'SetRecordAttr', rh, 'Selected', 1)
 | 
|---|
| 2537 |     end
 | 
|---|
| 2538 | 
 | 
|---|
| 2539 |     DO i = 1 TO points.0
 | 
|---|
| 2540 |         childnode = node || points.i || '\'
 | 
|---|
| 2541 |         CALL GetChildren childnode, rh
 | 
|---|
| 2542 |     END
 | 
|---|
| 2543 |     if options.!debug == 1 then say time()' GetChildren done'
 | 
|---|
| 2544 | RETURN
 | 
|---|
| 2545 | 
 | 
|---|
| 2546 | /*:VRX         GetMountPoints
 | 
|---|
| 2547 | */
 | 
|---|
| 2548 | GetMountPoints: PROCEDURE EXPOSE existrec. options. icons. fs. cd. samba.
 | 
|---|
| 2549 |     if options.!debug == 1 then say time()' GetMountPoints started'
 | 
|---|
| 2550 | /*  CALL VRSet "CN_CURRENT", 'Painting', 0 */
 | 
|---|
| 2551 | /*  if options.!debug == 1 then say time()' '||"GetMountPoints: SysDriveMap(USED) started"  */
 | 
|---|
| 2552 |     drvs = SysDriveMap('C:', 'USED') /* was "REMOTE" */
 | 
|---|
| 2553 | /*  if options.!debug == 1 then say time()' '||"GetMountPoints: SysDriveMap(USED) done" */
 | 
|---|
| 2554 |     ac = 0
 | 
|---|
| 2555 |     DO i = 1 TO WORDS( drvs )
 | 
|---|
| 2556 |         fs = TRANSLATE( SysFileSystemType( WORD( drvs, i )))
 | 
|---|
| 2557 |         IF fs == fs.!fileSystemtype THEN DO
 | 
|---|
| 2558 |             ac = ac + 1
 | 
|---|
| 2559 |             attached.ac = WORD( drvs, i )
 | 
|---|
| 2560 |         END
 | 
|---|
| 2561 |     END
 | 
|---|
| 2562 |     attached.0 = ac
 | 
|---|
| 2563 | 
 | 
|---|
| 2564 |     exc = 0
 | 
|---|
| 2565 |     DO i = 1 TO attached.0
 | 
|---|
| 2566 |         node = attached.i'\'
 | 
|---|
| 2567 | 
 | 
|---|
| 2568 |         CALL VRMethod 'CB_DRIVES',  'AddString', attached.i
 | 
|---|
| 2569 | 
 | 
|---|
| 2570 |         CALL _Dynamic "CALL "fs.!prefix"RxGetMount node, 'info.', 'points.', 'res.'"
 | 
|---|
| 2571 | 
 | 
|---|
| 2572 |         IF info.2 > 0 THEN icon = icons.!drive
 | 
|---|
| 2573 |                       ELSE icon = icons.!drive_inactive
 | 
|---|
| 2574 | 
 | 
|---|
| 2575 |         rh = VRMethod("CN_CURRENT", 'AddRecord',, 'Last', attached.i, icon )
 | 
|---|
| 2576 |         IF rh == '' THEN ITERATE
 | 
|---|
| 2577 | 
 | 
|---|
| 2578 |         exc = exc + 1
 | 
|---|
| 2579 |         existrec.exc = rh
 | 
|---|
| 2580 |         userdata = node';'info.2
 | 
|---|
| 2581 |         DO j = 1 TO res.0
 | 
|---|
| 2582 |             userdata = ParseResourceData( userdata, res.j )
 | 
|---|
| 2583 |         END
 | 
|---|
| 2584 | /*      if options.!debug == 1 then say '  "'attached.i'" "'userdata'"' */
 | 
|---|
| 2585 |         CALL VRMethod "CN_CURRENT", 'SetRecordAttr', rh, 'UserData', userdata /* , 'FileName', 'TESTER.EVP' */
 | 
|---|
| 2586 |         if options.currentdata = userdata then ok = VRMethod("CN_CURRENT", 'SetRecordAttr', rh, 'Selected', 1)
 | 
|---|
| 2587 | 
 | 
|---|
| 2588 |         CALL VRMethod "CN_CURRENT", 'SetRecordAttr', rh, 'Expanded', 1
 | 
|---|
| 2589 | 
 | 
|---|
| 2590 |         DO j = 1 TO points.0
 | 
|---|
| 2591 |             childnode = node || points.j || '\'
 | 
|---|
| 2592 |             CALL GetChildren childnode, rh
 | 
|---|
| 2593 |         END
 | 
|---|
| 2594 | 
 | 
|---|
| 2595 |     END
 | 
|---|
| 2596 |     existrec.0 = exc
 | 
|---|
| 2597 | /*  CALL VRSet "CN_CURRENT", 'Painting', 1 */
 | 
|---|
| 2598 |     if options.!debug == 1 then say time()' '||"GetMountPoints done"
 | 
|---|
| 2599 | RETURN
 | 
|---|
| 2600 | 
 | 
|---|
| 2601 | /*:VRX         Halt
 | 
|---|
| 2602 | */
 | 
|---|
| 2603 | Halt:
 | 
|---|
| 2604 |     signal _VREHalt
 | 
|---|
| 2605 | return
 | 
|---|
| 2606 | 
 | 
|---|
| 2607 | /*:VRX         Init
 | 
|---|
| 2608 | */
 | 
|---|
| 2609 | Init:
 | 
|---|
| 2610 | /* Herwig */
 | 
|---|
| 2611 | /*  CALL VRSet 'Console', 'WindowListTitle', ''  */
 | 
|---|
| 2612 | 
 | 
|---|
| 2613 |     window = VRWindow()
 | 
|---|
| 2614 |     call VRSet window,    "Visible", 0
 | 
|---|
| 2615 |     call VRMethod window, "Activate"
 | 
|---|
| 2616 |     drop window
 | 
|---|
| 2617 | 
 | 
|---|
| 2618 | RETURN
 | 
|---|
| 2619 | 
 | 
|---|
| 2620 | /*:VRX         LoadFileSysFuncs
 | 
|---|
| 2621 | */
 | 
|---|
| 2622 | LoadFileSysFuncs:
 | 
|---|
| 2623 |     if options.!debug == 1 then say time()' LoadFileSysFuncs() started'
 | 
|---|
| 2624 | 
 | 
|---|
| 2625 |     Fatal = 1
 | 
|---|
| 2626 |     RestartCount = 0
 | 
|---|
| 2627 |     FoundEVFS = 1
 | 
|---|
| 2628 |     FoundND = 1
 | 
|---|
| 2629 | 
 | 
|---|
| 2630 |     program = VRGet("Application", "Program")
 | 
|---|
| 2631 |     if program = "" then parse source . . program
 | 
|---|
| 2632 |     say "Program = '"program"'"
 | 
|---|
| 2633 |     program = translate(VRParseFileName(Program,'N'))
 | 
|---|
| 2634 |     say "Program = '"program"'"
 | 
|---|
| 2635 | 
 | 
|---|
| 2636 |     if SysSearchPath("PATH", "EVFSCTL.EXE") = "" | program = "SMBGUI" then do
 | 
|---|
| 2637 |         FoundEVFS = 0
 | 
|---|
| 2638 |         ForceNDFS = 1
 | 
|---|
| 2639 |     end
 | 
|---|
| 2640 | 
 | 
|---|
| 2641 | CtlRestart:
 | 
|---|
| 2642 |     if \ForceNDFS then signal NoNetDrive
 | 
|---|
| 2643 | 
 | 
|---|
| 2644 | ForceNDFS:
 | 
|---|
| 2645 |     if options.!debug == 1 then say '  NDFS check entered'
 | 
|---|
| 2646 |     call RxFuncAdd 'NdRxLoadFuncs', 'NDCALLS', 'NdRxLoadFuncs'
 | 
|---|
| 2647 |     SIGNAL ON SYNTAX NAME NoNetdrive
 | 
|---|
| 2648 |     call NdRxLoadFuncs
 | 
|---|
| 2649 |     FoundND = 1
 | 
|---|
| 2650 |     SIGNAL OFF SYNTAX
 | 
|---|
| 2651 |     fs.!prefix         = 'ND'
 | 
|---|
| 2652 |     fs.!fileSystemtype = "NDFS32"
 | 
|---|
| 2653 |     fs.!profileext     = "ndc"
 | 
|---|
| 2654 |     signal CommonToBothFS
 | 
|---|
| 2655 | NoNetdrive:
 | 
|---|
| 2656 |     if options.!debug == 1 then say '  NDFS not found'
 | 
|---|
| 2657 |     CALL RxFuncAdd 'EvfsRxLoadFuncs', 'EVFSCALL.DLL', 'EvfsRxLoadFuncs'
 | 
|---|
| 2658 |     SIGNAL ON SYNTAX NAME NoEVFSCALL
 | 
|---|
| 2659 |     CALL EvfsRxLoadFuncs
 | 
|---|
| 2660 |     FoundEVFS = 1
 | 
|---|
| 2661 |     SIGNAL OFF SYNTAX
 | 
|---|
| 2662 |     fs.!prefix         = 'EVFS'
 | 
|---|
| 2663 |     fs.!fileSystemtype = "EVFS"
 | 
|---|
| 2664 |     fs.!profileext     = "evp"
 | 
|---|
| 2665 | CommonToBothFS:
 | 
|---|
| 2666 |     if options.!debug == 1 then say '  Common version check'
 | 
|---|
| 2667 |     CALL _Dynamic "fsstat = "fs.!prefix"RxQueryIFS()"
 | 
|---|
| 2668 |     if fsstat = 252 then CALL _Dynamic "Found"fs.!prefix" = 0"
 | 
|---|
| 2669 | 
 | 
|---|
| 2670 |     if word(fsstat,1) = '0' then do
 | 
|---|
| 2671 |         PARSE VAR fsstat '0 'fsname fsver fsctl .
 | 
|---|
| 2672 |         fs.!name = fsname
 | 
|---|
| 2673 |         fs.!version = fsver
 | 
|---|
| 2674 | 
 | 
|---|
| 2675 |         if options.!debug == 1 then DO
 | 
|---|
| 2676 |             say '  fs.!prefix = 'fs.!prefix
 | 
|---|
| 2677 |             say '  fs.!name   = 'fs.!Name
 | 
|---|
| 2678 |             say '  Version    = 'fsver
 | 
|---|
| 2679 |             say '  fsctl      = 'fsctl
 | 
|---|
| 2680 |         end
 | 
|---|
| 2681 |     end
 | 
|---|
| 2682 |     else do
 | 
|---|
| 2683 |         if FoundND = 0 & FoundEVFS = 0 then do
 | 
|---|
| 2684 |             CALL VRMessage 'Main', 'FATAL: Neither EVFS nor Netdrive found: 'fs.!prefix'RxQueryIFS()='fsstat, NLVGetMessage( 5 ), 'E'
 | 
|---|
| 2685 |             signal Halt
 | 
|---|
| 2686 |         end
 | 
|---|
| 2687 |         signal ForceNDFS
 | 
|---|
| 2688 |     end
 | 
|---|
| 2689 |     IF fsctl \= 1 THEN DO
 | 
|---|
| 2690 |         if ReStartCount = 0 then do
 | 
|---|
| 2691 |             'detach 'fs.!prefix'ctl.exe'
 | 
|---|
| 2692 |             RestartCount = 1
 | 
|---|
| 2693 |             ok = SysSleep(1)
 | 
|---|
| 2694 |             signal CtlRestart
 | 
|---|
| 2695 |         end
 | 
|---|
| 2696 |         else do
 | 
|---|
| 2697 |             CALL VRMessage 'Main', NLVGetMessage( 101 ), NLVGetMessage( 5 ), 'E'
 | 
|---|
| 2698 |             signal Halt
 | 
|---|
| 2699 |         end
 | 
|---|
| 2700 |     END
 | 
|---|
| 2701 | 
 | 
|---|
| 2702 |     Fatal = 0
 | 
|---|
| 2703 | 
 | 
|---|
| 2704 |     if options.!debug == 1 then say time()' LoadFileSysFuncs() done'
 | 
|---|
| 2705 | return
 | 
|---|
| 2706 | 
 | 
|---|
| 2707 | /*:VRX         Main_Close
 | 
|---|
| 2708 | */
 | 
|---|
| 2709 | Main_Close:
 | 
|---|
| 2710 |     CALL Quit
 | 
|---|
| 2711 | RETURN
 | 
|---|
| 2712 | 
 | 
|---|
| 2713 | /*:VRX         Main_Create
 | 
|---|
| 2714 | */
 | 
|---|
| 2715 | Main_Create:
 | 
|---|
| 2716 |     options.!debug    = 0
 | 
|---|
| 2717 |     if options.!debug == 1 then do
 | 
|---|
| 2718 |         ok = VRRedirectStdIO("ON")
 | 
|---|
| 2719 |         say time()' Main_Create started'
 | 
|---|
| 2720 |     end
 | 
|---|
| 2721 |     else ok = VRRedirectStdIO("OFF")
 | 
|---|
| 2722 | 
 | 
|---|
| 2723 |     call _InitTempDir
 | 
|---|
| 2724 |     call _LoadOtherFuncs
 | 
|---|
| 2725 | 
 | 
|---|
| 2726 |     call NLVSetup
 | 
|---|
| 2727 |     call _StemsInit
 | 
|---|
| 2728 | 
 | 
|---|
| 2729 |     call _TabbedDialogSetup
 | 
|---|
| 2730 |     call _ContainersInit
 | 
|---|
| 2731 |     call _GUIInit
 | 
|---|
| 2732 | 
 | 
|---|
| 2733 |     CALL _ParseCommandLine
 | 
|---|
| 2734 | 
 | 
|---|
| 2735 |     CALL LoadFileSysFuncs
 | 
|---|
| 2736 | 
 | 
|---|
| 2737 |     CALL _CltInit
 | 
|---|
| 2738 | 
 | 
|---|
| 2739 |     CALL _INILoad
 | 
|---|
| 2740 |     if \VRFileExists(samba.!smbconf)|stream(samba.!smbconf,"c","query size") = 0 then do
 | 
|---|
| 2741 |         call _CreateSmbConf
 | 
|---|
| 2742 |     end
 | 
|---|
| 2743 | 
 | 
|---|
| 2744 |     call _TabFix 1
 | 
|---|
| 2745 |     call SW_ADVANCED_Init_Content
 | 
|---|
| 2746 |     call SW_SMBTREE_Init_Content
 | 
|---|
| 2747 |     call SW_CONDET_Init_Content
 | 
|---|
| 2748 |     call SW_SETTINGS_Init_Content
 | 
|---|
| 2749 | 
 | 
|---|
| 2750 |     CALL Refresh
 | 
|---|
| 2751 | 
 | 
|---|
| 2752 |     if advanced.!savepassive == 1 then CALL _PassiveLoad
 | 
|---|
| 2753 | 
 | 
|---|
| 2754 |     IF options.!timesync == 1 THEN CALL _TimeSync
 | 
|---|
| 2755 | 
 | 
|---|
| 2756 |     IF options.!autoload == 1 THEN CALL Menu_File_Load_Click
 | 
|---|
| 2757 | 
 | 
|---|
| 2758 |     CALL VRSet "CB_MOUNT",  "Selected", 1
 | 
|---|
| 2759 |     CALL VRSet "CB_DRIVES", "Selected", 1
 | 
|---|
| 2760 |     IF options.!autoclose == 1
 | 
|---|
| 2761 |     THEN CALL TM_AutoClose_Trigger
 | 
|---|
| 2762 |     ELSE do
 | 
|---|
| 2763 |         if advanced.!browseauth == 1 then do
 | 
|---|
| 2764 |             /* FIXME: unclear why we have to do the following 4 lines here */
 | 
|---|
| 2765 |             call SW_SETTINGS_Init
 | 
|---|
| 2766 |             call SW_SETTINGS_Init_Content
 | 
|---|
| 2767 |             call SW_ADVANCED_Init
 | 
|---|
| 2768 |             call SW_ADVANCED_Init_Content
 | 
|---|
| 2769 | 
 | 
|---|
| 2770 |             window = VRLoadSecondary( "SW_LOGIN", "W" )
 | 
|---|
| 2771 |             call Main_Resize
 | 
|---|
| 2772 |         end
 | 
|---|
| 2773 |         if advanced.!browseimme == 1 then call PB_SMBTREE_REFRESH_Click
 | 
|---|
| 2774 |     end
 | 
|---|
| 2775 | 
 | 
|---|
| 2776 |     if options.!debug == 1 then say time()' Main_Create done'
 | 
|---|
| 2777 | return
 | 
|---|
| 2778 | 
 | 
|---|
| 2779 | /*:VRX         Main_KeyPress
 | 
|---|
| 2780 | */
 | 
|---|
| 2781 | Main_KeyPress:
 | 
|---|
| 2782 |     key = VRGet('Main', 'KeyString')
 | 
|---|
| 2783 |     IF key == '{F5}' THEN CALL Refresh
 | 
|---|
| 2784 | RETURN
 | 
|---|
| 2785 | 
 | 
|---|
| 2786 | /*:VRX         Main_Resize
 | 
|---|
| 2787 | */
 | 
|---|
| 2788 | Main_Resize:
 | 
|---|
| 2789 |     if options.!debug == 1 then say time()' Main_Resize started'
 | 
|---|
| 2790 |     ok = VRset("Main","Painting", 0)
 | 
|---|
| 2791 | 
 | 
|---|
| 2792 |     /* Basic measurements */
 | 
|---|
| 2793 |     main_iwidth  = VRGet("Main","InteriorWidth")                /* Width of window client-area */
 | 
|---|
| 2794 |     main_iheight = VRGet("Main","InteriorHeight")               /* Height of window client-area */
 | 
|---|
| 2795 | 
 | 
|---|
| 2796 | /** This caused weird resizing glitches, horrible jittering, etc.  Instead,
 | 
|---|
| 2797 |  ** what we now do (further down) is set a minimum size in twips for the right
 | 
|---|
| 2798 |  ** pane, below which it simply stops resizing and switches to clipping.  (The
 | 
|---|
| 2799 |  ** left pane resizes all its controls dynamically anyway.)  This better matches
 | 
|---|
| 2800 |  ** standard application behaviour, and makes resizing behave more smoothly.
 | 
|---|
| 2801 |  *
 | 
|---|
| 2802 |  *  if VRMethod( "Screen", "TwipsToPixels", main_iheight) < 600 then
 | 
|---|
| 2803 |  *      ok = VRSet("Main","Height",VRMethod( "Screen", "PixelsToTwips", 580))
 | 
|---|
| 2804 |  *  if VRMethod( "Screen", "TwipsToPixels", main_iwidth)  < 730 then
 | 
|---|
| 2805 |  *      ok = VRSet("Main","Width", VRMethod( "Screen", "PixelsToTwips", 730))
 | 
|---|
| 2806 |  */
 | 
|---|
| 2807 | 
 | 
|---|
| 2808 |     sbar_height  = VRGet("GB_STATUSBAR","Height")               /* Height of status-bar */
 | 
|---|
| 2809 |     split_left   = VRGet("SPLIT_Main","Left")                   /* Position of the left edge of the split-bar */
 | 
|---|
| 2810 |     marginx2     = margin * 2                                   /* Common margin around controls */
 | 
|---|
| 2811 |     pbtn_height  = 400                                          /* Height of the panels' internal button areas */
 | 
|---|
| 2812 | 
 | 
|---|
| 2813 |     pane_height  = main_iheight - sbar_height - (margin * 4)    /* Height of a split-bar panel */
 | 
|---|
| 2814 |     lpane_width  = split_left - margin                          /* Width of the left split-bar panel */
 | 
|---|
| 2815 |     rpane_width  = main_iwidth - split_left - 60 - margin       /* Width of the right split-bar panel */
 | 
|---|
| 2816 | 
 | 
|---|
| 2817 |     /* Tabbed Dialog = right pane */
 | 
|---|
| 2818 |     ok = VRset("TDL_1", "Top",    marginx2)
 | 
|---|
| 2819 |     ok = VRset("TDL_1", "Left",   split_left + 60)
 | 
|---|
| 2820 |     ok = VRset("TDL_1", "Width",  rpane_width    )
 | 
|---|
| 2821 |     ok = VRset("TDL_1", "Height", pane_height    )
 | 
|---|
| 2822 | 
 | 
|---|
| 2823 |     /* Current Panel */
 | 
|---|
| 2824 |     ok = VRSet("GB_CURRENT",  "Visible", 1           )
 | 
|---|
| 2825 |     ok = VRSet("GB_CURRENT",  "Top",     marginx2  )
 | 
|---|
| 2826 |     ok = VRSet("GB_CURRENT",  "Left",    margin      )
 | 
|---|
| 2827 |     ok = VRSet("GB_CURRENT",  "Width",   lpane_width )
 | 
|---|
| 2828 |     ok = VRSet("GB_CURRENT",  "Height",  pane_height )
 | 
|---|
| 2829 | 
 | 
|---|
| 2830 |     ok = VRset("GB_CURRENT3", "Top",     margin )
 | 
|---|
| 2831 |     ok = VRset("GB_CURRENT3", "Left",    margin )
 | 
|---|
| 2832 |     ok = VRset("GB_CURRENT3", "Height",  245    )
 | 
|---|
| 2833 |     ok = VRset("GB_CURRENT3", "Width",   lpane_width - marginx2)
 | 
|---|
| 2834 | 
 | 
|---|
| 2835 |     ok = VRset("DT_CURRENT", "Top",      8   )
 | 
|---|
| 2836 |     ok = VRset("DT_CURRENT", "Left",     8   )
 | 
|---|
| 2837 |     ok = VRset("DT_CURRENT", "Height",   213 )
 | 
|---|
| 2838 |     ok = VRset("DT_CURRENT", "Width",    (lpane_width - marginx2) - 24 )
 | 
|---|
| 2839 | 
 | 
|---|
| 2840 |     ok = VRset("GB_CURRENT2", "Left",   margin                )
 | 
|---|
| 2841 |     ok = VRset("GB_CURRENT2", "Top",    245 + marginx2        )
 | 
|---|
| 2842 |     ok = VRset("GB_CURRENT2", "Width",  lpane_width - marginx2)
 | 
|---|
| 2843 |     ok = VRset("GB_CURRENT2", "Height", pane_height - (margin * 5) - pbtn_height - 245 )
 | 
|---|
| 2844 | 
 | 
|---|
| 2845 |     ok = VRset("CN_CURRENT", "Top",     margin )
 | 
|---|
| 2846 |     ok = VRset("CN_CURRENT", "Left",    margin )
 | 
|---|
| 2847 |     ok = VRset("CN_CURRENT", "Width",   VRGet("GB_CURRENT2","Width")  - marginx2)
 | 
|---|
| 2848 |     ok = VRset("CN_CURRENT", "Height",  VRGet("GB_CURRENT2","Height") - marginx2)
 | 
|---|
| 2849 | 
 | 
|---|
| 2850 |     ok = VRset("PB_DETACH",  "Left",   margin )
 | 
|---|
| 2851 |     ok = VRset("PB_DETACH",  "Top",    pane_height - pbtn_height - marginx2 )
 | 
|---|
| 2852 |     ok = VRset("PB_DETACH",  "Width",  min((lpane_width-margin*3) % 2, 1313))
 | 
|---|
| 2853 |     ok = VRset("PB_UNMOUNT", "Left",   VRGet("PB_DETACH","Width") + marginx2)
 | 
|---|
| 2854 |     ok = VRset("PB_UNMOUNT", "Top",    pane_height - pbtn_height - marginx2 )
 | 
|---|
| 2855 |     ok = VRset("PB_UNMOUNT", "Width",  min((lpane_width-margin*3) % 2, 1313))
 | 
|---|
| 2856 | 
 | 
|---|
| 2857 |     /* Splitbar - reduced in size to make it more noticable */
 | 
|---|
| 2858 |     ok = VRset("SPLIT_Main", "Visible", 1           )
 | 
|---|
| 2859 |     ok = VRset("SPLIT_Main", "Top",     marginx2 + (pane_height-1200)%2  )
 | 
|---|
| 2860 |     ok = VRset("SPLIT_Main", "Height",  1200 /* pane_height */ )
 | 
|---|
| 2861 | 
 | 
|---|
| 2862 |     /* Statusbar */
 | 
|---|
| 2863 |     ok = VRSet("GB_STATUSBAR", "Left",  margin )
 | 
|---|
| 2864 |     ok = VRSet("GB_STATUSBAR", "Top",   main_iheight - sbar_height - margin )
 | 
|---|
| 2865 |     ok = VRSet("GB_STATUSBAR", "Width", lpane_width + 50 + rpane_width      )
 | 
|---|
| 2866 | 
 | 
|---|
| 2867 |     ok = VRset("DT_STATUSBAR", "Top",   12 )
 | 
|---|
| 2868 |     ok = VRset("DT_STATUSBAR", "Left",  12 )
 | 
|---|
| 2869 |     ok = VRset("DT_STATUSBAR", "Height", VRGet("GB_STATUSBAR","Height") -24 )
 | 
|---|
| 2870 |     ok = VRset("DT_STATUSBAR", "Width", (lpane_width + 50 + rpane_width) - 24 )
 | 
|---|
| 2871 | 
 | 
|---|
| 2872 |     /* Modified for notebook pages */
 | 
|---|
| 2873 |     pane_height = marginx2 + pane_height -1180
 | 
|---|
| 2874 |     rpane_width = marginx2 + rpane_width -760
 | 
|---|
| 2875 |     /* Use this as the width for the container pages, which don't have as strict a minimum width */
 | 
|---|
| 2876 |     rcnr_width = rpane_width
 | 
|---|
| 2877 | 
 | 
|---|
| 2878 |     /* Minimum size of right panel (based on SW_DIALOG which is the largest) */
 | 
|---|
| 2879 |     if pane_height < 5360 then pane_height = 5360
 | 
|---|
| 2880 |     if rpane_width < 6010 then rpane_width = 6010
 | 
|---|
| 2881 | 
 | 
|---|
| 2882 |     /* Dialog page */
 | 
|---|
| 2883 |     ok = VRSet("GB_DIALOG", "Top",    margin /* marginx2 */ )
 | 
|---|
| 2884 |     ok = VRSet("GB_DIALOG", "Left",   margin /* marginx2 */ /* split_left + 60 */ )
 | 
|---|
| 2885 |     ok = VRset("GB_DIALOG", "Height", pane_height )
 | 
|---|
| 2886 |     ok = VRset("GB_DIALOG", "Width",  rpane_width )
 | 
|---|
| 2887 | 
 | 
|---|
| 2888 |     ok = VRset("PB_MOUNT",      "Left", margin )
 | 
|---|
| 2889 |     ok = VRset("PB_MOUNT",      "Top",  pane_height - pbtn_height - marginx2)
 | 
|---|
| 2890 |     ok = VRset("PB_EDIT_CANCEL", "Left", VRGet("PB_MOUNT","Width") + marginx2)
 | 
|---|
| 2891 |     ok = VRset("PB_EDIT_CANCEL", "Top",  pane_height - pbtn_height - marginx2)
 | 
|---|
| 2892 | 
 | 
|---|
| 2893 |     ok = VRset("PB_DIALOG_HELP", "Left", rpane_width - marginx2 - VRGet("PB_DIALOG_HELP","Width") + 24)
 | 
|---|
| 2894 |     ok = VRset("PB_DIALOG_HELP", "Top",  pane_height - pbtn_height - marginx2)
 | 
|---|
| 2895 | 
 | 
|---|
| 2896 |     ok = VRset("GB_SHARE", "Left",  margin )
 | 
|---|
| 2897 |     ok = VRset("GB_SHARE", "Top",   marginx2 /* 245 + marginx2 */ )
 | 
|---|
| 2898 |     ok = VRset("GB_SHARE", "Height",  2252 )
 | 
|---|
| 2899 |     ok = VRset("GB_SHARE", "Width", rpane_width - marginx2 )
 | 
|---|
| 2900 | 
 | 
|---|
| 2901 |     ok = VRset("GB_AUTH", "Left",  margin )
 | 
|---|
| 2902 |     ok = VRset("GB_AUTH", "Top",   margin * 3 + VRGet("GB_SHARE","Height") /* 245 + (margin * 3) + VRGet("GB_SHARE","Height") */ )
 | 
|---|
| 2903 |     ok = VRset("GB_AUTH", "Width", rpane_width - marginx2 )
 | 
|---|
| 2904 | 
 | 
|---|
| 2905 |     ok = VRset("GB_MPOINT","Left",   margin )
 | 
|---|
| 2906 |     ok = VRset("GB_MPOINT","Top",    /* 245 + */ (margin * 4) + VRGet("GB_SHARE","Height") + VRGet("GB_AUTH","Height"))
 | 
|---|
| 2907 |     ok = VRset("GB_MPOINT","Width",  rpane_width - marginx2 )
 | 
|---|
| 2908 | 
 | 
|---|
| 2909 |     /* Advanced page */
 | 
|---|
| 2910 |     ok = VRSet("GB_ADVANCED", "Top",    margin /* marginx2 */ )
 | 
|---|
| 2911 |     ok = VRSet("GB_ADVANCED", "Left",   margin /* marginx2 */ /* split_left + 60 */ )
 | 
|---|
| 2912 |     ok = VRset("GB_ADVANCED", "Height", pane_height )
 | 
|---|
| 2913 |     ok = VRset("GB_ADVANCED", "Width",  rpane_width )
 | 
|---|
| 2914 | 
 | 
|---|
| 2915 |     ok = VRset("GB_ADVANCED2", "Left",   margin )
 | 
|---|
| 2916 |     ok = VRset("GB_ADVANCED2", "Top",    /* 245 + */ marginx2)
 | 
|---|
| 2917 |     ok = VRset("GB_ADVANCED2", "Width",  rpane_width - marginx2)
 | 
|---|
| 2918 |     ok = VRset("GB_ADVANCED2", "Height", pane_height - (margin * 5) - pbtn_height /* - 245 */ )
 | 
|---|
| 2919 | 
 | 
|---|
| 2920 |     ok = VRset("PB_ADVANCED_APPLY", "Left",   margin )
 | 
|---|
| 2921 |     ok = VRset("PB_ADVANCED_APPLY", "Top",    pane_height - pbtn_height   - marginx2)
 | 
|---|
| 2922 |     ok = VRset("PB_ADVANCED_UNDO", "Left",   VRGet("PB_SMBTREE_CONNECT","Width") + marginx2)
 | 
|---|
| 2923 |     ok = VRset("PB_ADVANCED_UNDO", "Top",    pane_height - pbtn_height   - marginx2)
 | 
|---|
| 2924 |     ok = VRset("PB_ADVANCED_HELP", "Left", rpane_width - marginx2 - VRGet("PB_SMBTREE_HELP","Width") + 24)
 | 
|---|
| 2925 |     ok = VRset("PB_ADVANCED_HELP", "Top",  pane_height - pbtn_height - marginx2)
 | 
|---|
| 2926 | 
 | 
|---|
| 2927 |     /* SMBTree page */
 | 
|---|
| 2928 |     ok = VRSet("GB_SMBTREE", "Top",     margin /* x2 */     )
 | 
|---|
| 2929 |     ok = VRSet("GB_SMBTREE", "Left",    margin /* x2 */ /* split_left + 60 */ )
 | 
|---|
| 2930 |     ok = VRset("GB_SMBTREE", "Height",  pane_height     )
 | 
|---|
| 2931 |     ok = VRset("GB_SMBTREE", "Width",   rcnr_width     )
 | 
|---|
| 2932 | 
 | 
|---|
| 2933 |     ok = VRset("GB_SMBTREE2","Left",    margin                    )
 | 
|---|
| 2934 |     ok = VRset("GB_SMBTREE2","Top",     /* 45 + */ marginx2        )
 | 
|---|
| 2935 |     ok = VRset("GB_SMBTREE2","Width",   rcnr_width - marginx2)
 | 
|---|
| 2936 |     ok = VRset("GB_SMBTREE2","Height",  pane_height - (margin * 5) - pbtn_height /* - 245 */ )
 | 
|---|
| 2937 | 
 | 
|---|
| 2938 |     ok = VRset("CN_SMBTREE",  "Top",    margin )
 | 
|---|
| 2939 |     ok = VRset("CN_SMBTREE",  "Left",   margin )
 | 
|---|
| 2940 |     ok = VRset("CN_SMBTREE",  "Width",  VRGet("GB_SMBTREE2","Width")  - marginx2)
 | 
|---|
| 2941 |     ok = VRset("CN_SMBTREE",  "Height", VRGet("GB_SMBTREE2","Height") - marginx2)
 | 
|---|
| 2942 | 
 | 
|---|
| 2943 |     ok = VRset("PB_SMBTREE_CONNECT", "Left",   margin )
 | 
|---|
| 2944 |     ok = VRset("PB_SMBTREE_CONNECT", "Top",    pane_height - pbtn_height   - marginx2)
 | 
|---|
| 2945 |     ok = VRset("PB_SMBTREE_REFRESH", "Left",   VRGet("PB_SMBTREE_CONNECT","Width") + marginx2)
 | 
|---|
| 2946 |     ok = VRset("PB_SMBTREE_REFRESH", "Top",    pane_height - pbtn_height   - marginx2)
 | 
|---|
| 2947 | 
 | 
|---|
| 2948 |     hlpmin = VRGet("PB_SMBTREE_REFRESH", "Left") + VRGet("PB_SMBTREE_REFRESH","Width") + marginx2
 | 
|---|
| 2949 |     hlppos = rcnr_width - marginx2 - VRGet("PB_SMBTREE_HELP","Width") + 24
 | 
|---|
| 2950 |     IF hlppos < hlpmin THEN hlppos = hlpmin
 | 
|---|
| 2951 | 
 | 
|---|
| 2952 |     ok = VRset("PB_SMBTREE_HELP", "Left", hlppos )
 | 
|---|
| 2953 |     ok = VRset("PB_SMBTREE_HELP", "Top",  pane_height - pbtn_height - marginx2)
 | 
|---|
| 2954 | 
 | 
|---|
| 2955 |     ok = VRset("PICT_THROBBER", "Top",  VRGet("CN_SMBTREE","Height") % 2 - 100 )
 | 
|---|
| 2956 |     ok = VRset("PICT_THROBBER", "Left", VRGet("CN_SMBTREE","Width")  % 2 - 200 )
 | 
|---|
| 2957 | 
 | 
|---|
| 2958 |     /* Connection details page */
 | 
|---|
| 2959 |     ok = VRSet("GB_CONDET", "Top",     margin /* x2 */     )
 | 
|---|
| 2960 |     ok = VRSet("GB_CONDET", "Left",    margin /* x2 */  /* split_left + 60 */ )
 | 
|---|
| 2961 |     ok = VRset("GB_CONDET", "Height",  pane_height     )
 | 
|---|
| 2962 |     ok = VRset("GB_CONDET", "Width",   rcnr_width      )
 | 
|---|
| 2963 | 
 | 
|---|
| 2964 |     ok = VRset("GB_CONDET2", "Left",   margin )
 | 
|---|
| 2965 |     ok = VRset("GB_CONDET2", "Top",    /* 245 + */ marginx2)
 | 
|---|
| 2966 |     ok = VRset("GB_CONDET2", "Width",  rcnr_width - marginx2)
 | 
|---|
| 2967 |     ok = VRset("GB_CONDET2", "Height", pane_height - (margin * 5) - pbtn_height /* - 245 */ )
 | 
|---|
| 2968 | 
 | 
|---|
| 2969 |     ok = VRset("CN_CONDET",  "Top",    margin )
 | 
|---|
| 2970 |     ok = VRset("CN_CONDET",  "Left",   margin )
 | 
|---|
| 2971 |     ok = VRset("CN_CONDET",  "Width",  VRGet("GB_CONDET2","Width")  - marginx2)
 | 
|---|
| 2972 |     ok = VRset("CN_CONDET",  "Height", VRGet("GB_CONDET2","Height") - marginx2)
 | 
|---|
| 2973 | 
 | 
|---|
| 2974 |     ok = VRset("PB_CONDET_SAVE", "Left", margin )
 | 
|---|
| 2975 |     ok = VRset("PB_CONDET_SAVE", "Top",  pane_height - pbtn_height - marginx2      )
 | 
|---|
| 2976 |     ok = VRset("PB_CONDET_LOAD", "Left", VRGet("PB_CONDET_SAVE","Width") + marginx2)
 | 
|---|
| 2977 |     ok = VRset("PB_CONDET_LOAD", "Top",  pane_height - pbtn_height - marginx2      )
 | 
|---|
| 2978 | 
 | 
|---|
| 2979 |     hlpmin = VRGet("PB_CONDET_LOAD", "Left") + VRGet("PB_CONDET_LOAD","Width") + marginx2
 | 
|---|
| 2980 |     hlppos = rcnr_width - marginx2 - VRGet("PB_CONDET_HELP","Width") + 24
 | 
|---|
| 2981 |     IF hlppos < hlpmin THEN hlppos = hlpmin
 | 
|---|
| 2982 | 
 | 
|---|
| 2983 |     ok = VRset("PB_CONDET_HELP", "Left", hlppos )
 | 
|---|
| 2984 |     ok = VRset("PB_CONDET_HELP", "Top",  pane_height - pbtn_height - marginx2)
 | 
|---|
| 2985 | 
 | 
|---|
| 2986 |     /* Global settings page */
 | 
|---|
| 2987 |     ok = VRSet("GB_GLOBAL", "Top",     margin /* x2 */     )
 | 
|---|
| 2988 |     ok = VRSet("GB_GLOBAL", "Left",    margin /* x2 */  /* split_left + 60 */ )
 | 
|---|
| 2989 |     ok = VRset("GB_GLOBAL", "Height",  pane_height     )
 | 
|---|
| 2990 |     ok = VRset("GB_GLOBAL", "Width",   rpane_width     )
 | 
|---|
| 2991 | 
 | 
|---|
| 2992 |     ok = VRset("GB_GLOBAL2", "Left",  margin )
 | 
|---|
| 2993 |     ok = VRset("GB_GLOBAL2", "Top",   marginx2 /* 245 + marginx2 */ )
 | 
|---|
| 2994 |     ok = VRset("GB_GLOBAL2", "Width", rpane_width - marginx2 )
 | 
|---|
| 2995 | 
 | 
|---|
| 2996 |     ok = VRset("GB_RESOLUTION", "Left",  margin )
 | 
|---|
| 2997 |     ok = VRset("GB_RESOLUTION", "Top",   margin * 3 + VRGet("GB_GLOBAL2","Height") /* 245 + (margin * 3) + VRGet("GB_GLOBAL2","Height") */ )
 | 
|---|
| 2998 |     ok = VRset("GB_RESOLUTION", "Width", rpane_width - marginx2 )
 | 
|---|
| 2999 | 
 | 
|---|
| 3000 |     ok = VRset("GB_LOGGING","Left",   margin )
 | 
|---|
| 3001 |     ok = VRset("GB_LOGGING","Top",    /* 245 + */ (margin * 4) + VRGet("GB_GLOBAL2","Height") + VRGet("GB_RESOLUTION","Height"))
 | 
|---|
| 3002 |     ok = VRset("GB_LOGGING","Width",  rpane_width - marginx2 )
 | 
|---|
| 3003 | 
 | 
|---|
| 3004 |     ok = VRset("PB_SETTINGS_APPLY", "Left", margin )
 | 
|---|
| 3005 |     ok = VRset("PB_SETTINGS_APPLY", "Top",  pane_height - pbtn_height - marginx2      )
 | 
|---|
| 3006 |     ok = VRset("PB_SETTINGS_APPLY", "Height", pbtn_height)
 | 
|---|
| 3007 |     ok = VRset("PB_SETTINGS_UNDO", "Left", VRGet("PB_CONDET_SAVE","Width") + marginx2)
 | 
|---|
| 3008 |     ok = VRset("PB_SETTINGS_UNDO", "Top",  pane_height - pbtn_height - marginx2      )
 | 
|---|
| 3009 |     ok = VRset("PB_SETTINGS_UNDO", "Height", pbtn_height)
 | 
|---|
| 3010 |     ok = VRset("PB_SETTINGS_HELP", "Left", rpane_width - marginx2 - VRGet("PB_CONDET_HELP","Width") + 24)
 | 
|---|
| 3011 |     ok = VRset("PB_SETTINGS_HELP", "Top",  pane_height - pbtn_height - marginx2)
 | 
|---|
| 3012 |     ok = VRset("PB_SETTINGS_HELP", "Height", pbtn_height)
 | 
|---|
| 3013 | 
 | 
|---|
| 3014 |     /* SMB.CONF Settings page */
 | 
|---|
| 3015 |     ok = VRSet("GB_SMBCONFX", "Top",     margin /* x2 */     )
 | 
|---|
| 3016 |     ok = VRSet("GB_SMBCONFX", "Left",    margin /* x2 */  /* split_left + 60 */ )
 | 
|---|
| 3017 |     ok = VRset("GB_SMBCONFX", "Height",  pane_height     )
 | 
|---|
| 3018 |     ok = VRset("GB_SMBCONFX", "Width",   rpane_width     )
 | 
|---|
| 3019 | 
 | 
|---|
| 3020 |     ok = VRset("GB_SMBCONF2", "Left",  margin )
 | 
|---|
| 3021 |     ok = VRset("GB_SMBCONF2", "Top",   marginx2 )
 | 
|---|
| 3022 |     ok = VRset("GB_SMBCONF2", "Width", rpane_width - marginx2 )
 | 
|---|
| 3023 |     ok = VRset("GB_SMBCONF2", "Height",  pane_height - (margin * 7) - pbtn_height /* - 245 */ )
 | 
|---|
| 3024 | 
 | 
|---|
| 3025 |     ok = VRset("PB_SMBCONF_APPLY", "Left", margin )
 | 
|---|
| 3026 |     ok = VRset("PB_SMBCONF_APPLY", "Top",  pane_height - pbtn_height - marginx2      )
 | 
|---|
| 3027 |     ok = VRset("PB_SMBCONF_APPLY", "Height", pbtn_height)
 | 
|---|
| 3028 |     ok = VRset("PB_SMBCONF_UNDO", "Left", VRGet("PB_CONDET_SAVE","Width") + marginx2)
 | 
|---|
| 3029 |     ok = VRset("PB_SMBCONF_UNDO", "Top",  pane_height - pbtn_height - marginx2      )
 | 
|---|
| 3030 |     ok = VRset("PB_SMBCONF_UNDO", "Height", pbtn_height)
 | 
|---|
| 3031 |     ok = VRset("PB_SMBCONF_HELP", "Left", rpane_width - marginx2 - VRGet("PB_CONDET_HELP","Width") + 24)
 | 
|---|
| 3032 |     ok = VRset("PB_SMBCONF_HELP", "Top",  pane_height - pbtn_height - marginx2)
 | 
|---|
| 3033 |     ok = VRset("PB_SMBCONF_HELP", "Height", pbtn_height)
 | 
|---|
| 3034 | 
 | 
|---|
| 3035 |     /* DOne with pages */
 | 
|---|
| 3036 |     ok = VRset("Main","Painting", 1)
 | 
|---|
| 3037 | 
 | 
|---|
| 3038 |     /* check and empty event queue, trash spurious resize events */
 | 
|---|
| 3039 |     EventString = ''
 | 
|---|
| 3040 |     TrashedResize = 0
 | 
|---|
| 3041 | 
 | 
|---|
| 3042 |     do until EventString = 'nop'
 | 
|---|
| 3043 |         EventString = VREvent('N')
 | 
|---|
| 3044 |         if EventString <> 'nop' then do
 | 
|---|
| 3045 |             if EventString = 'CALL Main_Resize' then TrashedResize = 1
 | 
|---|
| 3046 |                                                 else interpret eventString
 | 
|---|
| 3047 |         end
 | 
|---|
| 3048 |     end
 | 
|---|
| 3049 |     if TrashedResize then CALL Main_Resize
 | 
|---|
| 3050 | 
 | 
|---|
| 3051 |     if options.!debug == 1 then say time()' Main_Resize done'
 | 
|---|
| 3052 | return
 | 
|---|
| 3053 | /*:VRX         Menu_Context_ChangeView_Click
 | 
|---|
| 3054 | */
 | 
|---|
| 3055 | Menu_Context_ChangeView_Click:
 | 
|---|
| 3056 |     ok = VRSet("Cn_Current","View","NameTree")
 | 
|---|
| 3057 | return
 | 
|---|
| 3058 | 
 | 
|---|
| 3059 | /*:VRX         Menu_Context_Detach_All_Click
 | 
|---|
| 3060 | */
 | 
|---|
| 3061 | Menu_Context_Detach_All_Click:
 | 
|---|
| 3062 |     ok = VRMethod( "CN_CURRENT", "GetRecordList", "All", "umrh." )
 | 
|---|
| 3063 |     do um = 1 to umrh.0
 | 
|---|
| 3064 |         ok = VRMethod( "CN_CURRENT", "SetRecordAttr", umrh.um, "Selected", 1)
 | 
|---|
| 3065 |         call PB_DETACH_Click
 | 
|---|
| 3066 |     end
 | 
|---|
| 3067 |     drop um umrh.
 | 
|---|
| 3068 | return
 | 
|---|
| 3069 | 
 | 
|---|
| 3070 | /*:VRX         Menu_Context_Detach_Click
 | 
|---|
| 3071 | */
 | 
|---|
| 3072 | Menu_Context_Detach_Click:
 | 
|---|
| 3073 |     call PB_DETACH_Click
 | 
|---|
| 3074 | return
 | 
|---|
| 3075 | 
 | 
|---|
| 3076 | /*:VRX         Menu_Context_Edit_Click
 | 
|---|
| 3077 | */
 | 
|---|
| 3078 | Menu_Context_Edit_Click:
 | 
|---|
| 3079 |     if options.!debug == 1 then say time()' Menu_Context_Edit_Click started'
 | 
|---|
| 3080 |     /* call VRMethod "TDL_1", 'PostEvent', 'PageSelected', 'Page', 1 */
 | 
|---|
| 3081 |     ok = VRset("TDL_1", 'Selected', 1)
 | 
|---|
| 3082 |     options.!editmode = 1
 | 
|---|
| 3083 |     CALL VRSet "PB_EDIT_CANCEL","Visible", 1
 | 
|---|
| 3084 |     CALL VRSet "PB_UNMOUNT","Enabled", 0
 | 
|---|
| 3085 | 
 | 
|---|
| 3086 |     ok = VRMethod( "TDL_1", "SetTabText", 1, " "NLVGetMessage(33)" " )
 | 
|---|
| 3087 | /*  CALL NLVSetText "DT_DIALOG","Caption",33 */
 | 
|---|
| 3088 |     CALL VRSet "GB_CURRENT", "ENABLED", 0
 | 
|---|
| 3089 | 
 | 
|---|
| 3090 |     ok = VRSet("CB_MOUNT","Value","")
 | 
|---|
| 3091 |     ok = VRSet("CB_MOUNT","Selected",1)
 | 
|---|
| 3092 |     ok = VRSet("CB_MOUNT","Value",mtype.1)
 | 
|---|
| 3093 | 
 | 
|---|
| 3094 |     parse var p_string p_workgroup':\\'p_server'\'p_share
 | 
|---|
| 3095 | 
 | 
|---|
| 3096 |     /* if options.!debug == 1 then say time()' '||p_workgroup */
 | 
|---|
| 3097 | 
 | 
|---|
| 3098 |     if options.!debug == 1 then say time()' data   '||data
 | 
|---|
| 3099 |     if options.!debug == 1 then say time()' domain '||p_workgroup
 | 
|---|
| 3100 |     if options.!debug == 1 then say time()' server '||p_server
 | 
|---|
| 3101 |     if options.!debug == 1 then say time()' share  '||p_share
 | 
|---|
| 3102 |     if options.!debug == 1 then say time()' string '||p_string
 | 
|---|
| 3103 | 
 | 
|---|
| 3104 | 
 | 
|---|
| 3105 |     CALL VRSet "EF_SHARE",  "VALUE", p_share
 | 
|---|
| 3106 |     CALL VRSet "EF_SERVER", "VALUE", p_server
 | 
|---|
| 3107 |     CALL VRSet "EF_NETWORK","VALUE", p_workgroup
 | 
|---|
| 3108 | 
 | 
|---|
| 3109 |     /* if options.!debug == 1 then say time()' '||p_node */
 | 
|---|
| 3110 |     parse var p_node p_drive'\'p_directory'\'
 | 
|---|
| 3111 |     CALL VRSet "CB_DRIVES", "Value", p_drive
 | 
|---|
| 3112 |     CALL VRSet "EF_DIRECTORY", "Value", p_directory
 | 
|---|
| 3113 |     if options.!debug == 1 then say time()' Menu_Context_Edit_Click done'
 | 
|---|
| 3114 | return
 | 
|---|
| 3115 | 
 | 
|---|
| 3116 | /*:VRX         Menu_Context_Open_Click
 | 
|---|
| 3117 | */
 | 
|---|
| 3118 | Menu_Context_Open_Click:
 | 
|---|
| 3119 |     ok = VRSet("Menu_Context_Open_Default","Visible",0)
 | 
|---|
| 3120 | return
 | 
|---|
| 3121 | 
 | 
|---|
| 3122 | /*:VRX         Menu_Context_Open_Default_Click
 | 
|---|
| 3123 | */
 | 
|---|
| 3124 | Menu_Context_Open_Default_Click:
 | 
|---|
| 3125 |     if options.!debug == 1 then say time()' '||"Menu_Context_Open_Click started"
 | 
|---|
| 3126 |     if \VRIsValidObject(rh) then return
 | 
|---|
| 3127 | 
 | 
|---|
| 3128 |     userdata = VRMethod( "CN_CURRENT", 'GetRecordAttr', rh, 'UserData')
 | 
|---|
| 3129 |     PARSE VAR userdata mountpoint ';' mounts ';' .
 | 
|---|
| 3130 | 
 | 
|---|
| 3131 |     if length(mountpoint) > 3 then mountpoint = strip(mountpoint,'T','\')
 | 
|---|
| 3132 | 
 | 
|---|
| 3133 |     ID = VRMethod( "Application", "StartThread", "wps_open", mountpoint, "DEFAULT" )
 | 
|---|
| 3134 | 
 | 
|---|
| 3135 |     if options.!debug == 1 then say time()' '||"Menu_Context_Open_Click done"
 | 
|---|
| 3136 | return
 | 
|---|
| 3137 | 
 | 
|---|
| 3138 | /*:VRX         Menu_Context_Open_Detail_Click
 | 
|---|
| 3139 | */
 | 
|---|
| 3140 | Menu_Context_Open_Detail_Click:
 | 
|---|
| 3141 |     if options.!debug == 1 then say time()' '||"Menu_Context_Open_Details_Click started"
 | 
|---|
| 3142 |     if \VRIsValidObject(rh) then return
 | 
|---|
| 3143 | 
 | 
|---|
| 3144 |     userdata = VRMethod( "CN_CURRENT", 'GetRecordAttr', rh, 'UserData')
 | 
|---|
| 3145 |     PARSE VAR userdata mountpoint ';' mounts ';' .
 | 
|---|
| 3146 | 
 | 
|---|
| 3147 |     if length(mountpoint) > 3 then mountpoint = strip(mountpoint,'T','\')
 | 
|---|
| 3148 | 
 | 
|---|
| 3149 |     ID = VRMethod( "Application", "StartThread", "wps_open", mountpoint, "DETAILS" )
 | 
|---|
| 3150 | 
 | 
|---|
| 3151 |     if options.!debug == 1 then say time()' '||"Menu_Context_Open_Details_Click done"
 | 
|---|
| 3152 | return
 | 
|---|
| 3153 | 
 | 
|---|
| 3154 | /*:VRX         Menu_Context_Open_Icon_Click
 | 
|---|
| 3155 | */
 | 
|---|
| 3156 | Menu_Context_Open_Icon_Click:
 | 
|---|
| 3157 |     if options.!debug == 1 then say time()' '||"Menu_Context_Open_Icon_Click started"
 | 
|---|
| 3158 |     if \VRIsValidObject(rh) then return
 | 
|---|
| 3159 | 
 | 
|---|
| 3160 |     userdata = VRMethod( "CN_CURRENT", 'GetRecordAttr', rh, 'UserData')
 | 
|---|
| 3161 |     PARSE VAR userdata mountpoint ';' mounts ';' .
 | 
|---|
| 3162 | 
 | 
|---|
| 3163 |     if length(mountpoint) > 3 then mountpoint = strip(mountpoint,'T','\')
 | 
|---|
| 3164 | 
 | 
|---|
| 3165 |     ID = VRMethod( "Application", "StartThread", "wps_open", mountpoint, "ICON" )
 | 
|---|
| 3166 | 
 | 
|---|
| 3167 |     if options.!debug == 1 then say time()' '||"Menu_Context_Open_Icon_Click done"
 | 
|---|
| 3168 | return
 | 
|---|
| 3169 | 
 | 
|---|
| 3170 | /*:VRX         Menu_Context_Open_Settings_Click
 | 
|---|
| 3171 | */
 | 
|---|
| 3172 | Menu_Context_Open_Settings_Click:
 | 
|---|
| 3173 |     if options.!debug == 1 then say time()' '||"Menu_Context_Open_Settings_Click started"
 | 
|---|
| 3174 |     if \VRIsValidObject(rh) then return
 | 
|---|
| 3175 | 
 | 
|---|
| 3176 |     userdata = VRMethod( "CN_CURRENT", 'GetRecordAttr', rh, 'UserData')
 | 
|---|
| 3177 |     PARSE VAR userdata mountpoint ';' mounts ';' .
 | 
|---|
| 3178 | 
 | 
|---|
| 3179 |     if length(mountpoint) > 3 then mountpoint = strip(mountpoint,'T','\')
 | 
|---|
| 3180 | 
 | 
|---|
| 3181 |     ID = VRMethod( "Application", "StartThread", "wps_open", mountpoint, "SETTINGS" )
 | 
|---|
| 3182 | 
 | 
|---|
| 3183 |     if options.!debug == 1 then say time()' '||"Menu_Context_Open_Settings_Click done"
 | 
|---|
| 3184 | return
 | 
|---|
| 3185 | 
 | 
|---|
| 3186 | /*:VRX         Menu_Context_Open_Splitview_Click
 | 
|---|
| 3187 | */
 | 
|---|
| 3188 | Menu_Context_Open_Splitview_Click:
 | 
|---|
| 3189 |     if options.!debug == 1 then say time()' '||"Menu_Context_Open_Splitview_Click started"
 | 
|---|
| 3190 |     if \VRIsValidObject(rh) then return
 | 
|---|
| 3191 | 
 | 
|---|
| 3192 |     userdata = VRMethod( "CN_CURRENT", 'GetRecordAttr', rh, 'UserData')
 | 
|---|
| 3193 |     PARSE VAR userdata mountpoint ';' mounts ';' .
 | 
|---|
| 3194 | 
 | 
|---|
| 3195 |     if length(mountpoint) > 3 then mountpoint = strip(mountpoint,'T','\')
 | 
|---|
| 3196 | 
 | 
|---|
| 3197 |     ID = VRMethod( "Application", "StartThread", "wps_open", mountpoint, "SPLITVIEW" )
 | 
|---|
| 3198 | 
 | 
|---|
| 3199 |     if options.!debug == 1 then say time()' '||"Menu_Context_Open_Splitview_Click done"
 | 
|---|
| 3200 | return
 | 
|---|
| 3201 | 
 | 
|---|
| 3202 | /*:VRX         Menu_Context_Open_Tree_Click
 | 
|---|
| 3203 | */
 | 
|---|
| 3204 | Menu_Context_Open_Tree_Click:
 | 
|---|
| 3205 |     if options.!debug == 1 then say time()' '||"Menu_Context_Open_Tree_Click started"
 | 
|---|
| 3206 |     if \VRIsValidObject(rh) then return
 | 
|---|
| 3207 | 
 | 
|---|
| 3208 |     userdata = VRMethod( "CN_CURRENT", 'GetRecordAttr', rh, 'UserData')
 | 
|---|
| 3209 |     PARSE VAR userdata mountpoint ';' mounts ';' .
 | 
|---|
| 3210 | 
 | 
|---|
| 3211 |     if length(mountpoint) > 3 then mountpoint = strip(mountpoint,'T','\')
 | 
|---|
| 3212 | 
 | 
|---|
| 3213 |     ID = VRMethod( "Application", "StartThread", "wps_open", mountpoint, "TREE" )
 | 
|---|
| 3214 | 
 | 
|---|
| 3215 |     if options.!debug == 1 then say time()' '||"Menu_Context_Open_Tree_Click done"
 | 
|---|
| 3216 | return
 | 
|---|
| 3217 | 
 | 
|---|
| 3218 | /*:VRX         Menu_Context_Refresh_Click
 | 
|---|
| 3219 | */
 | 
|---|
| 3220 | Menu_Context_Refresh_Click:
 | 
|---|
| 3221 |     CALL Refresh
 | 
|---|
| 3222 | return
 | 
|---|
| 3223 | 
 | 
|---|
| 3224 | /*:VRX         Menu_Context_Unmount_Click
 | 
|---|
| 3225 | */
 | 
|---|
| 3226 | Menu_Context_Unmount_Click:
 | 
|---|
| 3227 |     call PB_UNMOUNT_Click
 | 
|---|
| 3228 | return
 | 
|---|
| 3229 | 
 | 
|---|
| 3230 | /*:VRX         Menu_File_Autostart_Activate_Click
 | 
|---|
| 3231 | */
 | 
|---|
| 3232 | Menu_File_Autostart_Activate_Click:
 | 
|---|
| 3233 |     options.!autostart = 1
 | 
|---|
| 3234 | 
 | 
|---|
| 3235 |     Profile    = VRParseFilename(settings.!ini,'DPN')'.'fs.!profileext
 | 
|---|
| 3236 |     ExeName    = VRParseFileName(VRget("Application","Program"),'DPNE')
 | 
|---|
| 3237 |     if ExeName = "" then do
 | 
|---|
| 3238 |         parse source . . script
 | 
|---|
| 3239 |         ExeName = VRParseFilename(script,'DP')'\'options.!appname_short'.EXE'
 | 
|---|
| 3240 |     end
 | 
|---|
| 3241 |     StartupDir = VRParseFileName(VRget("Application","Program"),'DP')
 | 
|---|
| 3242 |     if StartupDir = "" then do
 | 
|---|
| 3243 |         parse source . . script
 | 
|---|
| 3244 |         StartUpDir = VRParseFilename(script,'DP')
 | 
|---|
| 3245 |     end
 | 
|---|
| 3246 | 
 | 
|---|
| 3247 |     ObjTitle   = NLVGetMessage( 59 )
 | 
|---|
| 3248 |     if ObjTitle = "" then ObjTitle = '[EVFS LAN-Connections]'
 | 
|---|
| 3249 | 
 | 
|---|
| 3250 |     CALL PB_CONDET_SAVE_Click
 | 
|---|
| 3251 | 
 | 
|---|
| 3252 |     rc = CreateObject( 'WPProgram', ObjTitle,'<WP_START>',,
 | 
|---|
| 3253 |             'EXENAME='||ExeName||';'||,
 | 
|---|
| 3254 |             'PROGTYPE=PM;'||,
 | 
|---|
| 3255 |             'TITLE='ObjTitle';'||,
 | 
|---|
| 3256 |             'PARAMETERS='Profile' -AUTOCLOSE -NOGUI;'||,
 | 
|---|
| 3257 |             'STARTUPDIR='StartupDir';'||,
 | 
|---|
| 3258 |             'NOPRINT=YES;'||,
 | 
|---|
| 3259 |             'HIDEBUTTON=DEFAULT;'||,
 | 
|---|
| 3260 |             'MINWIN=DEFAULT;'||,
 | 
|---|
| 3261 |             'CCVIEW=DEFAULT;'||,
 | 
|---|
| 3262 |             'DEFAULTVIEW=DEFAULT;'||,
 | 
|---|
| 3263 |             'OBJECTID=<'options.!appname_short'_AUTOSTART>',,
 | 
|---|
| 3264 |         'REPLACE' )
 | 
|---|
| 3265 | 
 | 
|---|
| 3266 |     IF rc == 1 THEN do
 | 
|---|
| 3267 |         Text = NLVGetMessage( 60 )
 | 
|---|
| 3268 |         if Text = "" then Text = '[Created object in Autostart-Folder]'
 | 
|---|
| 3269 |         CALL VRMessage 'Main', Text, VRGet("Main", "Caption")
 | 
|---|
| 3270 |     end
 | 
|---|
| 3271 |     ELSE do
 | 
|---|
| 3272 |         Text = NLVGetMessage( 61 )
 | 
|---|
| 3273 |         if Text = "" then Text = '[Could not create object in Autostart-Folder]'
 | 
|---|
| 3274 |         Title = NLVGetMessage( 5 )
 | 
|---|
| 3275 |         if Title = "" then Title = '[Error]'
 | 
|---|
| 3276 |         CALL VRMessage 'Main', Text, Title, 'E'
 | 
|---|
| 3277 |     end
 | 
|---|
| 3278 | 
 | 
|---|
| 3279 |     options.!autostart = 0
 | 
|---|
| 3280 | return
 | 
|---|
| 3281 | /*:VRX         Menu_File_Autostart_Click
 | 
|---|
| 3282 | */
 | 
|---|
| 3283 | Menu_File_Autostart_Click:
 | 
|---|
| 3284 | 
 | 
|---|
| 3285 | return
 | 
|---|
| 3286 | 
 | 
|---|
| 3287 | /*:VRX         Menu_File_Autostart_Deactivate_Click
 | 
|---|
| 3288 | */
 | 
|---|
| 3289 | Menu_File_Autostart_Deactivate_Click:
 | 
|---|
| 3290 |     ok = SysDestroyObject("<"options.!appname_short"_AUTOSTART>")
 | 
|---|
| 3291 |     IF ok == 1 THEN do
 | 
|---|
| 3292 |         Text = NLVGetMessage( 79 )
 | 
|---|
| 3293 |         if Text = "" then Text = '[Autostart object created successfully]'
 | 
|---|
| 3294 |         CALL VRMessage 'Main', Text, VRGet("Main", "Caption")
 | 
|---|
| 3295 |     end
 | 
|---|
| 3296 |     ELSE do
 | 
|---|
| 3297 |         Text = NLVGetMessage( 78 )
 | 
|---|
| 3298 |         if Text = "" then Text = '[Could find Autostart object]'
 | 
|---|
| 3299 |         Title = NLVGetMessage( 5 )
 | 
|---|
| 3300 |         if Title = "" then Title = '[Error]'
 | 
|---|
| 3301 |         CALL VRMessage 'Main', Text, Title, 'E'
 | 
|---|
| 3302 |     end
 | 
|---|
| 3303 | return
 | 
|---|
| 3304 | 
 | 
|---|
| 3305 | /*:VRX         Menu_File_Click
 | 
|---|
| 3306 | */
 | 
|---|
| 3307 | Menu_File_Click:
 | 
|---|
| 3308 |     ok = VRSet("Menu_File_LMHosts_Reset", "Enabled", VRFileExists( samba.!lmhosts ))
 | 
|---|
| 3309 |     ok = VRSet("Menu_File_ucCred_Reset",  "Enabled", (VRGet("Pict_PWINMEM","PicturePath") = "#36"))
 | 
|---|
| 3310 | return
 | 
|---|
| 3311 | 
 | 
|---|
| 3312 | /*:VRX         Menu_File_Close_Click
 | 
|---|
| 3313 | */
 | 
|---|
| 3314 | Menu_File_Close_Click:
 | 
|---|
| 3315 |     call Quit
 | 
|---|
| 3316 | return
 | 
|---|
| 3317 | 
 | 
|---|
| 3318 | /*:VRX         Menu_File_Daemon_Start_Click
 | 
|---|
| 3319 | */
 | 
|---|
| 3320 | Menu_File_Daemon_Start_Click:
 | 
|---|
| 3321 |     if options.!debug == 1 then say time()' Menu_File_Daemon_Start_Click started'
 | 
|---|
| 3322 |     if VRFileExists(SysBootDrive()"\ndpsmb.dbg") then do
 | 
|---|
| 3323 |         btns.0 = 2
 | 
|---|
| 3324 |         btns.1 = NLVGetMessage( 6 )
 | 
|---|
| 3325 |         btns.2 = NLVGetMessage( 7 )
 | 
|---|
| 3326 |         confirm = VRMessage('Main', NLVGetMessage( 119 ), NLVGetMessage( 8 ), 'Q', 'btns.', 1, 2 )
 | 
|---|
| 3327 |         IF confirm == 1 THEN do
 | 
|---|
| 3328 |             logFiles = value("LOGFILES",,"OS2ENVIRONMENT")
 | 
|---|
| 3329 |             ok1 = SysFileDelete(Logfiles||'\log.smbc')
 | 
|---|
| 3330 |             ok2 = SysFileDelete(Logfiles||'\log.ndpsmb')
 | 
|---|
| 3331 |             if ok1 <> 0 | ok2 <> 0 then do
 | 
|---|
| 3332 |                 ok = VRMessage('Main', NLVGetMessage(5)' 'Logfiles||'\log.smbc RC='ok1||'0D0A'x||NLVGetMessage(5)' 'Logfiles||'\log.ndpsmb RC='ok2, NLVGetMessage( 5 ), 'E')
 | 
|---|
| 3333 |             end
 | 
|---|
| 3334 |             drop ok1 ok2
 | 
|---|
| 3335 |         end
 | 
|---|
| 3336 |     end
 | 
|---|
| 3337 |     address cmd 'detach 'fs.!prefix'CTL.EXE'
 | 
|---|
| 3338 |     ok = VRset("GB_CURRENT","Enabled", 1)
 | 
|---|
| 3339 |     ok = VRset("TDL_1","Enabled", 1)
 | 
|---|
| 3340 |     CALL REFRESH
 | 
|---|
| 3341 |     ok = VRSet("Menu_File_Daemon_Start","Enabled",0)
 | 
|---|
| 3342 |     ok = VRSet("Menu_File_Daemon_Stop","Enabled",1)
 | 
|---|
| 3343 |     if options.!debug == 1 then say time()' Menu_File_Daemon_Start_Click done'
 | 
|---|
| 3344 | return
 | 
|---|
| 3345 | 
 | 
|---|
| 3346 | /*:VRX         Menu_File_Daemon_Stop_Click
 | 
|---|
| 3347 | */
 | 
|---|
| 3348 | Menu_File_Daemon_Stop_Click:
 | 
|---|
| 3349 |     if options.!debug == 1 then say time()' Menu_File_Daemon_Stop_Click started'
 | 
|---|
| 3350 |     ok = PRProcessList(proc)
 | 
|---|
| 3351 |     do I = 1 to proc.0
 | 
|---|
| 3352 |         CurProc = VRParseFileName(proc.i.name,'NE')
 | 
|---|
| 3353 |         if CurProc = fs.!prefix"CTL.EXE" then  do
 | 
|---|
| 3354 |             call charout , '  'CurProc' RC='
 | 
|---|
| 3355 |             ok = PRKillProcess(1,proc.i.pid)
 | 
|---|
| 3356 |             say ok
 | 
|---|
| 3357 |         end
 | 
|---|
| 3358 |     end
 | 
|---|
| 3359 |     ok = VRset("GB_CURRENT","Enabled", 0)
 | 
|---|
| 3360 |     ok = VRset("TDL_1","Enabled", 0)
 | 
|---|
| 3361 |     ok = VRSet("Menu_File_Daemon_Start","Enabled",1)
 | 
|---|
| 3362 |     ok = VRSet("Menu_File_Daemon_Stop","Enabled",0)
 | 
|---|
| 3363 |     if options.!debug == 1 then say time()' Menu_File_Daemon_Stop_Click stopped'
 | 
|---|
| 3364 | return
 | 
|---|
| 3365 | /*:VRX         Menu_File_LMHosts_Reset_Click
 | 
|---|
| 3366 | */
 | 
|---|
| 3367 | Menu_File_LMHosts_Reset_Click:
 | 
|---|
| 3368 |     call _LMHostsReset
 | 
|---|
| 3369 | return
 | 
|---|
| 3370 | 
 | 
|---|
| 3371 | /*:VRX         Menu_File_Load_Click
 | 
|---|
| 3372 | */
 | 
|---|
| 3373 | Menu_File_Load_Click: PROCEDURE EXPOSE settings. options. icons. advanced. vfs. Profile fs. cd. samba.
 | 
|---|
| 3374 |     IF options.!autoload == 1 then filename = Profile
 | 
|---|
| 3375 |     else filename = VRFileDialog('Main', NLVGetMessage( 55 ), 'L', '*.'fs.!profileext)
 | 
|---|
| 3376 |     IF filename == '' THEN RETURN
 | 
|---|
| 3377 |     IF STREAM( filename, 'C', 'QUERY EXISTS') == '' THEN DO
 | 
|---|
| 3378 |         CALL VRMessage 'Main', NLVGetMessage( 56, filename ), NLVGetMessage( 5 ), 'E'
 | 
|---|
| 3379 |         RETURN
 | 
|---|
| 3380 |     END
 | 
|---|
| 3381 | 
 | 
|---|
| 3382 |     CALL LINEIN filename, 1, 0
 | 
|---|
| 3383 |     DO WHILE LINES( filename )
 | 
|---|
| 3384 |         /* Fix Ticket #202 in order to allow blanks in sharenames */
 | 
|---|
| 3385 |         resline  = LINEIN( filename )
 | 
|---|
| 3386 |         nodelen  = pos('\\',resline)-2
 | 
|---|
| 3387 |         node     = left(resline,nodelen)
 | 
|---|
| 3388 |         rwFlag   = word(resline,words(resline))
 | 
|---|
| 3389 |         resource = substr(resline,nodelen+2,length(resline)-(nodelen+2)-(length(rwFlag)+1)+1)
 | 
|---|
| 3390 |         drop resline
 | 
|---|
| 3391 |         drop nodelen
 | 
|---|
| 3392 | 
 | 
|---|
| 3393 |         vfs.!drive      = FILESPEC('DRIVE', node )
 | 
|---|
| 3394 |         vfs.!mountpoint = STRIP( node, 'T', '\')
 | 
|---|
| 3395 | 
 | 
|---|
| 3396 |         /* In case we only have a volume we reattach the backslash, otherwise restore will fail */
 | 
|---|
| 3397 |         if vfs.!drive = vfs.!mountpoint then vfs.!mountpoint = vfs.!mountpoint||'\'
 | 
|---|
| 3398 | 
 | 
|---|
| 3399 |         call ParseResParmString
 | 
|---|
| 3400 | 
 | 
|---|
| 3401 |         options.!workgroup  = p_workgroup
 | 
|---|
| 3402 |         options.!server     = p_server
 | 
|---|
| 3403 |         options.!share      = p_share
 | 
|---|
| 3404 |         options.!user       = p_user
 | 
|---|
| 3405 |         options.!password   = p_password
 | 
|---|
| 3406 |         options.!spassword  = p_spassword
 | 
|---|
| 3407 |         options.!master     = p_master
 | 
|---|
| 3408 |         options.!mastertype = p_mtype
 | 
|---|
| 3409 | /*      options.!memlen     = p_memlen
 | 
|---|
| 3410 |         options.!logfile    = p_logfile
 | 
|---|
| 3411 |         options.!loglevel   = p_loglevel */
 | 
|---|
| 3412 |         options.!cachetimeout = p_cachetimeout
 | 
|---|
| 3413 |         options.!cachelistings = p_cachelistings
 | 
|---|
| 3414 |         options.!easupport  = p_easupport
 | 
|---|
| 3415 | 
 | 
|---|
| 3416 |         IF rwFlag == 'R' THEN
 | 
|---|
| 3417 |             options.!readonly = 1
 | 
|---|
| 3418 |         ELSE
 | 
|---|
| 3419 |             options.!readonly = 0
 | 
|---|
| 3420 | 
 | 
|---|
| 3421 |         CALL Mount
 | 
|---|
| 3422 | 
 | 
|---|
| 3423 |     END
 | 
|---|
| 3424 |     CALL STREAM filename, 'C', 'CLOSE'
 | 
|---|
| 3425 | 
 | 
|---|
| 3426 |     options.!autoload = 0
 | 
|---|
| 3427 | 
 | 
|---|
| 3428 |     CALL Refresh
 | 
|---|
| 3429 | RETURN
 | 
|---|
| 3430 | /*:VRX         Menu_File_Save_Click
 | 
|---|
| 3431 | */
 | 
|---|
| 3432 | Menu_File_Save_Click:
 | 
|---|
| 3433 |     call PB_CONDET_SAVE_Click
 | 
|---|
| 3434 | return
 | 
|---|
| 3435 | 
 | 
|---|
| 3436 | /*:VRX         Menu_File_ucCred_Reset_Click
 | 
|---|
| 3437 | */
 | 
|---|
| 3438 | Menu_File_ucCred_Reset_Click:
 | 
|---|
| 3439 |     if _ucChkUc() then ok = _ucDelUc()
 | 
|---|
| 3440 |     ok = VRSet("Pict_PWINMEM","PicturePath","#37")
 | 
|---|
| 3441 |     ok = VRSet("EF_USER",    "Value","")
 | 
|---|
| 3442 |     ok = VRSet("EF_PASSWORD","Value","")
 | 
|---|
| 3443 |     call _UserCredUpdate
 | 
|---|
| 3444 | return
 | 
|---|
| 3445 | 
 | 
|---|
| 3446 | /*:VRX         Menu_Help_About_Click
 | 
|---|
| 3447 | */
 | 
|---|
| 3448 | Menu_Help_About_Click:
 | 
|---|
| 3449 |     ok = VRLoadSecondary("SW_ABOUT", "W")
 | 
|---|
| 3450 | return
 | 
|---|
| 3451 | 
 | 
|---|
| 3452 | /*:VRX         Menu_Help_Extended_Click
 | 
|---|
| 3453 | */
 | 
|---|
| 3454 | Menu_Help_Extended_Click:
 | 
|---|
| 3455 |     ok = VRMethod( "Main", "InvokeHelp" )
 | 
|---|
| 3456 | return
 | 
|---|
| 3457 | 
 | 
|---|
| 3458 | /*:VRX         Menu_Selected_ACLS_Click
 | 
|---|
| 3459 | */
 | 
|---|
| 3460 | Menu_Selected_ACLS_Click:
 | 
|---|
| 3461 |     if options.!debug == 1 then say '  List ACLS for  "'SMBObj.udatatype'"'
 | 
|---|
| 3462 |     window = VRLoadSecondary( "SW_ACLS", "W" )
 | 
|---|
| 3463 | return
 | 
|---|
| 3464 | 
 | 
|---|
| 3465 | /*:VRX         Menu_Selected_Connect_Click
 | 
|---|
| 3466 | */
 | 
|---|
| 3467 | Menu_Selected_Connect_Click:
 | 
|---|
| 3468 |     call PB_SMBTREE_CONNECT_Click
 | 
|---|
| 3469 | return
 | 
|---|
| 3470 | 
 | 
|---|
| 3471 | /*:VRX         Menu_Selected_Default_Workgroup_Click
 | 
|---|
| 3472 | */
 | 
|---|
| 3473 | Menu_Selected_Default_Workgroup_Click:
 | 
|---|
| 3474 |     if options.!debug == 1 then say time()' '||"Menu_Selected_Default_Workgroup_Click started"
 | 
|---|
| 3475 |     if options.!debug == 1 then say '  SMBObj.rh        = "'SMBObj.rh'"'
 | 
|---|
| 3476 |     Success = 0
 | 
|---|
| 3477 |     if SMBObj.rh <> "" then do
 | 
|---|
| 3478 |         if options.!debug == 1 then say '  SMBObj.udatatype = "'SMBObj.udatatype'"'
 | 
|---|
| 3479 |         Success = 1
 | 
|---|
| 3480 |         select
 | 
|---|
| 3481 |             when SMBObj.udatatype = "WORKGROUP" then workgroupname = VRMethod("CN_SMBTREE","GetRecordAttr",SMBObj.rh,"Caption")
 | 
|---|
| 3482 |             when SMBObj.udatatype = "DISK"      then workgroupname = VRMethod("CN_SMBTREE","GetRecordAttr",SMBObj.gparentrh,"Caption")
 | 
|---|
| 3483 |             when SMBObj.udatatype = "PRINTER"   then workgroupname = VRMethod("CN_SMBTREE","GetRecordAttr",SMBObj.gparentrh,"Caption")
 | 
|---|
| 3484 |             when SMBObj.udatatype = "SERVER"    then workgroupname = VRMethod("CN_SMBTREE","GetRecordAttr",SMBObj.parentrh,"Caption")
 | 
|---|
| 3485 |             otherwise Success = 0
 | 
|---|
| 3486 |         end
 | 
|---|
| 3487 | 
 | 
|---|
| 3488 |         /* FIXME: switch over to REXXIni calls */
 | 
|---|
| 3489 |         if Success = 1 then ok = TRSetIni("[global]","workgroup", workgroupname, samba.!smbconf)
 | 
|---|
| 3490 |     end
 | 
|---|
| 3491 |     Buttons.1 = NLVGetMessage(2)
 | 
|---|
| 3492 |     Buttons.0 = 1
 | 
|---|
| 3493 | 
 | 
|---|
| 3494 |     if Success = 0 then do
 | 
|---|
| 3495 |         id = VRMessage( VRWindow(), NLVGetMessage(5), NLVGetMessage(75), "Error", "Buttons.", 1, 1 )
 | 
|---|
| 3496 |     end
 | 
|---|
| 3497 |     else do
 | 
|---|
| 3498 |         id = VRMessage( VRWindow(), NLVGetMessage(117, workgroupname), NLVGetMessage(75), "Information", "Buttons.", 1, 1 )
 | 
|---|
| 3499 |     end
 | 
|---|
| 3500 |     if options.!debug == 1 then say time()' '||"Menu_Selected_Default_Workgroup_Click done"
 | 
|---|
| 3501 | return
 | 
|---|
| 3502 | 
 | 
|---|
| 3503 | /*:VRX         Menu_Selected_DetailsView_Click
 | 
|---|
| 3504 | */
 | 
|---|
| 3505 | Menu_Selected_DetailsView_Click:
 | 
|---|
| 3506 |     ok = VRSet("CN_smbtree", "View", "Detail")
 | 
|---|
| 3507 | return
 | 
|---|
| 3508 | 
 | 
|---|
| 3509 | /*:VRX         Menu_Selected_Info_Click
 | 
|---|
| 3510 | */
 | 
|---|
| 3511 | Menu_Selected_Info_Click:
 | 
|---|
| 3512 |     if options.!debug == 1 then say time()' Menu_Selected_Info_Click started'
 | 
|---|
| 3513 | 
 | 
|---|
| 3514 |     ok = VRMethod( "CN_SMBTREE", "GetRecordList", "SourceOrSelected", "SelRH." )
 | 
|---|
| 3515 |     if SelRH.0 = 0 then do
 | 
|---|
| 3516 |         if options.!debug == 1 then say time()' Menu_Selected_Info_Click aborted'
 | 
|---|
| 3517 |         return
 | 
|---|
| 3518 |     end
 | 
|---|
| 3519 | 
 | 
|---|
| 3520 |     call _GetSMBObjectProperties SelRH.1
 | 
|---|
| 3521 | 
 | 
|---|
| 3522 |     window = VRLoadSecondary( "SW_INFO", "W" )
 | 
|---|
| 3523 |     if options.!debug == 1 then say time()' Menu_Selected_Info_Click done'
 | 
|---|
| 3524 | return
 | 
|---|
| 3525 | 
 | 
|---|
| 3526 | /*:VRX         Menu_Selected_Refresh_Click
 | 
|---|
| 3527 | */
 | 
|---|
| 3528 | Menu_Selected_Refresh_Click:
 | 
|---|
| 3529 |     ok = VRMethod( "CN_smbtree", "SetRecordAttr", SMBObj.rh, "Icon","#61:PMWP.DLL")
 | 
|---|
| 3530 |     call _DelSMBObjectShares SMBObj.rh
 | 
|---|
| 3531 |     machine = SMBObj.resname
 | 
|---|
| 3532 |     ok = VRSet("TM_RefreshTreeDisplay", "Delay", 1000)
 | 
|---|
| 3533 |     call _RefreshShares
 | 
|---|
| 3534 | return
 | 
|---|
| 3535 | 
 | 
|---|
| 3536 | /*:VRX         Menu_Selected_Remove_Click
 | 
|---|
| 3537 | */
 | 
|---|
| 3538 | Menu_Selected_Remove_Click:
 | 
|---|
| 3539 |     ok = VRMethod( "CN_CONDET", "GetRecordList", "SourceOrSelected", "selrec." )
 | 
|---|
| 3540 |     if selrec.0 = 0 then return
 | 
|---|
| 3541 | 
 | 
|---|
| 3542 |     do I = 1 to selrec.0
 | 
|---|
| 3543 |         if VRMethod("CN_CONDET", "GetFieldData", selrec.I, cd.statusfh) = icons.!passive then do
 | 
|---|
| 3544 |             CALL VRMethod "CN_CONDET", 'RemoveRecord', selrec.I
 | 
|---|
| 3545 |         end
 | 
|---|
| 3546 |         else do
 | 
|---|
| 3547 |             mountpoint = VRMethod("CN_CONDET", "GetFieldData", selrec.I, cd.mpointfh)
 | 
|---|
| 3548 |             mpidx = VRMethod("CN_CONDET", "GetFieldData", selrec.I, cd.mpidxfh)
 | 
|---|
| 3549 |             if mpidx = 1 then do
 | 
|---|
| 3550 |                 btns.0 = 2
 | 
|---|
| 3551 |                 btns.1 = NLVGetMessage( 6 )
 | 
|---|
| 3552 |                 btns.2 = NLVGetMessage( 7 )
 | 
|---|
| 3553 |                 confirm = VRMessage('Main', NLVGetMessage( 72, mountpoint ), NLVGetMessage( 8 ), 'Q', 'btns.', 1, 2 )
 | 
|---|
| 3554 |                 IF confirm \= 1 THEN RETURN
 | 
|---|
| 3555 | 
 | 
|---|
| 3556 |                 CALL _Dynamic "ok = "fs.!prefix"RxUnmount('"mountpoint"', "mpidx")"
 | 
|---|
| 3557 |                 CALL VRMethod "CN_CONDET", 'RemoveRecord', selrec.I
 | 
|---|
| 3558 |                 CALL Refresh
 | 
|---|
| 3559 |             end
 | 
|---|
| 3560 |             else do
 | 
|---|
| 3561 |                 CALL VRMessage 'Main', NLVGetMessage( 71 ) , NLVGetMessage( 89 )||" "||mountpoint , 'E'
 | 
|---|
| 3562 |             end
 | 
|---|
| 3563 |         end
 | 
|---|
| 3564 |     end
 | 
|---|
| 3565 | return
 | 
|---|
| 3566 | 
 | 
|---|
| 3567 | /*:VRX         Menu_Selected_Retry_Click
 | 
|---|
| 3568 | */
 | 
|---|
| 3569 | Menu_Selected_Retry_Click: PROCEDURE EXPOSE settings. options. icons. vfs. fs. advanced. cd. samba. mtype.
 | 
|---|
| 3570 | 
 | 
|---|
| 3571 |     ok = VRMethod( "CN_CONDET", "GetRecordList", "SourceOrSelected", "srcrec." )
 | 
|---|
| 3572 |     if srcrec.0 = 0 then return
 | 
|---|
| 3573 | 
 | 
|---|
| 3574 |     srcrec = srcrec.1
 | 
|---|
| 3575 | 
 | 
|---|
| 3576 |     p_mpoint    = VRMethod("CN_CONDET", "GetFieldData", srcrec, CD.MpointFH)
 | 
|---|
| 3577 | 
 | 
|---|
| 3578 |     p_workgroup = VRMethod("CN_CONDET", "GetFieldData", srcrec, cd.workgrpFH  )
 | 
|---|
| 3579 |     p_server    = VRMethod("CN_CONDET", "GetFieldData", srcrec, CD.ServerFH)
 | 
|---|
| 3580 |     p_share     = VRMethod("CN_CONDET", "GetFieldData", srcrec, CD.ShareFH)
 | 
|---|
| 3581 |     p_user      = VRMethod("CN_CONDET", "GetFieldData", srcrec, CD.UserFH)
 | 
|---|
| 3582 |     p_password  = x2c(VRMethod("CN_CONDET", "GetFieldData", srcrec, CD.SpasswordFH))
 | 
|---|
| 3583 | 
 | 
|---|
| 3584 |     ShareLevel = 1
 | 
|---|
| 3585 |     if p_share     = "" then ShareLevel = 2
 | 
|---|
| 3586 |     if p_server    = "" then ShareLevel = 3
 | 
|---|
| 3587 |     if p_workgroup = "" then ShareLevel = 4
 | 
|---|
| 3588 | 
 | 
|---|
| 3589 |     ok = VRSet("CB_MOUNT", "Selected", Sharelevel )
 | 
|---|
| 3590 |     ok = VRset("CB_MOUNT", "Value", mtype.sharelevel)
 | 
|---|
| 3591 | 
 | 
|---|
| 3592 |     call _UpdateObject "EF_SERVER", p_server
 | 
|---|
| 3593 |     ok = VRset("EF_SHARE"  ,  "Value", p_share)
 | 
|---|
| 3594 |     ok = VRset("EF_NETWORK",  "Value", p_workgroup)
 | 
|---|
| 3595 |     ok = VRset("EF_USER"   ,  "Value", p_user)
 | 
|---|
| 3596 |     ok = VRset("EF_PASSWORD", "Value", p_password)
 | 
|---|
| 3597 | 
 | 
|---|
| 3598 |     parse var p_mpoint p_drv '\' p_dir
 | 
|---|
| 3599 | 
 | 
|---|
| 3600 |     p_dir = strip(p_dir,'T','\')
 | 
|---|
| 3601 | 
 | 
|---|
| 3602 |     ok = VRset("CB_DRIVES"      ,  "Value", p_drv)
 | 
|---|
| 3603 |     ok = VRset("EF_DIRECTORY"   ,  "Value", p_dir)
 | 
|---|
| 3604 | 
 | 
|---|
| 3605 |     CALL PB_MOUNT_Click
 | 
|---|
| 3606 | 
 | 
|---|
| 3607 | /*  if VRMethod( "CN_CONDET", "ValidateRecord", srcRec) = 1 then do
 | 
|---|
| 3608 |         if VRMethod("CN_CONDET", "GetRecordAttr", srcRec, "Icon") = icons.!passive then ok = VRMethod( "CN_CONDET", "RemoveRecord", srcRec)
 | 
|---|
| 3609 |     end */
 | 
|---|
| 3610 | return
 | 
|---|
| 3611 | 
 | 
|---|
| 3612 | /*:VRX         Menu_Selected_TimeSync_Click
 | 
|---|
| 3613 | */
 | 
|---|
| 3614 | Menu_Selected_TimeSync_Click:
 | 
|---|
| 3615 |     if options.!debug == 1 then say time()' Menu_Selected_TimeSync_Click started'
 | 
|---|
| 3616 | 
 | 
|---|
| 3617 |     ok = VRMethod( "CN_SMBTREE", "GetRecordList", "SourceOrSelected", "SelRH." )
 | 
|---|
| 3618 |     if SelRH.0 = 0 then do
 | 
|---|
| 3619 |         if options.!debug == 1 then say time()' Menu_Selected_TimeSync_Click aborted'
 | 
|---|
| 3620 |         return
 | 
|---|
| 3621 |     end
 | 
|---|
| 3622 | 
 | 
|---|
| 3623 |     call _GetSMBObjectProperties SelRH.1
 | 
|---|
| 3624 | 
 | 
|---|
| 3625 |     options.!timesrv = SMBObj.resname
 | 
|---|
| 3626 |     call _TimeSync
 | 
|---|
| 3627 | 
 | 
|---|
| 3628 |     if options.!debug == 1 then say time()' Menu_Selected_TimeSync_Click done'
 | 
|---|
| 3629 | return
 | 
|---|
| 3630 | 
 | 
|---|
| 3631 | /*:VRX         Menu_Selected_TreeView_Click
 | 
|---|
| 3632 | */
 | 
|---|
| 3633 | Menu_Selected_TreeView_Click:
 | 
|---|
| 3634 |     ok = VRSet("CN_smbtree", "View", "IconTree")
 | 
|---|
| 3635 | return
 | 
|---|
| 3636 | 
 | 
|---|
| 3637 | /*:VRX         Mount
 | 
|---|
| 3638 | */
 | 
|---|
| 3639 | Mount: PROCEDURE EXPOSE settings. options. icons. vfs. fs. advanced. cd. samba.
 | 
|---|
| 3640 |     if options.!debug == 1 then say time()' Mount procedure started'
 | 
|---|
| 3641 |     /* Set mouse pointer to wait - this operation might take a few seconds */
 | 
|---|
| 3642 |     call VRSet VRWindow(), 'Pointer', 'Wait'
 | 
|---|
| 3643 | 
 | 
|---|
| 3644 | /*  Disabled, because we merge profile now - in earlier revisions
 | 
|---|
| 3645 |     we replaced it but only for preexisting drives - this made only
 | 
|---|
| 3646 |     sense as long as we were unable to detect double connections -
 | 
|---|
| 3647 |     this could be made an option!
 | 
|---|
| 3648 | 
 | 
|---|
| 3649 |     IF options.!autoload then do
 | 
|---|
| 3650 |         CALL _Dynamic "ok = "fs.!prefix"RxDetach('"vfs.!drive"')"
 | 
|---|
| 3651 |         if options.!debug == 1 then say time()' '||'Autoload Detach "'vfs.!drive'" =' ok
 | 
|---|
| 3652 |     end */
 | 
|---|
| 3653 | 
 | 
|---|
| 3654 |     /* Attach the virtual drive - only if drive is not already attached */
 | 
|---|
| 3655 |     NewlyAttached = 0
 | 
|---|
| 3656 |     if pos(vfs.!drive,MyFreeDriveMap("C:","FREE")) > 0 then do
 | 
|---|
| 3657 |         CALL _Dynamic "ok = "fs.!prefix"RxAttach('"vfs.!drive"')"
 | 
|---|
| 3658 |         NewlyAttached = 1 /* fixes AN Ticket 1654 */
 | 
|---|
| 3659 |         if options.!debug == 1 then say time()' '||'Attach "'vfs.!drive'" =' ok
 | 
|---|
| 3660 |     end
 | 
|---|
| 3661 | 
 | 
|---|
| 3662 |     /* Create the mount point and store whether it was created or already existed */
 | 
|---|
| 3663 |     CALL _Dynamic "CreateMP = "fs.!prefix"RxCreateMountPoint('"vfs.!mountpoint"')"
 | 
|---|
| 3664 | 
 | 
|---|
| 3665 |     if options.!debug == 1 then say time()' '||'Create "'vfs.!mountpoint'" = 'CreateMP
 | 
|---|
| 3666 | 
 | 
|---|
| 3667 |     /* encrypt password if necessary - fix for AN Ticket #1594 */
 | 
|---|
| 3668 |     if options.!password <> '' & options.!spassword = '' then do
 | 
|---|
| 3669 |         options.!spassword = c2x(options.!password)
 | 
|---|
| 3670 |         options.!password = ''
 | 
|---|
| 3671 |     end
 | 
|---|
| 3672 | 
 | 
|---|
| 3673 |     /* Build the resource parameter string */
 | 
|---|
| 3674 |     src = ''
 | 
|---|
| 3675 |     IF options.!workgroup  \= '' THEN src = src';WORKGROUP='options.!workgroup
 | 
|---|
| 3676 |     IF options.!server     \= '' THEN src = src';SERVER='options.!server
 | 
|---|
| 3677 |     IF options.!share      \= '' THEN src = src';SHARE='options.!share
 | 
|---|
| 3678 |     IF options.!user       \= '' THEN src = src';USER='options.!user
 | 
|---|
| 3679 | /* fix for AN Ticket #1594 */
 | 
|---|
| 3680 | /*  IF options.!password   \= '' THEN src = src';PASSWORD='options.!password */
 | 
|---|
| 3681 |     IF options.!spassword  \= '' THEN src = src';SPASSWORD='options.!spassword
 | 
|---|
| 3682 |     IF options.!master     \= '' THEN src = src';MASTER='options.!master
 | 
|---|
| 3683 |     IF options.!mastertype \= '' THEN src = src';MASTERTYPE='options.!mastertype
 | 
|---|
| 3684 | /*  IF options.!memlen     \= '' THEN src = src';MEMLEN='options.!memlen
 | 
|---|
| 3685 |     IF options.!logfile    \= '' THEN src = src';LOGFILE='options.!logfile
 | 
|---|
| 3686 |     IF options.!loglevel   \= '' THEN src = src';LOGLEVEL='options.!loglevel */
 | 
|---|
| 3687 |     IF options.!cachetimeout  \= '' THEN src = src';CTO='options.!cachetimeout
 | 
|---|
| 3688 |     IF options.!cachelistings \= '' THEN src = src';CLD='options.!cachelistings
 | 
|---|
| 3689 |     IF options.!easupport  \= '' THEN src = src';EASUPPORT='options.!easupport
 | 
|---|
| 3690 | 
 | 
|---|
| 3691 |     IF options.!readonly = 1 then rwFlag = 'R'; else rwFlag = 'W'
 | 
|---|
| 3692 | 
 | 
|---|
| 3693 |     parse var vfs.!mountpoint mpoint ';' .
 | 
|---|
| 3694 |     mpoint = strip(mpoint,'T','\')||'\'
 | 
|---|
| 3695 | 
 | 
|---|
| 3696 |     if options.!master   = "" then options.!master   = "WORKGROUP"
 | 
|---|
| 3697 |     if options.!mtype    = "" then options.!mtype    = "1"
 | 
|---|
| 3698 |     if options.!loglevel = "" then options.!loglevel = "0"
 | 
|---|
| 3699 |     if options.!memlen   = "" then options.!memlen   = "2"
 | 
|---|
| 3700 |     if options.!cachetimeout = "" then options.!cachetimeout = "10"
 | 
|---|
| 3701 |     if options.!cachelistings = "" then options.!cachelistings = "32"
 | 
|---|
| 3702 |     if options.!easupport= "" | options.!easupport= " " then options.!easupport = strip(options.!easupport)
 | 
|---|
| 3703 | 
 | 
|---|
| 3704 |     hashstr = mpoint' 'translate(options.!workgroup)' 'translate(options.!server)' 'translate(options.!share)' 'options.!user' 'options.!spassword' 'options.!easupport' 'rwFlag
 | 
|---|
| 3705 | 
 | 
|---|
| 3706 |     md5 = rexx_md5(hashstr)
 | 
|---|
| 3707 | 
 | 
|---|
| 3708 |     CALL VRMethod "CN_CONDET", 'GetRecordList', 'All', 'records.'
 | 
|---|
| 3709 |     DO i = 1 TO records.0
 | 
|---|
| 3710 |         hash = VRMethod("CN_CONDET","GetFieldData", records.i, cd.hashfh)
 | 
|---|
| 3711 | 
 | 
|---|
| 3712 |         if options.!debug == 1 then say VRMethod("CN_CONDET","GetFieldData", records.i, CD.mpointFH)'->'hash
 | 
|---|
| 3713 |         if options.!debug == 1 then say mpoint'->'md5
 | 
|---|
| 3714 | 
 | 
|---|
| 3715 |         if hash = md5 then do
 | 
|---|
| 3716 |             If VRMethod("CN_CONDET","GetFieldData", records.i, cd.statusfh) = icons.!active then do /* Same hash, status active */
 | 
|---|
| 3717 |                 say "Double connection detected!!"
 | 
|---|
| 3718 |                 if options.!spassword <> "" then upw = ":********"
 | 
|---|
| 3719 |                 else upw = ""
 | 
|---|
| 3720 |                 buttons.0 = 2
 | 
|---|
| 3721 |                 buttons.1 = NLVGetMessage(9)
 | 
|---|
| 3722 |                 buttons.2 = NLVGetMessage(3)
 | 
|---|
| 3723 |                 Answer = VRMessage('Main',NLVGetMessage(64) , NLVGetMessage( 36,options.!user||upw'@'options.!workgroup'\\'options.!server'\'options.!share, vfs.!mountpoint ), 'W','buttons.')
 | 
|---|
| 3724 |                 if Answer = 2 then do
 | 
|---|
| 3725 |                     call VRSet VRWindow(), 'Pointer', '<default>'
 | 
|---|
| 3726 |                     say "Double connection - do not mount!!"
 | 
|---|
| 3727 |                     return
 | 
|---|
| 3728 |                 end
 | 
|---|
| 3729 |             end
 | 
|---|
| 3730 |             else do /* Same hash, status passive - we have to remove it */
 | 
|---|
| 3731 |                 ok = VRMethod("CN_CONDET", "RemoveRecord", records.i )
 | 
|---|
| 3732 |             end
 | 
|---|
| 3733 |         end
 | 
|---|
| 3734 |     end
 | 
|---|
| 3735 | 
 | 
|---|
| 3736 |     cd.lastrh = ""
 | 
|---|
| 3737 |     ok = ParseResourceData(vfs.!mountpoint,'SMBFS SMBFS64 \\'options.!workgroup':'options.!server'\'options.!share'@'options.!user||src' 'rwFlag)
 | 
|---|
| 3738 | 
 | 
|---|
| 3739 |     /* Now mount the resource */
 | 
|---|
| 3740 |     CALL _Dynamic "ok = "fs.!prefix"RxMount('SMBFS','"vfs.!mountpoint"', '"src"', '"rwFlag"')"
 | 
|---|
| 3741 | 
 | 
|---|
| 3742 |     if options.!debug == 1 then say time()' '||'Mount "'vfs.!mountpoint'" =' ok
 | 
|---|
| 3743 |     if ok <> 0 then do
 | 
|---|
| 3744 |         if options.!password <> "" then upw = ":********"
 | 
|---|
| 3745 |             else upw = ""
 | 
|---|
| 3746 |         buttons.0 = 2
 | 
|---|
| 3747 |         buttons.1 = NLVGetMessage(2)
 | 
|---|
| 3748 |         buttons.2 = NLVGetMessage(37)
 | 
|---|
| 3749 |         Answer = VRMessage('Main', SysGetMessage(ok), NLVGetMessage( 36,  options.!user||upw'@'options.!workgroup'\\'options.!server'\'options.!share, vfs.!mountpoint ), 'W','buttons.')
 | 
|---|
| 3750 |         if Answer = 2 then do /* Show explanation */
 | 
|---|
| 3751 |             xx = VRMessage('Main', NLVGetMessage( 36,  options.!user||upw'@'options.!workgroup'\\'options.!server'\'options.!share, vfs.!mountpoint )||'0D0A'x||'0D0A'x||SysGetMessage(ok)||'0D0A'x||'0D0A'x||SysGetMessage(ok, 'OSO001H.MSG'), NLVGetMessage(37), 'W')
 | 
|---|
| 3752 |         end
 | 
|---|
| 3753 |         if cd.lastrh <> '' then do
 | 
|---|
| 3754 |             ok = VRMethod("CN_CONDET", "SetFieldData",  cd.lastrh, cd.statusfh, icons.!passive) /* Passive Connection icon */
 | 
|---|
| 3755 |             ok = VRMethod("CN_CONDET", "SetRecordAttr", cd.lastrh, "Icon", icons.!passive) /* Passive Connection icon */
 | 
|---|
| 3756 |             ok = VRMethod("CN_CONDET", "SetFieldData",  cd.lastrh, cd.passwordfh, '') /* remove pain text password */
 | 
|---|
| 3757 |         end
 | 
|---|
| 3758 | 
 | 
|---|
| 3759 |         /* In case the mountpoint was created for this failed operation, it is (optionally) removed again */
 | 
|---|
| 3760 |         say "CreateMP="createMP
 | 
|---|
| 3761 |         say "advanced.!alwaysmp="advanced.!alwaysmp
 | 
|---|
| 3762 |         if CreateMP = 0 & advanced.!alwaysmp <> 1 then do
 | 
|---|
| 3763 |             CALL _Dynamic "ok = "fs.!prefix"RxDeleteMountPoint('"vfs.!mountpoint"')"
 | 
|---|
| 3764 |             if options.!debug == 1 then say time()' '||'Remove "'vfs.!mountpoint'" = 'ok
 | 
|---|
| 3765 |             if NewlyAttached = 1 then do /* Also detach drive - fixes AN Ticket 1654 */
 | 
|---|
| 3766 |                 CALL _Dynamic "ok = "fs.!prefix"RxDetach('"vfs.!drive"')"
 | 
|---|
| 3767 |                 if options.!debug == 1 then say time()' '||'Also try to detach "'vfs.!drive'" ok = 'ok
 | 
|---|
| 3768 |             end
 | 
|---|
| 3769 |         end
 | 
|---|
| 3770 |     end
 | 
|---|
| 3771 |     else do
 | 
|---|
| 3772 |         if options.!storecreds = 1 then do
 | 
|---|
| 3773 |             ok = VRSet("EF_User",    "Value",options.!user)
 | 
|---|
| 3774 |             ok = VRSet("EF_Password","Value",x2c(options.!spassword))
 | 
|---|
| 3775 |         end
 | 
|---|
| 3776 |     end
 | 
|---|
| 3777 |     drop CreateMP /* not required anymore */
 | 
|---|
| 3778 |     drop NewlyAttached /* not required anymore */
 | 
|---|
| 3779 | 
 | 
|---|
| 3780 | /*  Obsolete - the IOCtl will not be implemented this way in the plugin
 | 
|---|
| 3781 |     The REXX function is present, but is has no counterpart in the plugin
 | 
|---|
| 3782 |     ok = EvfsRxIoctl( 100 , vfs.!mountpoint, outstring)
 | 
|---|
| 3783 |     if options.!debug == 1 then say time()' '||'RxIoctl "'vfs.!mountpoint'" = 'ok', 'outstring
 | 
|---|
| 3784 |  */
 | 
|---|
| 3785 |     /* Set mouse pointer to default again */
 | 
|---|
| 3786 |     call VRSet VRWindow(), 'Pointer', '<default>'
 | 
|---|
| 3787 |     if options.!debug == 1 then say time()' Mount procedure done'
 | 
|---|
| 3788 | RETURN ok
 | 
|---|
| 3789 | 
 | 
|---|
| 3790 | /*:VRX         MyFreeDriveMap
 | 
|---|
| 3791 | */
 | 
|---|
| 3792 | MyFreeDriveMap: procedure expose options. icons. fs. samba.
 | 
|---|
| 3793 |     if options.!debug == 1 then say time()' MyFreeDriveMap(proc) started'
 | 
|---|
| 3794 |     alldrives = "C: D: E: F: G: H: I: J: K: L: M: N: O: P: Q: R: S: T: U: V: W: X: Y: Z:"
 | 
|---|
| 3795 | /*  if options.!debug == 1 then say time()' '||"SysDriveMap(USED) started" */
 | 
|---|
| 3796 |     useddrives= SysDriveMap("C:","USED")
 | 
|---|
| 3797 | /*  if options.!debug == 1 then say time()' '||"SysDriveMap(USED) done" */
 | 
|---|
| 3798 | 
 | 
|---|
| 3799 |     Alldr = words(alldrives)
 | 
|---|
| 3800 |     FreeDriveMap = ""
 | 
|---|
| 3801 |     do I = 1 to AllDr
 | 
|---|
| 3802 |         if word(alldrives,1) = word(useddrives,1) then do
 | 
|---|
| 3803 |             Useddrives = subword(useddrives,2)
 | 
|---|
| 3804 |             Alldrives = subword(Alldrives,2)
 | 
|---|
| 3805 |         end
 | 
|---|
| 3806 |         else do
 | 
|---|
| 3807 |             FreeDriveMap = FreeDriveMap||word(alldrives,1)||' '
 | 
|---|
| 3808 |             Alldrives = subword(Alldrives,2)
 | 
|---|
| 3809 |         end
 | 
|---|
| 3810 |     end
 | 
|---|
| 3811 |     if options.!debug == 1 then say time()' MyFreeDriveMap(proc) done, result "'FreeDriveMap'"'
 | 
|---|
| 3812 | return FreeDriveMap
 | 
|---|
| 3813 | /*:VRX         NoEVFSCALL
 | 
|---|
| 3814 | */
 | 
|---|
| 3815 | NoEVFSCALL:
 | 
|---|
| 3816 |     CALL VRMessage 'Main', NLVGetMessage( 100 ), NLVGetMessage( 5 ), 'E'
 | 
|---|
| 3817 |     signal Halt
 | 
|---|
| 3818 | RETURN
 | 
|---|
| 3819 | 
 | 
|---|
| 3820 | /*:VRX         ParseResourceData
 | 
|---|
| 3821 | */
 | 
|---|
| 3822 | ParseResourceData: PROCEDURE EXPOSE userdata options. icons. advanced. fs. cd. samba.
 | 
|---|
| 3823 |     PARSE ARG userdata, resource
 | 
|---|
| 3824 |     if options.!debug == 1 then say time()' ParseResourceData started'
 | 
|---|
| 3825 |     if options.!debug == 1 then say '  receiving "'userdata'" "'resource'" length ('length(resource)')'
 | 
|---|
| 3826 | 
 | 
|---|
| 3827 | /* WARNING! resource has a maximal length of 255 and is truncated otherwise */
 | 
|---|
| 3828 | 
 | 
|---|
| 3829 | /*  PARSE VAR resource . ';WORKGROUP='p_workgroup';SERVER='p_server';SHARE='p_share';' . */
 | 
|---|
| 3830 | 
 | 
|---|
| 3831 |     select /* Support for other filesystems comes here! */
 | 
|---|
| 3832 |         when left(word(resource,1),5) = "SMBFS" then do
 | 
|---|
| 3833 |             cd.lastrh = VRMethod("CN_CONDET","AddRecord")
 | 
|---|
| 3834 |             PARSE VAR userdata p_mpoint ';' p_mpidx ';' .
 | 
|---|
| 3835 | 
 | 
|---|
| 3836 |             p_mpoint = strip(p_mpoint,'T','\')||'\'
 | 
|---|
| 3837 |             p_rw     = word(resource, words(resource))
 | 
|---|
| 3838 | 
 | 
|---|
| 3839 |             /* Workaround for truncated resource string */
 | 
|---|
| 3840 |             if length(p_rw) > 1 then do
 | 
|---|
| 3841 |                 /* The resource string must have been truncated
 | 
|---|
| 3842 |                    p_rw is already wrong and
 | 
|---|
| 3843 |                    p_easupport will most likely be also wrong (look below for workaround!) */
 | 
|---|
| 3844 |                 p_rw ="W" /* this is guessed only!!! */
 | 
|---|
| 3845 |                 if options.!debug == 1 then say '  WARNING! Detected truncated resource string - shorten workgroup name, server name, share name until this message goes away!'
 | 
|---|
| 3846 |             end
 | 
|---|
| 3847 |             /* this should be done unconditionally if the resource string is never truncated */
 | 
|---|
| 3848 |             else resource  = left(resource,length(resource)-length(p_rw))
 | 
|---|
| 3849 | 
 | 
|---|
| 3850 |             call ParseResParmString
 | 
|---|
| 3851 | 
 | 
|---|
| 3852 |             if p_master   = "" then p_master   = "WORKGROUP"
 | 
|---|
| 3853 |             if p_mtype    = "" then p_mtype    = "1"
 | 
|---|
| 3854 |             if p_loglevel = "" then p_loglevel = "0"
 | 
|---|
| 3855 |             if p_memlen   = "" then p_memlen   = "2"
 | 
|---|
| 3856 | 
 | 
|---|
| 3857 |             /* Also works around for a truncated resource string! */
 | 
|---|
| 3858 |             if p_easupport= "" | p_easupport= " " then p_easupport = strip(options.!easupport)
 | 
|---|
| 3859 | 
 | 
|---|
| 3860 |             if p_password <> "" & p_spassword = "" then do
 | 
|---|
| 3861 |                 p_spassword = c2x(p_password)
 | 
|---|
| 3862 |                 p_password = ""
 | 
|---|
| 3863 |             end
 | 
|---|
| 3864 | 
 | 
|---|
| 3865 |             ok = VRMethod("CN_CONDET", "SetFieldData", cd.lastrh, cd.mpointFH, p_mpoint, cd.mpidxfh, p_mpidx, cd.workgrpFH  , p_workgroup, cd.serverfh, p_server, cd.sharefh, p_share, cd.userfh, p_user)
 | 
|---|
| 3866 |             ok = VRMethod("CN_CONDET", "SetFieldData", cd.lastrh, cd.passwordfh, p_password, cd.spasswordfh, p_spassword, cd.masterfh, p_master, cd.mtypefh, p_mtype)
 | 
|---|
| 3867 |             ok = VRMethod("CN_CONDET", "SetFieldData", cd.lastrh, cd.ctoFH, p_cachetimeout, cd.cldFH, p_cachelistings)
 | 
|---|
| 3868 |             ok = VRMethod("CN_CONDET", "SetFieldData", cd.lastrh, cd.memlenfh, p_memlen, cd.easupportfh, p_easupport, cd.logfilefh, p_logfile, cd.loglevelfh, p_loglevel, cd.rwfh, p_rw)
 | 
|---|
| 3869 |             ok = VRMethod("CN_CONDET", "SetFieldData", cd.lastrh, cd.statusfh, icons.!active) /* Active */
 | 
|---|
| 3870 |             ok = VRMethod("CN_CONDET", "SetRecordAttr", cd.lastrh, "Icon", icons.!active) /* Active */
 | 
|---|
| 3871 | 
 | 
|---|
| 3872 |             hashstr = p_mpoint' 'translate(p_workgroup)' 'translate(p_server)' 'translate(p_share)' 'p_user' 'p_spassword' 'p_easupport' 'p_rw
 | 
|---|
| 3873 | 
 | 
|---|
| 3874 |             md5 = rexx_md5(hashstr)
 | 
|---|
| 3875 | 
 | 
|---|
| 3876 |             ok = VRMethod("CN_CONDET", "SetFieldData", cd.lastrh, cd.hashfh,md5)
 | 
|---|
| 3877 | 
 | 
|---|
| 3878 |             SELECT
 | 
|---|
| 3879 |                 WHEN p_share  == '' & p_server \= '' THEN DO   /* all shares on server */
 | 
|---|
| 3880 |                     IF p_workgroup == '' THEN
 | 
|---|
| 3881 |                         userdata = userdata';\\'p_server'\*'
 | 
|---|
| 3882 |                     ELSE
 | 
|---|
| 3883 |                         userdata = userdata';'p_workgroup':\\'p_server'\*'
 | 
|---|
| 3884 |                 END
 | 
|---|
| 3885 |                 WHEN p_server == '' & p_workgroup \= '' THEN    /* all servers in workgroup */
 | 
|---|
| 3886 |                     userdata = userdata';'p_workgroup':\\*'
 | 
|---|
| 3887 |                 WHEN p_server == '' & p_workgroup == '' THEN    /* all workgroups */
 | 
|---|
| 3888 |                     userdata = userdata';*:\\*'
 | 
|---|
| 3889 |                 OTHERWISE DO
 | 
|---|
| 3890 |                     IF p_workgroup == '' THEN
 | 
|---|
| 3891 |                         userdata = userdata';\\'p_server'\'p_share
 | 
|---|
| 3892 |                     ELSE
 | 
|---|
| 3893 |                         userdata = userdata';'p_workgroup':\\'p_server'\'p_share
 | 
|---|
| 3894 |                 END
 | 
|---|
| 3895 |             END
 | 
|---|
| 3896 | 
 | 
|---|
| 3897 |         end
 | 
|---|
| 3898 |         when left(word(resource,1),3) = "DAV" then do
 | 
|---|
| 3899 |             userdata = "webDAV"
 | 
|---|
| 3900 |         end
 | 
|---|
| 3901 |         otherwise do /* All unsupported filesystems end here! */
 | 
|---|
| 3902 |             userData = "UNKNOWN"
 | 
|---|
| 3903 |         end
 | 
|---|
| 3904 |     end
 | 
|---|
| 3905 |     if left(word(resource,1),5) <> "SMBFS" then do
 | 
|---|
| 3906 |     end
 | 
|---|
| 3907 |     else do
 | 
|---|
| 3908 |     end
 | 
|---|
| 3909 | 
 | 
|---|
| 3910 |     if options.!debug == 1 then say '  returning "'userdata'"'
 | 
|---|
| 3911 |     if options.!debug == 1 then say time()' ParseResourceData done'
 | 
|---|
| 3912 | RETURN userdata
 | 
|---|
| 3913 | 
 | 
|---|
| 3914 | /*:VRX         ParseResParmString
 | 
|---|
| 3915 | */
 | 
|---|
| 3916 | ParseResParmString:
 | 
|---|
| 3917 |     PARSE VAR resource . ';WORKGROUP=' p_workgroup ';' .
 | 
|---|
| 3918 |     PARSE VAR resource . ';SERVER=' p_server ';' .
 | 
|---|
| 3919 |     PARSE VAR resource . ';SHARE=' p_share ';' .
 | 
|---|
| 3920 |     PARSE VAR resource . ';USER=' p_user ';' .
 | 
|---|
| 3921 |     PARSE VAR resource . ';PASSWORD=' p_password ';' .
 | 
|---|
| 3922 |     PARSE VAR resource . ';SPASSWORD=' p_spassword ';' .
 | 
|---|
| 3923 |     PARSE VAR resource . ';MASTER=' p_master ';' .
 | 
|---|
| 3924 |     PARSE VAR resource . ';MASTERTYPE=' p_mtype ';' .
 | 
|---|
| 3925 |     PARSE VAR resource . ';MEMLEN=' p_memlen ';' .
 | 
|---|
| 3926 |     PARSE VAR resource . ';LOGFILE=' p_logfile ';' .
 | 
|---|
| 3927 |     PARSE VAR resource . ';LOGLEVEL=' p_loglevel ';' .
 | 
|---|
| 3928 |     PARSE VAR resource . ';CTO=' p_cachetimeout ';' .
 | 
|---|
| 3929 |     PARSE VAR resource . ';CLD=' p_cachelistings ';' .
 | 
|---|
| 3930 |     PARSE VAR resource . ';EASUPPORT=' p_easupport ';' .
 | 
|---|
| 3931 |     PARSE VAR resource . ';KRB5SUPPORT=' p_krb5support ';' .
 | 
|---|
| 3932 |     PARSE VAR resource . ';NTLMV1SUPPORT=' p_ntlmv1support ';' .
 | 
|---|
| 3933 |     PARSE VAR resource . ';ENCRYPTIONSUPPORT=' p_encryptionsupport ' '
 | 
|---|
| 3934 | 
 | 
|---|
| 3935 | return
 | 
|---|
| 3936 | /*:VRX         PB_ABOUT_CLOSE_Click
 | 
|---|
| 3937 | */
 | 
|---|
| 3938 | PB_ABOUT_CLOSE_Click:
 | 
|---|
| 3939 |     CALL SW_ABOUT_Close
 | 
|---|
| 3940 | return
 | 
|---|
| 3941 | 
 | 
|---|
| 3942 | /*:VRX         PB_ABOUT_COPY_Click
 | 
|---|
| 3943 | */
 | 
|---|
| 3944 | PB_ABOUT_COPY_Click:
 | 
|---|
| 3945 | 
 | 
|---|
| 3946 |     if VRGet("CB_TRAC","set") then DO
 | 
|---|
| 3947 |         remainstr = AboutStr
 | 
|---|
| 3948 |         AboutStr = ''
 | 
|---|
| 3949 |         DO WHILE remainstr <> ''
 | 
|---|
| 3950 |             PARSE VAR remainstr _part '0d0a'x remainstr
 | 
|---|
| 3951 |             AboutStr = AboutStr || _part ||'[[BR]]'||'0d0a'x
 | 
|---|
| 3952 |         END
 | 
|---|
| 3953 |     END
 | 
|---|
| 3954 |     ok = VRMethod( "Application", "PutClipboard", AboutStr )
 | 
|---|
| 3955 |     if options.!debug == 1 then call beep 880*2,10
 | 
|---|
| 3956 |     CALL SW_ABOUT_Close
 | 
|---|
| 3957 | return
 | 
|---|
| 3958 | 
 | 
|---|
| 3959 | /*:VRX         PB_ACLS_OK_Click
 | 
|---|
| 3960 | */
 | 
|---|
| 3961 | PB_ACLS_OK_Click:
 | 
|---|
| 3962 |     call SW_ACLS_Close
 | 
|---|
| 3963 | return
 | 
|---|
| 3964 | 
 | 
|---|
| 3965 | /*:VRX         PB_ADVANCED_APPLY_Click
 | 
|---|
| 3966 | */
 | 
|---|
| 3967 | PB_ADVANCED_APPLY_Click:
 | 
|---|
| 3968 |     advanced.!easupport     = VRGet( "CB_EAS",             "Set"   )
 | 
|---|
| 3969 |     advanced.!readonly      = VRGet( "CB_READONLY",        "Set"   )
 | 
|---|
| 3970 |     advanced.!alwaysmp      = VRGet( "CB_ALWAYSMP",        "Set"   )
 | 
|---|
| 3971 |     advanced.!cachetimeout  = VRGet( "SPIN_CACHETIMEOUT",  "Value" )
 | 
|---|
| 3972 |     advanced.!cachelistings = VRGet( "SPIN_CACHELISTINGS", "Value" )
 | 
|---|
| 3973 |     advanced.!kerberos5     = VRGet( "CB_KERBEROS5",       "Set"   )
 | 
|---|
| 3974 |     advanced.!ntlmv1        = VRGet( "CB_NTLMV1",          "Set"   )
 | 
|---|
| 3975 |     advanced.!encryption    = VRGet( "CB_ENCRYPTION",      "Set"   )
 | 
|---|
| 3976 | 
 | 
|---|
| 3977 |     /* Obsolete */
 | 
|---|
| 3978 |     advanced.!memlen        = VRGet( "SPB_MEMLEN",         "Value" )
 | 
|---|
| 3979 | return
 | 
|---|
| 3980 | 
 | 
|---|
| 3981 | /*:VRX         PB_ADVANCED_HELP_Click
 | 
|---|
| 3982 | */
 | 
|---|
| 3983 | PB_ADVANCED_HELP_Click:
 | 
|---|
| 3984 |     CALL VRMethod 'SW_ADVANCED', 'InvokeHelp'
 | 
|---|
| 3985 | return
 | 
|---|
| 3986 | 
 | 
|---|
| 3987 | /*:VRX         PB_ADVANCED_UNDO_Click
 | 
|---|
| 3988 | */
 | 
|---|
| 3989 | PB_ADVANCED_UNDO_Click:
 | 
|---|
| 3990 |     CALL SW_ADVANCED_Init_Content
 | 
|---|
| 3991 | RETURN
 | 
|---|
| 3992 | 
 | 
|---|
| 3993 | /*:VRX         PB_ClearCred_Click
 | 
|---|
| 3994 | */
 | 
|---|
| 3995 | PB_ClearCred_Click:
 | 
|---|
| 3996 |     call Menu_File_ucCred_Reset_Click
 | 
|---|
| 3997 | return
 | 
|---|
| 3998 | 
 | 
|---|
| 3999 | /*:VRX         PB_CONDET_HELP_Click
 | 
|---|
| 4000 | */
 | 
|---|
| 4001 | PB_CONDET_HELP_Click:
 | 
|---|
| 4002 |     CALL VRMethod 'GB_CONDET', 'InvokeHelp'
 | 
|---|
| 4003 | return
 | 
|---|
| 4004 | 
 | 
|---|
| 4005 | /*:VRX         PB_CONDET_LOAD_Click
 | 
|---|
| 4006 | */
 | 
|---|
| 4007 | PB_CONDET_LOAD_Click:
 | 
|---|
| 4008 |     if options.!debug == 1 then say time()' '||"PB_CONDET_LOAD_Click started"
 | 
|---|
| 4009 |     call Menu_File_Load_Click
 | 
|---|
| 4010 |     if options.!debug == 1 then say time()' '||"PB_CONDET_LOAD_Click done"
 | 
|---|
| 4011 | RETURN
 | 
|---|
| 4012 | 
 | 
|---|
| 4013 | /*:VRX         PB_CONDET_SAVE_Click
 | 
|---|
| 4014 | */
 | 
|---|
| 4015 | PB_CONDET_SAVE_Click: PROCEDURE EXPOSE settings. options. icons. Profile fs.  cd. advanced. samba.
 | 
|---|
| 4016 |     if options.!debug == 1 then say time()' '||"PB_CONDET_SAVE_Click started"
 | 
|---|
| 4017 | 
 | 
|---|
| 4018 |     if options.!autostart == 0 THEN filename = VRFileDialog('Main', NLVGetMessage( 50 ), 'S', '*.'fs.!profileext)
 | 
|---|
| 4019 |     ELSE filename = Profile
 | 
|---|
| 4020 | 
 | 
|---|
| 4021 |     IF filename == '' THEN RETURN
 | 
|---|
| 4022 | 
 | 
|---|
| 4023 |     IF STREAM( filename, 'C', 'QUERY EXISTS') \= '' THEN DO
 | 
|---|
| 4024 |         btns.0 = 2
 | 
|---|
| 4025 |         btns.1 = NLVGetMessage( 6 )
 | 
|---|
| 4026 |         if btns.1 = "" then btns.1 = '[Yes]'
 | 
|---|
| 4027 |         btns.2 = NLVGetMessage( 7 )
 | 
|---|
| 4028 |         if btns.2 = "" then btns.2 = '[No]'
 | 
|---|
| 4029 |         Title = NLVGetMessage( 53 )
 | 
|---|
| 4030 |         if Title = "" then Title = "[File exists]"
 | 
|---|
| 4031 |         Text = NLVGetMessage( 54, filename )
 | 
|---|
| 4032 |         if Text = "" then Text = "[File "filename" exists? Overwrite?]"
 | 
|---|
| 4033 | 
 | 
|---|
| 4034 |         confirm = VRMessage('Main', Text, Title, 'W', 'btns.', 1, 2 )
 | 
|---|
| 4035 |         IF confirm \= 1 THEN RETURN
 | 
|---|
| 4036 |         CALL VRChAttr filename,, 'HSR'
 | 
|---|
| 4037 |         CALL VRDeleteFile filename
 | 
|---|
| 4038 |     END
 | 
|---|
| 4039 | 
 | 
|---|
| 4040 |     CALL VRMethod "CN_CONDET", 'GetRecordList', 'All', 'records.'
 | 
|---|
| 4041 |     DO i = 1 TO records.0
 | 
|---|
| 4042 |         resource = ""
 | 
|---|
| 4043 |         resource = resource||VRMethod("CN_CONDET","GetFieldData", records.i, cd.mpointfh)||" "
 | 
|---|
| 4044 |         resource = resource||'\\'||VRMethod("CN_CONDET","GetFieldData", records.i, cd.workgrpFH  )
 | 
|---|
| 4045 |         resource = resource||':'||VRMethod("CN_CONDET","GetFieldData", records.i, cd.serverfh)
 | 
|---|
| 4046 |         resource = resource||'\'||VRMethod("CN_CONDET","GetFieldData", records.i, cd.sharefh)
 | 
|---|
| 4047 |         resource = resource||'@'||VRMethod("CN_CONDET","GetFieldData", records.i, cd.userfh)
 | 
|---|
| 4048 |         resource = resource||';WORKGROUP='||VRMethod("CN_CONDET","GetFieldData", records.i, cd.workgrpFH  )
 | 
|---|
| 4049 |         resource = resource||';SERVER='||VRMethod("CN_CONDET","GetFieldData", records.i, cd.serverfh)
 | 
|---|
| 4050 |         resource = resource||';SHARE='||VRMethod("CN_CONDET","GetFieldData", records.i, cd.sharefh)
 | 
|---|
| 4051 |         resource = resource||';USER='||VRMethod("CN_CONDET","GetFieldData", records.i, cd.userfh)
 | 
|---|
| 4052 |         resource = resource||';PASSWORD='||VRMethod("CN_CONDET","GetFieldData", records.i, cd.passwordfh)
 | 
|---|
| 4053 |         resource = resource||';SPASSWORD='||VRMethod("CN_CONDET","GetFieldData", records.i, cd.spasswordfh)
 | 
|---|
| 4054 |         resource = resource||';MASTER='||VRMethod("CN_CONDET","GetFieldData", records.i, cd.masterfh)
 | 
|---|
| 4055 |         resource = resource||';MASTERTYPE='||VRMethod("CN_CONDET","GetFieldData", records.i, cd.mtypefh)
 | 
|---|
| 4056 |         resource = resource||';CTO='||VRMethod("CN_CONDET","GetFieldData", records.i, cd.ctoFH)
 | 
|---|
| 4057 |         resource = resource||';CLD='||VRMethod("CN_CONDET","GetFieldData", records.i, cd.cldFH)
 | 
|---|
| 4058 | /*      resource = resource||';MEMLEN='||VRMethod("CN_CONDET","GetFieldData", records.i, cd.memlenfh)
 | 
|---|
| 4059 |         resource = resource||';LOGFILE='||VRMethod("CN_CONDET","GetFieldData", records.i, cd.logfilefh)
 | 
|---|
| 4060 |         resource = resource||';LOGLEVEL='||VRMethod("CN_CONDET","GetFieldData", records.i, cd.loglevelfh) */
 | 
|---|
| 4061 |         resource = resource||';EASUPPORT='||VRMethod("CN_CONDET","GetFieldData", records.i, cd.easupportfh)
 | 
|---|
| 4062 |         resource = resource||';KRB5SUPPORT='||VRMethod("CN_CONDET","GetFieldData", records.i, cd.kerberos5FH)
 | 
|---|
| 4063 |         resource = resource||';NTLMV1SUPPORT='||VRMethod("CN_CONDET","GetFieldData", records.i, cd.ntlmv1FH)
 | 
|---|
| 4064 |         resource = resource||';ENCRYPTIONSUPPORT='||VRMethod("CN_CONDET","GetFieldData", records.i, cd.encryptionFH)
 | 
|---|
| 4065 |         resource = resource||' '||VRMethod("CN_CONDET","GetFieldData", records.i, cd.rwfh)
 | 
|---|
| 4066 |         call lineout filename, resource
 | 
|---|
| 4067 |     END
 | 
|---|
| 4068 |     CALL STREAM filename, 'C', 'CLOSE'
 | 
|---|
| 4069 | 
 | 
|---|
| 4070 |     if options.!autostart == 0 THEN do
 | 
|---|
| 4071 |         Title = NLVGetMessage( 51 )
 | 
|---|
| 4072 |         if Title = "" then Title = "[Profile saved]"
 | 
|---|
| 4073 |         Text = NLVGetMessage( 52, filename )
 | 
|---|
| 4074 |         if Text = "" then Text = "[Profile saved to "filename"!]"
 | 
|---|
| 4075 |         CALL VRMessage 'Main', Text , Title, 'I'
 | 
|---|
| 4076 |     end
 | 
|---|
| 4077 | 
 | 
|---|
| 4078 |     if options.!debug == 1 then say time()' '||"PB_CONDET_SAVE_Click done"
 | 
|---|
| 4079 | RETURN
 | 
|---|
| 4080 | 
 | 
|---|
| 4081 | /*:VRX         PB_DETACH_Click
 | 
|---|
| 4082 | */
 | 
|---|
| 4083 | PB_DETACH_Click: PROCEDURE EXPOSE settings. options. icons. fs. cd. samba.
 | 
|---|
| 4084 |     if options.!debug == 1 then say time()' '||"PB_DETACH_Click started"
 | 
|---|
| 4085 |     CALL VRMethod "CN_CURRENT", 'GetRecordList', 'Selected', 'select.'
 | 
|---|
| 4086 |     IF select.0 < 1 THEN RETURN
 | 
|---|
| 4087 | 
 | 
|---|
| 4088 |     userdata = VRMethod( "CN_CURRENT", 'GetRecordAttr', select.1, 'UserData')
 | 
|---|
| 4089 |     PARSE VAR userdata mountpoint ';' mounts ';' .
 | 
|---|
| 4090 |     drive = STRIP( mountpoint, 'T', '\')
 | 
|---|
| 4091 | 
 | 
|---|
| 4092 |     btns.0 = 2
 | 
|---|
| 4093 |     btns.1 = NLVGetMessage( 6 )
 | 
|---|
| 4094 |     btns.2 = NLVGetMessage( 7 )
 | 
|---|
| 4095 |     confirm = VRMessage('Main', NLVGetMessage( 58, drive ), NLVGetMessage( 8 ), 'Q', 'btns.', 1, 2 )
 | 
|---|
| 4096 |     IF confirm \= 1 THEN RETURN
 | 
|---|
| 4097 | 
 | 
|---|
| 4098 |     /* TODO: ??  Unmount & delete all child mountpoints? - Do we need this? */
 | 
|---|
| 4099 |     /* FIXME: This is potentially dangerous on Netdrive - what happens with unknown mount types? */
 | 
|---|
| 4100 |     /* FIXME: Unclear under which circumstances we have an alpha value here (which crahed EVFSGUI) */
 | 
|---|
| 4101 |     if datatype(mounts) = 'NUM' then do
 | 
|---|
| 4102 |         /* Unmount any resources */
 | 
|---|
| 4103 |         DO i = 1 TO mounts
 | 
|---|
| 4104 |             CALL _Dynamic "ok = "fs.!prefix"RxUnmount('"mountpoint"', "i-1")"
 | 
|---|
| 4105 |         END
 | 
|---|
| 4106 |     end
 | 
|---|
| 4107 |     else if options.!debug == 1 then say ' '||"mounts = "mounts
 | 
|---|
| 4108 | 
 | 
|---|
| 4109 |     CALL _Dynamic "ok = "fs.!prefix"RxDetach('"drive"')"
 | 
|---|
| 4110 | 
 | 
|---|
| 4111 |     CALL Refresh
 | 
|---|
| 4112 |     if options.!debug == 1 then say time()' '||"PB_DETACH_Click done"
 | 
|---|
| 4113 | RETURN
 | 
|---|
| 4114 | 
 | 
|---|
| 4115 | /*:VRX         PB_DIALOG_HELP_Click
 | 
|---|
| 4116 | */
 | 
|---|
| 4117 | PB_DIALOG_HELP_Click:
 | 
|---|
| 4118 |     CALL VRMethod 'GB_DIALOG', 'InvokeHelp'
 | 
|---|
| 4119 | return
 | 
|---|
| 4120 | 
 | 
|---|
| 4121 | /*:VRX         PB_EDIT_CANCEL_Click
 | 
|---|
| 4122 | */
 | 
|---|
| 4123 | PB_EDIT_CANCEL_Click:
 | 
|---|
| 4124 |     options.!editmode = 0
 | 
|---|
| 4125 |     CALL VRSet "PB_UNMOUNT","Enabled", 1
 | 
|---|
| 4126 |     CALL VRSet "GB_CURRENT", "ENABLED", 1
 | 
|---|
| 4127 |     ok = VRSet("PB_EDIT_CANCEL","Visible", 0)
 | 
|---|
| 4128 |     ok = VRMethod( "TDL_1", "SetTabText", 1, " "NLVGetMessage(13)" " )
 | 
|---|
| 4129 | /*  CALL NLVSetText 'DT_DIALOG',        "Caption", 13 */
 | 
|---|
| 4130 | RETURN 0
 | 
|---|
| 4131 | 
 | 
|---|
| 4132 | /*:VRX         PB_INFO_OK_Click
 | 
|---|
| 4133 | */
 | 
|---|
| 4134 | PB_INFO_OK_Click:
 | 
|---|
| 4135 |     call SW_INFO_Close
 | 
|---|
| 4136 | RETURN
 | 
|---|
| 4137 | 
 | 
|---|
| 4138 | /*:VRX         PB_LOGIN_CANCEL_Click
 | 
|---|
| 4139 | */
 | 
|---|
| 4140 | PB_LOGIN_CANCEL_Click:
 | 
|---|
| 4141 |     credentials.!entered = 0
 | 
|---|
| 4142 |     call SW_LOGIN_Close
 | 
|---|
| 4143 | RETURN
 | 
|---|
| 4144 | 
 | 
|---|
| 4145 | /*:VRX         PB_LOGIN_OK_Click
 | 
|---|
| 4146 | */
 | 
|---|
| 4147 | PB_LOGIN_OK_Click:
 | 
|---|
| 4148 |     ok = VRSet("EF_USER","Value",VRGet("EF_USER1","Value"))
 | 
|---|
| 4149 |     ok = VRSet("EF_PASSWORD","Value",VRGet("EF_PASSWORD1","Value"))
 | 
|---|
| 4150 |     options.!storecreds = VRGet("CB_STORECREDS1","Set")
 | 
|---|
| 4151 |     credentials.!entered = 1
 | 
|---|
| 4152 | 
 | 
|---|
| 4153 |     if p_server <> "" then do
 | 
|---|
| 4154 |         ok = _rpcqueryuser(p_server, VRGet("EF_USER1","Value"), VRGet("EF_PASSWORD1","Value"), VRGet("EF_USER1","Value"))
 | 
|---|
| 4155 | 
 | 
|---|
| 4156 |         if word(ok,1) = "1" then do
 | 
|---|
| 4157 |             call _StatusBarWrapper NLVGetMessage(107, rpc.queryuser.FULL_NAME)
 | 
|---|
| 4158 |             say 'rpc.queryuser.DIR_DRIVE    = "'rpc.queryuser.DIR_DRIVE'"'
 | 
|---|
| 4159 |             say 'rpc.queryuser.LOGON_SCRIPT = "'rpc.queryuser.LOGON_SCRIPT'"'
 | 
|---|
| 4160 |         end
 | 
|---|
| 4161 |         else do
 | 
|---|
| 4162 |             CALL VRMessage 'Main', VRGet("EF_USER1","Value")" \\"p_server": "rpc.queryuser.LOGONSTATUS, NLVGetMessage(5), "E"
 | 
|---|
| 4163 |         end
 | 
|---|
| 4164 |     end
 | 
|---|
| 4165 | 
 | 
|---|
| 4166 |     call SW_LOGIN_Close
 | 
|---|
| 4167 | RETURN
 | 
|---|
| 4168 | 
 | 
|---|
| 4169 | /*:VRX         PB_MOUNT_Click
 | 
|---|
| 4170 | */
 | 
|---|
| 4171 | PB_MOUNT_Click:
 | 
|---|
| 4172 |     if options.!debug == 1 then say time()' '||"PB_MOUNT_Click started"
 | 
|---|
| 4173 |     ok = VRSet("TM_RefreshCurrentDisplay","Enabled", 0)
 | 
|---|
| 4174 |     say "  network = "network
 | 
|---|
| 4175 |     if options.!editmode = 1 then do
 | 
|---|
| 4176 |         CALL PB_UNMOUNT_Click
 | 
|---|
| 4177 |         options.!editmode = 0
 | 
|---|
| 4178 |         ok = VRMethod("TDL_1","SetTabText", " "strip(NLVGetMessage(13))" ")
 | 
|---|
| 4179 | /*      CALL NLVSetText 'DT_DIALOG',        "Caption", 13 */
 | 
|---|
| 4180 | 
 | 
|---|
| 4181 |         CALL VRSet "PB_UNMOUNT","Enabled", 1
 | 
|---|
| 4182 |         CALL VRSet "GB_CURRENT", "ENABLED", 1
 | 
|---|
| 4183 |     end
 | 
|---|
| 4184 | 
 | 
|---|
| 4185 |     options.!workgroup     = ''
 | 
|---|
| 4186 |     options.!server        = ''
 | 
|---|
| 4187 |     options.!share         = ''
 | 
|---|
| 4188 |     options.!user          = ''
 | 
|---|
| 4189 |     options.!password      = ''
 | 
|---|
| 4190 |     options.!master        = ''
 | 
|---|
| 4191 |     options.!mastertype    = ''
 | 
|---|
| 4192 |     options.!memlen        = advanced.!memlen
 | 
|---|
| 4193 |     options.!easupport     = advanced.!easupport
 | 
|---|
| 4194 |     options.!readonly      = advanced.!readonly
 | 
|---|
| 4195 |     options.!loglevel      = advanced.!loglevel
 | 
|---|
| 4196 |     options.!logfile       = advanced.!logfile
 | 
|---|
| 4197 |     options.!cachetimeout  = advanced.!cachetimeout
 | 
|---|
| 4198 |     options.!cachelistings = advanced.!cachelistings
 | 
|---|
| 4199 |     options.!kerberos5     = advanced.!kerberos5
 | 
|---|
| 4200 |     options.!ntlmv1        = advanced.!ntlmv1
 | 
|---|
| 4201 |     options.!encryption    = advanced.!encryption
 | 
|---|
| 4202 | 
 | 
|---|
| 4203 |     vfs.!drive      = ''
 | 
|---|
| 4204 |     vfs.!mountpoint = ''
 | 
|---|
| 4205 | 
 | 
|---|
| 4206 |     stype    = VRGet( "CB_MOUNT",            "Selected" )
 | 
|---|
| 4207 |     share    = STRIP( VRGet( "EF_SHARE",     "Value" ))
 | 
|---|
| 4208 |     server   = STRIP( VRGet( "EF_SERVER",    "Value" ))
 | 
|---|
| 4209 |     network  = STRIP( VRGet( "EF_NETWORK",   "Value" ))
 | 
|---|
| 4210 |     mtype    = VRGet( "CHK_MTYPE",           "Set" )
 | 
|---|
| 4211 |     userid   = STRIP( VRGet( "EF_USER",      "Value" ))
 | 
|---|
| 4212 |     password = STRIP( VRGet( "EF_PASSWORD",  "Value" ))
 | 
|---|
| 4213 |     mdrive   = VRGet( "CB_DRIVES",           "SelectedText" )
 | 
|---|
| 4214 |     if mdrive = "" then mdrive = VRGet( "CB_DRIVES", "Value" )
 | 
|---|
| 4215 |     mpath    = STRIP( VRGet( "EF_DIRECTORY", "Value" ))
 | 
|---|
| 4216 | 
 | 
|---|
| 4217 |     IF ( stype < 1 | stype > 4 ) THEN stype = 1
 | 
|---|
| 4218 | 
 | 
|---|
| 4219 |     /* The required/optional/ignored parameters depend on the type of mount
 | 
|---|
| 4220 |      * requested.  (Note, however, that the user, password, easupport and
 | 
|---|
| 4221 |      * memlen parameters are always optional.)
 | 
|---|
| 4222 |      */
 | 
|---|
| 4223 |     SELECT
 | 
|---|
| 4224 |         /* Scenario 1: Mount a single share.
 | 
|---|
| 4225 |          *             Required: share, server
 | 
|---|
| 4226 |          *             Optional: workgroup
 | 
|---|
| 4227 |          *             Unused:   master, mastertype
 | 
|---|
| 4228 |          */
 | 
|---|
| 4229 |         WHEN stype = 1 THEN DO
 | 
|---|
| 4230 |             IF server == '' | share == '' THEN DO
 | 
|---|
| 4231 |                 /* error */
 | 
|---|
| 4232 |                 RETURN 1
 | 
|---|
| 4233 |             END
 | 
|---|
| 4234 |             options.!server    = server
 | 
|---|
| 4235 |             options.!share     = share
 | 
|---|
| 4236 |             options.!workgroup = network
 | 
|---|
| 4237 |         END
 | 
|---|
| 4238 | 
 | 
|---|
| 4239 |         /* Scenario 2: Mount all shares on a server.
 | 
|---|
| 4240 |          *             Required: server
 | 
|---|
| 4241 |          *             Optional: workgroup
 | 
|---|
| 4242 |          *             Unused:   share, master, mastertype
 | 
|---|
| 4243 |          */
 | 
|---|
| 4244 |         WHEN stype = 2 THEN DO
 | 
|---|
| 4245 |             IF server == '' THEN DO
 | 
|---|
| 4246 |                 /* error */
 | 
|---|
| 4247 |                 RETURN 1
 | 
|---|
| 4248 |             END
 | 
|---|
| 4249 |             options.!server = server
 | 
|---|
| 4250 |             options.!workgroup = network
 | 
|---|
| 4251 |         END
 | 
|---|
| 4252 | 
 | 
|---|
| 4253 |         /* Scenario 3: Mount all servers in a workgroup.
 | 
|---|
| 4254 |          *             Required: workgroup
 | 
|---|
| 4255 |          *             Optional: -
 | 
|---|
| 4256 |          *             Unused:   share, server, master, mastertype
 | 
|---|
| 4257 |          */
 | 
|---|
| 4258 |         WHEN stype = 3 THEN DO
 | 
|---|
| 4259 |             IF workgroup == '' THEN DO
 | 
|---|
| 4260 |                 /* error */
 | 
|---|
| 4261 |                 RETURN 1
 | 
|---|
| 4262 |             END
 | 
|---|
| 4263 |             options.!workgroup  = network
 | 
|---|
| 4264 |         END
 | 
|---|
| 4265 | 
 | 
|---|
| 4266 |         /* Scenario 4: Mount all workgroups known to a master.
 | 
|---|
| 4267 |          *             Required: master, mastertype
 | 
|---|
| 4268 |          *             Optional: -
 | 
|---|
| 4269 |          *             Unused:   share, server, workgroup
 | 
|---|
| 4270 |          */
 | 
|---|
| 4271 |         WHEN stype = 4 THEN DO
 | 
|---|
| 4272 |             IF master == '' | mastertype == '' THEN DO
 | 
|---|
| 4273 |                 /* error */
 | 
|---|
| 4274 |                 RETURN 1
 | 
|---|
| 4275 |             END
 | 
|---|
| 4276 |             options.!master     = network
 | 
|---|
| 4277 |             options.!mastertype = mtype
 | 
|---|
| 4278 |         END
 | 
|---|
| 4279 |     END
 | 
|---|
| 4280 | 
 | 
|---|
| 4281 |     options.!user      = userid
 | 
|---|
| 4282 |     options.!password  = password
 | 
|---|
| 4283 | /* fix for AN Ticket #1653 */
 | 
|---|
| 4284 |     options.!spassword = c2x(options.!password)
 | 
|---|
| 4285 | 
 | 
|---|
| 4286 |     vfs.!drive      = mdrive
 | 
|---|
| 4287 |     vfs.!mountpoint = mdrive'\'mpath
 | 
|---|
| 4288 | 
 | 
|---|
| 4289 |     CALL Mount
 | 
|---|
| 4290 |     CALL Refresh
 | 
|---|
| 4291 |     ok = VRSet("TM_RefreshCurrentDisplay","Enabled", 1)
 | 
|---|
| 4292 |     if options.!debug == 1 then say time()' '||"PB_MOUNT_Click done"
 | 
|---|
| 4293 | RETURN 0
 | 
|---|
| 4294 | 
 | 
|---|
| 4295 | /*:VRX         PB_NEWMOUNTPOINTCANCEL_Click
 | 
|---|
| 4296 | */
 | 
|---|
| 4297 | PB_NEWMOUNTPOINTCANCEL_Click:
 | 
|---|
| 4298 |     ok = VRSet("CB_DRIVES","Value","")
 | 
|---|
| 4299 |     ok = VRSet("EF_DIRECTORY","Value","")
 | 
|---|
| 4300 |     call SW_MOUNTPOINT_Close
 | 
|---|
| 4301 | RETURN 0
 | 
|---|
| 4302 | 
 | 
|---|
| 4303 | /*:VRX         PB_NEWMOUNTPOINTOK_Click
 | 
|---|
| 4304 | */
 | 
|---|
| 4305 | PB_NEWMOUNTPOINTOK_Click:
 | 
|---|
| 4306 |     ok = VRSet("CB_DRIVES","Value",VRGet("CB_DRIVES1","Value"))
 | 
|---|
| 4307 |     ok = VRSet("EF_DIRECTORY","Value",VRGet("EF_DIRECTORY1","Value"))
 | 
|---|
| 4308 | 
 | 
|---|
| 4309 |     advanced.!readonly  = VRGet("CB_READONLY1","Set")
 | 
|---|
| 4310 |     advanced.!easupport = VRGet("CB_EAS1","Set")
 | 
|---|
| 4311 |     advanced.!alwaysmp  = VRGet("CB_ALWAYSMP1","Set")
 | 
|---|
| 4312 |     advanced.!cachetimeout  = VRGet( "SPIN_CACHETIMEOUT1",  "Value" )
 | 
|---|
| 4313 |     advanced.!cachelistings = VRGet( "SPIN_CACHELISTINGS1", "Value" )
 | 
|---|
| 4314 |     advanced.!kerberos5  = VRGet("CB_KERBEROS51","Set")
 | 
|---|
| 4315 |     advanced.!ntlmv1     = VRGet("CB_NTLMV11","Set")
 | 
|---|
| 4316 |     advanced.!encryption = VRGet("CB_ENCRYPTION1","Set")
 | 
|---|
| 4317 | 
 | 
|---|
| 4318 |     call SW_MOUNTPOINT_Close
 | 
|---|
| 4319 | RETURN
 | 
|---|
| 4320 | 
 | 
|---|
| 4321 | /*:VRX         PB_NEWPORTCANCEL_Click
 | 
|---|
| 4322 | */
 | 
|---|
| 4323 | PB_NEWPORTCANCEL_Click:
 | 
|---|
| 4324 | /*  ok = VRSet("CB_DRIVES","Value","")
 | 
|---|
| 4325 |     ok = VRSet("EF_DIRECTORY","Value","")
 | 
|---|
| 4326 |     call SW_MOUNTPOINT_Close */
 | 
|---|
| 4327 | RETURN 0
 | 
|---|
| 4328 | 
 | 
|---|
| 4329 | /*:VRX         PB_NEWPORTCONNECT_Click
 | 
|---|
| 4330 | */
 | 
|---|
| 4331 | PB_NEWPORTCONNECT_Click:
 | 
|---|
| 4332 | /*  ok = VRSet("CB_DRIVES","Value",VRGet("CB_DRIVES1","Value"))
 | 
|---|
| 4333 |     ok = VRSet("EF_DIRECTORY","Value",VRGet("EF_DIRECTORY1","Value"))
 | 
|---|
| 4334 | 
 | 
|---|
| 4335 |     advanced.!readonly  = VRGet("CB_READONLY1","Set")
 | 
|---|
| 4336 |     advanced.!easupport = VRGet("CB_EAS1","Set")
 | 
|---|
| 4337 |     advanced.!alwaysmp  = VRGet("CB_ALWAYSMP1","Set")
 | 
|---|
| 4338 |     advanced.!cachetimeout  = VRGet( "SPIN_CACHETIMEOUT1",  "Value" )
 | 
|---|
| 4339 |     advanced.!cachelistings = VRGet( "SPIN_CACHELISTINGS1", "Value" )
 | 
|---|
| 4340 | 
 | 
|---|
| 4341 |     call SW_MOUNTPOINT_Close */
 | 
|---|
| 4342 | RETURN
 | 
|---|
| 4343 | 
 | 
|---|
| 4344 | /*:VRX         PB_PROGRESS_ABORT_Click
 | 
|---|
| 4345 | */
 | 
|---|
| 4346 | PB_PROGRESS_ABORT_Click:
 | 
|---|
| 4347 |     options.!delay = 0
 | 
|---|
| 4348 |     options.!autoload = 0
 | 
|---|
| 4349 |     options.!autoclose = 0
 | 
|---|
| 4350 |     call SW_PROGRESS_Close
 | 
|---|
| 4351 | return
 | 
|---|
| 4352 | 
 | 
|---|
| 4353 | /*:VRX         PB_SETTINGS_APPLY_Click
 | 
|---|
| 4354 | */
 | 
|---|
| 4355 | PB_SETTINGS_APPLY_Click:
 | 
|---|
| 4356 |     if options.!debug == 1 then say time()' PB_SETTINGS_APPLY_Click() started'
 | 
|---|
| 4357 |     advanced.!loglevel    = VRGet("SPIN_LOG_LEVEL", "Value" )
 | 
|---|
| 4358 |     advanced.!logfile     = VRGet("EF_LOGFILE",    "Value" )
 | 
|---|
| 4359 |     advanced.!browseauth  = VRGet("CB_BROWSEAUTH", "Set" )
 | 
|---|
| 4360 |     advanced.!browseimme  = VRGet("CB_BROWSEIMME", "Set" )
 | 
|---|
| 4361 |     advanced.!special     = VRGet("CB_SPECIAL",    "Set" )
 | 
|---|
| 4362 |     advanced.!savepassive = VRGet("CB_SAVEPASSIVE","Set" )
 | 
|---|
| 4363 |     advanced.!lmhosts     = VRGet("CB_LMHOSTS",    "Set" )
 | 
|---|
| 4364 |     advanced.!broadcast   = VRGet("CB_BROADCAST",  "Set" )
 | 
|---|
| 4365 |     advanced.!miniicons   = VRGet("CB_MINIICONS",  "Set" )
 | 
|---|
| 4366 | 
 | 
|---|
| 4367 |     /* Note: CB_LOGGING has its own event tied to the click */
 | 
|---|
| 4368 |     options.!storecreds   = VRGet("CB_STORECREDS", "Set" )
 | 
|---|
| 4369 |     options.!debug        = VRGet("CB_DEBUG",      "Set" )
 | 
|---|
| 4370 |     if options.!debug == 1 then do /* Turn on additional columns in connection details view */
 | 
|---|
| 4371 |         ok = VRRedirectStdio("ON")
 | 
|---|
| 4372 |         ok = VRMethod("CN_CONDET", "SetFieldAttr", cd.mpidxfh ,       "Visible", 1)
 | 
|---|
| 4373 |         ok = VRMethod("CN_CONDET", "SetFieldAttr", cd.passwordfh ,    "Visible", 1)
 | 
|---|
| 4374 |         ok = VRMethod("CN_CONDET", "SetFieldAttr", cd.spasswordfh ,   "Visible", 1)
 | 
|---|
| 4375 |         ok = VRMethod("CN_CONDET", "SetFieldAttr", cd.masterFH ,      "Visible", 1)
 | 
|---|
| 4376 |         ok = VRMethod("CN_CONDET", "SetFieldAttr", cd.mtypeFH ,       "Visible", 1)
 | 
|---|
| 4377 |         ok = VRMethod("CN_CONDET", "SetFieldAttr", cd.memlenfh ,      "Visible", 1)
 | 
|---|
| 4378 |         ok = VRMethod("CN_CONDET", "SetFieldAttr", cd.logfilefh ,     "Visible", 1)
 | 
|---|
| 4379 |         ok = VRMethod("CN_CONDET", "SetFieldAttr", cd.loglevelfh ,    "Visible", 1)
 | 
|---|
| 4380 |         ok = VRMethod("CN_CONDET", "SetFieldAttr", cd.hashfh ,        "Visible", 1)
 | 
|---|
| 4381 | 
 | 
|---|
| 4382 |     end
 | 
|---|
| 4383 |     else do /* Turn on additional columns in connection details view */
 | 
|---|
| 4384 |         ok = VRRedirectStdio("OFF")
 | 
|---|
| 4385 |         ok = VRMethod("CN_CONDET", "SetFieldAttr", cd.mpidxfh ,       "Visible", 0)
 | 
|---|
| 4386 |         ok = VRMethod("CN_CONDET", "SetFieldAttr", cd.passwordfh ,    "Visible", 0)
 | 
|---|
| 4387 |         ok = VRMethod("CN_CONDET", "SetFieldAttr", cd.spasswordfh ,   "Visible", 0)
 | 
|---|
| 4388 |         ok = VRMethod("CN_CONDET", "SetFieldAttr", cd.masterFH ,      "Visible", 0)
 | 
|---|
| 4389 |         ok = VRMethod("CN_CONDET", "SetFieldAttr", cd.mtypeFH ,       "Visible", 0)
 | 
|---|
| 4390 |         ok = VRMethod("CN_CONDET", "SetFieldAttr", cd.memlenfh ,      "Visible", 0)
 | 
|---|
| 4391 |         ok = VRMethod("CN_CONDET", "SetFieldAttr", cd.logfilefh ,     "Visible", 0)
 | 
|---|
| 4392 |         ok = VRMethod("CN_CONDET", "SetFieldAttr", cd.loglevelfh ,    "Visible", 0)
 | 
|---|
| 4393 |         ok = VRMethod("CN_CONDET", "SetFieldAttr", cd.hashfh ,        "Visible", 0)
 | 
|---|
| 4394 |     end
 | 
|---|
| 4395 | 
 | 
|---|
| 4396 |     ok = VRset("CN_CURRENT", "MiniIcons", advanced.!miniicons)
 | 
|---|
| 4397 |     ok = VRset("CN_SMBTREE", "MiniIcons", advanced.!miniicons)
 | 
|---|
| 4398 |     ok = VRset("CN_CONDET",  "MiniIcons", advanced.!miniicons)
 | 
|---|
| 4399 | 
 | 
|---|
| 4400 |     if advanced.!lmhosts = 1 then do
 | 
|---|
| 4401 |         call _LMHostsRead
 | 
|---|
| 4402 |         call _LMHostsUpdate
 | 
|---|
| 4403 |     end
 | 
|---|
| 4404 | 
 | 
|---|
| 4405 |     if advanced.!smbconfchanged = 1 then do
 | 
|---|
| 4406 |         name_resolve_order = VRGet("SPIN_NRO1","value")' 'VRGet("SPIN_NRO2","value")' 'VRGet("SPIN_NRO3","value")' 'VRGet("SPIN_NRO4","value")
 | 
|---|
| 4407 |         handle = IniOpen('global', samba.!smbconf)
 | 
|---|
| 4408 |         call IniSet 'name resolve order', name_resolve_order, handle
 | 
|---|
| 4409 |         /* FIXME: Throw an error in this case */
 | 
|---|
| 4410 |         if \_IsValidIPAddress(VRGet("EF_WINS_SERVER","Value")) then ok = VRSet("EF_WINS_SERVER","Value","")
 | 
|---|
| 4411 |         call IniSet 'wins server', VRGet("EF_WINS_SERVER","Value"), handle
 | 
|---|
| 4412 |         call IniSet 'log level', VRGet("SPIN_LOG_LEVEL","Value"), handle
 | 
|---|
| 4413 |         call IniSave handle
 | 
|---|
| 4414 |         call IniClose handle
 | 
|---|
| 4415 |         advanced.!smbconfchanged = 0
 | 
|---|
| 4416 |         ok = VRSet("PB_SETTINGS_UNDO","Enabled", 0)
 | 
|---|
| 4417 |     end
 | 
|---|
| 4418 |     if options.!storecreds = 0 then call Menu_File_ucCred_Reset_Click
 | 
|---|
| 4419 | 
 | 
|---|
| 4420 |     if options.!debug == 1 then say time()' PB_SETTINGS_APPLY_Click() done'
 | 
|---|
| 4421 | return
 | 
|---|
| 4422 | 
 | 
|---|
| 4423 | /*:VRX         PB_SETTINGS_HELP_Click
 | 
|---|
| 4424 | */
 | 
|---|
| 4425 | PB_SETTINGS_HELP_Click:
 | 
|---|
| 4426 |     CALL VRMethod 'SW_SETTINGS', 'InvokeHelp'
 | 
|---|
| 4427 | return
 | 
|---|
| 4428 | 
 | 
|---|
| 4429 | /*:VRX         PB_SETTINGS_UNDO_Click
 | 
|---|
| 4430 | */
 | 
|---|
| 4431 | PB_SETTINGS_UNDO_Click:
 | 
|---|
| 4432 |     call SW_SETTINGS_Init_Content
 | 
|---|
| 4433 | return
 | 
|---|
| 4434 | 
 | 
|---|
| 4435 | /*:VRX         PB_SMBCONF_APPLY_Click
 | 
|---|
| 4436 | */
 | 
|---|
| 4437 | PB_SMBCONF_APPLY_Click:
 | 
|---|
| 4438 |     if advanced.!smbconfchanged = 1 then do
 | 
|---|
| 4439 |         client_NTLMv2_auth          = VRGet("CB_client_NTLMv2_auth","Set")
 | 
|---|
| 4440 |         client_lanman_auth          = VRGet("CB_client_lanman_auth","Set")
 | 
|---|
| 4441 |         client_plaintext_auth       = VRGet("CB_client_plaintext_auth","Set")
 | 
|---|
| 4442 |         client_use_spnego           = VRGet("CB_client_use_spnego","Set")
 | 
|---|
| 4443 |         client_use_spnego_principal = VRGet("CB_client_use_spnego_principal","Set")
 | 
|---|
| 4444 |         client_signing              = VRGet("SPIN_client_signing","Value")
 | 
|---|
| 4445 |         client_ipc_signing          = VRGet("SPIN_client_ipc_signing","Value")
 | 
|---|
| 4446 | 
 | 
|---|
| 4447 |         if VRGet("SPIN_client_max_protocol","Enabled") = 1 then do
 | 
|---|
| 4448 |             client_max_protocol         = VRGet("SPIN_client_max_protocol","Value")
 | 
|---|
| 4449 |             client_min_protocol         = VRGet("SPIN_client_min_protocol","Value")
 | 
|---|
| 4450 |         end
 | 
|---|
| 4451 | 
 | 
|---|
| 4452 | 
 | 
|---|
| 4453 |         handle = IniOpen('global', samba.!smbconf)
 | 
|---|
| 4454 |         call IniSet 'client NTLMv2 auth',          YesNo(client_NTLMv2_auth), handle
 | 
|---|
| 4455 |         call IniSet 'client lanman auth',          YesNo(client_lanman_auth), handle
 | 
|---|
| 4456 |         call IniSet 'client plaintext auth',       YesNo(client_plaintext_auth), handle
 | 
|---|
| 4457 |         call IniSet 'client use spnego',           YesNo(client_use_spnego), handle
 | 
|---|
| 4458 |         call IniSet 'client use spnego principal', YesNo(client_use_spnego_principal), handle
 | 
|---|
| 4459 |         call IniSet 'client signing',              client_signing, handle
 | 
|---|
| 4460 |         call IniSet 'client ipc signing',          client_ipc_signing, handle
 | 
|---|
| 4461 | 
 | 
|---|
| 4462 |         if VRGet("SPIN_client_max_protocol","Enabled") = 1 then do
 | 
|---|
| 4463 |             call IniSet 'client max protocol',         client_max_protocol, handle
 | 
|---|
| 4464 |             call IniSet 'client min protocol',         client_min_protocol, handle
 | 
|---|
| 4465 |         end
 | 
|---|
| 4466 | 
 | 
|---|
| 4467 |         call IniSave handle
 | 
|---|
| 4468 |         call IniClose handle
 | 
|---|
| 4469 |         advanced.!smbconfchanged = 0
 | 
|---|
| 4470 |         ok = VRSet("PB_SMBCONF_UNDO","Enabled", 0)
 | 
|---|
| 4471 |     end
 | 
|---|
| 4472 | return
 | 
|---|
| 4473 | 
 | 
|---|
| 4474 | /*:VRX         PB_SMBCONF_HELP_Click
 | 
|---|
| 4475 | */
 | 
|---|
| 4476 | PB_SMBCONF_HELP_Click:
 | 
|---|
| 4477 |     CALL VRMethod 'SW_SETTINGS', 'InvokeHelp'
 | 
|---|
| 4478 | return
 | 
|---|
| 4479 | 
 | 
|---|
| 4480 | /*:VRX         PB_SMBCONF_UNDO_Click
 | 
|---|
| 4481 | */
 | 
|---|
| 4482 | PB_SMBCONF_UNDO_Click:
 | 
|---|
| 4483 |     call SW_SETTINGS_Init_Content
 | 
|---|
| 4484 | return
 | 
|---|
| 4485 | 
 | 
|---|
| 4486 | /*:VRX         PB_SMBTREE_CONNECT_Click
 | 
|---|
| 4487 | */
 | 
|---|
| 4488 | PB_SMBTREE_CONNECT_Click: PROCEDURE EXPOSE settings. options. icons. fs. advanced. cd. samba. mtype.
 | 
|---|
| 4489 |     if options.!debug == 1 then say time()' '||"PB_CONNECT_Click started"
 | 
|---|
| 4490 | 
 | 
|---|
| 4491 |     ok = VRMethod( "CN_SMBTREE", "GetRecordList", "SourceOrSelected", "SelRH." )
 | 
|---|
| 4492 | 
 | 
|---|
| 4493 |     if SelRH.0 = 0 then do
 | 
|---|
| 4494 |         if options.!debug == 1 then say time()' '||"PB_CONNECT_Click aborted"
 | 
|---|
| 4495 |         return
 | 
|---|
| 4496 |     end
 | 
|---|
| 4497 | 
 | 
|---|
| 4498 |     p_workgroup = ''
 | 
|---|
| 4499 |     p_server    = ''
 | 
|---|
| 4500 |     p_share     = ''
 | 
|---|
| 4501 | 
 | 
|---|
| 4502 |     srcFile = ""
 | 
|---|
| 4503 |     srcCtn  = VRGet("CN_SMBTREE","Self")
 | 
|---|
| 4504 |     srcRec  = SelRH.1
 | 
|---|
| 4505 |     trgCtn  = VRGet("CN_CURRENT","Self")
 | 
|---|
| 4506 |     trgRec  = ""
 | 
|---|
| 4507 | 
 | 
|---|
| 4508 |     if options.!debug == 1 then do
 | 
|---|
| 4509 |         say '  srcCtn      = "'srcCtn'"'
 | 
|---|
| 4510 |         if srcCtn <> "" then say '  srcCtn name = "'VRGet(srcCtn,'Name')'"'
 | 
|---|
| 4511 |         say '  srcRec      = "'srcRec'"'
 | 
|---|
| 4512 |         say '  trgCtn      = "'trgCtn'"'
 | 
|---|
| 4513 |         if trgCtn <> "" then say '  trgCtn name = "'VRGet(trgCtn,'Name')'"'
 | 
|---|
| 4514 |         say '  trgRec      = "'trgRec'"'
 | 
|---|
| 4515 |     end
 | 
|---|
| 4516 | 
 | 
|---|
| 4517 |     ok = VRMethod("CB_MOUNT", "GetStringList", "ShareLevels." )
 | 
|---|
| 4518 | 
 | 
|---|
| 4519 |     DragCapt = VRMethod(srcCtn, "GetRecordAttr", srcRec, "Caption")
 | 
|---|
| 4520 |     ParentRH = VRMethod(srcCtn, "GetRecordAttr", srcRec, "Parent")
 | 
|---|
| 4521 | 
 | 
|---|
| 4522 |     if ParentRH = "" then do /* A workgroup was dragged */
 | 
|---|
| 4523 |         say "Workgroup dragged!"
 | 
|---|
| 4524 |         parse var DragCapt p_workgroup '0D0A'x .
 | 
|---|
| 4525 |         p_workgroup = strip(p_workgroup)
 | 
|---|
| 4526 |         ok = VRSet("EF_NETWORK","Value",strip(p_workgroup))
 | 
|---|
| 4527 |         call _UpdateObject "EF_SERVER", ""
 | 
|---|
| 4528 |         ok = VRSet("EF_SHARE","Value","")
 | 
|---|
| 4529 | 
 | 
|---|
| 4530 |         ShareLevel = 3
 | 
|---|
| 4531 |     end
 | 
|---|
| 4532 |     else do
 | 
|---|
| 4533 |         ParDragCapt = VRMethod(srcCtn, "GetRecordAttr", ParentRH, "Caption")
 | 
|---|
| 4534 |         GParentRH = VRMethod(srcCtn, "GetRecordAttr", ParentRH, "Parent")
 | 
|---|
| 4535 | 
 | 
|---|
| 4536 |         if GParentRH = "" then do /* A server was dragged */
 | 
|---|
| 4537 |             say "Server dragged!"
 | 
|---|
| 4538 |             parse var ParDragCapt p_workgroup '0D0A'x .
 | 
|---|
| 4539 |             ok = VRSet("EF_NETWORK","Value",strip(p_workgroup))
 | 
|---|
| 4540 |             p_workgroup = strip(p_workgroup)
 | 
|---|
| 4541 | 
 | 
|---|
| 4542 |             parse var DragCapt p_server '0D0A'x .
 | 
|---|
| 4543 |             p_server = strip(p_server)
 | 
|---|
| 4544 |             call _UpdateObject "EF_SERVER", p_server
 | 
|---|
| 4545 |             ok = VRSet("EF_Share","Value","")
 | 
|---|
| 4546 | 
 | 
|---|
| 4547 |             ShareLevel = 2
 | 
|---|
| 4548 |         end
 | 
|---|
| 4549 |         else do /* A share was dragged */
 | 
|---|
| 4550 |             say "Share dragged!"
 | 
|---|
| 4551 |             GParDragCapt = VRMethod(srcCtn, "GetRecordAttr", GParentRH, "Caption")
 | 
|---|
| 4552 | 
 | 
|---|
| 4553 |             parse var GParDragCapt p_workgroup '0D0A'x .
 | 
|---|
| 4554 |             p_workgroup = strip(p_workgroup)
 | 
|---|
| 4555 |             ok = VRSet("EF_NETWORK","Value",strip(p_workgroup))
 | 
|---|
| 4556 | 
 | 
|---|
| 4557 |             parse var ParDragCapt p_server '0D0A'x .
 | 
|---|
| 4558 |             p_server = strip(p_server)
 | 
|---|
| 4559 |             call _UpdateObject "EF_SERVER", p_server
 | 
|---|
| 4560 | 
 | 
|---|
| 4561 |             parse var DragCapt p_share '0D0A'x .
 | 
|---|
| 4562 |             p_share = strip(p_share)
 | 
|---|
| 4563 |             ok = VRSet("EF_Share","Value",strip(p_share))
 | 
|---|
| 4564 | 
 | 
|---|
| 4565 |             ShareLevel = 1
 | 
|---|
| 4566 |         end
 | 
|---|
| 4567 |     end
 | 
|---|
| 4568 | 
 | 
|---|
| 4569 |     say 'p_workgroup = "'p_workgroup'"'
 | 
|---|
| 4570 |     say 'p_server   = "'p_server'"'
 | 
|---|
| 4571 |     say 'p_share = "'p_share'"'
 | 
|---|
| 4572 | 
 | 
|---|
| 4573 |     ok = VRSet( "CB_MOUNT", "Selected", Sharelevel )
 | 
|---|
| 4574 |     call CB_MOUNT_Change
 | 
|---|
| 4575 | 
 | 
|---|
| 4576 |     if trgRec = "" then do
 | 
|---|
| 4577 |         window = VRLoadSecondary( "SW_MOUNTPOINT", "W" )
 | 
|---|
| 4578 |         if VRGet("CB_DRIVES","Value") = "" then return
 | 
|---|
| 4579 |     end
 | 
|---|
| 4580 |     else do
 | 
|---|
| 4581 | 
 | 
|---|
| 4582 |         TargetString = VRMethod(trgCtn, "GetRecordAttr", trgRec, "Caption")
 | 
|---|
| 4583 | 
 | 
|---|
| 4584 |         parTrgRH = VRMethod(trgCtn, "GetRecordAttr", trgRec, "Parent")
 | 
|---|
| 4585 | 
 | 
|---|
| 4586 |         do while parTrgRH <> ""
 | 
|---|
| 4587 |             partrgCapt = VRMethod(trgCtn, "GetRecordAttr", partrgRH, "Caption")
 | 
|---|
| 4588 |             TargetString = partrgCapt||'\'||TargetString
 | 
|---|
| 4589 |             parTrgRH = VRMethod(trgCtn, "GetRecordAttr", partrgRH , "Parent")
 | 
|---|
| 4590 |         end
 | 
|---|
| 4591 |         say 'TargetString = "'TargetString'"'
 | 
|---|
| 4592 |         ok = VRSet("CB_DRIVES","Value", left(TargetString,2))
 | 
|---|
| 4593 |         ok = VRSet("EF_DIRECTORY","Value", substr(TargetString,4))
 | 
|---|
| 4594 |     end
 | 
|---|
| 4595 | 
 | 
|---|
| 4596 |     window = VRLoadSecondary( "SW_LOGIN", "W" )
 | 
|---|
| 4597 |     if credentials.!entered = 1 then call PB_MOUNT_CLICK
 | 
|---|
| 4598 | 
 | 
|---|
| 4599 |     if options.!debug == 1 then say time()' '||"PB_CONNECT_Click done"
 | 
|---|
| 4600 | RETURN
 | 
|---|
| 4601 | 
 | 
|---|
| 4602 | /*:VRX         PB_SMBTREE_HELP_Click
 | 
|---|
| 4603 | */
 | 
|---|
| 4604 | PB_SMBTREE_HELP_Click:
 | 
|---|
| 4605 |     CALL VRMethod 'GB_SMBTREE', 'InvokeHelp'
 | 
|---|
| 4606 | return
 | 
|---|
| 4607 | 
 | 
|---|
| 4608 | /*:VRX         PB_SMBTREE_REFRESH_Click
 | 
|---|
| 4609 | */
 | 
|---|
| 4610 | PB_SMBTREE_REFRESH_Click: /* PROCEDURE EXPOSE settings. options. icons. fs. samba. debuglevel advanced. UserCred Refreshmode Tempdir */
 | 
|---|
| 4611 |     if options.!debug == 1 then say time()' '||"PB_REFRESH_Click started"
 | 
|---|
| 4612 | 
 | 
|---|
| 4613 |     if advanced.!browseauth = 1 & (UserCred = "--user=%" | UserCred = "" ) then do
 | 
|---|
| 4614 |         window = VRLoadSecondary( "SW_LOGIN", "W" )
 | 
|---|
| 4615 |     end
 | 
|---|
| 4616 | 
 | 
|---|
| 4617 |     call _UserCredUpdate
 | 
|---|
| 4618 |     ok = VRset("Pict_Throbber", "Visible", 1)
 | 
|---|
| 4619 |     ok = VRset("Menu_Selected_Connect", "Visible", 0)
 | 
|---|
| 4620 |     ok = VRset("TM_Throbber", "Enabled", 1)
 | 
|---|
| 4621 |     ShowHidden = advanced.!special
 | 
|---|
| 4622 |     BroadCast = advanced.!broadcast
 | 
|---|
| 4623 |     ok = VRSet("TM_RefreshTreeDisplay", "Delay", 1000)
 | 
|---|
| 4624 |     ok = time('R')
 | 
|---|
| 4625 |     call _RefreshTree
 | 
|---|
| 4626 |     if options.!debug == 1 then say time()' '||"PB_REFRESH_Click done"
 | 
|---|
| 4627 | RETURN
 | 
|---|
| 4628 | 
 | 
|---|
| 4629 | /*:VRX         PB_UNMOUNT_Click
 | 
|---|
| 4630 | */
 | 
|---|
| 4631 | PB_UNMOUNT_Click: PROCEDURE EXPOSE settings. options. icons. fs. cd. samba.
 | 
|---|
| 4632 |     if options.!debug == 1 then say time()' '||"PB_UNMOUNT_Click started"
 | 
|---|
| 4633 |     if options.!debug == 1 then say time()' '||'options.!editmode = 'options.!editmode
 | 
|---|
| 4634 |     CALL VRMethod "CN_CURRENT", 'GetRecordList', 'Selected', 'select.'
 | 
|---|
| 4635 |     IF select.0 < 1 THEN RETURN
 | 
|---|
| 4636 | 
 | 
|---|
| 4637 |     userdata = VRMethod( "CN_CURRENT", 'GetRecordAttr', select.1, 'UserData')
 | 
|---|
| 4638 |     PARSE VAR userdata mountpoint ';' mounts ';' .
 | 
|---|
| 4639 | say 'userdata="'userdata'"'
 | 
|---|
| 4640 |     IF mounts > 0 & options.!editmode = 0 THEN DO
 | 
|---|
| 4641 |         btns.0 = 2
 | 
|---|
| 4642 |         btns.1 = NLVGetMessage( 6 )
 | 
|---|
| 4643 |         btns.2 = NLVGetMessage( 7 )
 | 
|---|
| 4644 |         confirm = VRMessage('Main', NLVGetMessage( 57, mountpoint ), NLVGetMessage( 8 ), 'Q', 'btns.', 1, 2 )
 | 
|---|
| 4645 |         IF confirm \= 1 THEN RETURN
 | 
|---|
| 4646 |     END
 | 
|---|
| 4647 | 
 | 
|---|
| 4648 |     /* Unmount any resources */
 | 
|---|
| 4649 |     DO i = 1 TO mounts
 | 
|---|
| 4650 |         CALL _Dynamic "ok = "fs.!prefix"RxUnmount('"mountpoint"', "i-1")"
 | 
|---|
| 4651 |     END
 | 
|---|
| 4652 | 
 | 
|---|
| 4653 |     /* Delete mountpoint */
 | 
|---|
| 4654 |     parent = VRMethod("CN_CURRENT", 'GetRecordAttr', select.1, 'Parent')
 | 
|---|
| 4655 |     IF parent \= '' THEN DO
 | 
|---|
| 4656 |         CALL _Dynamic "ok = "fs.!prefix"RxDeleteMountPoint('"mountpoint"')"
 | 
|---|
| 4657 |     END
 | 
|---|
| 4658 | 
 | 
|---|
| 4659 |     CALL Refresh
 | 
|---|
| 4660 |     if options.!debug == 1 then say time()' '||"PB_UNMOUNT_Click done"
 | 
|---|
| 4661 | RETURN 0
 | 
|---|
| 4662 | 
 | 
|---|
| 4663 | /*:VRX         Pict_PWINMEM_Click
 | 
|---|
| 4664 | */
 | 
|---|
| 4665 | Pict_PWINMEM_Click:
 | 
|---|
| 4666 |     if VRGet("Pict_PWINMEM","PicturePath") = "#36" then do
 | 
|---|
| 4667 |         call Menu_File_ucCred_Reset_Click
 | 
|---|
| 4668 |     end
 | 
|---|
| 4669 | return
 | 
|---|
| 4670 | 
 | 
|---|
| 4671 | /*:VRX         Quit
 | 
|---|
| 4672 | */
 | 
|---|
| 4673 | Quit:
 | 
|---|
| 4674 |     if Fatal <> 1 then CALL _INISave
 | 
|---|
| 4675 |     /* ok = VRREdirectSTdio("OFF") */
 | 
|---|
| 4676 |     window = VRWindow()
 | 
|---|
| 4677 |     call VRSet window, "Shutdown", 1
 | 
|---|
| 4678 |     drop window
 | 
|---|
| 4679 | RETURN
 | 
|---|
| 4680 | 
 | 
|---|
| 4681 | /*:VRX         RB_ACLS_NUMERIC_Click
 | 
|---|
| 4682 | */
 | 
|---|
| 4683 | RB_ACLS_NUMERIC_Click:
 | 
|---|
| 4684 |     aclsnumeric = '--numeric'
 | 
|---|
| 4685 |     ok = VRSet("DT_REV_CONT","Caption","")
 | 
|---|
| 4686 |     ok = VRMethod("CN_ACLS","RemoveRecord","ALL")
 | 
|---|
| 4687 |     ok = VRMethod("CN_ACLS","SetFieldAttr", ACL.userFH, "Visible", 0 )
 | 
|---|
| 4688 |     call _ACLSBrowse
 | 
|---|
| 4689 | return
 | 
|---|
| 4690 | 
 | 
|---|
| 4691 | /*:VRX         RB_ACLS_TEXT_Click
 | 
|---|
| 4692 | */
 | 
|---|
| 4693 | RB_ACLS_TEXT_Click:
 | 
|---|
| 4694 |     aclsnumeric = ''
 | 
|---|
| 4695 |     ok = VRSet("DT_REV_CONT","Caption","")
 | 
|---|
| 4696 |     ok = VRMethod("CN_ACLS","RemoveRecord","ALL")
 | 
|---|
| 4697 |     ok = VRMethod("CN_ACLS","SetFieldAttr", ACL.userFH, "Visible", 1 )
 | 
|---|
| 4698 |     call _ACLSBrowse
 | 
|---|
| 4699 | return
 | 
|---|
| 4700 | 
 | 
|---|
| 4701 | /*:VRX         Refresh
 | 
|---|
| 4702 | */
 | 
|---|
| 4703 | Refresh:
 | 
|---|
| 4704 |     if options.!debug == 1 then say time()' Refresh started'
 | 
|---|
| 4705 |     CALL VRSet "CN_CURRENT", 'Painting', 0
 | 
|---|
| 4706 | 
 | 
|---|
| 4707 |     CALL VRMethod "CN_CURRENT", 'RemoveRecord', 'All'
 | 
|---|
| 4708 | 
 | 
|---|
| 4709 |     /* Remove Active connections from details view */
 | 
|---|
| 4710 |     ok = VRMethod( "CN_CONDET", "GetRecordList", 'All', "rh." )
 | 
|---|
| 4711 | 
 | 
|---|
| 4712 |     do I = 1 to rh.0
 | 
|---|
| 4713 |         /* This catches the bug we observed exactly once and were unable to reproduce! */
 | 
|---|
| 4714 |         if cd.statusfh = 'CD.STATUSFH' then do
 | 
|---|
| 4715 |             if options.!debug == 1 then call beep 880, 50
 | 
|---|
| 4716 |             if options.!debug == 1 then call beep 880, 50
 | 
|---|
| 4717 |             if options.!debug == 1 then say "  cd.statusfh is undefined - check why!!!!!!"
 | 
|---|
| 4718 |             leave
 | 
|---|
| 4719 |         end
 | 
|---|
| 4720 |         if options.!debug == 1 then say '  Icon.'i' = "'||VRMethod( "CN_CONDET", "GetFieldData", rh.i, cd.statusfh)'"'
 | 
|---|
| 4721 |         if VRMethod("CN_CONDET","GetFieldData", rh.i, cd.statusfh) = icons.!active then CALL VRMethod "CN_CONDET", 'RemoveRecord', rh.i
 | 
|---|
| 4722 |     end
 | 
|---|
| 4723 | 
 | 
|---|
| 4724 | /*  call _AddTemplates */
 | 
|---|
| 4725 |     CALL VRSet "PB_DETACH",  "Enabled", 0
 | 
|---|
| 4726 |     CALL VRSet "PB_UNMOUNT", "Enabled", 0
 | 
|---|
| 4727 | 
 | 
|---|
| 4728 |     ok = VRSet("MENU_CONTEXT_OPEN",    "Visible",  0)
 | 
|---|
| 4729 | /*  ok = VRSet("MENU_CONTEXT_SEP1",    "Visible",  0) */
 | 
|---|
| 4730 |     ok = VRSet("MENU_CONTEXT_DETACH",  "Visible",  0)
 | 
|---|
| 4731 |     ok = VRSet("MENU_CONTEXT_UNMOUNT", "Visible",  0)
 | 
|---|
| 4732 |     ok = VRSet("MENU_CONTEXT_EDIT",    "Visible",  0)
 | 
|---|
| 4733 | 
 | 
|---|
| 4734 |     ok = VRSet("MENU_SELECTED_REMOVE", "Visible",  0)
 | 
|---|
| 4735 |     ok = VRSet("MENU_SELECTED_RETRY",  "Visible",  0)
 | 
|---|
| 4736 | 
 | 
|---|
| 4737 |     if options.!debug == 1 then say '  Remove records, disable buttons done.'
 | 
|---|
| 4738 | 
 | 
|---|
| 4739 |     CALL VRMethod 'CB_DRIVES', 'Clear'
 | 
|---|
| 4740 | 
 | 
|---|
| 4741 |     CALL VRSet "CN_CURRENT", "Caption", fs.!Name' 'fs.!version
 | 
|---|
| 4742 | 
 | 
|---|
| 4743 |     /* Herwig B.: Attention! The SysDrivemap function with the "free" parameter causes hangs in case it is called repeatedly! */
 | 
|---|
| 4744 |     drvs = MyFreeDriveMap('C:', 'FREE')
 | 
|---|
| 4745 | 
 | 
|---|
| 4746 |     DO i = 1 TO WORDS( drvs )
 | 
|---|
| 4747 |         drvstem.i = WORD( drvs, i )
 | 
|---|
| 4748 |     END
 | 
|---|
| 4749 | 
 | 
|---|
| 4750 |     drvstem.0 = WORDS( drvs )
 | 
|---|
| 4751 | 
 | 
|---|
| 4752 |     /* Add any existing EVFS drives */
 | 
|---|
| 4753 |     CALL GetMountPoints
 | 
|---|
| 4754 | 
 | 
|---|
| 4755 |     CALL VRMethod "CB_DRIVES", "AddStringList", "drvstem."
 | 
|---|
| 4756 |     CALL VRSet "CN_CURRENT", 'Painting', 1
 | 
|---|
| 4757 |     if options.!debug == 1 then say time()' '||"Refresh done"
 | 
|---|
| 4758 | RETURN 0
 | 
|---|
| 4759 | 
 | 
|---|
| 4760 | /*:VRX         SPIN_client_ipc_signing_Change
 | 
|---|
| 4761 | */
 | 
|---|
| 4762 | SPIN_client_ipc_signing_Change:
 | 
|---|
| 4763 |     advanced.!smbconfchanged = 1
 | 
|---|
| 4764 | return
 | 
|---|
| 4765 | 
 | 
|---|
| 4766 | /*:VRX         SPIN_client_max_protocol_Change
 | 
|---|
| 4767 | */
 | 
|---|
| 4768 | SPIN_client_max_protocol_Change:
 | 
|---|
| 4769 |     advanced.!smbconfchanged = 1
 | 
|---|
| 4770 | return
 | 
|---|
| 4771 | 
 | 
|---|
| 4772 | /*:VRX         SPIN_client_min_protocol_Change
 | 
|---|
| 4773 | */
 | 
|---|
| 4774 | SPIN_client_min_protocol_Change:
 | 
|---|
| 4775 |     advanced.!smbconfchanged = 1
 | 
|---|
| 4776 | return
 | 
|---|
| 4777 | 
 | 
|---|
| 4778 | /*:VRX         SPIN_client_signing_Change
 | 
|---|
| 4779 | */
 | 
|---|
| 4780 | SPIN_client_signing_Change:
 | 
|---|
| 4781 |     advanced.!smbconfchanged = 1
 | 
|---|
| 4782 | return
 | 
|---|
| 4783 | 
 | 
|---|
| 4784 | /*:VRX         SPIN_LOG_LEVEL_Change
 | 
|---|
| 4785 | */
 | 
|---|
| 4786 | SPIN_LOG_LEVEL_Change:
 | 
|---|
| 4787 |     advanced.!smbconfchanged = 1
 | 
|---|
| 4788 | return
 | 
|---|
| 4789 | 
 | 
|---|
| 4790 | /*:VRX         SPIN_NRO1_Change
 | 
|---|
| 4791 | */
 | 
|---|
| 4792 | SPIN_NRO1_Change:
 | 
|---|
| 4793 |     advanced.!smbconfchanged = 1
 | 
|---|
| 4794 | return
 | 
|---|
| 4795 | 
 | 
|---|
| 4796 | /*:VRX         SPIN_NRO2_Change
 | 
|---|
| 4797 | */
 | 
|---|
| 4798 | SPIN_NRO2_Change:
 | 
|---|
| 4799 |     advanced.!smbconfchanged = 1
 | 
|---|
| 4800 | return
 | 
|---|
| 4801 | 
 | 
|---|
| 4802 | /*:VRX         SPIN_NRO3_Change
 | 
|---|
| 4803 | */
 | 
|---|
| 4804 | SPIN_NRO3_Change:
 | 
|---|
| 4805 |     advanced.!smbconfchanged = 1
 | 
|---|
| 4806 | return
 | 
|---|
| 4807 | 
 | 
|---|
| 4808 | /*:VRX         SPIN_NRO4_Change
 | 
|---|
| 4809 | */
 | 
|---|
| 4810 | SPIN_NRO4_Change:
 | 
|---|
| 4811 |     advanced.!smbconfchanged = 1
 | 
|---|
| 4812 | return
 | 
|---|
| 4813 | 
 | 
|---|
| 4814 | /*:VRX         SPLIT_Main_Move
 | 
|---|
| 4815 | */
 | 
|---|
| 4816 | SPLIT_Main_Move:
 | 
|---|
| 4817 |     ok = VRset("Main", "Painting", 0)
 | 
|---|
| 4818 |     NewPos = VRInfo("Left")
 | 
|---|
| 4819 |     OldPos = VRGet("SPLIT_Main","Left")
 | 
|---|
| 4820 |     ok = VRSet("SPLIT_Main","Left", NewPos)
 | 
|---|
| 4821 |     ok = VRset("GB_SMBTREE","Left", NewPos+60)
 | 
|---|
| 4822 |     call Main_Resize
 | 
|---|
| 4823 |     ok = VRset("Main", "Painting", 1)
 | 
|---|
| 4824 | return
 | 
|---|
| 4825 | 
 | 
|---|
| 4826 | /*:VRX         SW_ABOUT_Close
 | 
|---|
| 4827 | */
 | 
|---|
| 4828 | SW_ABOUT_Close:
 | 
|---|
| 4829 |     options.!tracmark = VRGet('CB_TRAC', 'Set')
 | 
|---|
| 4830 |     call SW_ABOUT_Fini
 | 
|---|
| 4831 | return
 | 
|---|
| 4832 | 
 | 
|---|
| 4833 | /*:VRX         SW_ABOUT_Create
 | 
|---|
| 4834 | */
 | 
|---|
| 4835 | SW_ABOUT_Create:
 | 
|---|
| 4836 |     call SW_ABOUT_Init
 | 
|---|
| 4837 | 
 | 
|---|
| 4838 |     CALL NLVSetText 'SW_ABOUT',        "Caption", 1
 | 
|---|
| 4839 |     CALL NLVSetText 'PB_ABOUT_CLOSE',  "Caption", 29
 | 
|---|
| 4840 |     CALL NLVSetText 'PB_ABOUT_COPY',   "Caption", 121
 | 
|---|
| 4841 |     CALL NLVSetText 'CB_TRAC',         "Caption", 134
 | 
|---|
| 4842 | 
 | 
|---|
| 4843 |     CALL VRSet 'CB_TRAC', 'Set', options.!tracmark
 | 
|---|
| 4844 | 
 | 
|---|
| 4845 |     ok = VRSet("DT_About","Caption", Program' (c) 2007-2018 Alexander Taylor for Arca Noae '||'0D0A'x||'and Herwig Bauernfeind for bww bitwise works GmbH.')
 | 
|---|
| 4846 | 
 | 
|---|
| 4847 |     About.DscFH  = VRMethod( "CN_ABOUT", "AddField", "String", "Component" )
 | 
|---|
| 4848 |     About.ValFH  = VRMethod( "CN_ABOUT", "AddField", "String", "Version" )
 | 
|---|
| 4849 | 
 | 
|---|
| 4850 |     call _AboutSambaClientGetInfo
 | 
|---|
| 4851 | 
 | 
|---|
| 4852 | return
 | 
|---|
| 4853 | /*:VRX         SW_ABOUT_Fini
 | 
|---|
| 4854 | */
 | 
|---|
| 4855 | SW_ABOUT_Fini:
 | 
|---|
| 4856 |     window = VRInfo( "Window" )
 | 
|---|
| 4857 |     call VRDestroy window
 | 
|---|
| 4858 |     drop window
 | 
|---|
| 4859 | return
 | 
|---|
| 4860 | /*:VRX         SW_ABOUT_Init
 | 
|---|
| 4861 | */
 | 
|---|
| 4862 | SW_ABOUT_Init:
 | 
|---|
| 4863 |     window = VRInfo( "Object" )
 | 
|---|
| 4864 |     if( \VRIsChildOf( window, "TabbedDialog" ) ) then do
 | 
|---|
| 4865 |         call VRMethod window, "CenterWindow"
 | 
|---|
| 4866 |         call VRSet window, "Visible", 1
 | 
|---|
| 4867 |         call VRMethod window, "Activate"
 | 
|---|
| 4868 |     end
 | 
|---|
| 4869 |     drop window
 | 
|---|
| 4870 | return
 | 
|---|
| 4871 | 
 | 
|---|
| 4872 | /*:VRX         SW_ACLS_Close
 | 
|---|
| 4873 | */
 | 
|---|
| 4874 | SW_ACLS_Close:
 | 
|---|
| 4875 |     call SW_ACLS_Fini
 | 
|---|
| 4876 | return
 | 
|---|
| 4877 | 
 | 
|---|
| 4878 | /*:VRX         SW_ACLS_Create
 | 
|---|
| 4879 | */
 | 
|---|
| 4880 | SW_ACLS_Create:
 | 
|---|
| 4881 |     call SW_ACLS_Init
 | 
|---|
| 4882 |     ACL.typeFH   = VRMethod( "CN_ACLS", "AddField", "String", "Type" )
 | 
|---|
| 4883 |     ACL.groupFH  = VRMethod( "CN_ACLS", "AddField", "String", "Group" )
 | 
|---|
| 4884 |     ACL.userFH   = VRMethod( "CN_ACLS", "AddField", "String", "User" )
 | 
|---|
| 4885 |     ACL.ADFH     = VRMethod( "CN_ACLS", "AddField", "String", "A/D" )
 | 
|---|
| 4886 |     ACL.flagsFH  = VRMethod( "CN_ACLS", "AddField", "String", "Flags" )
 | 
|---|
| 4887 |     ACL.accessFH = VRMethod( "CN_ACLS", "AddField", "String", "Access" )
 | 
|---|
| 4888 |     ok = VRMethod( "CN_ACLS", "RemoveRecord", "ALL")
 | 
|---|
| 4889 |     aclsnumeric = ''
 | 
|---|
| 4890 |     call _ACLSBrowse
 | 
|---|
| 4891 | return
 | 
|---|
| 4892 | 
 | 
|---|
| 4893 | /*:VRX         SW_ACLS_Fini
 | 
|---|
| 4894 | */
 | 
|---|
| 4895 | SW_ACLS_Fini:
 | 
|---|
| 4896 |     window = VRInfo( "Window" )
 | 
|---|
| 4897 |     call VRDestroy window
 | 
|---|
| 4898 |     drop window
 | 
|---|
| 4899 | return
 | 
|---|
| 4900 | /*:VRX         SW_ACLS_Init
 | 
|---|
| 4901 | */
 | 
|---|
| 4902 | SW_ACLS_Init:
 | 
|---|
| 4903 |     window = VRInfo( "Object" )
 | 
|---|
| 4904 |     if( \VRIsChildOf( window, "Notebook" ) ) then do
 | 
|---|
| 4905 |         call VRMethod window, "CenterWindow"
 | 
|---|
| 4906 |         call VRSet window, "Visible", 1
 | 
|---|
| 4907 |         call VRMethod window, "Activate"
 | 
|---|
| 4908 |     end
 | 
|---|
| 4909 |     drop window
 | 
|---|
| 4910 | return
 | 
|---|
| 4911 | 
 | 
|---|
| 4912 | /*:VRX         SW_ADVANCED_Close
 | 
|---|
| 4913 | */
 | 
|---|
| 4914 | SW_ADVANCED_Close:
 | 
|---|
| 4915 |     call SW_ADVANCED_Fini
 | 
|---|
| 4916 | return
 | 
|---|
| 4917 | 
 | 
|---|
| 4918 | /*:VRX         SW_ADVANCED_Create
 | 
|---|
| 4919 | */
 | 
|---|
| 4920 | SW_ADVANCED_Create:
 | 
|---|
| 4921 |     call SW_ADVANCED_Init
 | 
|---|
| 4922 | return
 | 
|---|
| 4923 | 
 | 
|---|
| 4924 | /*:VRX         SW_ADVANCED_Fini
 | 
|---|
| 4925 | */
 | 
|---|
| 4926 | SW_ADVANCED_Fini:
 | 
|---|
| 4927 |     window = VRInfo( "Window" )
 | 
|---|
| 4928 |     call VRDestroy window
 | 
|---|
| 4929 |     drop window
 | 
|---|
| 4930 | return
 | 
|---|
| 4931 | /*:VRX         SW_ADVANCED_Init
 | 
|---|
| 4932 | */
 | 
|---|
| 4933 | SW_ADVANCED_Init:
 | 
|---|
| 4934 |     /* Title bar */
 | 
|---|
| 4935 |     CALL NLVSetText "SW_ADVANCED",      "Caption", 40
 | 
|---|
| 4936 | 
 | 
|---|
| 4937 |     /* Options */
 | 
|---|
| 4938 |     CALL NLVSetText "GB_ADVANCED",      "Caption", 43
 | 
|---|
| 4939 |     CALL NLVSetText "CB_EAS",           "Caption", 44
 | 
|---|
| 4940 |     CALL NLVSetText "CB_READONLY",      "Caption", 45
 | 
|---|
| 4941 |     CALL NLVSetText "CB_ALWAYSMP",      "Caption", 65
 | 
|---|
| 4942 |     CALL NLVSetText "DT_CACHETIMEOUT",  "Caption", 130
 | 
|---|
| 4943 |     CALL NLVSetText "DT_CACHELISTINGS", "Caption", 131
 | 
|---|
| 4944 | 
 | 
|---|
| 4945 |     CALL NLVSetText "CB_NTLMv1",        "Caption", 144
 | 
|---|
| 4946 |     CALL NLVSetText "CB_KERBEROS5",     "Caption", 145
 | 
|---|
| 4947 |     CALL NLVSetText "CB_ENCRYPTION",    "Caption", 146
 | 
|---|
| 4948 | 
 | 
|---|
| 4949 |     /* Buttons */
 | 
|---|
| 4950 |     CALL NLVSetText "PB_ADVANCED_APPLY",     "Caption", 122
 | 
|---|
| 4951 |     CALL NLVSetText "PB_ADVANCED_UNDO", "Caption", 123
 | 
|---|
| 4952 |     CALL NLVSetText "PB_ADVANCED_HELP",   "Caption", 4
 | 
|---|
| 4953 | 
 | 
|---|
| 4954 |     CALL VRSet "SW_ADVANCED", "HelpTag", NLVGetMessage(40)
 | 
|---|
| 4955 | 
 | 
|---|
| 4956 | /*  call VRMethod "SW_ADVANCED", "CenterWindow" */
 | 
|---|
| 4957 |     ok = VRSet("SW_ADVANCED", "Visible", 1)
 | 
|---|
| 4958 | /*  call VRMethod "SW_ADVANCED", "Activate" */
 | 
|---|
| 4959 | return
 | 
|---|
| 4960 | 
 | 
|---|
| 4961 | /*:VRX         SW_ADVANCED_Init_Content
 | 
|---|
| 4962 | */
 | 
|---|
| 4963 | SW_ADVANCED_Init_Content:
 | 
|---|
| 4964 |     IF advanced.!easupport     \= "" THEN ok = VRSet("CB_EAS",              "Set",   advanced.!easupport)
 | 
|---|
| 4965 |     IF advanced.!readonly      \= "" THEN ok = VRSet("CB_READONLY",         "Set",   advanced.!readonly)
 | 
|---|
| 4966 |     IF advanced.!alwaysmp      \= "" THEN ok = VRSet("CB_ALWAYSMP",         "Set",   advanced.!alwaysmp)
 | 
|---|
| 4967 |     IF advanced.!cachetimeout  \= "" THEN ok = VRSet("SPIN_CACHETIMEOUT",   "Value", advanced.!cachetimeout)
 | 
|---|
| 4968 |     IF advanced.!cachelistings \= "" THEN ok = VRSet("SPIN_CACHELISTINGS",  "Value", advanced.!cachelistings)
 | 
|---|
| 4969 |     IF advanced.!kerberos5     \= "" THEN ok = VRSet("CB_KERBEROS5",        "Set",   advanced.!kerberos5)
 | 
|---|
| 4970 |     IF advanced.!NTLMv1        \= "" THEN ok = VRSet("CB_NTLMv1",           "Set",   advanced.!NTLMv1)
 | 
|---|
| 4971 |     IF advanced.!encryption    \= "" THEN ok = VRSet("CB_ENCRYPTION",       "Set",   advanced.!encryption)
 | 
|---|
| 4972 |     /* Obsolete */
 | 
|---|
| 4973 |     IF advanced.!memlen        \= "" THEN ok = VRSet("SPB_MEMLEN",          "Value", advanced.!memlen)
 | 
|---|
| 4974 | return
 | 
|---|
| 4975 | 
 | 
|---|
| 4976 | /*:VRX         SW_CONDET_Close
 | 
|---|
| 4977 | */
 | 
|---|
| 4978 | SW_CONDET_Close:
 | 
|---|
| 4979 |     call SW_CONDET_Fini
 | 
|---|
| 4980 | return
 | 
|---|
| 4981 | 
 | 
|---|
| 4982 | /*:VRX         SW_CONDET_Create
 | 
|---|
| 4983 | */
 | 
|---|
| 4984 | SW_CONDET_Create:
 | 
|---|
| 4985 |     call SW_CONDET_Init
 | 
|---|
| 4986 | return
 | 
|---|
| 4987 | 
 | 
|---|
| 4988 | /*:VRX         SW_CONDET_Fini
 | 
|---|
| 4989 | */
 | 
|---|
| 4990 | SW_CONDET_Fini:
 | 
|---|
| 4991 |     window = VRInfo( "Window" )
 | 
|---|
| 4992 |     call VRDestroy window
 | 
|---|
| 4993 |     drop window
 | 
|---|
| 4994 | return
 | 
|---|
| 4995 | /*:VRX         SW_CONDET_Init
 | 
|---|
| 4996 | */
 | 
|---|
| 4997 | SW_CONDET_Init:
 | 
|---|
| 4998 | 
 | 
|---|
| 4999 | return
 | 
|---|
| 5000 | 
 | 
|---|
| 5001 | /*:VRX         SW_CONDET_Init_Content
 | 
|---|
| 5002 | */
 | 
|---|
| 5003 | SW_CONDET_Init_Content:
 | 
|---|
| 5004 |     if VRGet("TM_Throbber","Enabled") = 1 then ok = VRset("Pict_Throbber", "Visible", 0)
 | 
|---|
| 5005 | 
 | 
|---|
| 5006 |     /* Hide any "foreign" menu entries */
 | 
|---|
| 5007 |     ok = VRSet("Menu_Selected_Connect", "Visible", 0)
 | 
|---|
| 5008 | return
 | 
|---|
| 5009 | 
 | 
|---|
| 5010 | /*:VRX         SW_DIALOG_Close
 | 
|---|
| 5011 | */
 | 
|---|
| 5012 | SW_DIALOG_Close:
 | 
|---|
| 5013 |     call SW_DIALOG_Fini
 | 
|---|
| 5014 | return
 | 
|---|
| 5015 | 
 | 
|---|
| 5016 | /*:VRX         SW_DIALOG_Create
 | 
|---|
| 5017 | */
 | 
|---|
| 5018 | SW_DIALOG_Create:
 | 
|---|
| 5019 |     call SW_DIALOG_Init
 | 
|---|
| 5020 | return
 | 
|---|
| 5021 | 
 | 
|---|
| 5022 | /*:VRX         SW_DIALOG_Fini
 | 
|---|
| 5023 | */
 | 
|---|
| 5024 | SW_DIALOG_Fini:
 | 
|---|
| 5025 |     window = VRInfo( "Window" )
 | 
|---|
| 5026 |     call VRDestroy window
 | 
|---|
| 5027 |     drop window
 | 
|---|
| 5028 | return
 | 
|---|
| 5029 | /*:VRX         SW_DIALOG_Init
 | 
|---|
| 5030 | */
 | 
|---|
| 5031 | SW_DIALOG_Init:
 | 
|---|
| 5032 |     LEDSize = VRMethod( "Screen", "PixelsToTwips", 16 )
 | 
|---|
| 5033 | 
 | 
|---|
| 5034 |     ok = VRSet("Pict_PWINMEM","Top",  VRGet("EF_USER","Top")+(VRGet("EF_USER","Height")-LEDSize)%2)
 | 
|---|
| 5035 |     ok = VRSet("Pict_PWINMEM","Width",  LEDSize)
 | 
|---|
| 5036 |     ok = VRSet("Pict_PWINMEM","Height", LEDSize)
 | 
|---|
| 5037 | return
 | 
|---|
| 5038 | 
 | 
|---|
| 5039 | /*:VRX         SW_DIALOG_Init_Content
 | 
|---|
| 5040 | */
 | 
|---|
| 5041 | SW_DIALOG_Init_Content:
 | 
|---|
| 5042 |     /* obsolete */
 | 
|---|
| 5043 |     if VRGet("TM_Throbber","Enabled") = 1 then ok = VRset("Pict_Throbber", "Visible", 0)
 | 
|---|
| 5044 | 
 | 
|---|
| 5045 |     ok = VRSet("Menu_Selected_Remove",  "Visible",  0)
 | 
|---|
| 5046 |     ok = VRSet("Menu_Selected_Retry",   "Visible",  0)
 | 
|---|
| 5047 |     ok = VRSet("Menu_Selected_Connect", "Visible",  0)
 | 
|---|
| 5048 | 
 | 
|---|
| 5049 |     call _DialogPopulate
 | 
|---|
| 5050 | return
 | 
|---|
| 5051 | 
 | 
|---|
| 5052 | /*:VRX         SW_INFO_Close
 | 
|---|
| 5053 | */
 | 
|---|
| 5054 | SW_INFO_Close:
 | 
|---|
| 5055 |     call SW_INFO_Fini
 | 
|---|
| 5056 | return
 | 
|---|
| 5057 | 
 | 
|---|
| 5058 | /*:VRX         SW_INFO_Create
 | 
|---|
| 5059 | */
 | 
|---|
| 5060 | SW_INFO_Create:
 | 
|---|
| 5061 |     if options.!debug == 1 then say time()' SW_INFO_Create started'
 | 
|---|
| 5062 |     call SW_INFO_Init
 | 
|---|
| 5063 |     CALL NLVSetText 'SW_INFO',    "Caption", 92
 | 
|---|
| 5064 |     CALL NLVSetText 'PB_INFO_OK',    "Caption", 2
 | 
|---|
| 5065 |     Info.TypeFH    = VRMethod( "CN_INFO", "AddField", "String", "Type" )
 | 
|---|
| 5066 |     Info.ValueFH   = VRMethod( "CN_INFO", "AddField", "String", "Value" )
 | 
|---|
| 5067 | 
 | 
|---|
| 5068 |     if options.!debug == 1 then do
 | 
|---|
| 5069 |         say '  Handle:   "'SMBObj.rh'"'
 | 
|---|
| 5070 |         say '  Resource: "'SMBObj.resname'"'
 | 
|---|
| 5071 |         say '  Comment:  "'SMBObj.comment'"'
 | 
|---|
| 5072 |         say '  Type:     "'SMBObj.udatatype'"'
 | 
|---|
| 5073 |         say '  Message:  "'SMBObj.udatamsg'"'
 | 
|---|
| 5074 |         say '  Icon:     "'SMBObj.icon'"'
 | 
|---|
| 5075 |     end
 | 
|---|
| 5076 | say "Vorher:"rpc.srvinfo.OS_VERSION
 | 
|---|
| 5077 |     drop rpc.
 | 
|---|
| 5078 | say "Vorher:"rpc.srvinfo.OS_VERSION
 | 
|---|
| 5079 |     rpc_success = _rpcsrvinfo(SMBObj.resname,credentials.!username,credentials.!password)
 | 
|---|
| 5080 | 
 | 
|---|
| 5081 |     Info.!nbname       = VRMethod( "CN_INFO", "AddRecord")
 | 
|---|
| 5082 |     Info.!comment      = VRMethod( "CN_INFO", "AddRecord")
 | 
|---|
| 5083 |     Info.!domain       = VRMethod( "CN_INFO", "AddRecord")
 | 
|---|
| 5084 |     Info.!DMBLMB       = VRMethod( "CN_INFO", "AddRecord")
 | 
|---|
| 5085 |     if rpc_success = 1 then Info.!capabilities = VRMethod( "CN_INFO", "AddRecord")
 | 
|---|
| 5086 |     Info.!os           = VRMethod( "CN_INFO", "AddRecord")
 | 
|---|
| 5087 |     Info.!server       = VRMethod( "CN_INFO", "AddRecord")
 | 
|---|
| 5088 |     if rpc_success = 1 then Info.!version      = VRMethod( "CN_INFO", "AddRecord")
 | 
|---|
| 5089 |     Info.!status       = VRMethod( "CN_INFO", "AddRecord")
 | 
|---|
| 5090 |     Info.!IP           = VRMethod( "CN_INFO", "AddRecord")
 | 
|---|
| 5091 |     Info.!MAC          = VRMethod( "CN_INFO", "AddRecord")
 | 
|---|
| 5092 | 
 | 
|---|
| 5093 |     if rpc_success = 1 then do
 | 
|---|
| 5094 |         if rpc.srvinfo.OS_VERSION = 'RPC.SRVINFO.OS_VERSION' then rpc.srvinfo.OS_VERSION = ''
 | 
|---|
| 5095 |         ok = VRMethod( "CN_INFO", "SetFieldData", Info.!nbname, Info.TypeFH, strip(NLVGetMessage(137),'T',':'),Info.ValueFH, rpc.srvinfo.NETBIOSNAME)
 | 
|---|
| 5096 |         ok = VRMethod( "CN_INFO", "SetFieldData", Info.!comment,Info.TypeFH, strip(NLVGetMessage(125),'T',':'),Info.ValueFH, rpc.srvinfo.SERVERSTRING)
 | 
|---|
| 5097 |         ok = VRMethod( "CN_INFO", "SetFieldData", Info.!capabilities, Info.TypeFH, strip(NLVGetMessage(138),'T',':'),Info.ValueFH, rpc.srvinfo.CAPABILITIES)
 | 
|---|
| 5098 |         ok = VRMethod( "CN_INFO", "SetFieldData", Info.!version,Info.TypeFH, strip(NLVGetMessage(139),'T',':'),Info.ValueFH, rpc.srvinfo.OS_VERSION)
 | 
|---|
| 5099 |         ok = VRMethod( "CN_INFO", "SetFieldData", Info.!status, Info.TypeFH, strip(NLVGetMessage(67),'T',':'),Info.ValueFH, rpc.srvinfo.LOGONSTATUS )
 | 
|---|
| 5100 |         /* we did not get these, but we know them anyway */
 | 
|---|
| 5101 |         if rpc.srvinfo.NETBIOSNAME  = "" then ok = VRMethod( "CN_INFO", "SetFieldData", Info.!nbname, Info.TypeFH, strip(NLVGetMessage(137),'T',':'),Info.ValueFH, SMBObj.resname)
 | 
|---|
| 5102 |         if rpc.srvinfo.SERVERSTRING = "" then ok = VRMethod( "CN_INFO", "SetFieldData", Info.!comment,Info.TypeFH, strip(NLVGetMessage(125),'T',':'),Info.ValueFH, SMBObj.comment)
 | 
|---|
| 5103 |     end
 | 
|---|
| 5104 |     else do
 | 
|---|
| 5105 |         ok = VRMethod( "CN_INFO", "SetFieldData", Info.!nbname, Info.TypeFH, strip(NLVGetMessage(137),'T',':'),Info.ValueFH, SMBObj.resname)
 | 
|---|
| 5106 |         ok = VRMethod( "CN_INFO", "SetFieldData", Info.!comment,Info.TypeFH, strip(NLVGetMessage(125),'T',':'),Info.ValueFH, SMBObj.comment)
 | 
|---|
| 5107 |         ok = VRMethod( "CN_INFO", "SetFieldData", Info.!status, Info.TypeFH, strip(NLVGetMessage(67),'T',':'), Info.ValueFH, SMBObj.udatamsg)
 | 
|---|
| 5108 |     end
 | 
|---|
| 5109 | 
 | 
|---|
| 5110 |     ok = VRMethod( "CN_INFO", "SetFieldData", Info.!domain, Info.TypeFH, strip(NLVGetMessage(21), 'T',':'),Info.ValueFH, VRMethod("CN_SMBTREE", "GetFieldData", SMBObj.RH, WorkGroupFH ))
 | 
|---|
| 5111 |     ok = VRMethod( "CN_INFO", "SetFieldData", Info.!os,     Info.TypeFH, strip(NLVGetMessage(93), 'T',':'),Info.ValueFH, VRMethod("CN_SMBTREE", "GetFieldData", SMBObj.RH, OSFH  ))
 | 
|---|
| 5112 |     ok = VRMethod( "CN_INFO", "SetFieldData", Info.!server, Info.TypeFH, strip(NLVGetMessage(19), 'T',':'),Info.ValueFH, VRMethod("CN_SMBTREE", "GetFieldData", SMBObj.RH, VersionFH  ))
 | 
|---|
| 5113 |     ok = VRMethod( "CN_INFO", "SetFieldData", Info.!DMBLMB, Info.TypeFH, strip(NLVGetMessage(124),'T',':'),Info.ValueFH, VRMethod("CN_SMBTREE", "GetFieldData", SMBObj.RH, MBFH  ))
 | 
|---|
| 5114 |     ok = VRMethod( "CN_INFO", "SetFieldData", Info.!IP,     Info.TypeFH, "IP"  ,Info.ValueFH, VRMethod("CN_SMBTREE", "GetFieldData", SMBObj.RH, IPFH  ))
 | 
|---|
| 5115 |     ok = VRMethod( "CN_INFO", "SetFieldData", Info.!MAC,    Info.TypeFH, "MAC" ,Info.ValueFH, VRMethod("CN_SMBTREE", "GetFieldData", SMBObj.RH, MacFH ))
 | 
|---|
| 5116 | 
 | 
|---|
| 5117 |     if options.!debug == 1 then say time()' SW_INFO_Create done'
 | 
|---|
| 5118 | return
 | 
|---|
| 5119 | 
 | 
|---|
| 5120 | /*:VRX         SW_INFO_Fini
 | 
|---|
| 5121 | */
 | 
|---|
| 5122 | SW_INFO_Fini:
 | 
|---|
| 5123 |     window = VRInfo( "Window" )
 | 
|---|
| 5124 |     call VRDestroy window
 | 
|---|
| 5125 |     drop window
 | 
|---|
| 5126 | return
 | 
|---|
| 5127 | /*:VRX         SW_INFO_Init
 | 
|---|
| 5128 | */
 | 
|---|
| 5129 | SW_INFO_Init:
 | 
|---|
| 5130 |     window = VRInfo( "Object" )
 | 
|---|
| 5131 |     if( \VRIsChildOf( window, "TabbedDialog" ) ) then do
 | 
|---|
| 5132 |         call VRMethod window, "CenterWindow"
 | 
|---|
| 5133 |         call VRSet window, "Visible", 1
 | 
|---|
| 5134 |         call VRMethod window, "Activate"
 | 
|---|
| 5135 |     end
 | 
|---|
| 5136 |     drop window
 | 
|---|
| 5137 | return
 | 
|---|
| 5138 | 
 | 
|---|
| 5139 | /*:VRX         SW_LOGIN_Close
 | 
|---|
| 5140 | */
 | 
|---|
| 5141 | SW_LOGIN_Close:
 | 
|---|
| 5142 |     call SW_LOGIN_Fini
 | 
|---|
| 5143 | return
 | 
|---|
| 5144 | 
 | 
|---|
| 5145 | /*:VRX         SW_LOGIN_Create
 | 
|---|
| 5146 | */
 | 
|---|
| 5147 | SW_LOGIN_Create:
 | 
|---|
| 5148 |     call SW_LOGIN_Init
 | 
|---|
| 5149 |     ok = VRSet("SW_LOGIN","Caption",NLVGetMessage(136)' 'strip(p_workgroup' \\'p_server'\'p_share,'T','\'))
 | 
|---|
| 5150 |     CALL NLVSetText 'DT_USER1',       "Caption", 25
 | 
|---|
| 5151 |     CALL NLVSetText 'DT_PASSWORD1',   "Caption", 26
 | 
|---|
| 5152 |     CALL NLVSetText 'CB_STORECREDS1', "Caption", 135
 | 
|---|
| 5153 |     CALL NLVSetText 'PB_LOGIN_OK',    "Caption", 2
 | 
|---|
| 5154 |     CALL NLVSetText 'PB_LOGIN_CANCEL',"Caption", 3
 | 
|---|
| 5155 | 
 | 
|---|
| 5156 |     if VRIsValidObject(SMBObj.rh) then do
 | 
|---|
| 5157 |         select
 | 
|---|
| 5158 |             when pos("PDC",VRMethod("CN_smbtree", "GetFieldData", SMBObj.rh, MBFH)) > 0 then LoginIcon = "#63:PMWP.DLL" /* icons.!pdc */
 | 
|---|
| 5159 |             when SMBObj.udatatype = "WORKGROUP" then LoginIcon = SMBObj.Icon
 | 
|---|
| 5160 |             when SMBObj.udatatype = "SERVER"    then LoginIcon = SMBObj.Icon
 | 
|---|
| 5161 |             when SMBObj.udatatype = "DISK"      then do
 | 
|---|
| 5162 |                 if pos("PDC",VRMethod("CN_smbtree", "GetFieldData", SMBObj.parentrh, MBFH)) > 0
 | 
|---|
| 5163 |                     then LoginIcon = "#63:PMWP.DLL" /* icons.!pdc */
 | 
|---|
| 5164 |                     else LoginIcon = "#35:PMWP.DLL" /* icons.!pdc */
 | 
|---|
| 5165 |             end
 | 
|---|
| 5166 |             otherwise LoginIcon = "#35:PMWP.DLL" /* icons.!machine_awake */
 | 
|---|
| 5167 |         end
 | 
|---|
| 5168 |         say loginicon
 | 
|---|
| 5169 |         ok = VRSet("Pict_Login","PicturePath", LoginIcon)
 | 
|---|
| 5170 |     end
 | 
|---|
| 5171 |     ok = VRSet("EF_USER1","Value",VRGet("EF_USER","Value"))
 | 
|---|
| 5172 |     ok = VRSet("EF_PASSWORD1","Value",VRGet("EF_PASSWORD","Value"))
 | 
|---|
| 5173 |     ok = VRSet("CB_STORECREDS1","Set",options.!storecreds)
 | 
|---|
| 5174 | return
 | 
|---|
| 5175 | 
 | 
|---|
| 5176 | /*:VRX         SW_LOGIN_Fini
 | 
|---|
| 5177 | */
 | 
|---|
| 5178 | SW_LOGIN_Fini:
 | 
|---|
| 5179 |     window = VRInfo( "Window" )
 | 
|---|
| 5180 |     call VRDestroy window
 | 
|---|
| 5181 |     drop window
 | 
|---|
| 5182 | return
 | 
|---|
| 5183 | /*:VRX         SW_LOGIN_Init
 | 
|---|
| 5184 | */
 | 
|---|
| 5185 | SW_LOGIN_Init:
 | 
|---|
| 5186 |     window = VRInfo( "Object" )
 | 
|---|
| 5187 |     if( \VRIsChildOf( window, "TabbedDialog" ) ) then do
 | 
|---|
| 5188 |         call VRMethod window, "CenterWindow"
 | 
|---|
| 5189 |         call VRSet window, "Visible", 1
 | 
|---|
| 5190 |         call VRMethod window, "Activate"
 | 
|---|
| 5191 |     end
 | 
|---|
| 5192 |     drop window
 | 
|---|
| 5193 | return
 | 
|---|
| 5194 | 
 | 
|---|
| 5195 | /*:VRX         SW_LOGIN_KeyPress
 | 
|---|
| 5196 | */
 | 
|---|
| 5197 | SW_LOGIN_KeyPress:
 | 
|---|
| 5198 |     obj = VRInfo( "Object" )
 | 
|---|
| 5199 |     keystr = VRGet( obj, "KeyString" )
 | 
|---|
| 5200 | /*  say keystr */
 | 
|---|
| 5201 |     select
 | 
|---|
| 5202 |         when keystr = "{Enter}" then ok = VRMethod( "EF_LoginPassword", "SetFocus" )
 | 
|---|
| 5203 |         when keystr = "{Newline}" then ok = VRMethod( "EF_LoginPassword", "SetFocus" )
 | 
|---|
| 5204 |         when keystr  = "{Esc}" then call PB_LOGIN_CANCEL_Click
 | 
|---|
| 5205 |         otherwise nop
 | 
|---|
| 5206 |     end
 | 
|---|
| 5207 | return
 | 
|---|
| 5208 | 
 | 
|---|
| 5209 | /*:VRX         SW_MOUNTPOINT_Close
 | 
|---|
| 5210 | */
 | 
|---|
| 5211 | SW_MOUNTPOINT_Close:
 | 
|---|
| 5212 |     call SW_MOUNTPOINT_Fini
 | 
|---|
| 5213 | return
 | 
|---|
| 5214 | 
 | 
|---|
| 5215 | /*:VRX         SW_MOUNTPOINT_Create
 | 
|---|
| 5216 | */
 | 
|---|
| 5217 | SW_MOUNTPOINT_Create:
 | 
|---|
| 5218 |     call SW_MOUNTPOINT_Init
 | 
|---|
| 5219 | 
 | 
|---|
| 5220 |     ok = VRSet("SW_MOUNTPOINT","Caption",strip(p_workgroup' \\'p_server'\'p_share,'T','\')) /* NLVGetMessage(14)' ' */
 | 
|---|
| 5221 |     CALL NLVSetText 'DT_MPOINT1',   "Caption", 27
 | 
|---|
| 5222 |     CALL NLVSetText 'PB_NEWMOUNTPOINTOK',    "Caption", 2
 | 
|---|
| 5223 |     CALL NLVSetText 'PB_NEWMOUNTPOINTCANCEL',"Caption", 3
 | 
|---|
| 5224 |     CALL NLVSetText 'CB_EAS1',               "Caption", 44
 | 
|---|
| 5225 |     CALL NLVSetText 'CB_READONLY1',          "Caption", 45
 | 
|---|
| 5226 |     CALL NLVSetText 'CB_ALWAYSMP1',          "Caption", 65
 | 
|---|
| 5227 |     CALL NLVSetText "DT_CACHETIMEOUT1",      "Caption", 130
 | 
|---|
| 5228 |     CALL NLVSetText "DT_CACHELISTINGS1",     "Caption", 131
 | 
|---|
| 5229 | 
 | 
|---|
| 5230 |     CALL NLVSetText "CB_NTLMv11",            "Caption", 144
 | 
|---|
| 5231 |     CALL NLVSetText "CB_KERBEROS51",         "Caption", 145
 | 
|---|
| 5232 |     CALL NLVSetText "CB_ENCRYPTION1",        "Caption", 146
 | 
|---|
| 5233 | 
 | 
|---|
| 5234 |     ok = VRMethod( "CB_DRIVES",  "GetStringList", "freedrives." )
 | 
|---|
| 5235 |     ok = VRMethod( "CB_DRIVES1", "AddStringList", "freedrives." )
 | 
|---|
| 5236 |     ok = VRSet("CB_DRIVES1", "Value", VRGet("CB_Drives","Value"))
 | 
|---|
| 5237 | 
 | 
|---|
| 5238 |     if VRGet("EF_Directory","Value") = "" then ok = VRSet("EF_DIRECTORY1", "Value", VRGet("EF_Directory","Value"))
 | 
|---|
| 5239 | 
 | 
|---|
| 5240 |     ok = VRMethod("EF_DIRECTORY1","AddString",p_share)
 | 
|---|
| 5241 | 
 | 
|---|
| 5242 |     IF advanced.!easupport     \= "" THEN ok = VRSet("CB_EAS1",            "Set",   advanced.!easupport)
 | 
|---|
| 5243 |     IF advanced.!readonly      \= "" THEN ok = VRSet("CB_READONLY1",       "Set",   advanced.!readonly)
 | 
|---|
| 5244 |     IF advanced.!alwaysmp      \= "" THEN ok = VRSet("CB_ALWAYSMP1",       "Set",   advanced.!alwaysmp)
 | 
|---|
| 5245 |     IF advanced.!cachetimeout  \= "" THEN ok = VRSet("SPIN_CACHETIMEOUT1", "Value", advanced.!cachetimeout)
 | 
|---|
| 5246 |     IF advanced.!cachelistings \= "" THEN ok = VRSet("SPIN_CACHELISTINGS1","Value", advanced.!cachelistings)
 | 
|---|
| 5247 | return
 | 
|---|
| 5248 | 
 | 
|---|
| 5249 | /*:VRX         SW_MOUNTPOINT_Fini
 | 
|---|
| 5250 | */
 | 
|---|
| 5251 | SW_MOUNTPOINT_Fini:
 | 
|---|
| 5252 |     window = VRInfo( "Window" )
 | 
|---|
| 5253 |     call VRDestroy window
 | 
|---|
| 5254 |     drop window
 | 
|---|
| 5255 | return
 | 
|---|
| 5256 | /*:VRX         SW_MOUNTPOINT_Init
 | 
|---|
| 5257 | */
 | 
|---|
| 5258 | SW_MOUNTPOINT_Init:
 | 
|---|
| 5259 |     window = VRInfo( "Object" )
 | 
|---|
| 5260 |     if( \VRIsChildOf( window, "TabbedDialog" ) ) then do
 | 
|---|
| 5261 |         call VRMethod window, "CenterWindow"
 | 
|---|
| 5262 |         call VRSet window, "Visible", 1
 | 
|---|
| 5263 |         call VRMethod window, "Activate"
 | 
|---|
| 5264 |     end
 | 
|---|
| 5265 |     drop window
 | 
|---|
| 5266 | return
 | 
|---|
| 5267 | 
 | 
|---|
| 5268 | /*:VRX         SW_PORTCONNECT_Close
 | 
|---|
| 5269 | */
 | 
|---|
| 5270 | SW_PORTCONNECT_Close:
 | 
|---|
| 5271 |     call SW_PORTCONNECT_Fini
 | 
|---|
| 5272 | return
 | 
|---|
| 5273 | 
 | 
|---|
| 5274 | /*:VRX         SW_PORTCONNECT_Create
 | 
|---|
| 5275 | */
 | 
|---|
| 5276 | SW_PORTCONNECT_Create:
 | 
|---|
| 5277 |     call SW_PORTCONNECT_Init
 | 
|---|
| 5278 | 
 | 
|---|
| 5279 |     ok = VRGetINI("PM_PORT_DRIVER","SMB","SYSTEM")
 | 
|---|
| 5280 | 
 | 
|---|
| 5281 |     if ok = "" then do
 | 
|---|
| 5282 | 
 | 
|---|
| 5283 |     end
 | 
|---|
| 5284 |     else do
 | 
|---|
| 5285 |         say "Samba Spooler Port driver installed!"
 | 
|---|
| 5286 |         ok = SysINI("SYSTEM","PM_SPOOLER_PORT","ALL:","ports")
 | 
|---|
| 5287 |         smbport.0 = 0
 | 
|---|
| 5288 |         do I = 1 to ports.0
 | 
|---|
| 5289 |             if left(ports.I,3) = "SMB" then do
 | 
|---|
| 5290 |                 X = smbport.0
 | 
|---|
| 5291 |                 X = X + 1
 | 
|---|
| 5292 |                 smbport.0 = X
 | 
|---|
| 5293 |                 smbport.X = ports.I
 | 
|---|
| 5294 |             end
 | 
|---|
| 5295 |         end
 | 
|---|
| 5296 |         do I = 1 to smbport.0
 | 
|---|
| 5297 |             say smbport.I
 | 
|---|
| 5298 |         end
 | 
|---|
| 5299 |     end
 | 
|---|
| 5300 | 
 | 
|---|
| 5301 | return
 | 
|---|
| 5302 | 
 | 
|---|
| 5303 | /*:VRX         SW_PORTCONNECT_Fini
 | 
|---|
| 5304 | */
 | 
|---|
| 5305 | SW_PORTCONNECT_Fini:
 | 
|---|
| 5306 |     window = VRInfo( "Window" )
 | 
|---|
| 5307 |     call VRDestroy window
 | 
|---|
| 5308 |     drop window
 | 
|---|
| 5309 | return
 | 
|---|
| 5310 | /*:VRX         SW_PORTCONNECT_Init
 | 
|---|
| 5311 | */
 | 
|---|
| 5312 | SW_PORTCONNECT_Init:
 | 
|---|
| 5313 |     window = VRInfo( "Object" )
 | 
|---|
| 5314 |     if( \VRIsChildOf( window, "TabbedDialog" ) ) then do
 | 
|---|
| 5315 |         call VRMethod window, "CenterWindow"
 | 
|---|
| 5316 |         call VRSet window, "Visible", 1
 | 
|---|
| 5317 |         call VRMethod window, "Activate"
 | 
|---|
| 5318 |     end
 | 
|---|
| 5319 |     drop window
 | 
|---|
| 5320 | return
 | 
|---|
| 5321 | 
 | 
|---|
| 5322 | /*:VRX         SW_PROGRESS_Close
 | 
|---|
| 5323 | */
 | 
|---|
| 5324 | SW_PROGRESS_Close:
 | 
|---|
| 5325 |     options.!delay = 0
 | 
|---|
| 5326 |     call Main_Resize
 | 
|---|
| 5327 |     call VRSet 'Main',    'Visible', 1
 | 
|---|
| 5328 |     call SW_PROGRESS_Fini
 | 
|---|
| 5329 | return
 | 
|---|
| 5330 | 
 | 
|---|
| 5331 | /*:VRX         SW_PROGRESS_Create
 | 
|---|
| 5332 | */
 | 
|---|
| 5333 | SW_PROGRESS_Create:
 | 
|---|
| 5334 |     call SW_PROGRESS_Init
 | 
|---|
| 5335 |     CALL NLVSetText 'SW_PROGRESS',  "Caption", 1
 | 
|---|
| 5336 |     CALL NLVSetText 'DT_PROGRESS',  "Caption", 34
 | 
|---|
| 5337 |     CALL NLVSetText 'PB_PROGRESS_ABORT',  "Caption", 3
 | 
|---|
| 5338 | 
 | 
|---|
| 5339 |     if options.!delay > 0 then ok = VRSet("TM_TheCloser","Delay", options.!delay*1000)
 | 
|---|
| 5340 | 
 | 
|---|
| 5341 |     CALL VRSet "TM_Progress_Throbber","Enabled", 1
 | 
|---|
| 5342 |     CALL VRSet "TM_TheCloser","Enabled", 1
 | 
|---|
| 5343 | return
 | 
|---|
| 5344 | 
 | 
|---|
| 5345 | /*:VRX         SW_PROGRESS_Fini
 | 
|---|
| 5346 | */
 | 
|---|
| 5347 | SW_PROGRESS_Fini:
 | 
|---|
| 5348 |     call VRDestroy "SW_PROGRESS"
 | 
|---|
| 5349 | return
 | 
|---|
| 5350 | /*:VRX         SW_PROGRESS_Init
 | 
|---|
| 5351 | */
 | 
|---|
| 5352 | SW_PROGRESS_Init:
 | 
|---|
| 5353 |     call VRMethod "SW_PROGRESS", "CenterWindow", "Parent"
 | 
|---|
| 5354 |     call VRSet    "SW_PROGRESS", "Visible", 1
 | 
|---|
| 5355 |     call VRMethod "SW_PROGRESS", "Activate"
 | 
|---|
| 5356 | return
 | 
|---|
| 5357 | 
 | 
|---|
| 5358 | /*:VRX         SW_SETTINGS_Close
 | 
|---|
| 5359 | */
 | 
|---|
| 5360 | SW_SETTINGS_Close:
 | 
|---|
| 5361 |     call SW_SETTINGS_Fini
 | 
|---|
| 5362 | return
 | 
|---|
| 5363 | 
 | 
|---|
| 5364 | /*:VRX         SW_SETTINGS_Create
 | 
|---|
| 5365 | */
 | 
|---|
| 5366 | SW_SETTINGS_Create:
 | 
|---|
| 5367 |     call SW_SETTINGS_Init
 | 
|---|
| 5368 | return
 | 
|---|
| 5369 | 
 | 
|---|
| 5370 | /*:VRX         SW_SETTINGS_Fini
 | 
|---|
| 5371 | */
 | 
|---|
| 5372 | SW_SETTINGS_Fini:
 | 
|---|
| 5373 |     window = VRInfo( "Window" )
 | 
|---|
| 5374 |     call VRDestroy window
 | 
|---|
| 5375 |     drop window
 | 
|---|
| 5376 | return
 | 
|---|
| 5377 | /*:VRX         SW_SETTINGS_Init
 | 
|---|
| 5378 | */
 | 
|---|
| 5379 | SW_SETTINGS_Init:
 | 
|---|
| 5380 |     /* Title bar */
 | 
|---|
| 5381 |     call NLVSetText "SW_SETTINGS",       "Caption", 47
 | 
|---|
| 5382 | 
 | 
|---|
| 5383 |     /* Options */
 | 
|---|
| 5384 |     call NLVSetText "GB_GLOBAL",         "Caption", 47
 | 
|---|
| 5385 |     call NLVSetText "CB_DEBUG",          "Caption", 42
 | 
|---|
| 5386 |     call NLVSetText "CB_LOGGING",        "Caption", 46
 | 
|---|
| 5387 |     call NLVSetText "CB_BROWSEIMME",     "Caption", 48
 | 
|---|
| 5388 |     call NLVSetText "CB_BROWSEAUTH",     "Caption", 49
 | 
|---|
| 5389 |     call NLVSetText "CB_SPECIAL",        "Caption", 66
 | 
|---|
| 5390 |     call NLVSetText "CB_SAVEPASSIVE",    "Caption", 73
 | 
|---|
| 5391 |     call NLVSetText "CB_LMHOSTS",        "Caption", 133
 | 
|---|
| 5392 |     call NLVSetText "CB_BROADCAST",      "Caption", 74
 | 
|---|
| 5393 |     call NLVSetText "CB_MINIICONS",      "Caption", 70
 | 
|---|
| 5394 |     call NLVSetText "CB_STORECREDS",     "Caption", 135
 | 
|---|
| 5395 | 
 | 
|---|
| 5396 |     /* Buttons */
 | 
|---|
| 5397 |     call NLVSetText "PB_SETTINGS_APPLY",  "Caption", 122
 | 
|---|
| 5398 |     call NLVSetText "PB_SETTINGS_UNDO",   "Caption", 123
 | 
|---|
| 5399 |     call NLVSetText "PB_SETTINGS_HELP",   "Caption", 4
 | 
|---|
| 5400 | 
 | 
|---|
| 5401 | /*  call VRSet "SW_ADVANCED", "HelpTag", NLVGetMessage(40) */
 | 
|---|
| 5402 | 
 | 
|---|
| 5403 | /*  call VRMethod "SW_SETTINGS", "CenterWindow" */
 | 
|---|
| 5404 |     ok = VRSet("SW_SETTINGS", "Visible", 1)
 | 
|---|
| 5405 | /*  call VRMethod "SW_SETTINGS", "Activate" */
 | 
|---|
| 5406 | return
 | 
|---|
| 5407 | 
 | 
|---|
| 5408 | /*:VRX         SW_SETTINGS_Init_Content
 | 
|---|
| 5409 | */
 | 
|---|
| 5410 | SW_SETTINGS_Init_Content:
 | 
|---|
| 5411 |     ok = VRSet("PB_SETTINGS_UNDO","Enabled", 1)
 | 
|---|
| 5412 | 
 | 
|---|
| 5413 |     if advanced.!browseauth  \= ""  then ok = VRSet("CB_BROWSEAUTH", "Set",   advanced.!browseauth)
 | 
|---|
| 5414 |     if advanced.!browseimme  \= ""  then ok = VRSet("CB_BROWSEIMME", "Set",   advanced.!browseimme)
 | 
|---|
| 5415 |     if advanced.!broadcast   \= ""  then ok = VRSet("CB_BROADCAST",  "Set",   advanced.!broadcast)
 | 
|---|
| 5416 |     if advanced.!special     \= ""  then ok = VRSet("CB_SPECIAL",    "Set",   advanced.!special)
 | 
|---|
| 5417 |     if advanced.!savepassive \= ""  then ok = VRSet("CB_SAVEPASSIVE","Set",   advanced.!savepassive)
 | 
|---|
| 5418 |     if advanced.!lmhosts     \= ""  then ok = VRSet("CB_LMHOSTS",    "Set",   advanced.!lmhosts)
 | 
|---|
| 5419 | 
 | 
|---|
| 5420 |     call VRSet "CB_LOGGING", "Set", VRFileExists(SysBootDrive()"\ndpsmb.dbg")
 | 
|---|
| 5421 |     if options.!debug        \= ""  then ok = VRSet("CB_debug",      "Set",   options.!debug)
 | 
|---|
| 5422 |     if options.!storecreds   \= ""  then ok = VRSet("CB_STORECREDS", "Set",   options.!storecreds)
 | 
|---|
| 5423 | 
 | 
|---|
| 5424 |     if advanced.!miniicons   \= ""  then ok = VRSet("CB_MINIICONS",  "Set",   advanced.!miniicons)
 | 
|---|
| 5425 | 
 | 
|---|
| 5426 | /*  if advanced.!logfile     \= ""  then ok = VRSet("EF_LOGFILE",    "Value", advanced.!logfile)     /* Obsolete */
 | 
|---|
| 5427 |     if advanced.!loglevel    \= "0" then ok = VRSet("SPIN_LOG_LEVEL", "Value", advanced.!loglevel) */
 | 
|---|
| 5428 | 
 | 
|---|
| 5429 |     log_level = IniGet('log level', 'global', samba.!smbconf)
 | 
|---|
| 5430 |     call _SmbConfCreateShadowCopy
 | 
|---|
| 5431 | 
 | 
|---|
| 5432 | 
 | 
|---|
| 5433 | say "log level ="log_level
 | 
|---|
| 5434 |     if log_level = "" then log_level = 2
 | 
|---|
| 5435 | say "log level ="log_level
 | 
|---|
| 5436 |     ok = VRSet("SPIN_LOG_LEVEL","Value",log_level)
 | 
|---|
| 5437 | 
 | 
|---|
| 5438 |     wins_support = translate(IniGet('wins support', 'global', samba.!shadowsmbconf))
 | 
|---|
| 5439 | 
 | 
|---|
| 5440 |     if wins_support = "YES" then do /* we are a WINS server ourself */
 | 
|---|
| 5441 |         ok = VRSet("DT_WINS_SERVER","Enabled", 0)
 | 
|---|
| 5442 |         ok = VRSet("EF_WINS_SERVER","BackColor", "PaleGray")
 | 
|---|
| 5443 |         ok = VRSet("EF_WINS_SERVER","Value", "")
 | 
|---|
| 5444 |         ok = VRSet("EF_WINS_SERVER","Enabled", 0)
 | 
|---|
| 5445 |     end
 | 
|---|
| 5446 |     else do
 | 
|---|
| 5447 |         ok = VRSet("EF_WINS_SERVER","Value", IniGet('wins server', 'global', samba.!shadowsmbconf))
 | 
|---|
| 5448 |     end
 | 
|---|
| 5449 | 
 | 
|---|
| 5450 |     name_resolve_order = IniGet('name resolve order', 'global', samba.!shadowsmbconf)
 | 
|---|
| 5451 | 
 | 
|---|
| 5452 |     do I = 1 to words(name_resolve_order)
 | 
|---|
| 5453 |         ok = VRSet("SPIN_NRO"||I, "value", word(name_resolve_order,I))
 | 
|---|
| 5454 |     end
 | 
|---|
| 5455 | 
 | 
|---|
| 5456 |     advanced.!smbconfchanged = 0
 | 
|---|
| 5457 | return
 | 
|---|
| 5458 | 
 | 
|---|
| 5459 | /*:VRX         SW_SMBCONF_Close
 | 
|---|
| 5460 | */
 | 
|---|
| 5461 | SW_SMBCONF_Close:
 | 
|---|
| 5462 |     call SW_SMBCONF_Fini
 | 
|---|
| 5463 | return
 | 
|---|
| 5464 | 
 | 
|---|
| 5465 | /*:VRX         SW_SMBCONF_Create
 | 
|---|
| 5466 | */
 | 
|---|
| 5467 | SW_SMBCONF_Create:
 | 
|---|
| 5468 |     call SW_SMBCONF_Init
 | 
|---|
| 5469 | return
 | 
|---|
| 5470 | 
 | 
|---|
| 5471 | /*:VRX         SW_SMBCONF_Fini
 | 
|---|
| 5472 | */
 | 
|---|
| 5473 | SW_SMBCONF_Fini:
 | 
|---|
| 5474 |     window = VRInfo( "Window" )
 | 
|---|
| 5475 |     call VRDestroy window
 | 
|---|
| 5476 |     drop window
 | 
|---|
| 5477 | return
 | 
|---|
| 5478 | /*:VRX         SW_SMBCONF_Init
 | 
|---|
| 5479 | */
 | 
|---|
| 5480 | SW_SMBCONF_Init:
 | 
|---|
| 5481 | 
 | 
|---|
| 5482 |     /* Buttons */
 | 
|---|
| 5483 |     call NLVSetText "PB_SMBCONF_APPLY",  "Caption", 122
 | 
|---|
| 5484 |     call NLVSetText "PB_SMBCONF_UNDO",   "Caption", 123
 | 
|---|
| 5485 |     call NLVSetText "PB_SMBCONF_HELP",   "Caption", 4
 | 
|---|
| 5486 | 
 | 
|---|
| 5487 | return
 | 
|---|
| 5488 | 
 | 
|---|
| 5489 | /*:VRX         SW_SMBCONF_Init_Content
 | 
|---|
| 5490 | */
 | 
|---|
| 5491 | SW_SMBCONF_Init_Content:
 | 
|---|
| 5492 |     call _SmbConfCreateShadowCopy
 | 
|---|
| 5493 | 
 | 
|---|
| 5494 |     client_NTLMv2_auth          = ZeroOne(IniGet('client NTLMv2 auth', 'global', samba.!shadowsmbconf))
 | 
|---|
| 5495 |     if client_NTLMv2_auth = 1 then do
 | 
|---|
| 5496 |         ok = VRSet("CB_client_NTLMv2_auth","Set",client_NTLMv2_auth)
 | 
|---|
| 5497 |         ok = VRSet("CB_client_lanman_auth","Enabled", 0)
 | 
|---|
| 5498 |         ok = VRSet("CB_client_plaintext_auth","Enabled", 0)
 | 
|---|
| 5499 |     end
 | 
|---|
| 5500 |     else do
 | 
|---|
| 5501 |         client_lanman_auth          = ZeroOne(IniGet('client lanman auth', 'global', samba.!shadowsmbconf))
 | 
|---|
| 5502 |         client_plaintext_auth       = ZeroOne(IniGet('client plaintext auth', 'global', samba.!shadowsmbconf))
 | 
|---|
| 5503 |         ok = VRSet("CB_client_lanman_auth","Set",client_lanman_auth)
 | 
|---|
| 5504 |         ok = VRSet("CB_client_plaintext_auth","Set",client_plaintext_auth)
 | 
|---|
| 5505 |     end
 | 
|---|
| 5506 | 
 | 
|---|
| 5507 |     client_use_spnego           = ZeroOne(IniGet('client use spnego', 'global', samba.!shadowsmbconf))
 | 
|---|
| 5508 |     ok = VRSet("CB_client_use_spnego","Set",client_use_spnego)
 | 
|---|
| 5509 | 
 | 
|---|
| 5510 |     client_use_spnego_principal = ZeroOne(IniGet('client use spnego principal', 'global', samba.!shadowsmbconf))
 | 
|---|
| 5511 |     ok = VRSet("CB_client_use_spnego_principal","Set",client_use_spnego_principal)
 | 
|---|
| 5512 | 
 | 
|---|
| 5513 |     client_max_protocol         = IniGet('client max protocol', 'global', samba.!shadowsmbconf)
 | 
|---|
| 5514 |     if client_max_protocol = "" then do
 | 
|---|
| 5515 |      /* ok = VRSet("SPIN_client_max_protocol","Enabled", 0)
 | 
|---|
| 5516 |         ok = VRSet("DT_client_max_protocol","Enabled", 0) */
 | 
|---|
| 5517 |     end
 | 
|---|
| 5518 |     else ok = VRSet("SPIN_client_max_protocol","Value",client_max_protocol)
 | 
|---|
| 5519 | 
 | 
|---|
| 5520 |     client_min_protocol         = IniGet('client min protocol', 'global', samba.!shadowsmbconf)
 | 
|---|
| 5521 |     if client_min_protocol = "" then do
 | 
|---|
| 5522 |      /* ok = VRSet("SPIN_client_min_protocol","Enabled", 0)
 | 
|---|
| 5523 |         ok = VRSet("DT_client_min_protocol","Enabled", 0) */
 | 
|---|
| 5524 |     end
 | 
|---|
| 5525 |     else ok = VRSet("SPIN_client_min_protocol","Value",client_min_protocol)
 | 
|---|
| 5526 | 
 | 
|---|
| 5527 |     client_signing         = IniGet('client signing', 'global', samba.!shadowsmbconf)
 | 
|---|
| 5528 |     client_ipc_signing     = IniGet('client ipc signing', 'global', samba.!shadowsmbconf)
 | 
|---|
| 5529 | say "client_signing ="client_signing
 | 
|---|
| 5530 |     ok = VRSet("SPIN_client_signing","Value",client_signing)
 | 
|---|
| 5531 |     ok = VRSet("SPIN_client_ipc_signing","Value",client_signing)
 | 
|---|
| 5532 | 
 | 
|---|
| 5533 |     advanced.!smbconfchanged = 0
 | 
|---|
| 5534 | return
 | 
|---|
| 5535 | 
 | 
|---|
| 5536 | /*:VRX         SW_SMBTREE_Close
 | 
|---|
| 5537 | */
 | 
|---|
| 5538 | SW_SMBTREE_Close:
 | 
|---|
| 5539 |     call SW_SMBTREE_Fini
 | 
|---|
| 5540 | return
 | 
|---|
| 5541 | 
 | 
|---|
| 5542 | /*:VRX         SW_SMBTREE_Create
 | 
|---|
| 5543 | */
 | 
|---|
| 5544 | SW_SMBTREE_Create:
 | 
|---|
| 5545 |     call SW_SMBTREE_Init
 | 
|---|
| 5546 | return
 | 
|---|
| 5547 | 
 | 
|---|
| 5548 | /*:VRX         SW_SMBTREE_Fini
 | 
|---|
| 5549 | */
 | 
|---|
| 5550 | SW_SMBTREE_Fini:
 | 
|---|
| 5551 |     window = VRInfo( "Window" )
 | 
|---|
| 5552 |     call VRDestroy window
 | 
|---|
| 5553 |     drop window
 | 
|---|
| 5554 | return
 | 
|---|
| 5555 | /*:VRX         SW_SMBTREE_Init
 | 
|---|
| 5556 | */
 | 
|---|
| 5557 | SW_SMBTREE_Init:
 | 
|---|
| 5558 | 
 | 
|---|
| 5559 | return
 | 
|---|
| 5560 | 
 | 
|---|
| 5561 | /*:VRX         SW_SMBTREE_Init_Content
 | 
|---|
| 5562 | */
 | 
|---|
| 5563 | SW_SMBTREE_Init_Content:
 | 
|---|
| 5564 |     if VRGet("TM_Throbber","Enabled") = 1 then ok = VRset("Pict_Throbber", "Visible", 1)
 | 
|---|
| 5565 | 
 | 
|---|
| 5566 |     /* Hide any "foreign" menu entries */
 | 
|---|
| 5567 |     ok = VRSet("Menu_Selected_Remove", "Visible", 0)
 | 
|---|
| 5568 |     ok = VRSet("Menu_Selected_Retry",  "Visible", 0)
 | 
|---|
| 5569 | return
 | 
|---|
| 5570 | 
 | 
|---|
| 5571 | /*:VRX         TDL_1_PageSelected
 | 
|---|
| 5572 | */
 | 
|---|
| 5573 | TDL_1_PageSelected:
 | 
|---|
| 5574 |     page =  VRInfo("Page")
 | 
|---|
| 5575 | 
 | 
|---|
| 5576 |     /* call _TabsStrip */
 | 
|---|
| 5577 |     select
 | 
|---|
| 5578 |         when page = 1 then do /* dialog */
 | 
|---|
| 5579 |             call _TabFix 1
 | 
|---|
| 5580 |         end
 | 
|---|
| 5581 |         when page = 2 then do /* advanced */
 | 
|---|
| 5582 |             call SW_ADVANCED_Init_Content
 | 
|---|
| 5583 |         end
 | 
|---|
| 5584 |         when page = 3 then do /* smbtree */
 | 
|---|
| 5585 |             call SW_SMBTREE_Init_Content
 | 
|---|
| 5586 |         end
 | 
|---|
| 5587 |         when page = 4 then do /* condet */
 | 
|---|
| 5588 |             call SW_CONDET_Init_Content
 | 
|---|
| 5589 |         end
 | 
|---|
| 5590 |         when page = 5 then do /* Settings */
 | 
|---|
| 5591 |             call SW_SETTINGS_Init_Content
 | 
|---|
| 5592 |         end
 | 
|---|
| 5593 |         when page = 6 then do /* SMB.CONF */
 | 
|---|
| 5594 |             call SW_SMBCONF_Init_Content
 | 
|---|
| 5595 |         end
 | 
|---|
| 5596 |         otherwise nop
 | 
|---|
| 5597 |     end
 | 
|---|
| 5598 | return
 | 
|---|
| 5599 | /*:VRX         TM_AutoClose_Trigger
 | 
|---|
| 5600 | */
 | 
|---|
| 5601 | TM_AutoClose_Trigger:
 | 
|---|
| 5602 |     call Quit
 | 
|---|
| 5603 | return
 | 
|---|
| 5604 | 
 | 
|---|
| 5605 | /*:VRX         TM_Progress_Throbber_Trigger
 | 
|---|
| 5606 | */
 | 
|---|
| 5607 | TM_Progress_Throbber_Trigger:
 | 
|---|
| 5608 |     pIdx = VRGet("Pict_Progress_Throbber","PicturePath")
 | 
|---|
| 5609 |     parse var pIdx '#' pidx
 | 
|---|
| 5610 |     pidx = pidx + 1
 | 
|---|
| 5611 |     if pidx = 23 then pidx = 11
 | 
|---|
| 5612 |     ok = VRSet("Pict_Progress_Throbber","PicturePath","#"pidx)
 | 
|---|
| 5613 | return
 | 
|---|
| 5614 | 
 | 
|---|
| 5615 | /*:VRX         TM_RefreshCurrentDisplay_Trigger
 | 
|---|
| 5616 | */
 | 
|---|
| 5617 | TM_RefreshCurrentDisplay_Trigger:
 | 
|---|
| 5618 |     if RefreshMode <> "" then return
 | 
|---|
| 5619 |     if _DaemonRunning() = 0 then do
 | 
|---|
| 5620 |         say "  Daemon not running - disable GUI"
 | 
|---|
| 5621 |         ok = VRset("GB_CURRENT",            "Enabled", 0)
 | 
|---|
| 5622 |         ok = VRset("TDL_1",                 "Enabled", 0)
 | 
|---|
| 5623 |         ok = VRSet("Menu_File_Daemon_Start","Enabled", 1)
 | 
|---|
| 5624 |         ok = VRSet("Menu_File_Daemon_Stop", "Enabled", 0)
 | 
|---|
| 5625 |     end
 | 
|---|
| 5626 |     else do
 | 
|---|
| 5627 |         say "  Daemon running - enable GUI"
 | 
|---|
| 5628 |         ok = VRset("GB_CURRENT",            "Enabled", 1)
 | 
|---|
| 5629 |         ok = VRset("TDL_1",                 "Enabled", 1)
 | 
|---|
| 5630 |         ok = VRSet("Menu_File_Daemon_Start","Enabled", 0)
 | 
|---|
| 5631 |         ok = VRSet("Menu_File_Daemon_Stop", "Enabled", 1)
 | 
|---|
| 5632 |     end
 | 
|---|
| 5633 |     CALL REFRESH
 | 
|---|
| 5634 | return
 | 
|---|
| 5635 | 
 | 
|---|
| 5636 | /*:VRX         TM_RefreshTreeDisplay_Trigger
 | 
|---|
| 5637 | */
 | 
|---|
| 5638 | TM_RefreshTreeDisplay_Trigger:
 | 
|---|
| 5639 |     ShowHidden = advanced.!special
 | 
|---|
| 5640 |     BroadCast  = advanced.!broadcast
 | 
|---|
| 5641 |     DoLMHosts  = advanced.!lmhosts
 | 
|---|
| 5642 | 
 | 
|---|
| 5643 |     select
 | 
|---|
| 5644 |         when RefreshMode = "TREE" then do
 | 
|---|
| 5645 |             call _RefreshTreeDisplay
 | 
|---|
| 5646 | 
 | 
|---|
| 5647 |             if smbtree.!workgroup <> 'SMBTREE.!WORKGROUP' then do
 | 
|---|
| 5648 |                 ok = VRset("Menu_Selected_Connect", "Visible", VRMethod("CN_SMBTREE", "ValidateRecord", smbtree.!workgroup ) )
 | 
|---|
| 5649 |             end
 | 
|---|
| 5650 |         end
 | 
|---|
| 5651 |         when RefreshMode = "SHARE" then do
 | 
|---|
| 5652 |             call _AddSharesDisplay
 | 
|---|
| 5653 |         end
 | 
|---|
| 5654 |         otherwise say "RefreshMode = "RefreshMode
 | 
|---|
| 5655 |     end
 | 
|---|
| 5656 |     call _DialogPopulate
 | 
|---|
| 5657 | return
 | 
|---|
| 5658 | 
 | 
|---|
| 5659 | /*:VRX         TM_STATUSBAR_Trigger
 | 
|---|
| 5660 | */
 | 
|---|
| 5661 | TM_STATUSBAR_Trigger:
 | 
|---|
| 5662 |     call _StatusbarReset
 | 
|---|
| 5663 | return
 | 
|---|
| 5664 | 
 | 
|---|
| 5665 | /*:VRX         TM_TheCloser_Trigger
 | 
|---|
| 5666 | */
 | 
|---|
| 5667 | TM_TheCloser_Trigger:
 | 
|---|
| 5668 |     call SW_PROGRESS_Close
 | 
|---|
| 5669 | return
 | 
|---|
| 5670 | 
 | 
|---|
| 5671 | /*:VRX         TM_Throbber_Trigger
 | 
|---|
| 5672 | */
 | 
|---|
| 5673 | TM_Throbber_Trigger:
 | 
|---|
| 5674 |     pIdx = VRGet("Pict_Throbber","PicturePath")
 | 
|---|
| 5675 |     parse var pIdx '#' pidx
 | 
|---|
| 5676 |     pidx = pidx + 1
 | 
|---|
| 5677 |     if pidx = 23 then pidx = 11
 | 
|---|
| 5678 |     ok = VRSet("Pict_Throbber","PicturePath","#"pidx)
 | 
|---|
| 5679 | return
 | 
|---|
| 5680 | 
 | 
|---|
| 5681 | /*:VRX         YesNo
 | 
|---|
| 5682 | */
 | 
|---|
| 5683 | YesNo: procedure
 | 
|---|
| 5684 |     if arg(1) = 1 then answer = "Yes"
 | 
|---|
| 5685 |                   else answer = "No"
 | 
|---|
| 5686 | return answer
 | 
|---|
| 5687 | 
 | 
|---|
| 5688 | /*:VRX         ZeroOne
 | 
|---|
| 5689 | */
 | 
|---|
| 5690 | ZeroOne: procedure
 | 
|---|
| 5691 |     if translate(arg(1)) = "YES" then answer = 1
 | 
|---|
| 5692 |                                  else answer = 0
 | 
|---|
| 5693 | return answer
 | 
|---|