source: trunk/guitools/evfsgui/evfsgui.vrx@ 662

Last change on this file since 662 was 662, checked in by Herwig Bauernfeind, 14 years ago

GUI-Tools: EVFSGUI 2.5.x: Start implementing server based logon script support

File size: 187.8 KB
Line 
1/*:VRX Main
2*/
3/* Main
4*/
5Main:
6/* Process the arguments.
7 Get the parent window.
8*/
9 parse source . calledAs .
10 parent = ""
11 argCount = arg()
12 argOff = 0
13 if( calledAs \= "COMMAND" )then do
14 if argCount >= 1 then do
15 parent = arg(1)
16 argCount = argCount - 1
17 argOff = 1
18 end
19 end; else do
20 call VROptions 'ImplicitNames'
21 call VROptions 'NoEchoQuit'
22 end
23 InitArgs.0 = argCount
24 if( argCount > 0 )then do i = 1 to argCount
25 InitArgs.i = arg( i + argOff )
26 end
27 drop calledAs argCount argOff
28
29/* Load the windows
30*/
31 call VRInit
32 parse source . . spec
33 _VREPrimaryWindowPath = ,
34 VRParseFileName( spec, "dpn" ) || ".VRW"
35 _VREPrimaryWindow = ,
36 VRLoad( parent, _VREPrimaryWindowPath )
37 drop parent spec
38 if( _VREPrimaryWindow == "" )then do
39 call VRMessage "", "Cannot load window:" VRError(), ,
40 "Error!"
41 _VREReturnValue = 32000
42 signal _VRELeaveMain
43 end
44
45/* Process events
46*/
47 call Init
48 signal on halt
49 do while( \ VRGet( _VREPrimaryWindow, "Shutdown" ) )
50 _VREEvent = VREvent()
51 interpret _VREEvent
52 end
53_VREHalt:
54 _VREReturnValue = Fini()
55 call VRDestroy _VREPrimaryWindow
56_VRELeaveMain:
57 call VRFini
58exit _VREReturnValue
59
60VRLoadSecondary:
61 __vrlsWait = abbrev( 'WAIT', translate(arg(2)), 1 )
62 if __vrlsWait then do
63 call VRFlush
64 end
65 __vrlsHWnd = VRLoad( VRWindow(), VRWindowPath(), arg(1) )
66 if __vrlsHWnd = '' then signal __vrlsDone
67 if __vrlsWait \= 1 then signal __vrlsDone
68 call VRSet __vrlsHWnd, 'WindowMode', 'Modal'
69 __vrlsTmp = __vrlsWindows.0
70 if( DataType(__vrlsTmp) \= 'NUM' ) then do
71 __vrlsTmp = 1
72 end
73 else do
74 __vrlsTmp = __vrlsTmp + 1
75 end
76 __vrlsWindows.__vrlsTmp = VRWindow( __vrlsHWnd )
77 __vrlsWindows.0 = __vrlsTmp
78 do while( VRIsValidObject( VRWindow() ) = 1 )
79 __vrlsEvent = VREvent()
80 interpret __vrlsEvent
81 end
82 __vrlsTmp = __vrlsWindows.0
83 __vrlsWindows.0 = __vrlsTmp - 1
84 call VRWindow __vrlsWindows.__vrlsTmp
85 __vrlsHWnd = ''
86__vrlsDone:
87return __vrlsHWnd
88
89/*:VRX __VXREXX____APPENDS__
90*/
91__VXREXX____APPENDS__:
92/*
93#append U:\Develop\Samba\trunk\guitools\shared\cltinit.vrs
94#append U:\Develop\Samba\trunk\guitools\shared\inittempdir.vrs
95#append U:\Develop\Samba\trunk\guitools\shared\nlv.vrs
96#append U:\Develop\Samba\trunk\guitools\shared\rexx_md5.vrs
97#append U:\Develop\Samba\trunk\guitools\shared\smbtree.vrs
98#append U:\Develop\Samba\trunk\guitools\shared\textini.vrs
99#append U:\Develop\Samba\trunk\guitools\shared\usercredmem.vrs
100#append U:\Develop\Samba\trunk\guitools\shared\rxrpclib.vrs
101*/
102return
103/*:VRX _AboutSambaClientGetInfo
104*/
105_AboutSambaClientGetInfo:
106 call VRSet "SW_ABOUT", "Painting", 0
107 if VRGet("CB_TRAC","set") then BR = '[[BR]]'
108 else BR = ''
109
110 ok = VRMethod( "CN_About", "RemoveRecord", "All" )
111
112 /* Filesystem version */
113 DummyRH = VRMethod('CN_About', 'AddRecord')
114 ok = VRMethod("CN_ABOUT", "SetFieldData", DummyRH, About.DscFH, "File system", About.ValFH, fs.!name' Version 'fs.!version)
115 ABoutStr = "Samba Client Versions:"||BR
116 AboutStr = AboutStr||'0D0A'x||"File system "||fs.!name' Version 'fs.!version||BR
117 plugindll. =""
118
119 address cmd 'look4dll.exe ndpsmb.dll >'samba.!msg
120 if RC <> 0 then do
121 /* Plugin */
122 NDFSDir = value("NDFSDIR",,"OS2ENVIRONMENT")
123 if NDFSDir = "" then NDFSDir = SysBootDrive()'\ecs\dll'
124 ok = SysFileTree(NDFSDir'\ndpsmb.dll', "plugindll.", 'FOS')
125 end
126 else do
127 pluginline = linein(samba.!msg)
128 ok = stream(samba.!msg,'c','close')
129 ok = SysFileDelete(samba.!msg)
130 parse var pluginline . 'loaded ' pluginline
131 NDFSDir = VRParseFileName(pluginline,"DP")
132 plugindll.0 = 1
133 plugindll.1 = pluginline
134 end
135
136 if plugindll.0 > 0 then do
137 do J = 1 to plugindll.0
138 DummyRH.1 = VRMethod('CN_About', 'AddRecord')
139 ok = VRMethod("CN_ABOUT", "SetFieldData", DummyRH.1, About.DscFH, "Plugin file", About.ValFH, plugindll.J)
140 AboutStr = AboutStr||'0D0A'x||"Plugin file "plugindll.J||BR
141
142 address cmd 'bldlevel.exe 'plugindll.J' >'samba.!msg
143
144 I = 0
145 Dummy = linein(samba.!msg)
146 say Dummy
147 Dummy = linein(samba.!msg)
148 say Dummy
149 Dummy = linein(samba.!msg)
150 say Dummy
151 do until lines(samba.!msg) = 0
152 I = I + 1
153 line.I = linein(samba.!msg)
154 if pos('has no LAN component-style version string', line.I) > 0 then do
155 DummyRH = VRMethod('CN_About', 'AddRecord')
156 ok = VRMethod("CN_ABOUT", "SetFieldData", DummyRH, About.DscFH, "Error", About.ValFH, "Plugin has no LAN component-style version string")
157 leave
158 end
159 else do
160 parse var line.I desc':'vers
161 DummyRH = VRMethod('CN_About', 'AddRecord')
162 ok = VRMethod("CN_ABOUT", "SetFieldData", DummyRH, About.DscFH, "Plugin "Desc, About.ValFH, strip(Vers))
163 AboutStr = AboutStr||'0D0A'x||"Plugin "Desc" "strip(Vers)||BR
164 end
165 end
166 line.0 = I
167 ok = stream(samba.!msg,'c','close')
168 ok = SysFileDelete(samba.!msg)
169 end
170 end
171 else do
172 DummyRH = VRMethod('CN_About', 'AddRecord')
173 ok = VRMethod("CN_ABOUT", "SetFieldData", DummyRH, About.DscFH, "Plugin", About.ValFH, "Not found!")
174 AboutStr = AboutStr||'0D0A'x||"Plugin not found!"||BR
175 end
176
177 /* Commandline utilities */
178 address cmd samba.!smbclientexe' -V >'samba.!msg
179 ClutVer = linein(samba.!msg)
180 ok = stream(samba.!msg,'c','close')
181 ok = SysFileDelete(samba.!msg)
182
183 DummyRH = VRMethod('CN_About', 'AddRecord')
184 ok = VRMethod("CN_ABOUT", "SetFieldData", DummyRH, About.DscFH, "Commandline utility path", About.ValFH, VRParseFileName(samba.!smbclientexe,"DP"))
185
186 DummyRH = VRMethod('CN_About', 'AddRecord')
187 ok = VRMethod("CN_ABOUT", "SetFieldData", DummyRH, About.DscFH, "Commandline utilities", About.ValFH, ClutVer)
188 AboutStr = AboutStr||'0D0A'x||"Commandline utilities "||ClutVer||BR
189
190 /* GUI Version */
191 DummyRH = VRMethod('CN_About', 'AddRecord')
192 ok = VRMethod("CN_ABOUT", "SetFieldData", DummyRH, About.DscFH, "EVFSGUI", About.ValFH, VRGet("Main", "HintText"))
193 AboutStr = AboutStr||'0D0A'x||"EVFSGUI"||VRGet("Main", "HintText")||BR
194 call VRSet "SW_ABOUT", "Painting", 1
195return
196
197/*:VRX _AddTemplates
198*/
199_AddTemplates:
200 VolTplRH = VRMethod("CN_CURRENT", 'AddRecord', , 'First', 'Volume template', icons.!template )
201 MpTplRH = VRMethod("CN_CURRENT", 'AddRecord', VolTplRH, 'First', 'Mountpoint template', icons.!template )
202return
203
204/*:VRX _BrowseBuildPath
205*/
206_BrowseBuildPath: procedure expose options. icons. sharerh
207 IF options.!debug == 1 THEN SAY time()' _BrowseBuildPath started'
208 rh = arg(1)
209
210 finished = 0
211 BrowsePathStr = ''
212
213 do while \finished
214 parentrh = VRMethod("CN_SMBTREE","GetRecordAttr",rh,"Parent")
215 resname = VRMethod("CN_SMBTREE","GetRecordAttr",rh,"caption")
216 userdata = VRMethod("CN_SMBTREE","GetRecordAttr",rh,"userdata")
217 parse var userdata udatatype '|' udatamsg
218 parse var resname resname '0D0A'x .
219 resname = strip(resname)
220 /* say " Not connected - cannot open!" */
221 select
222 when udatatype = "SERVER" then do
223 BrowsePathStr = '\\'resname'\'BrowsePathStr
224 finished = 1
225 end
226 when udatatype = "DISK" then do
227 BrowsePathStr = resname'\'BrowsePathStr
228 sharerh =rh
229 rh = parentrh
230 end
231 otherwise do
232 BrowsePathStr = resname'\'BrowsePathStr
233 rh = parentrh
234 end
235 end
236 /* say ' BrowsePathStr = "'BrowsePathStr'"' */
237 end
238 BrowsePathStr = strip(BrowsePathStr,'T','\')
239 IF options.!debug == 1 THEN SAY time()' _BrowseBuildPath done, returning "'BrowsePathStr'"'
240return BrowsePathStr
241
242/*:VRX _BrowseDirectory
243*/
244_BrowseDirectory: /* This must not be a procedure */
245 IF options.!debug == 1 THEN SAY time()' _BrowseDirectory started'
246
247 /* Turn off painting */
248 ok = VRSet("CN_SMBTREE","Painting", 0 )
249 call VRSet VRWindow(), 'Pointer', 'Wait'
250
251 /* Make sure credentials are usable */
252 if UserCred = 'USERCRED' | UserCred = '' | UserCred = '--user=%' then UserCred = '-N'
253
254 say ' 'samba.!smbclientexe' \\'machine'\'sharename' 'UserCred' --command="dir 'browsepath'"'
255 address cmd samba.!smbclientexe' \\'machine'\'sharename' 'UserCred' --command="dir 'browsepath'" 'debuglevel' 2>NUL 1>'samba.!msg
256
257 if UserCred = '-N' then UserCred = ''
258
259 I = 0
260 ok = VRSet("DT_STATUSBAR","Caption", "")
261 do until lines(samba.!msg) = 0
262 infoline = linein(samba.!msg)
263 select
264 when pos('blocks',infoline) > 0 then do /* Last line */
265 /* we should handle size information here */
266 iterate
267 end
268 when I = 0 & length(infoline) > 0 & left(infoline,2) <> " " then do /* Login message */
269 say ' Login message "'Infoline'"'
270 ok = VRMethod("CN_SMBTREE", "SetRecordAttr", SMBObj.rh, "Userdata", SMBObj.udatatype'|'infoline )
271 ok = VRSet("DT_STATUSBAR","Caption", infoline)
272 end
273 when left(infoline,2) = " " & length(infoline) > 0 then do /* file or DIR */
274 wn = words(infoline)
275 fyear = word(infoline,wn)
276 ftime = word(infoline,wn-1)
277 fday = word(infoline,wn-2)
278 fmonth = word(infoline,wn-3)
279 fwday = word(infoline,wn-4)
280 pos_attr = pos(fwday,infoline)-16
281 fsize = word(infoline,wn-5)
282 fattr = substr(infoline,pos_attr,6)
283 fname = strip( substr(infoline,3,pos_attr-3))
284 if fname = '.' | fname = '..' then iterate /* we do not display these */
285 if pos('H',fattr) > 0 then iterate /* we do not display hidden files */
286 if pos('S',fattr) > 0 then iterate /* we do not display system files */
287 I = I + 1
288 fh.I = VRMethod( "CN_SMBTREE", "AddRecord", SMBObj.rh, , fname)
289 if pos('D',fattr) = 0 then do
290 Ext = translate(VRParseFIleName(fname,'E'))
291 select
292 when Ext = 'EXE' then ficon = icons.!exe /* executable */
293 when Ext = 'CMD' then ficon = icons.!cmd /* OS/2 or NT batch */
294 when Ext = 'BAT' then ficon = icons.!bat /* DOS batch */
295 when Ext = 'PDF' then ficon = icons.!pdf /* PDF document */
296 when wordpos(Ext, 'XLS SXC ODS') > 0 then ficon = icons.!spreadsheet
297 when wordpos(Ext, 'DOC SXW ODT') > 0 then ficon = icons.!textdocument
298 when wordpos(Ext, 'FW2 FW3 FW4') > 0 then ficon = icons.!framework
299 when wordpos(Ext, 'JPG BMP PNG GIF TIF') > 0 then ficon = icons.!image
300 when wordpos(Ext, 'AVI MPG FLV WMV') > 0 then ficon = icons.!movie
301 when wordpos(Ext, 'WAV MP3 OGG MID') > 0 then ficon = icons.!sound
302 when wordpos(Ext, 'WPI') > 0 then ficon = icons.!warpin
303 when wordpos(Ext, 'ZIP') > 0 then ficon = icons.!zip
304 when wordpos(Ext, 'INF HLP') > 0 then ficon = icons.!view
305 when wordpos(Ext, 'TXT') > 0 then ficon = icons.!paintext
306 otherwise ficon = icons.!defaultfile /* default file icon */
307 end
308 ftype = 'FILE'
309 end
310 else do
311 ficon = icons.!folder
312 ftype = 'DIRECTORY'
313 end
314
315 ok = VRmethod("CN_SMBTREE", "SetRecordAttr", fh.I, "userdata", ftype'|'fsize' Bytes 'fday'-'fmonth'-'fyear' 'ftime,'icon',Ficon)
316
317 end
318 otherwise nop /* no other line type */
319 end
320 end
321 if I > 0 then ok = VRMethod("CN_SMBTREE","SetRecordAttr",SMBObj.rh, "Icon", icons.!folder_open)
322 ok = stream(samba.!msg,'c','close')
323 ok = SysFileDelete(samba.!msg)
324
325 ok = VRMethod( "CN_SMBTREE", "SetRecordAttr", SMBObj.rh,"Collapsed", 0)
326 /* Turn on painting */
327 call VRSet VRWindow(), 'Pointer', '<default>'
328 ok = VRSet("CN_SMBTREE","Painting", 1 )
329 IF options.!debug == 1 THEN SAY time()' _BrowseDirectory done'
330return
331
332/*:VRX _BrowseObjectOpen
333*/
334_BrowseObjectOpen: procedure expose options. cd. icons.
335 machine = arg(1)
336 sharename = arg(2)
337 browsepath = arg(3)
338
339 CALL VRMethod "CN_CONDET", 'GetRecordList', 'All', 'records.'
340
341 OpenOk = 0
342
343 DO i = 1 TO records.0
344 if VRMethod( "CN_CONDET", "GetFieldData", records.i, CD.StatusFH) = icons.!active then do
345 IF options.!debug == 1 THEN SAY ' 'VRMethod( "CN_CONDET", "GetFieldData", records.i, CD.StatusFH)' 'VRMethod( "CN_CONDET", "GetFieldData", records.i, CD.MPointFH)' 'VRMethod( "CN_CONDET", "GetFieldData", records.i, CD.ServerFH)' 'VRMethod( "CN_CONDET", "GetFieldData", records.i, CD.ShareFH)
346 if machine = VRMethod( "CN_CONDET", "GetFieldData", records.i, CD.ServerFH) &,
347 sharename = VRMethod( "CN_CONDET", "GetFieldData", records.i, CD.ShareFH) then do
348 Object = strip(VRMethod( "CN_CONDET", "GetFieldData", records.i, CD.MPointFH),'T','\')'\'browsepath
349 IF options.!debug == 1 THEN SAY ' Non UNC object: "'Object'"'
350 ID = VRMethod( "Application", "StartThread", "wps_open", Object, "DEFAULT" )
351 OpenOK = 1
352 end
353 end
354 if OpenOK = 1 then leave
355 end
356return OpenOK
357
358/*:VRX _BrowseResetObject
359*/
360_BrowseResetObject: procedure
361 ok = VRSet("CN_SMBTREE","Painting", 0 )
362 rh = arg(1)
363
364 /* Remove all files and directories whose parent is our share */
365 ok = VRMethod( "CN_SMBTREE", "GetRecordList", "All", "AllRH." )
366 do I = 1 to AllRH.0
367 AllParentRH = VRMethod("CN_SMBTREE","GetRecordAttr",AllRH.I,"Parent")
368 if AllParentRH = rh then ok = VRMethod( "CN_SMBTREE", "RemoveRecord", AllRH.I )
369 end
370 ok = VRSet("CN_SMBTREE","Painting", 1 )
371return
372
373/*:VRX _ContainersInit
374*/
375_ContainersInit:
376 IF options.!debug == 1 THEN SAY time()' _ContainersInit started'
377 /* Connection details */
378 CD.StatusFH = VRMethod( "CN_CONDET", "AddField", "Icon", "Status" )
379 CD.mpointFH = VRMethod( "CN_CONDET", "AddField", "String", "mpoint" )
380 CD.mpidxFH = VRMethod( "CN_CONDET", "AddField", "String", "index" )
381 CD.workgroupFH = VRMethod( "CN_CONDET", "AddField", "String", "workgroup" )
382 CD.serverFH = VRMethod( "CN_CONDET", "AddField", "String", "server" )
383 CD.shareFH = VRMethod( "CN_CONDET", "AddField", "String", "share" )
384 CD.userFH = VRMethod( "CN_CONDET", "AddField", "String", "user" )
385 CD.passwordFH = VRMethod( "CN_CONDET", "AddField", "String", "password" )
386 CD.spasswordFH = VRMethod( "CN_CONDET", "AddField", "String", "spassword" )
387 CD.masterFH = VRMethod( "CN_CONDET", "AddField", "String", "master" )
388 CD.mtypeFH = VRMethod( "CN_CONDET", "AddField", "String", "mastertype" )
389 CD.memlenFH = VRMethod( "CN_CONDET", "AddField", "String", "memlen" )
390 CD.easupportFH = VRMethod( "CN_CONDET", "AddField", "String", "easupport" )
391 CD.logfileFH = VRMethod( "CN_CONDET", "AddField", "String", "logfile" )
392 CD.loglevelFH = VRMethod( "CN_CONDET", "AddField", "String", "loglevel" )
393 CD.rwFH = VRMethod( "CN_CONDET", "AddField", "String", "readonly" )
394 CD.ctoFH = VRMethod( "CN_CONDET", "AddField", "String", "cachetimeout" )
395 CD.cldFH = VRMethod( "CN_CONDET", "AddField", "String", "cachelistings" )
396 CD.hashFH = VRMethod( "CN_CONDET", "AddField", "String", "hash" )
397
398 /* Connection details */
399 ok = VRMethod("CN_CONDET", "SetFieldAttr", cd.mpidxfh , "Visible", 0)
400 ok = VRMethod("CN_CONDET", "SetFieldAttr", cd.passwordfh , "Visible", 0)
401 ok = VRMethod("CN_CONDET", "SetFieldAttr", cd.spasswordfh , "Visible", 0)
402 ok = VRMethod("CN_CONDET", "SetFieldAttr", cd.masterFH , "Visible", 0)
403 ok = VRMethod("CN_CONDET", "SetFieldAttr", cd.mtypeFH , "Visible", 0)
404 ok = VRMethod("CN_CONDET", "SetFieldAttr", cd.memlenfh , "Visible", 0)
405 ok = VRMethod("CN_CONDET", "SetFieldAttr", cd.logfilefh , "Visible", 0)
406 ok = VRMethod("CN_CONDET", "SetFieldAttr", cd.loglevelfh , "Visible", 0)
407 ok = VRMethod("CN_CONDET", "SetFieldAttr", cd.hashfh , "Visible", 0)
408
409 ok = VRSet("CN_CONDET", "DetailSort", cd.mpointfh )
410
411 /* NLV columns */
412 ok = VRMethod("CN_CONDET", "SetFieldAttr", cd.statusfh , "Title", strip(NLVGetMessage(67),"T",":"))
413 ok = VRMethod("CN_CONDET", "SetFieldAttr", cd.mpointfh , "Title", strip(NLVGetMessage(27),"T",":"))
414 ok = VRMethod("CN_CONDET", "SetFieldAttr", cd.workgroupfh , "Title", strip(NLVGetMessage(21),"T",":"))
415 ok = VRMethod("CN_CONDET", "SetFieldAttr", cd.serverFH , "Title", strip(NLVGetMessage(19),"T",":"))
416 ok = VRMethod("CN_CONDET", "SetFieldAttr", cd.shareFH , "Title", strip(NLVGetMessage(20),"T",":"))
417 ok = VRMethod("CN_CONDET", "SetFieldAttr", cd.userFH , "Title", strip(NLVGetMessage(25),"T",":"))
418 ok = VRMethod("CN_CONDET", "SetFieldAttr", cd.ctoFH , "Title", strip(NLVGetMessage(130),"T",":"))
419 ok = VRMethod("CN_CONDET", "SetFieldAttr", cd.cldFH , "Title", strip(NLVGetMessage(131),"T",":"))
420 ok = VRMethod("CN_CONDET", "SetFieldAttr", cd.easupportFH , "Title", strip(NLVGetMessage(68),"T",":"))
421 ok = VRMethod("CN_CONDET", "SetFieldAttr", cd.rwfh , "Title", strip(NLVGetMessage(69),"T",":"))
422
423 /* SMBTree columns */
424 WorkgroupFH= VRMethod( "CN_smbtree", "AddField", "String", "Workgroup" )
425 NBFH = VRMethod( "CN_smbtree", "AddField", "String", "NetBIOS name" )
426 IpFH = VRMethod( "CN_smbtree", "AddField", "String", "IP" )
427 MBFH = VRMethod( "CN_smbtree", "AddField", "String", "Role" )
428 OSFH = VRMethod( "CN_smbtree", "AddField", "String", "OS" )
429 VersionFH = VRMethod( "CN_SmbTree", "AddField", "String", "Version" )
430 CommentFH = VRMethod( "CN_smbtree", "AddField", "String", "Comment" )
431 MacFH = VRMethod( "CN_smbtree", "AddField", "String", "MAC" )
432
433 ok = VRMethod("CN_smbtree","SetfieldAttr",IPFH, "ReadOnly", 1)
434 ok = VRMethod("CN_smbtree","SetfieldAttr",NBFH, "ReadOnly", 1)
435 ok = VRMethod("CN_smbtree","SetfieldAttr",MBFH, "ReadOnly", 1)
436 ok = VRMethod("CN_smbtree","SetfieldAttr",WorkGroupFH,"ReadOnly", 1)
437 ok = VRMethod("CN_smbtree","SetfieldAttr",OSFH, "ReadOnly", 1)
438 ok = VRMethod("CN_smbtree","SetfieldAttr",MacFH, "ReadOnly", 1)
439
440 IF options.!debug == 1 THEN SAY time()' _ContainersInit done'
441return
442/*:VRX _ContextMenuSelectedSet
443*/
444_ContextMenuSelectedSet:
445 /* Hide all context menu entries */
446 ok = VRSet("Menu_Selected_Remove", "Visible", 0) /* CN_CONDET */
447 ok = VRSet("Menu_Selected_Retry", "Visible", 0) /* CN_CONDET */
448 ok = VRSet("Menu_Selected_Connect", "Visible", 0) /* CN_SMBTREE */
449 ok = VRSet("Menu_Selected_Sep1", "Visible", 0) /* CN_SMBTREE */
450 ok = VRSet("Menu_Selected_Info", "Visible", 0) /* CN_SMBTREE */
451 ok = VRSet("Menu_Selected_Refresh", "Visible", 0) /* CN_SMBTREE */
452 ok = VRSet("Menu_Selected_Default_Workgroup","Visible", 0) /* CN_SMBTREE */
453
454
455ok = VRSet("Menu_Selected_TreeView","Visible",1)
456ok = VRSet("Menu_Selected_DetailsView","Visible",1)
457 select
458 when SMBObj.udatatype = "DISK" then do
459 ok = VRSet("Menu_Selected_Connect", "Visible", 1)
460 end
461 when SMBObj.udatatype = "SERVER" then do
462 ok = VRSet("Menu_Selected_Connect", "Visible", 1)
463 ok = VRSet("Menu_Selected_Sep1", "Visible", 1)
464 ok = VRSet("Menu_Selected_Info", "Visible", 1)
465 ok = VRSet("Menu_Selected_Refresh", "Visible", 1)
466 end
467 when SMBObj.udatatype = "WORKGROUP" then do
468 ok = VRSet("Menu_Selected_Connect", "Visible", 1)
469 ok = VRSet("Menu_Selected_Sep1", "Visible", 1)
470 ok = VRSet("Menu_Selected_Default_Workgroup","Visible", 1)
471 end
472 when SMBObj.udatatype = "PRINTER" then do
473 call _PrinterInfo
474 /* CALL VRMessage 'Main', NLVGetMessage( 62 ), NLVGetMessage( 5 ), 'E' */
475 end
476 otherwise nop /* FILE DIRECTORY */
477 end
478return
479
480/*:VRX _CreateSmbConf
481*/
482_CreateSmbConf:
483 IF options.!debug == 1 THEN SAY time()' '||"_CreateSmbConf started"
484 call lineout samba.!smbconf, '# Samba config file created using EVFSGUI ver. 'word(VRGet("Main","Hinttext"),2)
485 call lineout samba.!smbconf, '# from 'value("USER",,'OS2ENVIRONMENT')'@'value("HOSTNAME",,'OS2ENVIRONMENT')
486 call lineout samba.!smbconf, '# Date: 'date()' 'time()
487 call lineout samba.!smbconf, '[global]'
488 if settings.!network <> '' then do
489 call lineout samba.!smbconf, '09'x||'workgroup = 'settings.!network
490 end
491 else do
492 call lineout samba.!smbconf, '09'x||'workgroup = WORKGROUP'
493 end
494 call lineout samba.!smbconf, '09'x||'log level = 0'
495 ok = stream(samba.!smbconf,'c','close')
496 IF options.!debug == 1 THEN SAY time()' '||"_CreateSmbConf done"
497return
498
499/*:VRX _DaemonRunning
500*/
501_DaemonRunning: procedure expose fs.
502 ok = PRProcessList(proc)
503 PID = 0
504 do I = 1 to proc.0
505 CurProc = VRParseFileName(proc.i.name,'NE')
506 if CurProc = fs.!prefix"CTL.EXE" then do
507 PID = proc.i.pid
508 leave
509 end
510 end
511return PID
512
513/*:VRX _DelSMBObjectShares
514*/
515_DelSMBObjectShares: procedure expose options. SMBObj. rh
516 /* Purpose: Delete shares for a given Object (as handle) */
517
518 rh = arg(1)
519
520 ok = VRMethod("CN_smbtree", "GetRecordList", "All", rh.)
521
522 do J = 1 to rh.0 /* populate shares with valid entries */
523 ParentRH = VRMethod("CN_SMBTREE","GetRecordAttr",rh.J,"Parent")
524
525 if ParentRH = rh then do /* we found a share belonging to our server */
526 ok = VRMethod("CN_SMBTree", "RemoveRecord", rh.J )
527 end
528 end
529 SmbObj.shares. = ''
530 SmbObj.shares.0 = 0
531return
532
533/*:VRX _DialogPopulate
534*/
535_DialogPopulate:
536
537 ok = VRMethod( "CN_SMBTREE", "GetRecordList", "Visible", "rh." )
538
539 ok = VRMethod("EF_SHARE", "Reset")
540 ok = VRMethod("EF_SERVER", "Reset")
541 ok = VRMethod("EF_NETWORK", "Reset")
542
543 do I = 1 to rh.0
544
545 Userdata = VRMethod("CN_SMBTREE","GetRecordAttr",rh.I,"Userdata")
546 ResName = VRMethod("CN_SMBTREE","GetRecordAttr",rh.I,"Caption")
547
548 parse var ResName ResName '0D0A'x .
549 ResName = strip(ResName)
550 parse var userdata ResType '|' .
551
552 select
553 when ResType = "WORKGROUP" then ok = VRMethod("EF_NETWORK","AddString", ResName)
554 when ResType = "SERVER" then ok = VRMethod("EF_SERVER", "AddString", ResName)
555 when ResType = "DISK" then ok = VRMethod("EF_SHARE", "AddString", ResName)
556 otherwise nop
557 end
558 end
559
560return
561
562/*:VRX _dropdeprecated
563*/
564_dropdeprecated:
565 /* The stem-less counterparts of these variables are considered deprecated and should be removed wherever possible
566 The _dropdeprecated routine will drop any value in order to make sure the stem actually works
567 If another variable is added to the stem, ensure to also drop it in dropdeprecated otherwise it will not be exported
568 */
569 drop rh
570 drop parentrh
571 drop gparentrh
572 drop icon
573 drop resname
574 drop comment
575 drop udatatype
576 drop udatamsg
577return
578
579/*:VRX _Dynamic
580*/
581_Dynamic:
582 dyn_code = arg(1)
583 IF options.!debug == 1 THEN SAY ' Dynamic code: 'dyn_code
584 interpret dyn_code; drop dyn_code
585return
586
587/*:VRX _GetSMBObjectProperties
588*/
589_GetSMBObjectProperties: procedure expose options. SMBObj. rh icon resname udatatype udatamsg parentrh icons.
590 IF options.!debug == 1 THEN SAY time()' _GetSMBObjectProperties started'
591
592 /* Purpose of this subroutine:
593 The current SMB object's frequently used properties should be stored in a stem
594 SMBObj.rh = recordhandle of the object
595 SMBObj.resname = resourcename of the object
596 SMBObj.comment = commentstring of the object
597 SMBObj.icon = icon of the object
598 SMBObj.udatatype = type of object (WORKGROUP, SERVER, DISK, PRINTER, FILE, DIRECTORY)
599 SMBObj.udatamsg = arbitrary object related data (Login message, file properties)
600 SMBObj.parentrh = recordhandle of the object's parent
601 SMBObj.gparentrh = recordhandle of the object's grandparent
602
603 The stem-less counterparts of these variables are considered deprecated and should be removed wherever possible
604 The _dropdeprecated routine will drop any value in order to make sure the stem actually works
605 If another variable is added to the stem, ensure to also drop it in dropdeprecated otherwise it will not be exported
606 */
607 call _dropdeprecated
608
609 SMBObj. = ""
610 SMBObj.rh = arg(1)
611
612 if VRMethod( "CN_SMBTREE", "ValidateRecord", SMBObj.rh) <> 1 | SMBObj.rh = "" then do
613 IF options.!debug == 1 THEN SAY time()' _GetSMBObjectProperties aborted'
614 return
615 end
616
617 SMBObj.Icon = VRMethod("CN_SMBTREE", "GetRecordAttr", SMBObj.rh, "Icon")
618
619 SMBObj.parentrh = VRMethod("CN_SMBTREE", "GetRecordAttr", SMBObj.rh, "Parent")
620 if SMBObj.parentrh = ""
621 then SMBObj.gparentrh = ""
622 else SMBObj.gparentrh = VRMethod("CN_SMBTREE", "GetRecordAttr", SMBObj.parentrh, "Parent")
623
624 SMBObj.resname = VRMethod("CN_SMBTREE", "GetRecordAttr", SMBObj.rh, "Caption")
625 parse var SMBObj.resname SMBObj.resname '0D0A'x SMBObj.comment
626 SMBObj.resname = strip(SMBObj.resname)
627 SMBObj.comment = strip(SMBObj.comment)
628
629 Userdata = VRMethod("CN_SMBTREE", "GetRecordAttr", SMBObj.rh, "Userdata")
630 parse var userdata SMBObj.udatatype '|' SMBObj.udatamsg
631 SMBObj.udatatype = strip(SMBObj.udatatype)
632 SMBObj.udatamsg = strip(SMBObj.udatamsg)
633
634 IF options.!debug == 1 THEN do
635 SAY ' Handle: "'SMBObj.rh'"'
636 say ' GParentrh "'SMBObj.gparentrh'"'
637 SAY ' Resource: "'SMBObj.resname'"'
638 SAY ' Comment: "'SMBObj.comment'"'
639 SAY ' Type: "'SMBObj.udatatype'"'
640 SAY ' Message: "'SMBObj.udatamsg'"'
641 SAY ' Icon: "'SMBObj.icon'"'
642 end
643
644 IF options.!debug == 1 THEN SAY time()' _GetSMBObjectProperties done'
645return
646
647/*:VRX _GetSMBObjectShares
648*/
649_GetSMBObjectShares: procedure expose options. SMBObj. rh
650 /* Purpose: Return stem with shares for a given Object (as handle) */
651
652 rh = arg(1)
653
654 SmbObj.shares. = ''
655 SmbObj.shares.0 = 0
656
657 ok = VRMethod("CN_smbtree", "GetRecordList", "All", rh.)
658
659 do J = 1 to rh.0 /* populate shares with valid entries */
660 Userdata = VRMethod("CN_SMBTREE","GetRecordAttr",rh.J,"Userdata")
661 ResName = VRMethod("CN_SMBTREE","GetRecordAttr",rh.J,"Caption")
662 ParentRH = VRMethod("CN_SMBTREE","GetRecordAttr",rh.J,"Parent")
663
664 parse var ResName ResName '0D0A'x .
665 ResName = strip(ResName)
666 parse var userdata ResType '|' .
667 I = 0
668 if ParentRH = rh then do /* we found a share belonging to our server */
669 if ResType = "DISK" then do
670 I = I + 1
671 SmbObj.shares.I = ResName
672 end
673 end
674 end
675 SmbObj.shares.0 = I
676return
677
678/*:VRX _GUIInit
679*/
680_GUIInit:
681 IF options.!debug == 1 THEN SAY time()' _GUIInit started'
682 CALL VRSet 'Main', 'HelpFile', settings.!helpfile
683
684 /* Main Window */
685 CALL NLVSetText 'Main', "Caption", 1
686
687 CALL NLVSetText 'Menu_File', "Caption", 80
688 CALL NLVSetText 'Menu_Context', "Caption", 81
689 CALL NLVSetText 'Menu_Selected', "Caption", 83
690 CALL NLVSetText 'Menu_Help', "Caption", 84
691
692 CALL NLVSetText 'Menu_File_LOAD', "Caption", 31
693 CALL NLVSetText 'Menu_File_SAVE', "Caption", 30
694 CALL NLVSetText 'Menu_File_LMHosts_Reset', "Caption", 127
695 CALL NLVSetText 'Menu_File_ucCred_Reset', "Caption", 128
696 CALL NLVSetText 'Menu_File_Autostart', "Caption", 35
697 CALL NLVSetText 'Menu_File_Autostart_Activate', "Caption", 76
698 CALL NLVSetText 'Menu_File_Autostart_Deactivate', "Caption", 77
699 CALL NLVSetText 'Menu_File_Daemon', "Caption", 126
700 CALL NLVSetText 'Menu_File_Daemon_Start', "Caption", 76
701 CALL NLVSetText 'Menu_File_Daemon_Stop', "Caption", 77
702 CALL NLVSetText 'Menu_File_CLOSE', "Caption", 29
703
704 CALL NLVSetText 'Menu_Context_DETACH', "Caption", 11
705 CALL NLVSetText 'Menu_Context_DETACH_ALL', "Caption", 120
706 CALL NLVSetText 'Menu_Context_REFRESH', "Caption", 38
707 CALL NLVSetText 'Menu_Context_UNMOUNT', "Caption", 12
708 CALL NLVSetText 'Menu_Context_EDIT', "Caption", 32
709 CALL NLVSetText 'Menu_Context_OPEN', "Caption", 94
710 CALL NLVSetText 'Menu_Context_OPEN_ICON', "Caption", 95
711 CALL NLVSetText 'Menu_Context_OPEN_TREE', "Caption", 96
712 CALL NLVSetText 'Menu_Context_OPEN_DETAIL', "Caption", 97
713 CALL NLVSetText 'Menu_Context_OPEN_SETTINGS', "Caption", 98
714 CALL NLVSetText 'Menu_Context_OPEN_SPLITVIEW', "Caption", 99
715
716 CALL NLVSetText 'Menu_Selected_Connect', "Caption", 28
717 CALL NLVSetText 'Menu_Selected_Remove', "Caption", 12
718 CALL NLVSetText 'Menu_Selected_Retry', "Caption", 90
719 CALL NLVSetText 'Menu_Selected_Info', "Caption", 92
720 CALL NLVSetText 'Menu_Selected_Refresh', "Caption", 38
721 CALL NLVSetText 'Menu_Selected_Default_Workgroup',"Caption", 75
722
723 CALL NLVSetText 'Menu_Help_Extended', "Caption", 4
724 CALL NLVSetText 'Menu_Help_About', "Caption", 91
725
726 /* Left pane */
727 CALL NLVSetText 'DT_CURRENT', "Caption", 10
728 CALL NLVSetText 'PB_DETACH', "Caption", 11
729 CALL NLVSetText 'PB_UNMOUNT', "Caption", 12
730
731 /* Dialog window */
732 CALL NLVSetText 'DT_MOUNT', "Caption", 14
733 CALL NLVSetText 'DT_SERVER', "Caption", 19
734 CALL NLVSetText 'DT_SHARE', "Caption", 20
735 CALL NLVSetText 'DT_NETWORK', "Caption", 21
736 CALL NLVSetText 'CHK_MTYPE', "Caption", 23
737 CALL NLVSetText 'DT_USER', "Caption", 25
738 CALL NLVSetText 'DT_PASSWORD', "Caption", 26
739 CALL NLVSetText 'DT_MPOINT', "Caption", 27
740 CALL NLVSetText 'PB_MOUNT', "Caption", 28
741 CALL NLVSetText 'PB_EDIT_CANCEL', "Caption", 3
742 CALL NLVSetText 'PB_DIALOG_HELP', "Caption", 4
743
744 IF (mtype.1 \= '' & mtype.2 \= '' & mtype.3 \= '' & mtype.4 \= '') THEN DO
745 CALL VRMethod CB_MOUNT, 'Clear'
746 CALL VRMethod CB_MOUNT, 'AddStringList', 'mtype.'
747 END
748
749 /* SMBTree */
750 CALL NLVSetText 'PB_SMBTREE_CONNECT', "Caption", 28
751 CALL NLVSetText 'PB_SMBTREE_REFRESH', "Caption", 38
752 CALL NLVSetText 'PB_SMBTREE_HELP', "Caption", 4
753 ok = VRSet("Pict_Throbber","Width", VRMethod( "Screen", "PixelsToTwips", 32 ))
754 ok = VRSet("Pict_Throbber","Height", VRMethod( "Screen", "PixelsToTwips", 32 ))
755
756 /* Condet */
757 CALL NLVSetText 'PB_CONDET_SAVE', "Caption", 30
758 CALL NLVSetText 'PB_CONDET_LOAD', "Caption", 31
759 CALL NLVSetText 'PB_CONDET_HELP',"Caption", 4
760
761 /* Statusbar */
762 ok = VRSet("DT_STATUSBAR", "Caption", VRGet("Main", "HintText"))
763
764 /* Common margin around controls */
765 margin = ((VRGet("Main", "InteriorLeft") / 3) * 2) + 2
766
767 IF options.!debug == 1 THEN SAY time()' _GUIInit done'
768return
769
770/*:VRX _INILoad
771*/
772_INILoad:
773 IF options.!debug == 1 THEN SAY time()' _INILoad started'
774
775 /* Locate the profile */
776 os2_ini = VALUE('USER_INI',,'OS2ENVIRONMENT')
777 inipath = VRParseFilePath( os2_ini, 'DP')
778 IF inipath == '' THEN inipath = SysBootDrive() || '\OS2'
779 settings.!ini = inipath'\evfsgui.ini'
780 drop os2_ini inipath
781 IF options.!debug == 1 THEN SAY ' EVFSGUI INIfile = "'settings.!ini'"'
782
783 settings.!network = ""
784 /* Create default smb.conf if none exists */
785 if \VRFileExists( samba.!smbconf ) then call _CreateSmbConf
786
787 say _ucInitObj()
788
789 options.!storecreds = _ucChkObj()
790
791 IF STREAM( settings.!ini, 'C', 'QUERY EXISTS') == '' THEN DO
792 /* First start */
793 IF options.!debug == 1 THEN say " First start!"
794
795 advanced.!browseauth = 0
796 advanced.!browseimme = 1
797 advanced.!broadcast = 0
798 advanced.!special = 0
799 advanced.!savepassive= 0
800 advanced.!lmhosts = 1
801
802 advanced.!miniicons = 0
803
804 advanced.!easupport = 1
805 advanced.!readonly = 0
806 advanced.!alwaysmp = 0
807 advanced.!cachetimeout = 10
808 advanced.!cachelistings = 32
809
810 CALL VRSet "Main", 'Height', 7576
811 CALL VRSet "Main", 'Width', 8200
812 CALL VRSet "SPLIT_MAIN", 'Left', 2915
813 CALL VRMethod "Main", 'CenterWindow'
814 call VRSet 'Main', 'Visible', 1
815 call Main_Resize
816 END
817 ELSE DO
818 /* Subsequent start */
819 /* Load window position settings */
820 settings.!x = VRGetIni('Settings', 'X', settings.!ini, 'NoClose')
821 settings.!y = VRGetIni('Settings', 'Y', settings.!ini, 'NoClose')
822 settings.!h = VRGetIni('Settings', 'H', settings.!ini, 'NoClose')
823 settings.!w = VRGetIni('Settings', 'W', settings.!ini, 'NoClose')
824 settings.!s = VRGetIni('Settings', 'S', settings.!ini, 'NoClose')
825
826 IF settings.!x == '' THEN settings.!x = -1
827 IF settings.!y == '' THEN settings.!y = -1
828 IF settings.!h == '' THEN settings.!h = -1
829 IF settings.!w == '' THEN settings.!w = -1
830 IF settings.!s == '' THEN settings.!s = -1
831
832 /* Titlebar settings */
833 settings.!curbcolor = VRGetIni('Settings', 'TitleBarBackground', settings.!ini, 'NoClose')
834 settings.!curfcolor = VRGetIni('Settings', 'TitleBarForeground', settings.!ini, 'NoClose')
835 IF (settings.!curbcolor = '' | settings.!curbcolor = '<default>') THEN settings.!curbcolor = 'SystemActiveTitle'
836 IF (settings.!curfcolor = '' | settings.!curfcolor = '<default>') THEN settings.!curfcolor = 'SystemActiveTitleText'
837
838 /* Load font settings */
839 IF VRFileExists( SysBootDrive() || '\OS2DBCS') == 1
840 THEN default_font = '9.WarpSans Combined'
841 ELSE default_font = '9.WarpSans'
842
843 settings.!cfont = VRGetIni('Settings', 'ContainerFont', settings.!ini, 'NoClose')
844 settings.!wfont = VRGetIni('Settings', 'WindowFont', settings.!ini, 'NoClose')
845 IF settings.!cfont == '' THEN settings.!cfont = default_font
846 IF settings.!wfont == '' THEN settings.!wfont = default_font
847
848 /* Current page */
849 settings.!curpage = VRGetIni('Settings', 'CurrentPage', settings.!ini, 'NoClose')
850 IF settings.!curpage == '' THEN settings.!curpage = 1
851
852 /* Global settings */
853 advanced.!browseauth = VRGetIni('Settings', 'BrowseAuth', settings.!ini, 'NoClose')
854 advanced.!browseimme = VRGetIni('Settings', 'BrowseImme', settings.!ini, 'NoClose')
855 advanced.!broadcast = VRGetIni('Settings', 'Broadcast', settings.!ini, 'NoClose')
856 advanced.!special = VRGetIni('Settings', 'SpecialShares', settings.!ini, 'NoClose')
857 advanced.!savepassive= VRGetIni('Settings', 'SavePassive', settings.!ini, 'NoClose')
858 advanced.!lmhosts = VRGetIni('Settings', 'LMHosts', settings.!ini, 'NoClose')
859 advanced.!miniicons = VRGetIni('Settings', 'MiniIcons', settings.!ini, 'NoClose')
860
861 advanced.!easupport = VRGetIni('Settings', 'EAS', settings.!ini, 'NoClose')
862 advanced.!readonly = VRGetIni('Settings', 'ReadOnly', settings.!ini, 'NoClose')
863 advanced.!alwaysmp = VRGetIni('Settings', 'AlwaysMP', settings.!ini, 'NoClose')
864 advanced.!cachetimeout = VRGetIni('Settings', 'CacheTimeOut', settings.!ini, 'NoClose')
865 advanced.!cachelistings = VRGetIni('Settings', 'CacheListings',settings.!ini, 'NoClose')
866
867 IF advanced.!browseauth == '' THEN advanced.!browseauth = 0
868 IF advanced.!browseimme == '' THEN advanced.!browseimme = 1
869 IF advanced.!broadcast == '' THEN advanced.!broadcast = 0
870 IF advanced.!special == '' THEN advanced.!special = 0
871 IF advanced.!savepassive== '' THEN advanced.!savepassive= 0
872 IF advanced.!lmhosts == '' THEN advanced.!lmhosts = 1
873
874 options.!debug = VRGetIni('Settings', 'Debug', settings.!ini)
875 IF options.!debug == '' THEN options.!debug = 0 /* Turn off debug by default for release builds */
876 IF options.!debug == 1 THEN ok = VRRedirectStdIO("ON")
877 else ok = VRRedirectStdio("OFF")
878
879 IF advanced.!miniicons == '' THEN advanced.!miniicons = 0
880
881 /* Advanced */
882 IF advanced.!easupport == '' THEN advanced.!easupport = 1
883 IF advanced.!readonly == '' THEN advanced.!readonly = 0
884 IF advanced.!alwaysmp == '' THEN advanced.!alwaysmp = 0
885 IF advanced.!cachetimeout == '' THEN advanced.!cachetimeout = 10
886 IF advanced.!cachelistings == '' THEN advanced.!cachelistings = 32
887
888 /* Apply the settings */
889 ok = VRSet("DT_CURRENT","BACKCOLOR", settings.!curbcolor )
890 ok = VRSet("DT_CURRENT","FORECOLOR", settings.!curfcolor )
891
892 ok = VRset("CN_CURRENT", "MiniIcons", advanced.!miniicons)
893 ok = VRset("CN_SMBTREE", "MiniIcons", advanced.!miniicons)
894 ok = VRset("CN_CONDET", "MiniIcons", advanced.!miniicons)
895
896 IF ( settings.!x >= 0 ) & ( settings.!y >= 0 ) & ( settings.!l >= 0 ) & ( settings.!w >= 0 ) & ( settings.!s >= 0 ) THEN DO
897 CALL VRSet VRWindow(), 'Left', settings.!x
898 CALL VRSet VRWindow(), 'Top', settings.!y
899 CALL VRSet VRWindow(), 'Height', settings.!h
900 CALL VRSet VRWindow(), 'Width', settings.!w
901 CALL VRSet "SPLIT_MAIN", 'Left', settings.!s
902 END
903 ELSE CALL VRMethod VRWindow(), 'CenterWindow'
904
905 CALL VRSet "CN_CURRENT", 'Font', settings.!cfont
906 CALL VRSet "CN_CONDET", 'Font', settings.!cfont
907 CALL VRSet "CN_SMBTREE", 'Font', settings.!cfont
908
909 CALL VRSet 'Main', 'Font', settings.!wfont
910 CALL VRSet 'Main', 'StatusFont', settings.!wfont
911
912 ok = VRSet("TDL_1","Selected", settings.!curpage)
913 END
914
915 if options.!nogui == 1 then CALL VRLoadSecondary "SW_PROGRESS","W"
916 else do
917 if options.!delay > 0 then do
918 /* Set mouse pointer to wait - this operation might take a few seconds */
919 call VRSet VRWindow(), 'Pointer', 'Wait'
920 call Main_Resize
921 ok = SysSleep(options.!delay)
922 options.!delay = 0
923 /* Set mouse pointer to default again */
924 call VRSet VRWindow(), 'Pointer', '<default>'
925 end
926 end
927
928 /* Look for usable credentials */
929 if options.!storecreds = 1 & _ucChkUc() then do
930 UserCred = _ucGetUc()
931 parse var UserCred '--user='Credentials.!username'%'Credentials.!password
932 ok = VRSet("EF_USER", "Value",Credentials.!username)
933 ok = VRSet("EF_PASSWORD","Value",Credentials.!password)
934 end
935
936 /* SambaInit.VRS needs these 2 */
937 ShowHidden = advanced.!special
938 Broadcast = advanced.!broadcast
939
940 /* in non debug versions this is normally not visible */
941 IF options.!debug == 1 THEN SAY ' NLV MessageFile = "'settings.!messages'"'
942 IF options.!debug == 1 THEN SAY ' NLV HelpFile = "'settings.!helpfile'"'
943
944 IF options.!debug == 1 THEN SAY time()' _INILoad done'
945RETURN
946
947/*:VRX _INISave
948*/
949_INISave: PROCEDURE EXPOSE settings. options. icons. fs. advanced. cd. samba.
950 IF options.!debug == 1 THEN SAY time()' '||"SaveSettings started"
951
952 if advanced.!savepassive then call _PassiveSave
953
954/* This does not make sense anymore
955 settings.!network = VRGet("EF_NETWORK","Value")
956 CALL VRSetIni 'Settings', 'Network', settings.!network, settings.!ini, 'NoClose'
957 */
958
959 font = VRGet("CN_CURRENT", 'Font')
960 CALL VRSetIni 'Settings', 'ContainerFont', font, settings.!ini, 'NoClose'
961
962 font = VRGet('Main', 'Font')
963 CALL VRSetIni 'Settings', 'WindowFont', font, settings.!ini, 'NoClose'
964
965 settings.!curbcolor = VRGet("DT_CURRENT","BackColor")
966 CALL VRSetIni 'Settings', 'TitleBarBackground', settings.!curbcolor, settings.!ini, 'NoClose'
967
968 settings.!curfcolor = VRGet("DT_CURRENT","ForeColor")
969 CALL VRSetIni 'Settings', 'TitleBarForeground', settings.!curfcolor, settings.!ini, 'NoClose'
970
971 /* Global options */
972 CALL VRSetIni 'Settings', 'BrowseAuth', advanced.!browseauth , settings.!ini, 'NoClose'
973 CALL VRSetIni 'Settings', 'BrowseImme', advanced.!browseimme , settings.!ini, 'NoClose'
974 CALL VRSetIni 'Settings', 'Broadcast', advanced.!broadcast , settings.!ini, 'NoClose'
975 CALL VRSetIni 'Settings', 'SpecialShares', advanced.!special , settings.!ini, 'NoClose'
976 CALL VRSetIni 'Settings', 'SavePassive', advanced.!savepassive, settings.!ini, 'NoClose'
977 CALL VRSetIni 'Settings', 'LMHosts', advanced.!lmhosts , settings.!ini, 'NoClose'
978
979 CALL VRSetIni 'Settings', 'Debug', options.!debug , settings.!ini, 'NoClose'
980 CALL VRSetIni 'Settings', 'MiniIcons', advanced.!miniicons , settings.!ini, 'NoClose'
981
982 /* Advanced */
983 CALL VRSetIni 'Settings', 'EAS', advanced.!easupport , settings.!ini, 'NoClose'
984 CALL VRSetIni 'Settings', 'ReadOnly', advanced.!readonly , settings.!ini, 'NoClose'
985 CALL VRSetIni 'Settings', 'AlwaysMP', advanced.!alwaysmp , settings.!ini, 'NoClose'
986 CALL VRSetIni 'Settings', 'CacheTimeOut', advanced.!cachetimeout , settings.!ini, 'NoClose'
987 CALL VRSetIni 'Settings', 'CacheListings', advanced.!cachelistings, settings.!ini, 'NoClose'
988
989 /* Current page */
990 settings.!curpage = VRget("TDL_1","Selected")
991 CALL VRSetIni 'Settings', 'CurrentPage', settings.!curpage , settings.!ini, 'NoClose'
992
993 /* Save position and size */
994 settings.!l = VRGet("Main", 'Left' )
995 settings.!t = VRGet("Main", 'Top' )
996 settings.!h = VRGet("Main", 'Height')
997 settings.!w = VRGet("Main", 'Width' )
998 settings.!s = VRGet("SPLIT_Main", 'Left' )
999
1000 CALL VRSetIni 'Settings', 'X', settings.!l, settings.!ini, 'NoClose'
1001 CALL VRSetIni 'Settings', 'Y', settings.!t, settings.!ini, 'NoClose'
1002 CALL VRSetIni 'Settings', 'H', settings.!h, settings.!ini, 'NoClose'
1003 CALL VRSetIni 'Settings', 'W', settings.!w, settings.!ini, 'NoClose'
1004 CALL VRSetIni 'Settings', 'S', settings.!s, settings.!ini
1005
1006 IF options.!debug == 1 THEN SAY time()' '||"SaveSettings done"
1007RETURN
1008
1009/*:VRX _isValidIPAddress
1010*/
1011_isValidIPAddress: procedure
1012 ipaddr = arg(1)
1013 d. = ''
1014 d.0 = 4
1015 fail = 0
1016 parse var ipaddr d.1 '.' d.2 '.' d.3 '.' d.4
1017 do I = 1 to 4
1018 if datatype(d.I) = 'NUM' then do
1019 if d.I < 0 | d.I > 255 then fail = 1
1020 end
1021 else fail = 1
1022 if fail = 1 then leave
1023 end
1024return(\fail)
1025
1026/*:VRX _LMHostsRead
1027*/
1028_LMHostsRead:
1029 ok = file2stem(samba.!lmhosts,'lmhosts.', 'NoDel')
1030 lmname. = "#"
1031 lmapp. = ""
1032 lmname.0 = lmhosts.0
1033 lmip.0 = lmhosts.0
1034 lmapp.0 = lmhosts.0
1035 do I = 1 to lmhosts.0
1036 if left(lmhosts.I,1) = "#" then iterate
1037 parse var lmhosts.I lmip.I ' ' lmname.I '#' lmapp.I
1038 lmip.I = strip(lmip.I)
1039 lmname.I = strip(lmname.I)
1040 if lmapp.I <> "" & left(lmapp.I,1) <> '#' then lmapp.I = '#'lmapp.I
1041 end
1042 drop lmhosts.
1043return
1044
1045/*:VRX _LMHostsUpdate
1046*/
1047_LMHostsUpdate:
1048 ok = VRMethod( "CN_SMBTREE", "GetRecordList", "Visible", "rh." )
1049 do I = 1 to rh.0
1050 call _GetSMBObjectProperties rh.I
1051 if SMBObj.udatatype = "SERVER" then do
1052 IP = VRMethod("CN_SMBTREE","GetFieldData",rh.I, IPFH )
1053 Role = VRMethod("CN_SMBTREE","GetFieldData",rh.I, MBFH )
1054 parse var IP T1 '.' T2 '.' T3 '.' T4
1055 if datatype(T1) = "NUM" & datatype(T2) = "NUM" & datatype(T3) = "NUM" & datatype(T4) = "NUM" then do
1056 FoundName = 0
1057 do J = 1 to lmname.0 /* machine already in LMHosts? */
1058 if lmname.J = SmbObj.resname then do /* Yes? then update IP */
1059 lmip.J = IP
1060 if pos('PDC',Role) > 0 & SMBObj.parentrh <> "" then do
1061 Domain = VRMethod("CN_SMBTREE", "GetRecordAttr", SMBObj.parentrh, "Caption")
1062 lmapp.J = "#DOM:"Domain
1063 end
1064 FoundName = 1
1065 leave
1066 end
1067 end
1068 if FoundName = 0 then do /* New machine for LMhosts - add it */
1069 new = lmname.0 + 1
1070 lmname.0 = new
1071 lmname.new = SmbObj.resname
1072 lmip.0 = new
1073 lmip.new = IP
1074 end
1075 end
1076 end
1077 end
1078 ok = SysFileDelete(samba.!lmhosts)
1079 call lineout samba.!lmhosts,'# Created by 'translate(VRParseFilename(settings.!ini,'N'))' Version 'word(VRGet("Main","Hinttext"),2)' on 'date()' at 'time()
1080 call lineout samba.!lmhosts,'# Syntax:'
1081 call lineout samba.!lmhosts,left('# IP-address',25)||left('NetBIOS-name',16)' [Role]'
1082 do I = 1 to lmname.0
1083 if left(lmname.I,1) = "#" then iterate
1084 call lineout samba.!lmhosts,left(lmip.I,25)||left(lmname.I,16)' 'lmapp.I
1085 end
1086 ok = stream(samba.!lmhosts,'c','close')
1087return
1088
1089/*:VRX _LMHostsWrite
1090*/
1091_LMHostsWrite:
1092
1093return
1094
1095/*:VRX _LoadOtherFuncs
1096*/
1097_LoadOtherFuncs:
1098 call RxFuncAdd 'SysLoadFuncs', 'REXXUTIL', 'SysLoadFuncs'
1099 call SysLoadFuncs
1100
1101 call rxfuncadd 'IniLoadFuncs', 'REXXINI', 'IniLoadFuncs'
1102 call IniLoadFuncs
1103
1104 call RxFuncAdd 'PRLoadFuncs', 'PR1UTIL', 'PRLoadFuncs'
1105 call PRLoadFuncs
1106
1107 call RxFuncAdd 'RxuInit','Rxu','RxuInit'
1108 call RxuInit
1109return
1110
1111/*:VRX _ParseCommandLine
1112*/
1113_ParseCommandLine:
1114 IF options.!debug == 1 THEN SAY time()' _ParseCommandLine() started'
1115 CmdLine = VRGet("Application","Commandline")
1116 upCmdLine = translate(CmdLine)
1117 IF options.!debug == 1 THEN SAY ' Commandline = "'CmdLine'"'
1118
1119 ForceNDFS = 0
1120 if wordpos('-NDFS',upCmdLine) > 0 then do
1121 IF options.!debug == 1 THEN SAY " NDFS switch detected"
1122 CmdLine = delWord(CmdLine,wordpos('-NDFS',upCmdLine),1)
1123 upCmdLine = translate(CmdLine)
1124 ForceNDFS = 1
1125 CALL VRSet "Menu_File_Autostart","Visible", 0
1126 end
1127
1128 if wordpos('-AUTOCLOSE',upCmdLine) > 0 then do
1129 options.!autoclose = 1
1130 IF options.!debug == 1 THEN SAY " AutoClose switch detected"
1131 CmdLine = delWord(CmdLine,wordpos('-AUTOCLOSE',upCmdLine),1)
1132 upCmdLine = translate(CmdLine)
1133 end
1134 if wordpos('-NOGUI',upCmdLine) > 0 then do
1135 options.!nogui = 1
1136 options.!autoclose = 1
1137 IF options.!debug == 1 THEN SAY " -NOGUI switch detected"
1138 CmdLine = delWord(CmdLine,wordpos('-NOGUI',upCmdLine),1)
1139 upCmdLine = translate(CmdLine)
1140 end
1141
1142 if wordpos('-DELAY',upCmdLine) > 0 then do
1143 IF options.!debug == 1 THEN SAY " DELAY switch detected"
1144 dwpos = wordpos('-DELAY',upCmdLine)
1145 if dwpos = words(upCmdLine) then do /* DELAY was last parm - assume 60 seconds */
1146 options.!delay = 60
1147 CmdLine = delWord(CmdLine,dwpos,1)
1148 end
1149 else do
1150 options.!delay = word(upCmdLine,dwpos+1)
1151 if datatype(options.!delay) <> "NUM" then do /* No number of seconds specified */
1152 options.!delay = 60
1153 CmdLine = delWord(CmdLine,dwpos,1)
1154 end
1155 else do
1156 CmdLine = delWord(CmdLine,dwpos,2)
1157 end
1158 end
1159 upCmdLine = translate(CmdLine)
1160 IF options.!debug == 1 THEN SAY " DELAY set to "options.!delay" seconds."
1161 end
1162
1163 Profile = strip(CmdLine,,'"')
1164 if Profile <> "" then do
1165 Profile = strip(VRParseFilename(Profile,"DPNE"))
1166 options.!autoload = 1
1167 IF options.!debug == 1 THEN SAY ' Profile = "'Profile'"'
1168 if \VRFileExists(Profile) then do
1169 CALL VRMessage 'Main', NLVGetMessage( 102, Profile ), NLVGetMessage( 1 ), 'E'
1170 /* Disable all switches in case of an error */
1171 options.!autoload = 0
1172 options.!autoclose = 0
1173 options.!nogui = 0
1174 options.!delay = 0
1175 end
1176 end
1177 IF options.!debug == 1 THEN SAY time()' _ParseCommandLine done'
1178return
1179
1180/*:VRX _PassiveLoad
1181*/
1182_PassiveLoad:
1183 IF options.!debug == 1 THEN SAY time()' '||"_PassiveLoad started"
1184
1185 do cnt = 1 to 255
1186 resdata = VRGetIni( "PassiveConnections", cnt, settings.!ini )
1187 if resdata = "" then leave
1188
1189 PARSE Var resdata p_mpoint resource rwFlag
1190 IF options.!debug == 1 THEN do
1191 say " resdata ="resdata
1192 say " p_mpoint ="p_mpoint
1193 say " resource ="resource
1194 say " rwFlag ="rwFlag
1195 end
1196
1197/* vfs.!drive = FILESPEC('DRIVE', node )
1198 vfs.!mountpoint = STRIP( node, 'T', '\') */
1199
1200 /* In case we only have a volume we reattach the backslash, otherwise restore will fail */
1201 if vfs.!drive = vfs.!mountpoint then vfs.!mountpoint = vfs.!mountpoint||'\'
1202
1203 p_mpidx = ""
1204
1205 call ParseResParmString
1206
1207 p_rw = rwFlag
1208
1209 cd.lastrh = VRMethod("CN_CONDET","AddRecord")
1210 IF options.!debug == 1 THEN say " cd.lastrh = "cd.lastrh
1211
1212 ok = VRMethod("CN_CONDET", "SetFieldData", cd.lastrh, cd.mpointFH, p_mpoint, cd.mpidxfh, p_mpidx)
1213 ok = VRMethod("CN_CONDET", "SetFieldData", cd.lastrh, cd.workgroupfh, p_workgroup, cd.serverfh, p_server, cd.sharefh, p_share)
1214 ok = VRMethod("CN_CONDET", "SetFieldData", cd.lastrh, cd.userfh, p_user, cd.passwordfh, p_password, cd.spasswordfh, p_spassword)
1215 ok = VRMethod("CN_CONDET", "SetFieldData", cd.lastrh, cd.ctoFH, p_cachetimeout,cd.cldFH, p_cachelistings)
1216 ok = VRMethod("CN_CONDET", "SetFieldData", cd.lastrh, cd.masterfh, p_master, cd.mtypefh, p_mtype, cd.easupportfh, p_easupport, cd.rwfh, p_rw)
1217
1218/* ok = VRMethod("CN_CONDET", "SetFieldData", cd.lastrh, cd.memlenfh, p_memlen, cd.logfilefh, p_logfile, cd.loglevelfh, p_loglevel ) */
1219
1220 ok = VRMethod("CN_CONDET", "SetFieldData", cd.lastrh, cd.statusfh, icons.!passive) /* Passive */
1221 ok = VRMethod("CN_CONDET", "SetRecordAttr", cd.lastrh, "Icon", icons.!passive) /* Passive */
1222
1223 hashstr = p_mpoint' 'translate(p_workgroup)' 'translate(p_server)' 'translate(p_share)' 'p_user' 'p_spassword' 'p_easupport' 'p_rw
1224
1225 md5 = rexx_md5(hashstr)
1226
1227 ok = VRMethod("CN_CONDET", "SetFieldData", cd.lastrh, cd.hashfh,md5)
1228
1229 end
1230 IF options.!debug == 1 THEN SAY time()' '||"_PassiveLoad done"
1231return
1232/*:VRX _PassiveSave
1233*/
1234_PassiveSave:
1235 IF options.!debug == 1 THEN SAY time()' '||"_PassiveSave started"
1236 ok = VRDelIni( "PassiveConnections", "ALL", settings.!ini )
1237
1238 ok = SysIni(settings.!ini, 'PassiveConnections', 'DELETE:')
1239
1240 CALL VRMethod "CN_CONDET", 'GetRecordList', 'All', 'records.'
1241 cnt = 0
1242 DO i = 1 TO records.0
1243
1244 if VRMethod( "CN_CONDET", "GetFieldData", records.i, CD.StatusFH) = icons.!passive then do
1245 cnt = cnt + 1
1246 resdata = ""
1247 resdata = resdata||VRMethod("CN_CONDET","GetFieldData", records.i, cd.mpointfh)||" "
1248 resdata = resdata||'\\'||VRMethod("CN_CONDET","GetFieldData", records.i, cd.workgroupfh)
1249 resdata = resdata||':'||VRMethod("CN_CONDET","GetFieldData", records.i, cd.serverfh)
1250 resdata = resdata||'\'||VRMethod("CN_CONDET","GetFieldData", records.i, cd.sharefh)
1251 resdata = resdata||'@'||VRMethod("CN_CONDET","GetFieldData", records.i, cd.userfh)
1252 resdata = resdata||';WORKGROUP='||VRMethod("CN_CONDET","GetFieldData", records.i, cd.workgroupfh)
1253 resdata = resdata||';SERVER='||VRMethod("CN_CONDET","GetFieldData", records.i, cd.serverfh)
1254 resdata = resdata||';SHARE='||VRMethod("CN_CONDET","GetFieldData", records.i, cd.sharefh)
1255 resdata = resdata||';USER='||VRMethod("CN_CONDET","GetFieldData", records.i, cd.userfh)
1256 resdata = resdata||';PASSWORD='||VRMethod("CN_CONDET","GetFieldData", records.i, cd.passwordfh)
1257 resdata = resdata||';SPASSWORD='||VRMethod("CN_CONDET","GetFieldData", records.i, cd.spasswordfh)
1258 resdata = resdata||';MASTER='||VRMethod("CN_CONDET","GetFieldData", records.i, cd.masterfh)
1259 resdata = resdata||';MASTERTYPE='||VRMethod("CN_CONDET","GetFieldData", records.i, cd.mtypefh)
1260/* resdata = resdata||';MEMLEN='||VRMethod("CN_CONDET","GetFieldData", records.i, cd.memlenfh)
1261 resdata = resdata||';LOGFILE='||VRMethod("CN_CONDET","GetFieldData", records.i, cd.logfilefh)
1262 resdata = resdata||';LOGLEVEL='||VRMethod("CN_CONDET","GetFieldData", records.i, cd.loglevelfh) */
1263 resdata = resdata||';CTO='||VRMethod("CN_CONDET","GetFieldData", records.i, cd.ctoFH)
1264 resdata = resdata||';CLD='||VRMethod("CN_CONDET","GetFieldData", records.i, cd.cldFH)
1265 resdata = resdata||';EASUPPORT='||VRMethod("CN_CONDET","GetFieldData", records.i, cd.easupportfh)
1266 resdata = resdata||' '||VRMethod("CN_CONDET","GetFieldData", records.i, cd.rwfh)
1267 ok = VRSetIni( "PassiveConnections", cnt, resdata, settings.!ini )
1268 END
1269 else iterate
1270 end
1271 IF options.!debug == 1 THEN SAY time()' '||"_PassiveSave done"
1272return
1273
1274/*:VRX _PrinterInfo
1275*/
1276_PrinterInfo:
1277 if \_SMBpdrInstalled() then do
1278 /* SMB.PDR is not installed */
1279 CALL VRMessage 'Main', NLVGetMessage( 104 ), NLVGetMessage( 5 ), 'E'
1280 end
1281 else do /* SMB.pdr is installed */
1282 /* shared queue name */
1283 p_printer = SMBObj.resname
1284
1285 /* printer server */
1286 capt = VRMethod("CN_SMBTREE", "GetRecordAttr", SMBObj.parentrh, "Caption")
1287 parse var Capt p_prtsrv '0D0A'x .
1288 p_prtsrv = strip(p_prtsrv)
1289
1290 /* workgroup of the printer server */
1291 Gparrh = VRMethod("CN_SMBTREE", "GetRecordAttr", SMBObj.parentrh, "Parent")
1292 capt = VRMethod("CN_SMBTREE", "GetRecordAttr", GParrh, "Caption")
1293 parse var Capt p_workgroup '0D0A'x .
1294
1295 /* This is the string we will find in case this resource is already connected */
1296 DescStr = translate(p_prtsrv'#'p_printer'#'p_workgroup'#')
1297 say '"'DescStr'"'
1298 LDescStr = length(DescStr)
1299
1300 /* Enumerate all SMB ports */
1301 ok = SysIni('SYSTEM','PM_SPOOLER_PORT',"All:",'ports')
1302 if ports.0 = 0 then do
1303 /* No SMB ports installed */
1304 CALL VRMessage 'Main', NLVGetMessage( 105 ), NLVGetMessage( 5 ), 'E'
1305 end
1306 else do
1307 /* At least 1 SMB port was found - lets check whether it is already connected to our resource */
1308 FoundPort = 0
1309 do I = 1 to ports.0
1310 if left(ports.i,3) = 'SMB' then do
1311 say ports.I
1312 say translate(left(SysIni('SYSTEM','PM_'ports.I,'INITIALIZATION'),LDescStr))
1313 say DescStr
1314 if translate(left(SysIni('SYSTEM','PM_'ports.I,'INITIALIZATION'),LDescStr)) = DescStr then do
1315 OurPort = ports.I
1316 FoundPort = 1
1317 leave
1318 end
1319 end
1320 end
1321 say 'OurPort = "'OurPort'"'
1322 if Foundport then do
1323 ok = SysIni('SYSTEM','PM_SPOOLER_PRINTER',"All:",'printer')
1324 FoundPrinter = 0
1325 do I = 1 to printer.0
1326 prtsummary = SysINi('SYSTEM','PM_SPOOLER_PRINTER',printer.i)
1327 parse var prtsummary port ';'PrinterDriver';'PrinterQueue';' .
1328 say printer.I' 'prtsummary
1329 if port = ourPort then do
1330 PrinterName = SysINi('SYSTEM','PM_SPOOLER_PRINTER_DESCR',printer.i)
1331 parse var Printername Printername ';' .
1332 CALL VRMessage 'Main', PrinterName' ('PrinterQueue') prints to port ' Port' connected to \\'p_workgroup'\'p_prtsrv'\'p_printer, NLVGetMessage( 1 ), 'I'
1333 FoundPrinter = 1
1334 leave
1335 end
1336 end
1337 if FoundPrinter = 0 then do
1338 /* Port installed and configured, but not used by any printer */
1339 CALL VRMessage 'Main', NLVGetMessage( 106 ), NLVGetMessage( 5 ), 'E'
1340 end
1341 end
1342 else do
1343 CALL VRMessage 'Main', NLVGetMessage( 62 ), NLVGetMessage( 5 ), 'E'
1344 end
1345 end
1346 end
1347return
1348
1349/*:VRX _ShowMsg
1350*/
1351_ShowMsg:
1352 /* preliminary implementation - we just do not ignore it anymore -
1353 - ShowMsg from smbmon/smbusers shoule become a shared library */
1354 ok = VRSet("DT_StatusBar", "Caption", Msg.Text)
1355return
1356
1357/*:VRX _SmbConfCreateShadowCopy
1358*/
1359_SmbConfCreateShadowCopy:
1360 IF options.!debug == 1 THEN SAY time()' _SmbConfCreateShadowCopy started'
1361 /* we create a complete version of smb.conf in temporary directory for reading purposes */
1362 /* as we can only determine a default value from this complete version of the file */
1363 /* however it is not desirable to always have a complete copy normally */
1364 ok = SysFileDelete(samba.!shadowsmbconf)
1365 say ' 'samba.!testparmexe' -v -s 1>'samba.!shadowsmbconf' 2>'TempDir'testparm.stderr'
1366 address cmd samba.!testparmexe' -v -s 1>'samba.!shadowsmbconf' 2>'TempDir'testparm.stderr'
1367 IF options.!debug == 1 THEN SAY time()' _SmbConfCreateShadowCopy done'
1368return
1369
1370/*:VRX _SMBpdrInstalled
1371*/
1372_SMBpdrInstalled: procedure
1373 ok = VRGetINI("PM_PORT_DRIVER","SMB","SYSTEM")
1374return (ok <> "")
1375
1376/*:VRX _StemsInit
1377*/
1378_StemsInit:
1379 IF options.!debug == 1 THEN SAY time()' _StemsInit started'
1380 IF options.!debug == 1 THEN SAY ' initializing options.'
1381 options.!workgroup = ''
1382 options.!server = ''
1383 options.!share = ''
1384 options.!user = ''
1385 options.!password = ''
1386 options.!spassword = ''
1387 options.!master = ''
1388 options.!mastertype = ''
1389 options.!memlen = '2'
1390 options.!cachetimeout = '10'
1391 options.!cachelistings = '32'
1392 options.!easupport = '1'
1393 options.!readonly = ''
1394 options.!loglevel = 0
1395 options.!logfile = ''
1396
1397 options.!autoload = 0
1398 options.!autoclose = 0
1399 options.!nogui = 0
1400 options.!autostart = 0
1401 options.!editmode = 0
1402 options.!delay = 0
1403 options.!storecreds = 0
1404
1405 IF options.!debug == 1 THEN SAY ' initializing vfs. '
1406 vfs.!drive = ''
1407 vfs.!mountpoint = ''
1408
1409 IF options.!debug == 1 THEN SAY ' initializing advanced. '
1410 advanced.!browseauth = ''
1411 advanced.!browseimme = ''
1412 advanced.!broadcast = ''
1413 advanced.!special = ''
1414 advanced.!savepassive= ''
1415 advanced.!miniicons = ''
1416
1417 advanced.!easupport = 1
1418 advanced.!readonly = ''
1419 advanced.!alwaysmp = ''
1420 advanced.!cachetimeout = '10'
1421 advanced.!cachelistings = '32'
1422
1423 advanced.!smbconfchanged = 0
1424
1425 /* Obsolete */
1426 advanced.!memlen = ''
1427 advanced.!loglevel = '0'
1428 advanced.!logfile = ''
1429
1430 IF options.!debug == 1 THEN SAY ' initializing credentials. '
1431 credentials.!username = ""
1432 credentials.!password = ""
1433 credentials.!entered = 0
1434
1435 UserCred = ""
1436 RefreshMode = ""
1437
1438 IF options.!debug == 1 THEN SAY ' initializing mtype. '
1439 mtype.0 = 4
1440 mtype.1 = NLVGetMessage( 15 )
1441 mtype.2 = NLVGetMessage( 16 )
1442 mtype.3 = NLVGetMessage( 17 )
1443 mtype.4 = NLVGetMessage( 18 )
1444
1445 IF options.!debug == 1 THEN SAY ' initializing icons. '
1446 icons.!bat = '#1:PMWP.DLL'
1447 icons.!cmd = '#2:PMWP.DLL'
1448 icons.!exe = '#3:PMWP.DLL'
1449 icons.!template = '#10:PMWP.DLL'
1450 icons.!drive = '#16:PMWP.DLL'
1451 icons.!defaultfile = '#24:PMWP.DLL'
1452 icons.!folder = '#26:PMWP.DLL'
1453 icons.!folder_open = '#34:PMWP.DLL'
1454 icons.!machine_awake = '#35:PMWP.DLL'
1455 icons.!machine_sleeping = '#61:PMWP.DLL'
1456 icons.!workgroup = '#62:PMWP.DLL'
1457 icons.!pdc = '#63:PMWP.DLL'
1458 icons.!active = '#64:PMWP.DLL'
1459 icons.!passive = '#68:PMWP.DLL'
1460 icons.!printer = '#65:PMWP.DLL'
1461 icons.!drive_inactive = '#70:PMWP.DLL'
1462 icons.!pdf = '#80'
1463 icons.!spreadsheet = '#82'
1464 icons.!textdocument = '#86'
1465 icons.!framework = '#87'
1466 icons.!image = '#88'
1467 icons.!movie = '#89'
1468 icons.!sound = '#90'
1469 icons.!warpin = '#91'
1470 icons.!zip = '#92'
1471 icons.!view = '#93'
1472 icons.!plaintext = '#94'
1473
1474 IF options.!debug == 1 THEN SAY time()' _StemsInit done'
1475return
1476/*:VRX _TabbedDialogSetup
1477*/
1478_TabbedDialogSetup:
1479 IF options.!debug == 1 THEN SAY time()' _TabbedDialogSetup started'
1480 w = VRLoad( "TDL_1", VRWindowPath(), "SW_DIALOG" )
1481 ok = VRMethod( "TDL_1", "InsertPage", w,"+ "NLVGetMessage(13)" ")
1482 ok = VRMethod( "TDL_1", "SetStatusText", 1, NLVGetMessage(132,"1","2"))
1483 w = VRLoad( "TDL_1", VRWindowPath(), "SW_ADVANCED" )
1484 ok = VRMethod( "TDL_1", "InsertPage", w,"- "NLVGetMessage(40)" ")
1485 ok = VRMethod( "TDL_1", "SetStatusText", 2, NLVGetMessage(132,"2","2"))
1486 w = VRLoad( "TDL_1", VRWindowPath(), "SW_SMBTREE" )
1487 ok = VRMethod( "TDL_1", "InsertPage", w,"+ "NLVGetMessage(39)" ")
1488 w = VRLoad( "TDL_1", VRWindowPath(), "SW_CONDET" )
1489 ok = VRMethod( "TDL_1", "InsertPage", w,"+ "NLVGetMessage(63)" ")
1490 w = VRLoad( "TDL_1", VRWindowPath(), "SW_SETTINGS" )
1491 ok = VRMethod( "TDL_1", "InsertPage", w,"+ "NLVGetMessage(47)" ")
1492 IF options.!debug == 1 THEN SAY time()' _TabbedDialogSetup done'
1493return
1494
1495
1496/*:VRX _TabFix
1497*/
1498_TabFix:
1499 ok = VRMethod( "TDL_1", "SetTabText", arg(1), " "strip(VRMethod( "TDL_1", "GetTabText", arg(1)))" ")
1500return
1501
1502/*:VRX _TabsStrip
1503*/
1504_TabsStrip:
1505 ok = VRMethod( "TDL_1", "SetTabText", 1, strip(VRMethod( "TDL_1", "GetTabText", 1)))
1506 ok = VRMethod( "TDL_1", "SetTabText", 2, strip(VRMethod( "TDL_1", "GetTabText", 2)))
1507 ok = VRMethod( "TDL_1", "SetTabText", 3, strip(VRMethod( "TDL_1", "GetTabText", 3)))
1508 ok = VRMethod( "TDL_1", "SetTabText", 4, strip(VRMethod( "TDL_1", "GetTabText", 4)))
1509 ok = VRMethod( "TDL_1", "SetTabText", 5, strip(VRMethod( "TDL_1", "GetTabText", 5)))
1510return
1511
1512/*:VRX _UpdateObject
1513*/
1514_UpdateObject: procedure
1515 Object = arg(1)
1516 ObjValue = arg(2)
1517 if VRGet(Object,"Value") <> ObjValue then ok = VRset(Object,"Value",ObjValue)
1518return
1519
1520/*:VRX _UserCredUpdate
1521*/
1522_UserCredUpdate:
1523 IF options.!debug == 1 THEN SAY time()' _UserCredUpdate started'
1524 credentials.!username = VRGet("EF_USER","Value")
1525 credentials.!password = VRGet("EF_PASSWORD","Value")
1526
1527 if pos("4OS2", value("COMSPEC",,"OS2ENVIRONMENT")) = 0
1528 then UserCred = '--user='Credentials.!username'%'Credentials.!password
1529 else UserCred = '--user='Credentials.!username'%%'Credentials.!password
1530
1531 if options.!storecreds = 1 & \(UserCred = 'USERCRED' | UserCred = '' | UserCred = '--user=%' | UserCred = '-N') then do
1532 ok = _ucSetUc()
1533 call beep 2400, 10
1534 end
1535 else call beep 200, 20
1536 IF options.!debug == 1 THEN SAY time()' _UserCredUpdate done'
1537return
1538
1539/*:VRX CB_DEBUG_Click
1540*/
1541CB_DEBUG_Click:
1542
1543return
1544
1545/*:VRX CB_LOGGING_Click
1546*/
1547CB_LOGGING_Click:
1548 if VRFileExists(SysBootDrive()'\ndpsmb.dbg') then
1549 ok = SysFileDelete(SysBootDrive()'\ndpsmb.dbg')
1550 else do
1551 call lineout SysBootDrive()'\ndpsmb.dbg','EVFS debug flag file'
1552 ok = stream(SysBootDrive()'\ndpsmb.dbg','c','close')
1553 end
1554
1555 CALL VRSet "CB_LOGGING", "Set", VRFileExists(SysBootDrive()'\ndpsmb.dbg')
1556return
1557
1558/*:VRX CB_MOUNT_Change
1559*/
1560CB_MOUNT_Change:
1561 IF options.!debug == 1 THEN SAY time()' '||"CB_MOUNT_Change started"
1562
1563 mount = VRGet("CB_MOUNT", "Value")
1564
1565 SELECT
1566 WHEN mount == mtype.1 THEN DO
1567 CALL VRSet "DT_SHARE", "Visible", 1
1568 CALL VRSet "EF_SHARE", "Visible", 1
1569 CALL VRSet "DT_SERVER", "Visible", 1
1570 CALL VRSet "EF_SERVER", "Visible", 1
1571 CALL VRSet "CHK_MTYPE", "Visible", 0
1572 CALL NLVSetText "DT_NETWORK", "Caption", 21
1573 END
1574 WHEN mount == mtype.2 THEN DO
1575 CALL VRSet "DT_SHARE", "Visible", 0
1576 CALL VRSet "EF_SHARE", "Visible", 0
1577 CALL VRSet "DT_SERVER", "Visible", 1
1578 CALL VRSet "EF_SERVER", "Visible", 1
1579 CALL VRSet "CHK_MTYPE", "Visible", 0
1580 CALL NLVSetText "DT_NETWORK", "Caption", 21
1581 END
1582 WHEN mount == mtype.3 THEN DO
1583 CALL VRSet "DT_SHARE", "Visible", 0
1584 CALL VRSet "EF_SHARE", "Visible", 0
1585 CALL VRSet "DT_SERVER", "Visible", 0
1586 CALL VRSet "EF_SERVER", "Visible", 0
1587 CALL VRSet "CHK_MTYPE", "Visible", 0
1588 CALL NLVSetText "DT_NETWORK", "Caption", 21
1589 END
1590 WHEN mount == mtype.4 THEN DO
1591 CALL VRSet "DT_SHARE", "Visible", 0
1592 CALL VRSet "EF_SHARE", "Visible", 0
1593 CALL VRSet "DT_SERVER", "Visible", 0
1594 CALL VRSet "EF_SERVER", "Visible", 0
1595 CALL VRSet "CHK_MTYPE", "Visible", 1
1596 CALL NLVSetText "DT_NETWORK", "Caption", 22
1597 END
1598 END
1599 IF options.!debug == 1 THEN SAY time()' '||"CB_MOUNT_Change done"
1600RETURN
1601
1602/*:VRX CN_CONDET_Click
1603*/
1604CN_CONDET_Click:
1605 /* ok = VRset("DT_StatusBar","Caption", VRGet("Main", "HintText")) */
1606return
1607
1608/*:VRX CN_CONDET_ContextMenu
1609*/
1610CN_CONDET_ContextMenu:
1611 rh = VRInfo('Record')
1612 if VRMethod( "CN_CONDET", "ValidateRecord", rh) <> 1 then return
1613
1614 /* This is the place to enable specific context menu entries */
1615 ok = VRMethod( "CN_CONDET", "GetRecordList", "All", "records." )
1616 ok = VRSet("Menu_Selected_Remove", "Visible", (records.0 <> 0))
1617 ok = VRSet("Menu_Selected_Retry", "Visible", (records.0 <> 0))
1618
1619 if VRMethod( "CN_CONDET", "GetFieldData", rh, CD.StatusFH) = icons.!passive then do
1620 ok = VRSet("Menu_Selected_Retry", "Enabled",1)
1621 ok = VRSet("Menu_Selected_Remove", "Enabled",1)
1622 end
1623 ok = VRMethod( "Menu_Selected", "Popup", , , "", "" )
1624return
1625/*:VRX CN_CONDET_DragStart
1626*/
1627CN_CONDET_DragStart:
1628
1629 obj = VRInfo( "object" )
1630 ok = VRMethod( "CN_CONDET", "GetRecordList", "SourceOrSelected", "selrec." )
1631 if selrec.0 = 0 then return
1632
1633 Icon = VRMethod("CN_CONDET", "GetRecordAttr", selrec.1, "Icon")
1634
1635 if Icon = icons.!printer then do /* Printers not supported at the moment */
1636 CALL VRMessage 'Main', NLVGetMessage( 62 ), NLVGetMessage( 5 ), 'E'
1637 end
1638 else call VRMethod obj, 'StartDrag'
1639return
1640
1641/*:VRX CN_CURRENT_Click
1642*/
1643CN_CURRENT_Click:
1644 IF options.!debug == 1 THEN SAY time()' CN_CURRENT_Click started'
1645 /* ok = VRset("DT_StatusBar","Caption", VRGet("Main", "HintText")) */
1646
1647 /* Herwig B. */
1648 CALL VRSet "TM_AUTOCLOSE", "ENABLED", 0
1649
1650 rh = VRInfo('Record')
1651 if VRMethod( "CN_CURRENT", "ValidateRecord", rh) <> 1 then return
1652
1653 data = VRMethod("CN_CURRENT", 'GetRecordAttr', rh, 'UserData')
1654 options.currentdata = data
1655
1656 /* ok = VRset("DT_StatusBar","Caption", data' - 'VRGet("Main", "HintText")) */
1657
1658 PARSE VAR data p_node ';' p_mounts ';' p_string
1659
1660 IF options.!debug == 1 THEN do
1661 SAY ' data = "'data'"'
1662 SAY ' p_node = "'p_node'"'
1663 SAY ' p_mounts = "'p_mounts'"'
1664 SAY ' p_string = "'p_string'"'
1665 end
1666
1667 if p_string = ""
1668 then infotext = fs.!name' 'fs.!version
1669 else infotext = p_string
1670
1671 if infotext = "" then infotext = " "
1672 CALL VRSet "CN_CURRENT", "Caption", infotext
1673 CALL VRSet "CN_CURRENT", 'HintText',infotext
1674
1675 IF p_mounts > 0 THEN DO
1676 CALL VRSet 'PB_UNMOUNT', 'Enabled', 1
1677 CALL VRSet 'MENU_CONTEXT_UNMOUNT', 'Visible', 1
1678
1679 if pos("*",p_string) > 0 | pos(";",p_string) > 0
1680 then CALL VRSet 'MENU_CONTEXT_EDIT', 'Visible', 0
1681 else CALL VRSet 'MENU_CONTEXT_EDIT', 'Visible', 1
1682 END
1683 ELSE DO
1684 CALL VRSet 'PB_UNMOUNT', 'Enabled', 0
1685 CALL VRSet 'MENU_CONTEXT_UNMOUNT', 'Visible', 0
1686 CALL VRSet 'MENU_CONTEXT_EDIT', 'Visible', 0
1687 END
1688
1689 parent = VRMethod("CN_CURRENT", 'GetRecordAttr', rh, 'Parent')
1690
1691 IF parent == '' THEN DO
1692 CALL VRSet 'PB_DETACH', 'Enabled', 1
1693 CALL VRSet 'MENU_CONTEXT_DETACH', 'Visible', 1
1694 CALL VRSet 'MENU_CONTEXT_OPEN', 'Visible', 1
1695/* CALL VRSet 'MENU_CONTEXT_SEP1', 'Visible', 1 */
1696 CALL VRSet 'MENU_CONTEXT_DETACH_ALL', 'Visible', 1
1697/* CALL VRSet 'MENU_CONTEXT_SEP2', 'Visible', 1 */
1698
1699 END
1700 ELSE DO
1701 CALL VRSet 'PB_DETACH', 'Enabled', 0
1702 CALL VRSet 'MENU_CONTEXT_DETACH', 'Visible', 0
1703 CALL VRSet 'MENU_CONTEXT_OPEN', 'Visible', 0
1704/* CALL VRSet 'MENU_CONTEXT_SEP1', 'Visible', 0 */
1705 CALL VRSet 'MENU_CONTEXT_DETACH_ALL', 'Visible', 0
1706/* CALL VRSet 'MENU_CONTEXT_SEP2', 'Visible', 0 */
1707 END
1708
1709 parse var p_string p_workgroup':\\'p_server'\'p_share
1710
1711 p_server = translate(p_server)
1712
1713 ok = VRSet("EF_NETWORK","Value", p_workgroup)
1714 if p_workgroup <> "" then do
1715 wgh = _GetMachineHandle(p_workgroup)
1716 if wgh = "" then wgh = _AddWorkGroup(p_workgroup)
1717 call _UpdateObject "EF_SERVER", p_server
1718 mh = _GetMachineHandle(p_server)
1719 if mh = "" & p_server <> "*" then do
1720 mh = _AddSleepingMachine(p_server,'',wgh)
1721 machine = p_server
1722 call _RefreshShares
1723 end
1724 ok = VRSet("EF_Share","Value", p_share)
1725 select
1726 when p_workgroup = "*" then ok = VRSet("CB_MOUNT","Value", mtype.4)
1727 when p_server = "*" then ok = VRSet("CB_MOUNT","Value", mtype.3)
1728 when p_share = "*" then ok = VRSet("CB_MOUNT","Value", mtype.2)
1729 otherwise ok = VRSet("CB_MOUNT","Value", mtype.1)
1730 end
1731 end
1732 IF options.!debug == 1 THEN SAY time()' CN_CURRENT_Click done'
1733RETURN
1734
1735/*:VRX CN_CURRENT_ContextMenu
1736*/
1737CN_CURRENT_ContextMenu: /* PROCEDURE EXPOSE existrec. options. icons. fs. */
1738 IF options.!debug == 1 THEN SAY time()' '||"CN_CURRENT_ContextMenu started"
1739
1740 CALL VRSet "TM_AUTOCLOSE", "ENABLED", 0
1741
1742 rh = VRInfo('Record')
1743
1744 /* we have to check whether the record still exists because under certain
1745 circumstances the event routine is executed after the record was already
1746 removed */
1747 if VRMethod( "CN_CURRENT", "ValidateRecord", rh) <> 1 then do
1748 IF options.!debug == 1 THEN SAY time()' '||"CN_CURRENT_ContextMenu aborted"
1749 return
1750 end
1751
1752 data = VRMethod("CN_CURRENT", 'GetRecordAttr', rh, 'UserData')
1753 PARSE VAR data p_node ';' p_mounts ';' p_string
1754
1755 IF options.!debug == 1 THEN do
1756 SAY ' data = "'data'"'
1757 SAY ' p_node = "'p_node'"'
1758 SAY ' p_mounts = "'p_mounts'"'
1759 SAY ' p_string = "'p_string'"'
1760 end
1761/*
1762 infotext = p_node
1763 DO i = 1 TO p_mounts
1764 infotext = infotext ' ['p_string']'
1765 END
1766*/
1767 if p_string = ""
1768 then infotext = fs.!name' 'fs.!version
1769 else infotext = p_string
1770
1771 if infotext = "" then infotext = " "
1772 CALL VRSet "CN_CURRENT", "Caption", infotext
1773 CALL VRSet "CN_CURRENT", 'HintText',infotext
1774
1775 CALL VRSet 'MENU_CONTEXT_OPEN', 'Visible', 1
1776/* CALL VRSet 'MENU_CONTEXT_SEP1', 'Visible', 1
1777 CALL VRSet 'MENU_CONTEXT_SEP2', 'Visible', 1
1778 CALL VRSet 'MENU_CONTEXT_SEP3', 'Visible', 1 */
1779 CALL VRSet 'Menu_Context_Open_Default', "Visible", 1
1780
1781 IF p_mounts > 0 THEN DO
1782 CALL VRSet 'PB_UNMOUNT', 'Enabled', 1
1783 CALL VRSet 'MENU_CONTEXT_UNMOUNT', 'Visible', 1
1784
1785 if pos("*",p_string) > 0 | pos(";",p_string) > 0 then CALL VRSet 'MENU_CONTEXT_EDIT', 'Visible', 0
1786 else CALL VRSet 'MENU_CONTEXT_EDIT', 'Visible', 1
1787 END
1788 ELSE DO
1789 CALL VRSet 'PB_UNMOUNT', 'Enabled', 0
1790 CALL VRSet 'MENU_CONTEXT_UNMOUNT', 'Visible', 0
1791 CALL VRSet 'MENU_CONTEXT_EDIT', 'Visible', 0
1792 END
1793
1794 parent = VRMethod("CN_CURRENT", 'GetRecordAttr', rh, 'Parent')
1795
1796 IF parent == '' THEN DO
1797 CALL VRSet 'PB_DETACH', 'Enabled', 1
1798 CALL VRSet 'MENU_CONTEXT_DETACH', 'Visible', 1
1799 CALL VRSet 'MENU_CONTEXT_OPEN', 'Visible', 1
1800/* CALL VRSet 'MENU_CONTEXT_SEP1', 'Visible', 1 */
1801 CALL VRSet 'MENU_CONTEXT_DETACH_ALL', 'Visible', 1
1802/* CALL VRSet 'MENU_CONTEXT_SEP2', 'Visible', 1 */
1803/* CALL VRSet 'MENU_CONTEXT_SEP3', 'Visible', 1 */
1804 END
1805 ELSE DO
1806 CALL VRSet 'PB_DETACH', 'Enabled', 0
1807 CALL VRSet 'MENU_CONTEXT_DETACH', 'Visible', 0
1808 CALL VRSet 'MENU_CONTEXT_OPEN', 'Visible', 0
1809/* CALL VRSet 'MENU_CONTEXT_SEP1', 'Visible', 0 */
1810 CALL VRSet 'MENU_CONTEXT_DETACH_ALL', 'Visible', 0
1811/* CALL VRSet 'MENU_CONTEXT_SEP2', 'Visible', 0 */
1812/* CALL VRSet 'MENU_CONTEXT_SEP3', 'Visible', 0 */
1813 END
1814
1815 ok = VRMethod( "Menu_Context", "Popup", , , "", "" )
1816 IF options.!debug == 1 THEN SAY time()' '||"CN_CURRENT_ContextMenu done"
1817return
1818
1819/*:VRX CN_CURRENT_DoubleClick
1820*/
1821CN_CURRENT_DoubleClick:
1822 IF options.!debug == 1 THEN SAY time()' '||"CN_CURRENT_DoubleClick started"
1823
1824 CALL VRSet "TM_AUTOCLOSE", "ENABLED", 0
1825
1826 rh = VRInfo('Record')
1827
1828 /* we have to check whether the record still exists because under certain
1829 circumstances the event routine is executed after the record was already
1830 removed */
1831 if VRMethod( "CN_CURRENT", "ValidateRecord", rh) <> 1 then do
1832 IF options.!debug == 1 THEN SAY time()' '||"CN_CURRENT_DoubleClick aborted"
1833 return
1834 end
1835
1836 data = VRMethod("CN_CURRENT", 'GetRecordAttr', rh, 'UserData')
1837 PARSE VAR data p_node ';' p_mounts ';' p_string
1838
1839 IF options.!debug == 1 THEN do
1840 SAY ' data = "'data'"'
1841 SAY ' p_node = "'p_node'"'
1842 SAY ' p_mounts = "'p_mounts'"'
1843 SAY ' p_string = "'p_string'"'
1844 end
1845 call Menu_Context_Open_Default_Click
1846
1847 IF options.!debug == 1 THEN SAY time()' '||"CN_CURRENT_DoubleClick done"
1848return
1849
1850/*:VRX CN_CURRENT_DragDrop
1851*/
1852CN_CURRENT_DragDrop:
1853 IF options.!debug == 1 THEN SAY time()' CN_CURRENT_DragDrop started'
1854 ok = VRSet("TM_RefreshCurrentDisplay","Enabled", 0)
1855 IF options.!debug == 1 THEN say " settings.!network = "settings.!network
1856
1857 p_workgroup = ''
1858 p_server = ''
1859 p_share = ''
1860
1861 srcFile = VRInfo( "SourceFile" )
1862 srcCtn = VRInfo( "SourceObject" )
1863 srcRec = VRInfo( "SourceRecord" )
1864 trgCtn = VRInfo( "TargetObject" )
1865 trgRec = VRInfo( "TargetRecord" )
1866
1867 IF options.!debug == 1 THEN do
1868 say ' srcFile = "'srcFile'"'
1869 say ' srcCtn = "'srcCtn'"'
1870 if srcCtn <> "" then say ' srcCtn name = "'VRGet(srcCtn,'Name')'"'
1871 say ' srcRec = "'srcRec'"'
1872 say ' trgCtn = "'trgCtn'"'
1873 if trgCtn <> "" then say ' trgCtn name = "'VRGet(trgCtn,'Name')'"'
1874 say ' trgRec = "'trgRec'"'
1875 end
1876
1877 if srcFile <> "" then do /* A file was dropped onto the container - attempt to load it */
1878 IF options.!debug == 1 THEN say ' Possible profile dropped: "'srcFile'"'
1879
1880 /* was it really a profile ? */
1881 if translate(VRParseFileName(srcFile,'E')) = translate(fs.!profileext) then do /* Yes - load it! */
1882 options.!autoload = 1
1883 Profile = srcFile
1884 call Menu_File_Load_Click
1885 ok = VRSet("EF_NETWORK","Value",options.!workgroup)
1886 end
1887 else do /* No - barf! */
1888 buttons.0 = 1
1889 buttons.1 = NLVGetMessage(9)
1890 ok = VRMessage('Main', NLVGetMessage(103,srcFile ), NLVGetMessage(5), 'E','buttons.')
1891 end
1892 IF options.!debug == 1 THEN SAY time()' CN_CURRENT_DragDrop done (load profile)'
1893 return
1894 end
1895
1896 ok = VRMethod("CB_MOUNT", "GetStringList", "ShareLevels." )
1897
1898 if VRGet(srcCtn,'Name') = "CN_CONDET" then do
1899 p_mpoint = VRMethod("CN_CONDET", "GetFieldData", srcRec, CD.MpointFH)
1900
1901 p_workgroup = VRMethod("CN_CONDET", "GetFieldData", srcRec, CD.WorkgroupFH)
1902 p_server = VRMethod("CN_CONDET", "GetFieldData", srcRec, CD.ServerFH)
1903 p_share = VRMethod("CN_CONDET", "GetFieldData", srcRec, CD.ShareFH)
1904 p_user = VRMethod("CN_CONDET", "GetFieldData", srcRec, CD.UserFH)
1905 p_password = x2c(VRMethod("CN_CONDET", "GetFieldData", srcRec, CD.SpasswordFH))
1906
1907 ShareLevel = 1
1908 if p_share = "" then ShareLevel = 2
1909 if p_server = "" then ShareLevel = 3
1910 if p_workgroup = "" then ShareLevel = 4
1911
1912 ok = VRSet("CB_MOUNT", "Selected", Sharelevel )
1913 ok = VRset("CB_MOUNT", "Value", mtype.sharelevel)
1914
1915 call _UpdateObject "EF_SERVER", p_server
1916 ok = VRset("EF_SHARE", "Value", p_share)
1917 ok = VRset("EF_NETWORK", "Value", p_workgroup)
1918 ok = VRset("EF_USER", "Value", p_user)
1919 ok = VRset("EF_PASSWORD", "Value", p_password)
1920
1921 parse var p_mpoint p_drv '\' p_dir
1922
1923 p_dir = strip(p_dir,'T','\')
1924
1925 ok = VRset("CB_DRIVES", "Value", p_drv)
1926 ok = VRset("EF_DIRECTORY", "Value", p_dir)
1927 end /* Drag from CN_CONDET */
1928
1929 else do /* Drag from CN_SMBTREE */
1930 call _GetSMBObjectProperties srcRec
1931 select
1932 when SMBObj.udatatype = "WORKGROUP" then do
1933 say "Workgroup dragged!"
1934 p_workgroup = SMBObj.resname
1935 p_server = ""
1936 p_share = ""
1937
1938 ShareLevel = 3
1939 end
1940 when SMBObj.udatatype = "SERVER" then do
1941 say "Server dragged!"
1942 p_workgroup = VRMethod("CN_SMBTREE", "GetRecordAttr", SMBObj.parentrh, "Caption")
1943 p_server = SMBObj.resname
1944 p_share = ""
1945
1946 ShareLevel = 2
1947 end
1948 when SMBObj.udatatype = "DISK" then do
1949 say "Shared disk dragged!"
1950 p_workgroup = VRMethod("CN_SMBTREE", "GetRecordAttr", SMBObj.gparentrh, "Caption")
1951 p_server = VRMethod("CN_SMBTREE", "GetRecordAttr", SMBObj.parentrh, "Caption")
1952 parse var p_server p_server '0D0A'x .
1953 p_share = SMBObj.resname
1954
1955 ShareLevel = 1
1956 end
1957 otherwise nop /* Printer */
1958 end
1959 ok = VRSet("EF_NETWORK","Value",p_workgroup)
1960 call _UpdateObject "EF_SERVER", p_server
1961 ok = VRSet("EF_Share","Value", p_share)
1962 end /* Drag from CN_SMBTREE */
1963
1964 IF options.!debug == 1 THEN do
1965 say 'p_workgroup = "'p_workgroup'"'
1966 say 'p_server = "'p_server'"'
1967 say 'p_share = "'p_share'"'
1968 end
1969
1970 ok = VRSet( "CB_MOUNT", "Selected", Sharelevel )
1971
1972 settings.!network = VRGet("EF_NETWORK","Value")
1973 call CB_MOUNT_Change
1974
1975 if trgRec = "" then do
1976 ok = VRMethod("CB_DRIVES", "GetStringList", "freedrives.")
1977 if freedrives.0 > 0
1978 then ok = VRSet("CB_DRIVES","Value", freedrives.1)
1979 else ok = VRSet("CB_DRIVES","Value", "")
1980
1981 ok = VRSet("EF_DIRECTORY","Value", "")
1982 end
1983 else do
1984 TargetString = VRMethod(trgCtn, "GetRecordAttr", trgRec, "Caption")
1985
1986 parTrgRH = VRMethod(trgCtn, "GetRecordAttr", trgRec, "Parent")
1987
1988 do while parTrgRH <> ""
1989 partrgCapt = VRMethod(trgCtn, "GetRecordAttr", partrgRH, "Caption")
1990 TargetString = partrgCapt||'\'||TargetString
1991 parTrgRH = VRMethod(trgCtn, "GetRecordAttr", partrgRH , "Parent")
1992 end
1993 say 'TargetString = "'TargetString'"'
1994 ok = VRSet("CB_DRIVES","Value", left(TargetString,2))
1995 ok = VRSet("EF_DIRECTORY","Value", substr(TargetString,4))
1996 end
1997
1998 window = VRLoadSecondary( "SW_MOUNTPOINT", "W" )
1999 if VRGet("CB_DRIVES","Value") = "" then return
2000
2001 window = VRLoadSecondary( "SW_LOGIN", "W" )
2002 if credentials.!entered = 1 then call PB_MOUNT_CLICK
2003
2004 if VRGet(srcCtn,'Name') = "CN_CONDET" & VRMethod( "CN_CONDET", "ValidateRecord", srcRec) = 1 then do
2005 if VRMethod("CN_CONDET", "GetRecordAttr", srcRec, "Icon") = icons.!passive then ok = VRMethod( "CN_CONDET", "RemoveRecord", srcRec)
2006 end
2007 IF options.!debug == 1 THEN SAY time()' CN_CURRENT_DragDrop done'
2008return
2009/*:VRX CN_SMBTREE_Click
2010*/
2011CN_SMBTREE_Click:
2012 IF options.!debug == 1 THEN SAY time()' CN_SMBTREE_Click started'
2013 /* ok = VRset("DT_StatusBar","Caption", VRGet("Main", "HintText")) */
2014
2015 call _dropdeprecated
2016 call _GetSmbObjectProperties VRInfo('Record')
2017 call _ContextMenuSelectedSet
2018
2019 ok = VRset("DT_Statusbar", "Caption", SMBObj.udatamsg)
2020
2021 IF options.!debug == 1 THEN SAY time()' CN_SMBTREE_Click done'
2022return
2023/*:VRX CN_SMBTREE_ContextMenu
2024*/
2025CN_SMBTREE_ContextMenu:
2026 IF options.!debug == 1 THEN SAY time()' CN_SMBTREE_ContextMenu started'
2027
2028 call _dropdeprecated
2029 call _GetSmbObjectProperties VRInfo('Record')
2030
2031 call _ContextMenuSelectedSet
2032 ok = VRMethod( "Menu_Selected", "Popup", , , "", "" )
2033
2034 IF options.!debug == 1 THEN SAY time()' CN_SMBTREE_ContextMenu done'
2035return
2036/*:VRX CN_SMBTREE_DoubleClick
2037*/
2038CN_SMBTREE_DoubleClick:
2039 IF options.!debug == 1 THEN SAY time()' CN_SMBTREE_DoubleClick started'
2040
2041 call _dropdeprecated
2042 call _GetSmbObjectProperties VRInfo('Record')
2043
2044/* IF options.!debug == 1 THEN SAY time()' CN_SMBTREE_DoubleClick done'
2045return */
2046 /* Enable last 2 lines for 2.0.x (to disable on the fly browsing) */
2047
2048 IF options.!debug == 1 THEN SAY ' Browsing "'SMBObj.udatatype'"'
2049
2050 If SMBObj.udatatype = "DIRECTORY" then do
2051 BrowsePath = _browsebuildpath(SMBObj.rh)
2052
2053 call _BrowseResetObject(SmbObj.rh)
2054
2055 parse var browsepath '\\'machine'\'sharename '\' browsepath
2056 browsepath = browsepath'\*'
2057
2058 call _BrowseDirectory
2059 end
2060
2061 If SMBObj.udatatype = "FILE" then do
2062 BrowsePath = _browsebuildpath(SMBObj.rh)
2063 call _BrowseResetObject(SmbObj.rh)
2064
2065 parse var browsepath '\\'machine'\'sharename '\' browsepath
2066
2067 OpenOk = _browseobjectopen(machine,sharename,browsepath)
2068
2069 if \OpenOK then do
2070 say " Not connected - trying to connect"
2071 ok = VRMethod( "CN_SMBTREE", "SetRecordAttr", sharerh, "Selected", 1)
2072 call PB_SMBTREE_CONNECT_Click
2073 ok = VRMethod( "CN_SMBTREE", "SetRecordAttr", SMBObj.rh, "Selected", 1)
2074
2075 OpenOk = _browseobjectopen(machine,sharename,browsepath)
2076
2077 if \OpenOk then do
2078 say " Not connected - cannot open - aborting!"
2079 end
2080 end
2081 end
2082
2083 if SMBObj.udatatype = "DISK" then do
2084 machine = VRMethod("CN_SMBTREE","GetRecordAttr",SMBObj.parentrh,"Caption")
2085 parse var machine machine '0D0A'x .
2086 machine = strip(machine)
2087
2088 call _BrowseResetObject(SmbObj.rh)
2089
2090 sharename = SMBObj.resname
2091 BrowsePath = ""
2092
2093 call _BrowseDirectory
2094 end
2095 IF options.!debug == 1 THEN SAY time()' CN_SMBTREE_DoubleClick done'
2096return
2097/*:VRX CN_SMBTREE_DragFile
2098*/
2099CN_SMBTREE_DragFile:
2100 IF options.!debug == 1 THEN SAY time()' CN_SMBTREE_DragFile started'
2101
2102 obj = VRInfo( "object" )
2103
2104 ok = VRMethod( "CN_SMBTREE", "GetRecordList", "SourceOrSelected", "SelRH." )
2105 if SelRH.0 = 0 then do
2106 IF options.!debug == 1 THEN SAY time()' CN_SMBTREE_DragStart aborted'
2107 return
2108 end
2109
2110 call _dropdeprecated
2111 call _GetSMBObjectProperties SelRH.1
2112
2113 select
2114 when SMBObj.udatatype = "WORKGROUP" | SMBObj.udatatype = "SERVER" | SMBObj.udatatype = "DISK" then do
2115 call VRMethod obj, 'StartDrag'
2116 end
2117 when SMBObj.udatatype = "PRINTER" then do
2118 CALL VRMessage 'Main', NLVGetMessage( 62 ), NLVGetMessage( 5 ), 'E'
2119 end
2120 otherwise nop /* FILE DIRECTORY */
2121 end
2122
2123 IF options.!debug == 1 THEN SAY time()' CN_SMBTREE_DragFile done'
2124return
2125
2126/*:VRX CN_SMBTREE_DragStart
2127*/
2128CN_SMBTREE_DragStart:
2129 IF options.!debug == 1 THEN SAY time()' CN_SMBTREE_DragStart started'
2130
2131 obj = VRInfo( "object" )
2132
2133 ok = VRMethod( "CN_SMBTREE", "GetRecordList", "SourceOrSelected", "SelRH." )
2134 if SelRH.0 = 0 then do
2135 IF options.!debug == 1 THEN SAY time()' CN_SMBTREE_DragStart aborted'
2136 return
2137 end
2138
2139 call _dropdeprecated
2140 call _GetSMBObjectProperties SelRH.1
2141
2142 select
2143 when SMBObj.udatatype = "WORKGROUP" | SMBObj.udatatype = "SERVER" | SMBObj.udatatype = "DISK" then do
2144 call VRMethod obj, 'StartDrag'
2145 end
2146 when SMBObj.udatatype = "PRINTER" then do
2147 CALL VRMessage 'Main', NLVGetMessage( 62 ), NLVGetMessage( 5 ), 'E'
2148 end
2149 otherwise nop /* FILE DIRECTORY */
2150 end
2151
2152 IF options.!debug == 1 THEN SAY time()' CN_SMBTREE_DragStart done'
2153return
2154/*:VRX CreateObject
2155*/
2156CreateObject: procedure
2157 Parse Arg Class, Title, Location, Setup, Collision
2158 /* Say 'Creating ['Title']' */
2159say Setup
2160 rc = SysCreateObject( Class, Title, Location, Setup, Collision )
2161 If rc <> 1 Then do
2162 Msg.Text = ' > failed to create ['Title' | 'Class'] at location ['Location']'
2163 Msg.Type = 'Error'
2164 say Msg.Text
2165 end
2166return rc
2167/*:VRX DT_STATUSBAR_ContextMenu
2168*/
2169DT_STATUSBAR_ContextMenu:
2170 ok = VRSet("DT_STATUSBAR","Caption", VRGet("Main", "HintText"))
2171return
2172
2173/*:VRX EF_PASSWORD1_KeyPress
2174*/
2175EF_PASSWORD1_KeyPress:
2176 IF options.!debug == 1 THEN SAY time()' EF_PASSWORD1_KeyPress started'
2177 obj = VRInfo( "Object" )
2178 keystr = VRGet( obj, "KeyString" )
2179/* say keystr */
2180 select
2181 when keystr = "{Enter}" then call PB_LOGIN_OK_Click
2182 when keystr = "{Newline}" then call PB_LOGIN_OK_Click
2183 when keystr = "{Esc}" then call PB_LOGIN_CANCEL_Click
2184 otherwise nop
2185 end
2186 IF options.!debug == 1 THEN SAY time()' EF_PASSWORD1_KeyPress done'
2187return
2188
2189/*:VRX EF_PASSWORD_Change
2190*/
2191EF_PASSWORD_Change:
2192 Now = VRGet("EF_PASSWORD","value")
2193 if Now = "" | Now = LastPassword then return
2194 ok = SysSleep(1)
2195 LastPassword = Now
2196 if Now <> VRGet("EF_PASSWORD","value") then return
2197 call _UserCredUpdate
2198return
2199
2200/*:VRX EF_SERVER_Change
2201*/
2202EF_SERVER_Change:
2203 IF options.!debug == 1 THEN SAY time()' EF_SERVER_Change started'
2204 Now = VRGet("EF_SERVER","value")
2205say now' 'LastServer
2206 if Now = "" | Now = LastServer then return
2207 ok = SysSleep(2)
2208 if Now <> VRGet("EF_SERVER","value") then return
2209
2210 IF options.!editmode = 1 then return
2211
2212 /* Do nothing for incomplete IP addresses */
2213 if strip(translate(VRGet("EF_SERVER","value"),copies(' ',11),'01234567890.')) = "" then do /* got an IP address */
2214 if \_IsValidIPAddress(VRGet("EF_SERVER","value")) then return /* it is invalid or incomplete */
2215 end
2216
2217 machine = VRGet("EF_SERVER","value")
2218 rh = _GetMachineHandle(machine)
2219
2220 if rh <> "" then do
2221 call _GetSMBObjectProperties rh
2222
2223 if SMBObj.parentrh = ""
2224 then ok = VRSet("EF_NETWORK","Value", "") /* The workgroup might be unknown at this moment */
2225 else ok = VRSet("EF_NETWORK","Value", VRMethod("CN_SMBTREE","GetRecordAttr",SMBObj.parentRH,"Caption"))
2226
2227 call _GetSMBObjectShares rh
2228
2229 ok = VRMethod("EF_SHARE", "Reset")
2230 if SMBObj.shares.0 > 0 then ok = VRMethod("EF_SHARE", "AddRecordList", "SMBObj.shares.")
2231 end
2232 else do
2233 call _RefreshWorkgroups
2234 smbtree.!machine = _AddSleepingMachine(machine,"","")
2235 call _UserCredUpdate
2236 call _RefreshShares
2237 ok = VRSet( "CN_smbtree", "Painting", 1 )
2238
2239 ok = VRSet("Main", 'Pointer', '<default>' )
2240 ok = VRSet("CN_smbtree","Enabled", 1)
2241 ok = VRSet("TM_Throbber","Enabled", 0)
2242 ok = VRSet("Pict_Throbber","Visible", 0)
2243 end
2244
2245 LastServer = VRGet("EF_SERVER","value")
2246 IF options.!debug == 1 THEN SAY time()' EF_SERVER_Change done'
2247return
2248
2249/*:VRX EF_USER1_KeyPress
2250*/
2251EF_USER1_KeyPress:
2252 IF options.!debug == 1 THEN SAY time()' EF_USER1_KeyPress started'
2253 obj = VRInfo( "Object" )
2254 keystr = VRGet( obj, "KeyString" )
2255 say keystr
2256 select
2257 when keystr = "{Enter}" then ok = VRMethod( "EF_Password1", "SetFocus" )
2258 when keystr = "{Newline}" then ok = VRMethod( "EF_Password1", "SetFocus" )
2259 when keystr = "{Esc}" then call PB_LOGIN_CANCEL_Click
2260 otherwise nop
2261 end
2262 IF options.!debug == 1 THEN SAY time()' EF_USER1_KeyPress done'
2263return
2264
2265/*:VRX EF_USER_Change
2266*/
2267EF_USER_Change:
2268 Now = VRGet("EF_USER","value")
2269 if Now = "" | Now = LastUser then return
2270 ok = SysSleep(1)
2271 LastUser = Now
2272 if Now <> VRGet("EF_USER","value") then return
2273 call _UserCredUpdate
2274return
2275
2276/*:VRX EF_WINS_SERVER_Change
2277*/
2278EF_WINS_SERVER_Change:
2279 advanced.!smbconfchanged = 1
2280return
2281
2282/*:VRX Fini
2283*/
2284Fini:
2285 window = VRWindow()
2286 call VRSet window, "Visible", 0
2287 drop window
2288return 0
2289
2290/*:VRX GetChildren
2291*/
2292GetChildren: PROCEDURE EXPOSE existrec. exc options. icons. fs. cd. samba.
2293 IF options.!debug == 1 THEN SAY time()' GetChildren started'
2294 PARSE ARG node, parec
2295
2296 CALL _Dynamic "CALL "fs.!prefix"RxGetMount node, 'info.', 'points.', 'res.'"
2297
2298 IF info.2 > 0 THEN icon = icons.!active
2299 ELSE icon = icons.!passive
2300
2301 rh = VRMethod("CN_CURRENT", 'AddRecord', parec, 'Last', info.0, icon )
2302 IF rh == '' | datatype(res.0) <> "NUM" THEN RETURN
2303
2304 exc = exc + 1
2305 existrec.exc = rh
2306 userdata = node';'info.2
2307 DO i = 1 TO res.0
2308 userdata = ParseResourceData( userdata, res.i )
2309 END
2310 if userdata = "UNKNOWN" then ok = VRMethod("CN_CURRENT", 'RemoveRecord', rh)
2311 else do
2312 CALL VRMethod "CN_CURRENT", 'SetRecordAttr', rh, 'UserData', userdata
2313 if options.currentdata = userdata then ok = VRMethod("CN_CURRENT", 'SetRecordAttr', rh, 'Selected', 1)
2314 end
2315
2316 DO i = 1 TO points.0
2317 childnode = node || points.i || '\'
2318 CALL GetChildren childnode, rh
2319 END
2320 IF options.!debug == 1 THEN SAY time()' GetChildren done'
2321RETURN
2322
2323/*:VRX GetMountPoints
2324*/
2325GetMountPoints: PROCEDURE EXPOSE existrec. options. icons. fs. cd. samba.
2326 IF options.!debug == 1 THEN SAY time()' GetMountPoints started'
2327/* CALL VRSet "CN_CURRENT", 'Painting', 0 */
2328/* IF options.!debug == 1 THEN SAY time()' '||"GetMountPoints: SysDriveMap(USED) started" */
2329 drvs = SysDriveMap('C:', 'USED') /* was "REMOTE" */
2330/* IF options.!debug == 1 THEN SAY time()' '||"GetMountPoints: SysDriveMap(USED) done" */
2331 ac = 0
2332 DO i = 1 TO WORDS( drvs )
2333 fs = TRANSLATE( SysFileSystemType( WORD( drvs, i )))
2334 IF fs == fs.!fileSystemtype THEN DO
2335 ac = ac + 1
2336 attached.ac = WORD( drvs, i )
2337 END
2338 END
2339 attached.0 = ac
2340
2341 exc = 0
2342 DO i = 1 TO attached.0
2343 node = attached.i'\'
2344
2345 CALL VRMethod 'CB_DRIVES', 'AddString', attached.i
2346
2347 CALL _Dynamic "CALL "fs.!prefix"RxGetMount node, 'info.', 'points.', 'res.'"
2348
2349 IF info.2 > 0 THEN icon = icons.!drive
2350 ELSE icon = icons.!drive_inactive
2351
2352 rh = VRMethod("CN_CURRENT", 'AddRecord',, 'Last', attached.i, icon )
2353 IF rh == '' THEN ITERATE
2354
2355 exc = exc + 1
2356 existrec.exc = rh
2357 userdata = node';'info.2
2358 DO j = 1 TO res.0
2359 userdata = ParseResourceData( userdata, res.j )
2360 END
2361/* IF options.!debug == 1 THEN say ' "'attached.i'" "'userdata'"' */
2362 CALL VRMethod "CN_CURRENT", 'SetRecordAttr', rh, 'UserData', userdata
2363 if options.currentdata = userdata then ok = VRMethod("CN_CURRENT", 'SetRecordAttr', rh, 'Selected', 1)
2364
2365 CALL VRMethod "CN_CURRENT", 'SetRecordAttr', rh, 'Expanded', 1
2366
2367 DO j = 1 TO points.0
2368 childnode = node || points.j || '\'
2369 CALL GetChildren childnode, rh
2370 END
2371
2372 END
2373 existrec.0 = exc
2374/* CALL VRSet "CN_CURRENT", 'Painting', 1 */
2375 IF options.!debug == 1 THEN SAY time()' '||"GetMountPoints done"
2376RETURN
2377
2378/*:VRX Halt
2379*/
2380Halt:
2381 signal _VREHalt
2382return
2383
2384/*:VRX Init
2385*/
2386Init:
2387/* Herwig */
2388/* CALL VRSet 'Console', 'WindowListTitle', '' */
2389
2390 window = VRWindow()
2391 call VRSet window, "Visible", 0
2392 call VRMethod window, "Activate"
2393 drop window
2394
2395RETURN
2396
2397/*:VRX LoadFileSysFuncs
2398*/
2399LoadFileSysFuncs:
2400 IF options.!debug == 1 THEN SAY time()' LoadFileSysFuncs() started'
2401 Fatal = 1
2402 RestartCount = 0
2403 FoundEVFS = 1
2404 FoundND = 1
2405
2406 if SysSearchPath("PATH", "EVFSCTL.EXE") = "" then do
2407 FoundEVFS = 0
2408 ForceNDFS = 1
2409 end
2410
2411CtlRestart:
2412 if \ForceNDFS then signal NoNetDrive
2413
2414ForceNDFS:
2415 IF options.!debug == 1 THEN SAY ' NDFS check entered'
2416 call RxFuncAdd 'NdRxLoadFuncs', 'NDCALLS', 'NdRxLoadFuncs'
2417 SIGNAL ON SYNTAX NAME NoNetdrive
2418 call NdRxLoadFuncs
2419 FoundND = 1
2420 SIGNAL OFF SYNTAX
2421 fs.!prefix = 'ND'
2422 fs.!fileSystemtype = "NDFS32"
2423 fs.!profileext = "ndc"
2424 signal CommonToBothFS
2425NoNetdrive:
2426 IF options.!debug == 1 THEN SAY ' NDFS not found'
2427 CALL RxFuncAdd 'EvfsRxLoadFuncs', 'EVFSCALL.DLL', 'EvfsRxLoadFuncs'
2428 SIGNAL ON SYNTAX NAME NoEVFSCALL
2429 CALL EvfsRxLoadFuncs
2430 FoundEVFS = 1
2431 SIGNAL OFF SYNTAX
2432 fs.!prefix = 'EVFS'
2433 fs.!fileSystemtype = "EVFS"
2434 fs.!profileext = "evp"
2435CommonToBothFS:
2436 IF options.!debug == 1 THEN SAY ' Common version check'
2437 CALL _Dynamic "fsstat = "fs.!prefix"RxQueryIFS()"
2438 if fsstat = 252 then CALL _Dynamic "Found"fs.!prefix" = 0"
2439
2440 if word(fsstat,1) = '0' then do
2441 PARSE VAR fsstat '0 'fsname fsver fsctl .
2442 fs.!name = fsname
2443 fs.!version = fsver
2444
2445 IF options.!debug == 1 THEN DO
2446 say ' fs.!prefix = 'fs.!prefix
2447 say ' fs.!name = 'fs.!Name
2448 say ' Version = 'fsver
2449 say ' fsctl = 'fsctl
2450 end
2451 end
2452 else do
2453 if FoundND = 0 & FoundEVFS = 0 then do
2454 CALL VRMessage 'Main', 'FATAL: Neither EVFS nor Netdrive found: 'fs.!prefix'RxQueryIFS()='fsstat, NLVGetMessage( 5 ), 'E'
2455 signal Halt
2456 end
2457 signal ForceNDFS
2458 end
2459 IF fsctl \= 1 THEN DO
2460 if ReStartCount = 0 then do
2461 'detach 'fs.!prefix'ctl.exe'
2462 RestartCount = 1
2463 ok = SysSleep(1)
2464 signal CtlRestart
2465 end
2466 else do
2467 CALL VRMessage 'Main', NLVGetMessage( 101 ), NLVGetMessage( 5 ), 'E'
2468 signal Halt
2469 end
2470 END
2471
2472 Fatal = 0
2473
2474 IF options.!debug == 1 THEN SAY time()' LoadFileSysFuncs() done'
2475return
2476
2477/*:VRX Main_Close
2478*/
2479Main_Close:
2480 CALL Quit
2481RETURN
2482
2483/*:VRX Main_Create
2484*/
2485Main_Create:
2486 options.!debug = 1
2487 IF options.!debug == 1 THEN do
2488 ok = VRRedirectStdIO("ON")
2489 say time()' Main_Create started'
2490 end
2491 else ok = VRRedirectStdIO("OFF")
2492
2493 call _LoadOtherFuncs
2494 call _InitTempDir
2495 call NLVSetup
2496 call _StemsInit
2497
2498 call _TabbedDialogSetup
2499 call _ContainersInit
2500 call _GUIInit
2501
2502 CALL _ParseCommandLine
2503
2504 CALL LoadFileSysFuncs
2505
2506 CALL _CltInit
2507
2508 CALL _INILoad
2509
2510 CALL Refresh
2511
2512 if advanced.!savepassive == 1 then CALL _PassiveLoad
2513
2514 IF options.!autoload == 1 THEN CALL Menu_File_Load_Click
2515
2516 CALL VRSet "CB_MOUNT", "Selected", 1
2517 CALL VRSet "CB_DRIVES", "Selected", 1
2518 IF options.!autoclose == 1
2519 THEN CALL TM_AutoClose_Trigger
2520 ELSE do
2521 if advanced.!browseauth == 1 then do
2522 /* FIXME: unclear why we have to do the following 4 lines here */
2523 call SW_SETTINGS_Init
2524 call SW_SETTINGS_Init_Content
2525 call SW_ADVANCED_Init
2526 call SW_ADVANCED_Init_Content
2527
2528 window = VRLoadSecondary( "SW_LOGIN", "W" )
2529 call Main_Resize
2530 end
2531 if advanced.!browseimme == 1 then call PB_SMBTREE_REFRESH_Click
2532 end
2533
2534 IF options.!debug == 1 THEN SAY time()' Main_Create done'
2535return
2536
2537/*:VRX Main_KeyPress
2538*/
2539Main_KeyPress:
2540 key = VRGet('Main', 'KeyString')
2541 IF key == '{F5}' THEN CALL Refresh
2542RETURN
2543
2544/*:VRX Main_Resize
2545*/
2546Main_Resize:
2547 IF options.!debug == 1 THEN SAY time()' Main_Resize started'
2548 ok = VRset("Main","Painting", 0)
2549
2550 /* Basic measurements */
2551 main_iwidth = VRGet("Main","InteriorWidth") /* Width of window client-area */
2552 main_iheight = VRGet("Main","InteriorHeight") /* Height of window client-area */
2553
2554 if main_iheight < 5500 then ok = VRSet("Main","Height",6200)
2555 sbar_height = VRGet("GB_STATUSBAR","Height") /* Height of status-bar */
2556 split_left = VRGet("SPLIT_Main","Left") /* Position of the left edge of the split-bar */
2557 marginx2 = margin * 2 /* Common margin around controls */
2558 pbtn_height = 400 /* Height of the panels' internal button areas */
2559
2560 pane_height = main_iheight - sbar_height - (margin * 4) /* Height of a split-bar panel */
2561 lpane_width = split_left - margin /* Width of the left split-bar panel */
2562 rpane_width = main_iwidth - split_left - 60 - margin /* Width of the right split-bar panel */
2563
2564 /* Tabbed Dialog = right pane */
2565 ok = VRset("TDL_1", "Top", marginx2)
2566 ok = VRset("TDL_1", "Left", split_left + 60)
2567 ok = VRset("TDL_1", "Width", rpane_width )
2568 ok = VRset("TDL_1", "Height", pane_height )
2569
2570 /* Current Panel */
2571 ok = VRSet("GB_CURRENT", "Visible", 1 )
2572 ok = VRSet("GB_CURRENT", "Top", marginx2 )
2573 ok = VRSet("GB_CURRENT", "Left", margin )
2574 ok = VRSet("GB_CURRENT", "Width", lpane_width )
2575 ok = VRSet("GB_CURRENT", "Height", pane_height )
2576
2577 ok = VRset("GB_CURRENT3", "Top", margin )
2578 ok = VRset("GB_CURRENT3", "Left", margin )
2579 ok = VRset("GB_CURRENT3", "Height", 245 )
2580 ok = VRset("GB_CURRENT3", "Width", lpane_width - marginx2)
2581
2582 ok = VRset("DT_CURRENT", "Top", 8 )
2583 ok = VRset("DT_CURRENT", "Left", 8 )
2584 ok = VRset("DT_CURRENT", "Height", 213 )
2585 ok = VRset("DT_CURRENT", "Width", (lpane_width - marginx2) - 24 )
2586
2587 ok = VRset("GB_CURRENT2", "Left", margin )
2588 ok = VRset("GB_CURRENT2", "Top", 245 + marginx2 )
2589 ok = VRset("GB_CURRENT2", "Width", lpane_width - marginx2)
2590 ok = VRset("GB_CURRENT2", "Height", pane_height - (margin * 5) - pbtn_height - 245 )
2591
2592 ok = VRset("CN_CURRENT", "Top", margin )
2593 ok = VRset("CN_CURRENT", "Left", margin )
2594 ok = VRset("CN_CURRENT", "Width", VRGet("GB_CURRENT2","Width") - marginx2)
2595 ok = VRset("CN_CURRENT", "Height", VRGet("GB_CURRENT2","Height") - marginx2)
2596
2597 ok = VRset("PB_DETACH", "Left", margin )
2598 ok = VRset("PB_DETACH", "Top", pane_height - pbtn_height - marginx2 )
2599 ok = VRset("PB_DETACH", "Width", min((lpane_width-margin*3) % 2, 1313) )
2600 ok = VRset("PB_UNMOUNT", "Left", VRGet("PB_DETACH","Width") + marginx2)
2601 ok = VRset("PB_UNMOUNT", "Top", pane_height - pbtn_height - marginx2 )
2602 ok = VRset("PB_UNMOUNT", "Width", min((lpane_width-margin*3) % 2, 1313) )
2603
2604 /* Splitbar - reduced in size to make it more noticable */
2605 ok = VRset("SPLIT_Main", "Visible", 1 )
2606 ok = VRset("SPLIT_Main", "Top", marginx2 + (pane_height-1200)%2 )
2607 ok = VRset("SPLIT_Main", "Height", 1200 /* pane_height */ )
2608
2609 /* Statusbar */
2610 ok = VRSet("GB_STATUSBAR", "Left", margin )
2611 ok = VRSet("GB_STATUSBAR", "Top", main_iheight - sbar_height - margin )
2612 ok = VRSet("GB_STATUSBAR", "Width", lpane_width + 50 + rpane_width )
2613
2614 ok = VRset("DT_STATUSBAR", "Top", 12 )
2615 ok = VRset("DT_STATUSBAR", "Left", 12 )
2616 ok = VRset("DT_STATUSBAR", "Height", VRGet("GB_STATUSBAR","Height") -24 )
2617 ok = VRset("DT_STATUSBAR", "Width", (lpane_width + 50 + rpane_width) - 24 )
2618
2619 /* Modified for notebook pages */
2620 pane_height = marginx2 + pane_height -1020
2621 rpane_width = marginx2 + rpane_width -760
2622
2623 /* Dialog page */
2624 ok = VRSet("GB_DIALOG", "Top", margin /* marginx2 */ )
2625 ok = VRSet("GB_DIALOG", "Left", margin /* marginx2 */ /* split_left + 60 */ )
2626 ok = VRset("GB_DIALOG", "Height", pane_height )
2627 ok = VRset("GB_DIALOG", "Width", rpane_width )
2628
2629 ok = VRset("PB_MOUNT", "Left", margin )
2630 ok = VRset("PB_MOUNT", "Top", pane_height - pbtn_height - marginx2)
2631 ok = VRset("PB_EDIT_CANCEL", "Left", VRGet("PB_MOUNT","Width") + marginx2)
2632 ok = VRset("PB_EDIT_CANCEL", "Top", pane_height - pbtn_height - marginx2)
2633
2634 ok = VRset("PB_DIALOG_HELP", "Left", rpane_width - marginx2 - VRGet("PB_DIALOG_HELP","Width") + 24)
2635 ok = VRset("PB_DIALOG_HELP", "Top", pane_height - pbtn_height - marginx2)
2636
2637 ok = VRset("GB_SHARE", "Left", margin )
2638 ok = VRset("GB_SHARE", "Top", marginx2 /* 245 + marginx2 */ )
2639 ok = VRset("GB_SHARE", "Height", 2252 )
2640 ok = VRset("GB_SHARE", "Width", rpane_width - marginx2 )
2641
2642 ok = VRset("GB_AUTH", "Left", margin )
2643 ok = VRset("GB_AUTH", "Top", margin * 3 + VRGet("GB_SHARE","Height") /* 245 + (margin * 3) + VRGet("GB_SHARE","Height") */ )
2644 ok = VRset("GB_AUTH", "Width", rpane_width - marginx2 )
2645
2646 ok = VRset("GB_MPOINT","Left", margin )
2647 ok = VRset("GB_MPOINT","Top", /* 245 + */ (margin * 4) + VRGet("GB_SHARE","Height") + VRGet("GB_AUTH","Height"))
2648 ok = VRset("GB_MPOINT","Width", rpane_width - marginx2 )
2649
2650 /* Advanced page */
2651 ok = VRSet("GB_ADVANCED", "Top", margin /* marginx2 */ )
2652 ok = VRSet("GB_ADVANCED", "Left", margin /* marginx2 */ /* split_left + 60 */ )
2653 ok = VRset("GB_ADVANCED", "Height", pane_height )
2654 ok = VRset("GB_ADVANCED", "Width", rpane_width )
2655
2656 ok = VRset("GB_ADVANCED2", "Left", margin )
2657 ok = VRset("GB_ADVANCED2", "Top", /* 245 + */ marginx2)
2658 ok = VRset("GB_ADVANCED2", "Width", rpane_width - marginx2)
2659 ok = VRset("GB_ADVANCED2", "Height", pane_height - (margin * 5) - pbtn_height /* - 245 */ )
2660
2661 ok = VRset("PB_ADVANCED_APPLY", "Left", margin )
2662 ok = VRset("PB_ADVANCED_APPLY", "Top", pane_height - pbtn_height - marginx2)
2663 ok = VRset("PB_ADVANCED_UNDO", "Left", VRGet("PB_SMBTREE_CONNECT","Width") + marginx2)
2664 ok = VRset("PB_ADVANCED_UNDO", "Top", pane_height - pbtn_height - marginx2)
2665 ok = VRset("PB_ADVANCED_HELP", "Left", rpane_width - marginx2 - VRGet("PB_SMBTREE_HELP","Width") + 24)
2666 ok = VRset("PB_ADVANCED_HELP", "Top", pane_height - pbtn_height - marginx2)
2667
2668 /* SMBTree page */
2669 ok = VRSet("GB_SMBTREE", "Top", margin /* x2 */ )
2670 ok = VRSet("GB_SMBTREE", "Left", margin /* x2 */ /* split_left + 60 */ )
2671 ok = VRset("GB_SMBTREE", "Height", pane_height )
2672 ok = VRset("GB_SMBTREE", "Width", rpane_width )
2673
2674 ok = VRset("GB_SMBTREE2","Left", margin )
2675 ok = VRset("GB_SMBTREE2","Top", /* 45 + */ marginx2 )
2676 ok = VRset("GB_SMBTREE2","Width", rpane_width - marginx2)
2677 ok = VRset("GB_SMBTREE2","Height", pane_height - (margin * 5) - pbtn_height /* - 245 */ )
2678
2679 ok = VRset("CN_SMBTREE", "Top", margin )
2680 ok = VRset("CN_SMBTREE", "Left", margin )
2681 ok = VRset("CN_SMBTREE", "Width", VRGet("GB_SMBTREE2","Width") - marginx2)
2682 ok = VRset("CN_SMBTREE", "Height", VRGet("GB_SMBTREE2","Height") - marginx2)
2683
2684 ok = VRset("PB_SMBTREE_CONNECT", "Left", margin )
2685 ok = VRset("PB_SMBTREE_CONNECT", "Top", pane_height - pbtn_height - marginx2)
2686 ok = VRset("PB_SMBTREE_REFRESH", "Left", VRGet("PB_SMBTREE_CONNECT","Width") + marginx2)
2687 ok = VRset("PB_SMBTREE_REFRESH", "Top", pane_height - pbtn_height - marginx2)
2688 ok = VRset("PB_SMBTREE_HELP", "Left", rpane_width - marginx2 - VRGet("PB_SMBTREE_HELP","Width") + 24)
2689 ok = VRset("PB_SMBTREE_HELP", "Top", pane_height - pbtn_height - marginx2)
2690
2691 ok = VRset("PICT_THROBBER", "Top", VRGet("CN_SMBTREE","Height") % 2 - 100 )
2692 ok = VRset("PICT_THROBBER", "Left", VRGet("CN_SMBTREE","Width") % 2 - 200 )
2693
2694 /* Connection details page */
2695 ok = VRSet("GB_CONDET", "Top", margin /* x2 */ )
2696 ok = VRSet("GB_CONDET", "Left", margin /* x2 */ /* split_left + 60 */ )
2697 ok = VRset("GB_CONDET", "Height", pane_height )
2698 ok = VRset("GB_CONDET", "Width", rpane_width )
2699
2700 ok = VRset("GB_CONDET2", "Left", margin )
2701 ok = VRset("GB_CONDET2", "Top", /* 245 + */ marginx2)
2702 ok = VRset("GB_CONDET2", "Width", rpane_width - marginx2)
2703 ok = VRset("GB_CONDET2", "Height", pane_height - (margin * 5) - pbtn_height /* - 245 */ )
2704
2705 ok = VRset("CN_CONDET", "Top", margin )
2706 ok = VRset("CN_CONDET", "Left", margin )
2707 ok = VRset("CN_CONDET", "Width", VRGet("GB_CONDET2","Width") - marginx2)
2708 ok = VRset("CN_CONDET", "Height", VRGet("GB_CONDET2","Height") - marginx2)
2709
2710 ok = VRset("PB_CONDET_SAVE", "Left", margin )
2711 ok = VRset("PB_CONDET_SAVE", "Top", pane_height - pbtn_height - marginx2 )
2712 ok = VRset("PB_CONDET_LOAD", "Left", VRGet("PB_CONDET_SAVE","Width") + marginx2)
2713 ok = VRset("PB_CONDET_LOAD", "Top", pane_height - pbtn_height - marginx2 )
2714 ok = VRset("PB_CONDET_HELP", "Left", rpane_width - marginx2 - VRGet("PB_CONDET_HELP","Width") + 24)
2715 ok = VRset("PB_CONDET_HELP", "Top", pane_height - pbtn_height - marginx2)
2716
2717 /* Global settings page */
2718 ok = VRSet("GB_GLOBAL", "Top", margin /* x2 */ )
2719 ok = VRSet("GB_GLOBAL", "Left", margin /* x2 */ /* split_left + 60 */ )
2720 ok = VRset("GB_GLOBAL", "Height", pane_height )
2721 ok = VRset("GB_GLOBAL", "Width", rpane_width )
2722
2723 ok = VRset("GB_GLOBAL2", "Left", margin )
2724 ok = VRset("GB_GLOBAL2", "Top", marginx2 /* 245 + marginx2 */ )
2725 ok = VRset("GB_GLOBAL2", "Width", rpane_width - marginx2 )
2726
2727 ok = VRset("GB_LOGGING", "Left", margin )
2728 ok = VRset("GB_LOGGING", "Top", margin * 3 + VRGet("GB_GLOBAL2","Height") /* 245 + (margin * 3) + VRGet("GB_GLOBAL2","Height") */ )
2729 ok = VRset("GB_LOGGING", "Width", rpane_width - marginx2 )
2730
2731 ok = VRset("GB_GUI","Left", margin )
2732 ok = VRset("GB_GUI","Top", /* 245 + */ (margin * 4) + VRGet("GB_GLOBAL2","Height") + VRGet("GB_LOGGING","Height"))
2733 ok = VRset("GB_GUI","Width", rpane_width - marginx2 )
2734
2735 ok = VRset("PB_SETTINGS_APPLY", "Left", margin )
2736 ok = VRset("PB_SETTINGS_APPLY", "Top", pane_height - pbtn_height - marginx2 )
2737 ok = VRset("PB_SETTINGS_APPLY", "Height", pbtn_height)
2738 ok = VRset("PB_SETTINGS_UNDO", "Left", VRGet("PB_CONDET_SAVE","Width") + marginx2)
2739 ok = VRset("PB_SETTINGS_UNDO", "Top", pane_height - pbtn_height - marginx2 )
2740 ok = VRset("PB_SETTINGS_UNDO", "Height", pbtn_height)
2741 ok = VRset("PB_SETTINGS_HELP", "Left", rpane_width - marginx2 - VRGet("PB_CONDET_HELP","Width") + 24)
2742 ok = VRset("PB_SETTINGS_HELP", "Top", pane_height - pbtn_height - marginx2)
2743 ok = VRset("PB_SETTINGS_HELP", "Height", pbtn_height)
2744
2745 /* DOne with pages */
2746 ok = VRset("Main","Painting", 1)
2747
2748 /* check and empty event queue, trash spurious resize events */
2749 EventString = ''
2750 TrashedResize = 0
2751
2752 do until EventString = 'nop'
2753 EventString = VREvent('N')
2754 if EventString <> 'nop' then do
2755 if EventString = 'CALL Main_Resize' then TrashedResize = 1
2756 else interpret eventString
2757 end
2758 end
2759 if TrashedResize then CALL Main_Resize
2760
2761 IF options.!debug == 1 THEN SAY time()' Main_Resize done'
2762return
2763/*:VRX Menu_Context_ChangeView_Click
2764*/
2765Menu_Context_ChangeView_Click:
2766 ok = VRSet("Cn_Current","View","NameTree")
2767return
2768
2769/*:VRX Menu_Context_Detach_All_Click
2770*/
2771Menu_Context_Detach_All_Click:
2772 ok = VRMethod( "CN_CURRENT", "GetRecordList", "All", "umrh." )
2773 do um = 1 to umrh.0
2774 ok = VRMethod( "CN_CURRENT", "SetRecordAttr", umrh.um, "Selected", 1)
2775 call PB_DETACH_Click
2776 end
2777 drop um umrh.
2778return
2779
2780/*:VRX Menu_Context_Detach_Click
2781*/
2782Menu_Context_Detach_Click:
2783 call PB_DETACH_Click
2784return
2785
2786/*:VRX Menu_Context_Edit_Click
2787*/
2788Menu_Context_Edit_Click:
2789 IF options.!debug == 1 THEN SAY time()' Menu_Context_Edit_Click started'
2790 /* call VRMethod "TDL_1", 'PostEvent', 'PageSelected', 'Page', 1 */
2791 ok = VRset("TDL_1", 'Selected', 1)
2792 options.!editmode = 1
2793 CALL VRSet "PB_EDIT_CANCEL","Visible", 1
2794 CALL VRSet "PB_UNMOUNT","Enabled", 0
2795
2796 ok = VRMethod( "TDL_1", "SetTabText", 1, " "NLVGetMessage(33)" " )
2797/* CALL NLVSetText "DT_DIALOG","Caption",33 */
2798 CALL VRSet "GB_CURRENT", "ENABLED", 0
2799
2800 ok = VRSet("CB_MOUNT","Value","")
2801 ok = VRSet("CB_MOUNT","Selected",1)
2802 ok = VRSet("CB_MOUNT","Value",mtype.1)
2803
2804 parse var p_string p_workgroup':\\'p_server'\'p_share
2805
2806 /* IF options.!debug == 1 THEN SAY time()' '||p_workgroup */
2807
2808 IF options.!debug == 1 THEN SAY time()' data '||data
2809 IF options.!debug == 1 THEN SAY time()' domain '||p_workgroup
2810 IF options.!debug == 1 THEN SAY time()' server '||p_server
2811 IF options.!debug == 1 THEN SAY time()' share '||p_share
2812 IF options.!debug == 1 THEN SAY time()' string '||p_string
2813
2814
2815 CALL VRSet "EF_SHARE", "VALUE", p_share
2816 CALL VRSet "EF_SERVER", "VALUE", p_server
2817 CALL VRSet "EF_NETWORK","VALUE", p_workgroup
2818
2819 /* IF options.!debug == 1 THEN SAY time()' '||p_node */
2820 parse var p_node p_drive'\'p_directory'\'
2821 CALL VRSet "CB_DRIVES", "Value", p_drive
2822 CALL VRSet "EF_DIRECTORY", "Value", p_directory
2823 IF options.!debug == 1 THEN SAY time()' Menu_Context_Edit_Click done'
2824return
2825
2826/*:VRX Menu_Context_Open_Click
2827*/
2828Menu_Context_Open_Click:
2829 ok = VRSet("Menu_Context_Open_Default","Visible",0)
2830return
2831
2832/*:VRX Menu_Context_Open_Default_Click
2833*/
2834Menu_Context_Open_Default_Click:
2835 IF options.!debug == 1 THEN SAY time()' '||"Menu_Context_Open_Click started"
2836 userdata = VRMethod( "CN_CURRENT", 'GetRecordAttr', rh, 'UserData')
2837 PARSE VAR userdata mountpoint ';' mounts ';' .
2838
2839 if length(mountpoint) > 3 then mountpoint = strip(mountpoint,'T','\')
2840
2841 ID = VRMethod( "Application", "StartThread", "wps_open", mountpoint, "DEFAULT" )
2842
2843 IF options.!debug == 1 THEN SAY time()' '||"Menu_Context_Open_Click done"
2844return
2845
2846/*:VRX Menu_Context_Open_Detail_Click
2847*/
2848Menu_Context_Open_Detail_Click:
2849 IF options.!debug == 1 THEN SAY time()' '||"Menu_Context_Open_Details_Click started"
2850 userdata = VRMethod( "CN_CURRENT", 'GetRecordAttr', rh, 'UserData')
2851 PARSE VAR userdata mountpoint ';' mounts ';' .
2852
2853 if length(mountpoint) > 3 then mountpoint = strip(mountpoint,'T','\')
2854
2855 ID = VRMethod( "Application", "StartThread", "wps_open", mountpoint, "DETAILS" )
2856
2857 IF options.!debug == 1 THEN SAY time()' '||"Menu_Context_Open_Details_Click done"
2858return
2859
2860/*:VRX Menu_Context_Open_Icon_Click
2861*/
2862Menu_Context_Open_Icon_Click:
2863 IF options.!debug == 1 THEN SAY time()' '||"Menu_Context_Open_Icon_Click started"
2864 userdata = VRMethod( "CN_CURRENT", 'GetRecordAttr', rh, 'UserData')
2865 PARSE VAR userdata mountpoint ';' mounts ';' .
2866
2867 if length(mountpoint) > 3 then mountpoint = strip(mountpoint,'T','\')
2868
2869 ID = VRMethod( "Application", "StartThread", "wps_open", mountpoint, "ICON" )
2870
2871 IF options.!debug == 1 THEN SAY time()' '||"Menu_Context_Open_Icon_Click done"
2872return
2873
2874/*:VRX Menu_Context_Open_Settings_Click
2875*/
2876Menu_Context_Open_Settings_Click:
2877 IF options.!debug == 1 THEN SAY time()' '||"Menu_Context_Open_DetailsClick started"
2878 userdata = VRMethod( "CN_CURRENT", 'GetRecordAttr', rh, 'UserData')
2879 PARSE VAR userdata mountpoint ';' mounts ';' .
2880
2881 if length(mountpoint) > 3 then mountpoint = strip(mountpoint,'T','\')
2882
2883 ID = VRMethod( "Application", "StartThread", "wps_open", mountpoint, "SETTINGS" )
2884
2885 IF options.!debug == 1 THEN SAY time()' '||"Menu_Context_Open_Details_Click done"
2886return
2887
2888/*:VRX Menu_Context_Open_Splitview_Click
2889*/
2890Menu_Context_Open_Splitview_Click:
2891 IF options.!debug == 1 THEN SAY time()' '||"Menu_Context_Open_Splitview_Click started"
2892 userdata = VRMethod( "CN_CURRENT", 'GetRecordAttr', rh, 'UserData')
2893 PARSE VAR userdata mountpoint ';' mounts ';' .
2894
2895 if length(mountpoint) > 3 then mountpoint = strip(mountpoint,'T','\')
2896
2897 ID = VRMethod( "Application", "StartThread", "wps_open", mountpoint, "SPLITVIEW" )
2898
2899 IF options.!debug == 1 THEN SAY time()' '||"Menu_Context_Open_Splitview_Click done"
2900return
2901
2902/*:VRX Menu_Context_Open_Tree_Click
2903*/
2904Menu_Context_Open_Tree_Click:
2905 IF options.!debug == 1 THEN SAY time()' '||"Menu_Context_Open_Tree_Click started"
2906 userdata = VRMethod( "CN_CURRENT", 'GetRecordAttr', rh, 'UserData')
2907 PARSE VAR userdata mountpoint ';' mounts ';' .
2908
2909 if length(mountpoint) > 3 then mountpoint = strip(mountpoint,'T','\')
2910
2911 ID = VRMethod( "Application", "StartThread", "wps_open", mountpoint, "TREE" )
2912
2913 IF options.!debug == 1 THEN SAY time()' '||"Menu_Context_Open_Tree_Click done"
2914return
2915
2916/*:VRX Menu_Context_Refresh_Click
2917*/
2918Menu_Context_Refresh_Click:
2919 CALL Refresh
2920return
2921
2922/*:VRX Menu_Context_Unmount_Click
2923*/
2924Menu_Context_Unmount_Click:
2925 call PB_UNMOUNT_Click
2926return
2927
2928/*:VRX Menu_File_Autostart_Activate_Click
2929*/
2930Menu_File_Autostart_Activate_Click:
2931 options.!autostart = 1
2932
2933 Profile = VRParseFilename(settings.!ini,'DPN')'.'fs.!profileext
2934 ExeName = VRParseFileName(VRget("Application","Program"),'DPNE')
2935 if ExeName = "" then do
2936 parse source . . script
2937 ExeName = VRParseFilename(script,'DP')'\EVFSGUI.EXE'
2938 end
2939 StartupDir = VRParseFileName(VRget("Application","Program"),'DP')
2940 if StartupDir = "" then do
2941 parse source . . script
2942 StartUpDir = VRParseFilename(script,'DP')
2943 end
2944
2945 ObjTitle = NLVGetMessage( 59 )
2946 if ObjTitle = "" then ObjTitle = '[EVFS LAN-Connections]'
2947
2948 CALL PB_SAVE_Click
2949
2950 rc = CreateObject( 'WPProgram', ObjTitle,'<WP_START>',,
2951 'EXENAME='||ExeName||';'||,
2952 'PROGTYPE=PM;'||,
2953 'TITLE='ObjTitle';'||,
2954 'PARAMETERS='Profile' -AUTOCLOSE -NOGUI;'||,
2955 'STARTUPDIR='StartupDir';'||,
2956 'NOPRINT=YES;'||,
2957 'HIDEBUTTON=DEFAULT;'||,
2958 'MINWIN=DEFAULT;'||,
2959 'CCVIEW=DEFAULT;'||,
2960 'DEFAULTVIEW=DEFAULT;'||,
2961 'OBJECTID=<EVFSGUI_AUTOSTART>',,
2962 'REPLACE' )
2963
2964 IF rc == 1 THEN do
2965 Text = NLVGetMessage( 60 )
2966 if Text = "" then Text = '[Created object in Autostart-Folder]'
2967 CALL VRMessage 'Main', Text, VRGet("Main", "Caption")
2968 end
2969 ELSE do
2970 Text = NLVGetMessage( 61 )
2971 if Text = "" then Text = '[Could not create object in Autostart-Folder]'
2972 Title = NLVGetMessage( 5 )
2973 if Title = "" then Title = '[Error]'
2974 CALL VRMessage 'Main', Text, Title, 'E'
2975 end
2976
2977 options.!autostart = 0
2978return
2979/*:VRX Menu_File_Autostart_Click
2980*/
2981Menu_File_Autostart_Click:
2982
2983return
2984
2985/*:VRX Menu_File_Autostart_Deactivate_Click
2986*/
2987Menu_File_Autostart_Deactivate_Click:
2988 ok = SysDestroyObject("<EVFSGUI_AUTOSTART>")
2989 IF ok == 1 THEN do
2990 Text = NLVGetMessage( 79 )
2991 if Text = "" then Text = '[Autostart object created successfully]'
2992 CALL VRMessage 'Main', Text, VRGet("Main", "Caption")
2993 end
2994 ELSE do
2995 Text = NLVGetMessage( 78 )
2996 if Text = "" then Text = '[Could find Autostart object]'
2997 Title = NLVGetMessage( 5 )
2998 if Title = "" then Title = '[Error]'
2999 CALL VRMessage 'Main', Text, Title, 'E'
3000 end
3001return
3002
3003/*:VRX Menu_File_Close_Click
3004*/
3005Menu_File_Close_Click:
3006 call Quit
3007return
3008
3009/*:VRX Menu_File_Daemon_Start_Click
3010*/
3011Menu_File_Daemon_Start_Click:
3012 IF options.!debug == 1 THEN SAY time()' Menu_File_Daemon_Start_Click started'
3013 if VRFileExists(SysBootDrive()"\ndpsmb.dbg") then do
3014 btns.0 = 2
3015 btns.1 = NLVGetMessage( 6 )
3016 btns.2 = NLVGetMessage( 7 )
3017 confirm = VRMessage('Main', NLVGetMessage( 119 ), NLVGetMessage( 8 ), 'Q', 'btns.', 1, 2 )
3018 IF confirm == 1 THEN do
3019 logFiles = value("LOGFILES",,"OS2ENVIRONMENT")
3020 ok1 = SysFileDelete(Logfiles||'\log.smbc')
3021 ok2 = SysFileDelete(Logfiles||'\log.ndpsmb')
3022 if ok1 <> 0 | ok2 <> 0 then do
3023 ok = VRMessage('Main', NLVGetMessage(5)' 'Logfiles||'\log.smbc RC='ok1||'0D0A'x||NLVGetMessage(5)' 'Logfiles||'\log.ndpsmb RC='ok2, NLVGetMessage( 5 ), 'E')
3024 end
3025 drop ok1 ok2
3026 end
3027 end
3028 address cmd 'detach 'fs.!prefix'CTL.EXE'
3029 ok = VRset("GB_CURRENT","Enabled", 1)
3030 ok = VRset("TDL_1","Enabled", 1)
3031 CALL REFRESH
3032 ok = VRSet("Menu_File_Daemon_Start","Enabled",0)
3033 ok = VRSet("Menu_File_Daemon_Stop","Enabled",1)
3034 IF options.!debug == 1 THEN SAY time()' Menu_File_Daemon_Start_Click done'
3035return
3036
3037/*:VRX Menu_File_Daemon_Stop_Click
3038*/
3039Menu_File_Daemon_Stop_Click:
3040 IF options.!debug == 1 THEN SAY time()' Menu_File_Daemon_Stop_Click started'
3041 ok = PRProcessList(proc)
3042 do I = 1 to proc.0
3043 CurProc = VRParseFileName(proc.i.name,'NE')
3044 if CurProc = fs.!prefix"CTL.EXE" then do
3045 call charout , ' 'CurProc' RC='
3046 ok = PRKillProcess(1,proc.i.pid)
3047 say ok
3048 end
3049 end
3050 ok = VRset("GB_CURRENT","Enabled", 0)
3051 ok = VRset("TDL_1","Enabled", 0)
3052 ok = VRSet("Menu_File_Daemon_Start","Enabled",1)
3053 ok = VRSet("Menu_File_Daemon_Stop","Enabled",0)
3054 IF options.!debug == 1 THEN SAY time()' Menu_File_Daemon_Stop_Click stopped'
3055return
3056/*:VRX Menu_File_LMHosts_Reset_Click
3057*/
3058Menu_File_LMHosts_Reset_Click:
3059 ok = SysFileDelete(samba.!lmhosts)
3060 /* FIXME: Add a message box here */
3061return
3062
3063/*:VRX Menu_File_Load_Click
3064*/
3065Menu_File_Load_Click: PROCEDURE EXPOSE settings. options. icons. advanced. vfs. Profile fs. cd. samba.
3066 IF options.!autoload == 1 then filename = Profile
3067 else filename = VRFileDialog('Main', NLVGetMessage( 55 ), 'L', '*.'fs.!profileext)
3068 IF filename == '' THEN RETURN
3069 IF STREAM( filename, 'C', 'QUERY EXISTS') == '' THEN DO
3070 CALL VRMessage 'Main', NLVGetMessage( 56, filename ), NLVGetMessage( 5 ), 'E'
3071 RETURN
3072 END
3073
3074 CALL LINEIN filename, 1, 0
3075 DO WHILE LINES( filename )
3076 PARSE VALUE LINEIN( filename ) WITH node resource rwFlag
3077
3078 vfs.!drive = FILESPEC('DRIVE', node )
3079 vfs.!mountpoint = STRIP( node, 'T', '\')
3080
3081 /* In case we only have a volume we reattach the backslash, otherwise restore will fail */
3082 if vfs.!drive = vfs.!mountpoint then vfs.!mountpoint = vfs.!mountpoint||'\'
3083
3084 call ParseResParmString
3085
3086 options.!workgroup = p_workgroup
3087 options.!server = p_server
3088 options.!share = p_share
3089 options.!user = p_user
3090 options.!password = p_password
3091 options.!spassword = p_spassword
3092 options.!master = p_master
3093 options.!mastertype = p_mtype
3094/* options.!memlen = p_memlen
3095 options.!logfile = p_logfile
3096 options.!loglevel = p_loglevel */
3097 options.!cachetimeout = p_cachetimeout
3098 options.!cachelistings = p_cachelistings
3099 options.!easupport = p_easupport
3100
3101 IF rwFlag == 'R' THEN
3102 options.!readonly = 1
3103 ELSE
3104 options.!readonly = 0
3105
3106 CALL Mount
3107
3108 END
3109 CALL STREAM filename, 'C', 'CLOSE'
3110
3111 options.!autoload = 0
3112
3113 CALL Refresh
3114RETURN
3115/*:VRX Menu_File_Save_Click
3116*/
3117Menu_File_Save_Click:
3118 call PB_CONDET_SAVE_Click
3119return
3120
3121/*:VRX Menu_File_ucCred_Reset_Click
3122*/
3123Menu_File_ucCred_Reset_Click:
3124 ok = _ucDelUc()
3125 /* FIXME: Add a message box here */
3126return
3127
3128/*:VRX Menu_Help_About_Click
3129*/
3130Menu_Help_About_Click:
3131 ok = VRLoadSecondary("SW_ABOUT", "W")
3132return
3133
3134/*:VRX Menu_Help_Extended_Click
3135*/
3136Menu_Help_Extended_Click:
3137 ok = VRMethod( "Main", "InvokeHelp" )
3138return
3139
3140/*:VRX Menu_Selected_Connect_Click
3141*/
3142Menu_Selected_Connect_Click:
3143 call PB_SMBTREE_CONNECT_Click
3144return
3145
3146/*:VRX Menu_Selected_Default_Workgroup_Click
3147*/
3148Menu_Selected_Default_Workgroup_Click:
3149 workgroupname = VRMethod("CN_SMBTREE","GetRecordAttr",SMBObj.rh,"Caption")
3150 /* FIXME: switch over to REXXIni calls */
3151 ok = TRSetIni("[global]","workgroup", workgroupname, samba.!smbconf)
3152return
3153
3154/*:VRX Menu_Selected_DetailsView_Click
3155*/
3156Menu_Selected_DetailsView_Click:
3157 ok = VRSet("CN_smbtree", "View", "Detail")
3158return
3159
3160/*:VRX Menu_Selected_Info_Click
3161*/
3162Menu_Selected_Info_Click:
3163 IF options.!debug == 1 THEN SAY time()' Menu_Selected_Info_Click started'
3164
3165 ok = VRMethod( "CN_SMBTREE", "GetRecordList", "SourceOrSelected", "SelRH." )
3166 if SelRH.0 = 0 then do
3167 IF options.!debug == 1 THEN SAY time()' Menu_Selected_Info_Click aborted'
3168 return
3169 end
3170
3171 call _GetSMBObjectProperties SelRH.1
3172
3173 window = VRLoadSecondary( "SW_INFO", "W" )
3174 IF options.!debug == 1 THEN SAY time()' Menu_Selected_Info_Click done'
3175return
3176
3177/*:VRX Menu_Selected_Refresh_Click
3178*/
3179Menu_Selected_Refresh_Click:
3180 ok = VRMethod( "CN_smbtree", "SetRecordAttr", SMBObj.rh, "Icon","#61:PMWP.DLL")
3181 call _DelSMBObjectShares SMBObj.rh
3182 machine = SMBObj.resname
3183 ok = VRSet("TM_RefreshTreeDisplay", "Delay", 1000)
3184 call _RefreshShares
3185return
3186
3187/*:VRX Menu_Selected_Remove_Click
3188*/
3189Menu_Selected_Remove_Click:
3190 ok = VRMethod( "CN_CONDET", "GetRecordList", "SourceOrSelected", "selrec." )
3191 if selrec.0 = 0 then return
3192
3193 do I = 1 to selrec.0
3194 if VRMethod("CN_CONDET", "GetFieldData", selrec.I, cd.statusfh) = icons.!passive then do
3195 CALL VRMethod "CN_CONDET", 'RemoveRecord', selrec.I
3196 end
3197 else do
3198 mountpoint = VRMethod("CN_CONDET", "GetFieldData", selrec.I, cd.mpointfh)
3199 mpidx = VRMethod("CN_CONDET", "GetFieldData", selrec.I, cd.mpidxfh)
3200 if mpidx = 1 then do
3201 btns.0 = 2
3202 btns.1 = NLVGetMessage( 6 )
3203 btns.2 = NLVGetMessage( 7 )
3204 confirm = VRMessage('Main', NLVGetMessage( 72, mountpoint ), NLVGetMessage( 8 ), 'Q', 'btns.', 1, 2 )
3205 IF confirm \= 1 THEN RETURN
3206
3207 CALL _Dynamic "ok = "fs.!prefix"RxUnmount('"mountpoint"', "mpidx")"
3208 CALL VRMethod "CN_CONDET", 'RemoveRecord', selrec.I
3209 CALL Refresh
3210 end
3211 else do
3212 CALL VRMessage 'Main', NLVGetMessage( 71 ) , NLVGetMessage( 89 )||" "||mountpoint , 'E'
3213 end
3214 end
3215 end
3216return
3217
3218/*:VRX Menu_Selected_Retry_Click
3219*/
3220Menu_Selected_Retry_Click: PROCEDURE EXPOSE settings. options. icons. vfs. fs. advanced. cd. samba.
3221
3222 ok = VRMethod( "CN_CONDET", "GetRecordList", "SourceOrSelected", "srcrec." )
3223 if srcrec.0 = 0 then return
3224
3225 srcrec = srcrec.1
3226
3227 p_mpoint = VRMethod("CN_CONDET", "GetFieldData", srcrec, CD.MpointFH)
3228
3229 p_workgroup = VRMethod("CN_CONDET", "GetFieldData", srcrec, CD.WorkgroupFH)
3230 p_server = VRMethod("CN_CONDET", "GetFieldData", srcrec, CD.ServerFH)
3231 p_share = VRMethod("CN_CONDET", "GetFieldData", srcrec, CD.ShareFH)
3232 p_user = VRMethod("CN_CONDET", "GetFieldData", srcrec, CD.UserFH)
3233 p_password = x2c(VRMethod("CN_CONDET", "GetFieldData", srcrec, CD.SpasswordFH))
3234
3235 ShareLevel = 1
3236 if p_share = "" then ShareLevel = 2
3237 if p_server = "" then ShareLevel = 3
3238 if p_workgroup = "" then ShareLevel = 4
3239
3240 ok = VRSet("CB_MOUNT", "Selected", Sharelevel )
3241 ok = VRset("CB_MOUNT", "Value", mtype.sharelevel)
3242
3243 call _UpdateObject "EF_SERVER", p_server
3244 ok = VRset("EF_SHARE" , "Value", p_share)
3245 ok = VRset("EF_NETWORK", "Value", p_workgroup)
3246 ok = VRset("EF_USER" , "Value", p_user)
3247 ok = VRset("EF_PASSWORD", "Value", p_password)
3248
3249 parse var p_mpoint p_drv '\' p_dir
3250
3251 p_dir = strip(p_dir,'T','\')
3252
3253 ok = VRset("CB_DRIVES" , "Value", p_drv)
3254 ok = VRset("EF_DIRECTORY" , "Value", p_dir)
3255
3256 CALL PB_MOUNT_Click
3257
3258 if VRMethod( "CN_CONDET", "ValidateRecord", srcRec) = 1 then do
3259 if VRMethod("CN_CONDET", "GetRecordAttr", srcRec, "Icon") = icons.!passive then ok = VRMethod( "CN_CONDET", "RemoveRecord", srcRec)
3260 end
3261return
3262
3263/*:VRX Menu_Selected_TreeView_Click
3264*/
3265Menu_Selected_TreeView_Click:
3266 ok = VRSet("CN_smbtree", "View", "IconTree")
3267return
3268
3269/*:VRX Mount
3270*/
3271Mount: PROCEDURE EXPOSE settings. options. icons. vfs. fs. advanced. cd. samba.
3272 IF options.!debug == 1 THEN SAY time()' Mount procedure started'
3273 /* Set mouse pointer to wait - this operation might take a few seconds */
3274 call VRSet VRWindow(), 'Pointer', 'Wait'
3275
3276/* Disabled, because we merge profile now - in earlier revisions
3277 we replaced it but only for preexisting drives - this made only
3278 sense as long as we were unable to detect double connections -
3279 this could be made an option!
3280
3281 IF options.!autoload then do
3282 CALL _Dynamic "ok = "fs.!prefix"RxDetach('"vfs.!drive"')"
3283 IF options.!debug == 1 THEN SAY time()' '||'Autoload Detach "'vfs.!drive'" =' ok
3284 end */
3285
3286 /* Attach the virtual drive - only if drive is not already attached */
3287 if pos(vfs.!drive,MyFreeDriveMap("C:","FREE")) > 0 then do
3288 CALL _Dynamic "ok = "fs.!prefix"RxAttach('"vfs.!drive"')"
3289
3290 IF options.!debug == 1 THEN SAY time()' '||'Attach "'vfs.!drive'" =' ok
3291 end
3292
3293 /* Create the mount point and store whether it was created or already existed */
3294 CALL _Dynamic "CreateMP = "fs.!prefix"RxCreateMountPoint('"vfs.!mountpoint"')"
3295
3296 IF options.!debug == 1 THEN SAY time()' '||'Create "'vfs.!mountpoint'" = 'CreateMP
3297
3298
3299 /* Build the resource parameter string */
3300 src = ''
3301 IF options.!workgroup \= '' THEN src = src';WORKGROUP='options.!workgroup
3302 IF options.!server \= '' THEN src = src';SERVER='options.!server
3303 IF options.!share \= '' THEN src = src';SHARE='options.!share
3304 IF options.!user \= '' THEN src = src';USER='options.!user
3305 IF options.!password \= '' THEN src = src';PASSWORD='options.!password
3306 IF options.!spassword \= '' THEN src = src';SPASSWORD='options.!spassword
3307 IF options.!master \= '' THEN src = src';MASTER='options.!master
3308 IF options.!mastertype \= '' THEN src = src';MASTERTYPE='options.!mastertype
3309/* IF options.!memlen \= '' THEN src = src';MEMLEN='options.!memlen
3310 IF options.!logfile \= '' THEN src = src';LOGFILE='options.!logfile
3311 IF options.!loglevel \= '' THEN src = src';LOGLEVEL='options.!loglevel */
3312 IF options.!cachetimeout \= '' THEN src = src';CTO='options.!cachetimeout
3313 IF options.!cachelistings \= '' THEN src = src';CLD='options.!cachelistings
3314 IF options.!easupport \= '' THEN src = src';EASUPPORT='options.!easupport
3315
3316 IF options.!readonly = 1 then rwFlag = 'R'; else rwFlag = 'W'
3317
3318 parse var vfs.!mountpoint mpoint ';' .
3319 mpoint = strip(mpoint,'T','\')||'\'
3320
3321 if options.!master = "" then options.!master = "WORKGROUP"
3322 if options.!mtype = "" then options.!mtype = "1"
3323 if options.!loglevel = "" then options.!loglevel = "0"
3324 if options.!memlen = "" then options.!memlen = "2"
3325 if options.!cachetimeout = "" then options.!cachetimeout = "10"
3326 if options.!cachelistings = "" then options.!cachelistings = "32"
3327 if options.!easupport= "" | options.!easupport= " " then options.!easupport = strip(options.!easupport)
3328 if options.!password <> "" & options.!spassword = "" then do
3329 options.!spassword = c2x(options.!password)
3330 options.!password = ""
3331 end
3332
3333 hashstr = mpoint' 'translate(options.!workgroup)' 'translate(options.!server)' 'translate(options.!share)' 'options.!user' 'options.!spassword' 'options.!easupport' 'rwFlag
3334
3335 md5 = rexx_md5(hashstr)
3336
3337 CALL VRMethod "CN_CONDET", 'GetRecordList', 'All', 'records.'
3338 DO i = 1 TO records.0
3339 hash = VRMethod("CN_CONDET","GetFieldData", records.i, cd.hashfh)
3340
3341 IF options.!debug == 1 THEN say VRMethod("CN_CONDET","GetFieldData", records.i, CD.mpointFH)'->'hash
3342 IF options.!debug == 1 THEN say mpoint'->'md5
3343
3344 if hash = md5 then do
3345 If VRMethod("CN_CONDET","GetFieldData", records.i, cd.statusfh) = icons.!active then do /* Same hash, status active */
3346 say "Double connection detected!!"
3347 if options.!spassword <> "" then upw = ":********"
3348 else upw = ""
3349 buttons.0 = 2
3350 buttons.1 = NLVGetMessage(9)
3351 buttons.2 = NLVGetMessage(3)
3352 Answer = VRMessage('Main',NLVGetMessage(64) , NLVGetMessage( 36,options.!user||upw'@'options.!workgroup'\\'options.!server'\'options.!share, vfs.!mountpoint ), 'W','buttons.')
3353 if Answer = 2 then do
3354 call VRSet VRWindow(), 'Pointer', '<default>'
3355 say "Double connection - do not mount!!"
3356 return
3357 end
3358 end
3359 else do /* Same hash, status passive - we have to remove it */
3360 ok = VRMethod("CN_CONDET", "RemoveRecord", records.i )
3361 end
3362 end
3363 end
3364
3365 cd.lastrh = ""
3366 ok = ParseResourceData(vfs.!mountpoint,'SMBFS SMBFS64 \\'options.!workgroup':'options.!server'\'options.!share'@'options.!user||src' 'rwFlag)
3367
3368 /* Now mount the resource */
3369 CALL _Dynamic "ok = "fs.!prefix"RxMount('SMBFS','"vfs.!mountpoint"', '"src"', '"rwFlag"')"
3370
3371 IF options.!debug == 1 THEN SAY time()' '||'Mount "'vfs.!mountpoint'" =' ok
3372 if ok <> 0 then do
3373 if options.!password <> "" then upw = ":********"
3374 else upw = ""
3375 buttons.0 = 2
3376 buttons.1 = NLVGetMessage(2)
3377 buttons.2 = NLVGetMessage(37)
3378 Answer = VRMessage('Main', SysGetMessage(ok), NLVGetMessage( 36, options.!user||upw'@'options.!workgroup'\\'options.!server'\'options.!share, vfs.!mountpoint ), 'W','buttons.')
3379 if Answer = 2 then do /* Show explanation */
3380 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')
3381 end
3382 if cd.lastrh <> '' then do
3383 ok = VRMethod("CN_CONDET", "SetFieldData", cd.lastrh, cd.statusfh, icons.!passive) /* Passive Connection icon */
3384 ok = VRMethod("CN_CONDET", "SetRecordAttr", cd.lastrh, "Icon", icons.!passive) /* Passive Connection icon */
3385 ok = VRMethod("CN_CONDET", "SetFieldData", cd.lastrh, cd.passwordfh, '') /* remove pain text password */
3386 end
3387
3388 /* In case the mountpoint was created for this failed operation, it is (optionally) removed again */
3389 if CreateMP = 0 & advanced.!alwaysmp <> 1 then do
3390 CALL _Dynamic "ok = "fs.!prefix"RxDeleteMountPoint('"vfs.!mountpoint"')"
3391 IF options.!debug == 1 THEN SAY time()' '||'Remove "'vfs.!mountpoint'" = 'ok
3392 end
3393 end
3394 drop CreateMP /* not required anymore */
3395
3396/* Obsolete - the IOCtl will not be implemented this way in the plugin
3397 The REXX function is present, but is has no counterpart in the plugin
3398 ok = EvfsRxIoctl( 100 , vfs.!mountpoint, outstring)
3399 IF options.!debug == 1 THEN SAY time()' '||'RxIoctl "'vfs.!mountpoint'" = 'ok', 'outstring
3400 */
3401 /* Set mouse pointer to default again */
3402 call VRSet VRWindow(), 'Pointer', '<default>'
3403 IF options.!debug == 1 THEN SAY time()' Mount procedure done'
3404RETURN ok
3405
3406/*:VRX MyFreeDriveMap
3407*/
3408MyFreeDriveMap: procedure expose options. icons. fs. samba.
3409 IF options.!debug == 1 THEN SAY time()' MyFreeDriveMap(proc) started'
3410 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:"
3411/* IF options.!debug == 1 THEN SAY time()' '||"SysDriveMap(USED) started" */
3412 useddrives= SysDriveMap("C:","USED")
3413/* IF options.!debug == 1 THEN SAY time()' '||"SysDriveMap(USED) done" */
3414
3415 Alldr = words(alldrives)
3416 FreeDriveMap = ""
3417 do I = 1 to AllDr
3418 if word(alldrives,1) = word(useddrives,1) then do
3419 Useddrives = subword(useddrives,2)
3420 Alldrives = subword(Alldrives,2)
3421 end
3422 else do
3423 FreeDriveMap = FreeDriveMap||word(alldrives,1)||' '
3424 Alldrives = subword(Alldrives,2)
3425 end
3426 end
3427 IF options.!debug == 1 THEN SAY time()' MyFreeDriveMap(proc) done, result "'FreeDriveMap'"'
3428return FreeDriveMap
3429/*:VRX NoEVFSCALL
3430*/
3431NoEVFSCALL:
3432 CALL VRMessage 'Main', NLVGetMessage( 100 ), NLVGetMessage( 5 ), 'E'
3433 signal Halt
3434RETURN
3435
3436/*:VRX ParseResourceData
3437*/
3438ParseResourceData: PROCEDURE EXPOSE userdata options. icons. advanced. fs. cd. samba.
3439 PARSE ARG userdata, resource
3440 IF options.!debug == 1 THEN SAY time()' ParseResourceData started'
3441 IF options.!debug == 1 THEN SAY ' receiving "'userdata'" "'resource'" length ('length(resource)')'
3442
3443/* WARNING! resource has a maximal length of 255 and is truncated otherwise */
3444
3445/* PARSE VAR resource . ';WORKGROUP='p_workgroup';SERVER='p_server';SHARE='p_share';' . */
3446
3447 if left(word(resource,1),5) <> "SMBFS" then do
3448 /* Support for other filesystems would come here! */
3449 userData = "UNKNOWN"
3450 end
3451 else do
3452 cd.lastrh = VRMethod("CN_CONDET","AddRecord")
3453 PARSE VAR userdata p_mpoint ';' p_mpidx ';' .
3454
3455 p_mpoint = strip(p_mpoint,'T','\')||'\'
3456 p_rw = word(resource, words(resource))
3457
3458 /* Workaround for truncated resource string */
3459 if length(p_rw) > 1 then do
3460 /* The resource string must have been truncated
3461 p_rw is already wrong and
3462 p_easupport will most likely be also wrong (look below for workaround!) */
3463 p_rw ="W" /* this is guessed only!!! */
3464 IF options.!debug == 1 THEN SAY ' WARNING! Detected truncated resource string - shorten workgroup name, server name, share name until this message goes away!'
3465 end
3466 /* this should be done unconditionally if the resource string is never truncated */
3467 else resource = left(resource,length(resource)-length(p_rw))
3468
3469 call ParseResParmString
3470
3471 if p_master = "" then p_master = "WORKGROUP"
3472 if p_mtype = "" then p_mtype = "1"
3473 if p_loglevel = "" then p_loglevel = "0"
3474 if p_memlen = "" then p_memlen = "2"
3475
3476 /* Also works around for a truncated resource string! */
3477 if p_easupport= "" | p_easupport= " " then p_easupport = strip(options.!easupport)
3478
3479 if p_password <> "" & p_spassword = "" then do
3480 p_spassword = c2x(p_password)
3481 p_password = ""
3482 end
3483
3484 ok = VRMethod("CN_CONDET", "SetFieldData", cd.lastrh, cd.mpointFH, p_mpoint, cd.mpidxfh, p_mpidx, cd.workgroupfh, p_workgroup, cd.serverfh, p_server, cd.sharefh, p_share, cd.userfh, p_user)
3485 ok = VRMethod("CN_CONDET", "SetFieldData", cd.lastrh, cd.passwordfh, p_password, cd.spasswordfh, p_spassword, cd.masterfh, p_master, cd.mtypefh, p_mtype)
3486 ok = VRMethod("CN_CONDET", "SetFieldData", cd.lastrh, cd.ctoFH, p_cachetimeout, cd.cldFH, p_cachelistings)
3487 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)
3488 ok = VRMethod("CN_CONDET", "SetFieldData", cd.lastrh, cd.statusfh, icons.!active) /* Active */
3489 ok = VRMethod("CN_CONDET", "SetRecordAttr", cd.lastrh, "Icon", icons.!active) /* Active */
3490
3491 hashstr = p_mpoint' 'translate(p_workgroup)' 'translate(p_server)' 'translate(p_share)' 'p_user' 'p_spassword' 'p_easupport' 'p_rw
3492
3493 md5 = rexx_md5(hashstr)
3494
3495 ok = VRMethod("CN_CONDET", "SetFieldData", cd.lastrh, cd.hashfh,md5)
3496
3497 SELECT
3498 WHEN p_share == '' & p_server \= '' THEN DO /* all shares on server */
3499 IF p_workgroup == '' THEN
3500 userdata = userdata';\\'p_server'\*'
3501 ELSE
3502 userdata = userdata';'p_workgroup':\\'p_server'\*'
3503 END
3504 WHEN p_server == '' & p_workgroup \= '' THEN /* all servers in workgroup */
3505 userdata = userdata';'p_workgroup':\\*'
3506 WHEN p_server == '' & p_workgroup == '' THEN /* all workgroups */
3507 userdata = userdata';*:\\*'
3508 OTHERWISE DO
3509 IF p_workgroup == '' THEN
3510 userdata = userdata';\\'p_server'\'p_share
3511 ELSE
3512 userdata = userdata';'p_workgroup':\\'p_server'\'p_share
3513 END
3514 END
3515 end
3516
3517 IF options.!debug == 1 THEN SAY ' returning "'userdata'"'
3518 IF options.!debug == 1 THEN SAY time()' ParseResourceData done'
3519RETURN userdata
3520
3521/*:VRX ParseResParmString
3522*/
3523ParseResParmString:
3524 PARSE VAR resource . ';WORKGROUP=' p_workgroup ';' .
3525 PARSE VAR resource . ';SERVER=' p_server ';' .
3526 PARSE VAR resource . ';SHARE=' p_share ';' .
3527 PARSE VAR resource . ';USER=' p_user ';' .
3528 PARSE VAR resource . ';PASSWORD=' p_password ';' .
3529 PARSE VAR resource . ';SPASSWORD=' p_spassword ';' .
3530 PARSE VAR resource . ';MASTER=' p_master ';' .
3531 PARSE VAR resource . ';MASTERTYPE=' p_mtype ';' .
3532 PARSE VAR resource . ';MEMLEN=' p_memlen ';' .
3533 PARSE VAR resource . ';LOGFILE=' p_logfile ';' .
3534 PARSE VAR resource . ';LOGLEVEL=' p_loglevel ';' .
3535 PARSE VAR resource . ';CTO=' p_cachetimeout ';' .
3536 PARSE VAR resource . ';CLD=' p_cachelistings ';' .
3537 PARSE VAR resource . ';EASUPPORT=' p_easupport ' '
3538return
3539/*:VRX PB_ABOUT_CLOSE_Click
3540*/
3541PB_ABOUT_CLOSE_Click:
3542 CALL SW_ABOUT_Close
3543return
3544
3545/*:VRX PB_ABOUT_COPY_Click
3546*/
3547PB_ABOUT_COPY_Click:
3548 ok = VRMethod( "Application", "PutClipboard", AboutStr )
3549 call beep 880*2,10
3550 CALL SW_ABOUT_Close
3551return
3552
3553/*:VRX PB_ADVANCED_APPLY_Click
3554*/
3555PB_ADVANCED_APPLY_Click:
3556 advanced.!easupport = VRGet( "CB_EAS", "Set" )
3557 advanced.!readonly = VRGet( "CB_READONLY", "Set" )
3558 advanced.!alwaysmp = VRGet( "CB_ALWAYSMP", "Set" )
3559 advanced.!cachetimeout = VRGet( "SPIN_CACHETIMEOUT", "Value" )
3560 advanced.!cachelistings = VRGet( "SPIN_CACHELISTINGS", "Value" )
3561
3562 /* Obsolete */
3563 advanced.!memlen = VRGet( "SPB_MEMLEN", "Value" )
3564return
3565
3566/*:VRX PB_ADVANCED_HELP_Click
3567*/
3568PB_ADVANCED_HELP_Click:
3569 CALL VRMethod 'SW_ADVANCED', 'InvokeHelp'
3570return
3571
3572/*:VRX PB_ADVANCED_UNDO_Click
3573*/
3574PB_ADVANCED_UNDO_Click:
3575 CALL SW_ADVANCED_Init_Content
3576RETURN
3577
3578/*:VRX PB_CONDET_HELP_Click
3579*/
3580PB_CONDET_HELP_Click:
3581 CALL VRMethod 'GB_CONDET', 'InvokeHelp'
3582return
3583
3584/*:VRX PB_CONDET_LOAD_Click
3585*/
3586PB_CONDET_LOAD_Click:
3587 IF options.!debug == 1 THEN SAY time()' '||"PB_CONDET_LOAD_Click started"
3588 call Menu_File_Load_Click
3589 IF options.!debug == 1 THEN SAY time()' '||"PB_CONDET_LOAD_Click done"
3590RETURN
3591
3592/*:VRX PB_CONDET_SAVE_Click
3593*/
3594PB_CONDET_SAVE_Click: PROCEDURE EXPOSE settings. options. icons. Profile fs. cd. advanced. samba.
3595 IF options.!debug == 1 THEN SAY time()' '||"PB_CONDET_SAVE_Click started"
3596
3597 if options.!autostart == 0 THEN filename = VRFileDialog('Main', NLVGetMessage( 50 ), 'S', '*.'fs.!profileext)
3598 ELSE filename = Profile
3599
3600 IF filename == '' THEN RETURN
3601
3602 IF STREAM( filename, 'C', 'QUERY EXISTS') \= '' THEN DO
3603 btns.0 = 2
3604 btns.1 = NLVGetMessage( 6 )
3605 if btns.1 = "" then btns.1 = '[Yes]'
3606 btns.2 = NLVGetMessage( 7 )
3607 if btns.2 = "" then btns.2 = '[No]'
3608 Title = NLVGetMessage( 53 )
3609 if Title = "" then Title = "[File exists]"
3610 Text = NLVGetMessage( 54, filename )
3611 if Text = "" then Text = "[File "filename" exists? Overwrite?]"
3612
3613 confirm = VRMessage('Main', Text, Title, 'W', 'btns.', 1, 2 )
3614 IF confirm \= 1 THEN RETURN
3615 CALL VRChAttr filename,, 'HSR'
3616 CALL VRDeleteFile filename
3617 END
3618
3619 CALL VRMethod "CN_CONDET", 'GetRecordList', 'All', 'records.'
3620 DO i = 1 TO records.0
3621 resource = ""
3622 resource = resource||VRMethod("CN_CONDET","GetFieldData", records.i, cd.mpointfh)||" "
3623 resource = resource||'\\'||VRMethod("CN_CONDET","GetFieldData", records.i, cd.workgroupfh)
3624 resource = resource||':'||VRMethod("CN_CONDET","GetFieldData", records.i, cd.serverfh)
3625 resource = resource||'\'||VRMethod("CN_CONDET","GetFieldData", records.i, cd.sharefh)
3626 resource = resource||'@'||VRMethod("CN_CONDET","GetFieldData", records.i, cd.userfh)
3627 resource = resource||';WORKGROUP='||VRMethod("CN_CONDET","GetFieldData", records.i, cd.workgroupfh)
3628 resource = resource||';SERVER='||VRMethod("CN_CONDET","GetFieldData", records.i, cd.serverfh)
3629 resource = resource||';SHARE='||VRMethod("CN_CONDET","GetFieldData", records.i, cd.sharefh)
3630 resource = resource||';USER='||VRMethod("CN_CONDET","GetFieldData", records.i, cd.userfh)
3631 resource = resource||';PASSWORD='||VRMethod("CN_CONDET","GetFieldData", records.i, cd.passwordfh)
3632 resource = resource||';SPASSWORD='||VRMethod("CN_CONDET","GetFieldData", records.i, cd.spasswordfh)
3633 resource = resource||';MASTER='||VRMethod("CN_CONDET","GetFieldData", records.i, cd.masterfh)
3634 resource = resource||';MASTERTYPE='||VRMethod("CN_CONDET","GetFieldData", records.i, cd.mtypefh)
3635 resource = resource||';CTO='||VRMethod("CN_CONDET","GetFieldData", records.i, cd.ctoFH)
3636 resource = resource||';CLD='||VRMethod("CN_CONDET","GetFieldData", records.i, cd.cldFH)
3637/* resource = resource||';MEMLEN='||VRMethod("CN_CONDET","GetFieldData", records.i, cd.memlenfh)
3638 resource = resource||';LOGFILE='||VRMethod("CN_CONDET","GetFieldData", records.i, cd.logfilefh)
3639 resource = resource||';LOGLEVEL='||VRMethod("CN_CONDET","GetFieldData", records.i, cd.loglevelfh) */
3640 resource = resource||';EASUPPORT='||VRMethod("CN_CONDET","GetFieldData", records.i, cd.easupportfh)
3641 resource = resource||' '||VRMethod("CN_CONDET","GetFieldData", records.i, cd.rwfh)
3642 call lineout filename, resource
3643 END
3644 CALL STREAM filename, 'C', 'CLOSE'
3645
3646 if options.!autostart == 0 THEN do
3647 Title = NLVGetMessage( 51 )
3648 if Title = "" then Title = "[Profile saved]"
3649 Text = NLVGetMessage( 52, filename )
3650 if Text = "" then Text = "[Profile saved to "filename"!]"
3651 CALL VRMessage 'Main', Text , Title, 'I'
3652 end
3653
3654 IF options.!debug == 1 THEN SAY time()' '||"PB_CONDET_SAVE_Click done"
3655RETURN
3656
3657/*:VRX PB_DETACH_Click
3658*/
3659PB_DETACH_Click: PROCEDURE EXPOSE settings. options. icons. fs. cd. samba.
3660 IF options.!debug == 1 THEN SAY time()' '||"PB_DETACH_Click started"
3661 CALL VRMethod "CN_CURRENT", 'GetRecordList', 'Selected', 'select.'
3662 IF select.0 < 1 THEN RETURN
3663
3664 userdata = VRMethod( "CN_CURRENT", 'GetRecordAttr', select.1, 'UserData')
3665 PARSE VAR userdata mountpoint ';' mounts ';' .
3666 drive = STRIP( mountpoint, 'T', '\')
3667
3668 btns.0 = 2
3669 btns.1 = NLVGetMessage( 6 )
3670 btns.2 = NLVGetMessage( 7 )
3671 confirm = VRMessage('Main', NLVGetMessage( 58, drive ), NLVGetMessage( 8 ), 'Q', 'btns.', 1, 2 )
3672 IF confirm \= 1 THEN RETURN
3673
3674 /* TODO: ?? Unmount & delete all child mountpoints? - Do we need this? */
3675 /* FIXME: This is potentially dangerous on Netdrive - what happens with unknown mount types? */
3676 /* FIXME: Unclear under which circumstances we have an alpha value here (which crahed EVFSGUI) */
3677 if datatype(mounts) = 'NUM' then do
3678 /* Unmount any resources */
3679 DO i = 1 TO mounts
3680 CALL _Dynamic "ok = "fs.!prefix"RxUnmount('"mountpoint"', "i-1")"
3681 END
3682 end
3683 else IF options.!debug == 1 THEN SAY ' '||"mounts = "mounts
3684
3685 CALL _Dynamic "ok = "fs.!prefix"RxDetach('"drive"')"
3686
3687 CALL Refresh
3688 IF options.!debug == 1 THEN SAY time()' '||"PB_DETACH_Click done"
3689RETURN
3690
3691/*:VRX PB_DIALOG_HELP_Click
3692*/
3693PB_DIALOG_HELP_Click:
3694 CALL VRMethod 'GB_DIALOG', 'InvokeHelp'
3695return
3696
3697/*:VRX PB_EDIT_CANCEL_Click
3698*/
3699PB_EDIT_CANCEL_Click:
3700 options.!editmode = 0
3701 CALL VRSet "PB_UNMOUNT","Enabled", 1
3702 CALL VRSet "GB_CURRENT", "ENABLED", 1
3703 ok = VRSet("PB_EDIT_CANCEL","Visible", 0)
3704 ok = VRMethod( "TDL_1", "SetTabText", 1, " "NLVGetMessage(13)" " )
3705/* CALL NLVSetText 'DT_DIALOG', "Caption", 13 */
3706RETURN 0
3707
3708/*:VRX PB_INFO_OK_Click
3709*/
3710PB_INFO_OK_Click:
3711 call SW_INFO_Close
3712RETURN
3713
3714/*:VRX PB_LOGIN_CANCEL_Click
3715*/
3716PB_LOGIN_CANCEL_Click:
3717 credentials.!entered = 0
3718 call SW_LOGIN_Close
3719RETURN
3720
3721/*:VRX PB_LOGIN_OK_Click
3722*/
3723PB_LOGIN_OK_Click:
3724 ok = VRSet("EF_USER","Value",VRGet("EF_USER1","Value"))
3725 ok = VRSet("EF_PASSWORD","Value",VRGet("EF_PASSWORD1","Value"))
3726 options.!storecreds = VRGet("CB_STORECREDS1","Set")
3727 credentials.!entered = 1
3728
3729 ok = _rpcqueryuser(p_server, VRGet("EF_USER1","Value"), VRGet("EF_PASSWORD1","Value"), VRGet("EF_USER1","Value"))
3730
3731 LogonRetVal = word(ok,1)
3732
3733 if LogonRetVal = "1" then do
3734 Msg.Type ="I"
3735 ok = VRSet("DT_STATUSBAR","Caption", "Welcome "rpc.queryuser.FULL_NAME"!")
3736 end
3737 else do
3738 Msg.Type ="E"
3739 CALL VRMessage 'Main', Credentials.!username" at "p_server": "rpc.queryuser.LOGONSTATUS, "Login failure", Msg.Type
3740 end
3741
3742 call SW_LOGIN_Close
3743RETURN
3744
3745/*:VRX PB_MOUNT_Click
3746*/
3747PB_MOUNT_Click:
3748 IF options.!debug == 1 THEN SAY time()' '||"PB_MOUNT_Click started"
3749 ok = VRSet("TM_RefreshCurrentDisplay","Enabled", 0)
3750 say " network = "network
3751 if options.!editmode = 1 then do
3752 CALL PB_UNMOUNT_Click
3753 options.!editmode = 0
3754 ok = VRMethod("TDL_1","SetTabText", " "strip(NLVGetMessage(13))" ")
3755/* CALL NLVSetText 'DT_DIALOG', "Caption", 13 */
3756
3757 CALL VRSet "PB_UNMOUNT","Enabled", 1
3758 CALL VRSet "GB_CURRENT", "ENABLED", 1
3759 end
3760
3761 options.!workgroup = ''
3762 options.!server = ''
3763 options.!share = ''
3764 options.!user = ''
3765 options.!password = ''
3766 options.!master = ''
3767 options.!mastertype = ''
3768 options.!memlen = advanced.!memlen
3769 options.!easupport = advanced.!easupport
3770 options.!readonly = advanced.!readonly
3771 options.!loglevel = advanced.!loglevel
3772 options.!logfile = advanced.!logfile
3773 options.!cachetimeout = advanced.!cachetimeout
3774 options.!cachelistings = advanced.!cachelistings
3775
3776 vfs.!drive = ''
3777 vfs.!mountpoint = ''
3778
3779 stype = VRGet( "CB_MOUNT", "Selected" )
3780 share = STRIP( VRGet( "EF_SHARE", "Value" ))
3781 server = STRIP( VRGet( "EF_SERVER", "Value" ))
3782 network = STRIP( VRGet( "EF_NETWORK", "Value" ))
3783 mtype = VRGet( "CHK_MTYPE", "Set" )
3784 userid = STRIP( VRGet( "EF_USER", "Value" ))
3785 password = STRIP( VRGet( "EF_PASSWORD", "Value" ))
3786 mdrive = VRGet( "CB_DRIVES", "SelectedText" )
3787 if mdrive = "" then mdrive = VRGet( "CB_DRIVES", "Value" )
3788 mpath = STRIP( VRGet( "EF_DIRECTORY", "Value" ))
3789
3790 IF ( stype < 1 | stype > 4 ) THEN stype = 1
3791
3792 /* The required/optional/ignored parameters depend on the type of mount
3793 * requested. (Note, however, that the user, password, easupport and
3794 * memlen parameters are always optional.)
3795 */
3796 SELECT
3797 /* Scenario 1: Mount a single share.
3798 * Required: share, server
3799 * Optional: workgroup
3800 * Unused: master, mastertype
3801 */
3802 WHEN stype = 1 THEN DO
3803 IF server == '' | share == '' THEN DO
3804 /* error */
3805 RETURN 1
3806 END
3807 options.!server = server
3808 options.!share = share
3809 options.!workgroup = network
3810 END
3811
3812 /* Scenario 2: Mount all shares on a server.
3813 * Required: server
3814 * Optional: workgroup
3815 * Unused: share, master, mastertype
3816 */
3817 WHEN stype = 2 THEN DO
3818 IF server == '' THEN DO
3819 /* error */
3820 RETURN 1
3821 END
3822 options.!server = server
3823 options.!workgroup = network
3824 END
3825
3826 /* Scenario 3: Mount all servers in a workgroup.
3827 * Required: workgroup
3828 * Optional: -
3829 * Unused: share, server, master, mastertype
3830 */
3831 WHEN stype = 3 THEN DO
3832 IF workgroup == '' THEN DO
3833 /* error */
3834 RETURN 1
3835 END
3836 options.!workgroup = network
3837 END
3838
3839 /* Scenario 4: Mount all workgroups known to a master.
3840 * Required: master, mastertype
3841 * Optional: -
3842 * Unused: share, server, workgroup
3843 */
3844 WHEN stype = 4 THEN DO
3845 IF master == '' | mastertype == '' THEN DO
3846 /* error */
3847 RETURN 1
3848 END
3849 options.!master = network
3850 options.!mastertype = mtype
3851 END
3852 END
3853
3854 options.!user = userid
3855 options.!password = password
3856
3857 vfs.!drive = mdrive
3858 vfs.!mountpoint = mdrive'\'mpath
3859
3860 CALL Mount
3861 CALL Refresh
3862 ok = VRSet("TM_RefreshCurrentDisplay","Enabled", 1)
3863 IF options.!debug == 1 THEN SAY time()' '||"PB_MOUNT_Click done"
3864RETURN 0
3865
3866/*:VRX PB_NEWMOUNTPOINTCANCEL_Click
3867*/
3868PB_NEWMOUNTPOINTCANCEL_Click:
3869 ok = VRSet("CB_DRIVES","Value","")
3870 ok = VRSet("EF_DIRECTORY","Value","")
3871 call SW_MOUNTPOINT_Close
3872RETURN 0
3873
3874/*:VRX PB_NEWMOUNTPOINTOK_Click
3875*/
3876PB_NEWMOUNTPOINTOK_Click:
3877 ok = VRSet("CB_DRIVES","Value",VRGet("CB_DRIVES1","Value"))
3878 ok = VRSet("EF_DIRECTORY","Value",VRGet("EF_DIRECTORY1","Value"))
3879
3880 advanced.!readonly = VRGet("CB_READONLY1","Set")
3881 advanced.!easupport = VRGet("CB_EAS1","Set")
3882 advanced.!alwaysmp = VRGet("CB_ALWAYSMP1","Set")
3883 advanced.!cachetimeout = VRGet( "SPIN_CACHETIMEOUT1", "Value" )
3884 advanced.!cachelistings = VRGet( "SPIN_CACHELISTINGS1", "Value" )
3885
3886 call SW_MOUNTPOINT_Close
3887RETURN
3888
3889/*:VRX PB_NEWPORTCANCEL_Click
3890*/
3891PB_NEWPORTCANCEL_Click:
3892/* ok = VRSet("CB_DRIVES","Value","")
3893 ok = VRSet("EF_DIRECTORY","Value","")
3894 call SW_MOUNTPOINT_Close */
3895RETURN 0
3896
3897/*:VRX PB_NEWPORTCONNECT_Click
3898*/
3899PB_NEWPORTCONNECT_Click:
3900/* ok = VRSet("CB_DRIVES","Value",VRGet("CB_DRIVES1","Value"))
3901 ok = VRSet("EF_DIRECTORY","Value",VRGet("EF_DIRECTORY1","Value"))
3902
3903 advanced.!readonly = VRGet("CB_READONLY1","Set")
3904 advanced.!easupport = VRGet("CB_EAS1","Set")
3905 advanced.!alwaysmp = VRGet("CB_ALWAYSMP1","Set")
3906 advanced.!cachetimeout = VRGet( "SPIN_CACHETIMEOUT1", "Value" )
3907 advanced.!cachelistings = VRGet( "SPIN_CACHELISTINGS1", "Value" )
3908
3909 call SW_MOUNTPOINT_Close */
3910RETURN
3911
3912/*:VRX PB_PROGRESS_ABORT_Click
3913*/
3914PB_PROGRESS_ABORT_Click:
3915 options.!delay = 0
3916 options.!autoload = 0
3917 options.!autoclose = 0
3918 call SW_PROGRESS_Close
3919return
3920
3921/*:VRX PB_SETTINGS_APPLY_Click
3922*/
3923PB_SETTINGS_APPLY_Click:
3924 advanced.!loglevel = VRGet("SPIN_LOGLEVEL", "Value" )
3925 advanced.!logfile = VRGet("EF_LOGFILE", "Value" )
3926 advanced.!browseauth = VRGet("CB_BROWSEAUTH", "Set" )
3927 advanced.!browseimme = VRGet("CB_BROWSEIMME", "Set" )
3928 advanced.!special = VRGet("CB_SPECIAL", "Set" )
3929 advanced.!savepassive = VRGet("CB_SAVEPASSIVE","Set" )
3930 advanced.!lmhosts = VRGet("CB_LMHOSTS", "Set" )
3931 advanced.!broadcast = VRGet("CB_BROADCAST", "Set" )
3932 advanced.!miniicons = VRGet("CB_MINIICONS", "Set" )
3933
3934 /* Note: CB_LOGGING has its own event tied to the click */
3935 options.!storecreds = VRGet("CB_STORECREDS", "Set" )
3936 options.!debug = VRGet("CB_DEBUG", "Set" )
3937
3938 if options.!debug == 1 then do /* Turn on additional columns in connection details view */
3939 ok = VRRedirectStdio("ON")
3940 ok = VRMethod("CN_CONDET", "SetFieldAttr", cd.mpidxfh , "Visible", 1)
3941 ok = VRMethod("CN_CONDET", "SetFieldAttr", cd.passwordfh , "Visible", 1)
3942 ok = VRMethod("CN_CONDET", "SetFieldAttr", cd.spasswordfh , "Visible", 1)
3943 ok = VRMethod("CN_CONDET", "SetFieldAttr", cd.masterFH , "Visible", 1)
3944 ok = VRMethod("CN_CONDET", "SetFieldAttr", cd.mtypeFH , "Visible", 1)
3945 ok = VRMethod("CN_CONDET", "SetFieldAttr", cd.memlenfh , "Visible", 1)
3946 ok = VRMethod("CN_CONDET", "SetFieldAttr", cd.logfilefh , "Visible", 1)
3947 ok = VRMethod("CN_CONDET", "SetFieldAttr", cd.loglevelfh , "Visible", 1)
3948 ok = VRMethod("CN_CONDET", "SetFieldAttr", cd.hashfh , "Visible", 1)
3949 end
3950 else do /* Turn on additional columns in connection details view */
3951 ok = VRRedirectStdio("OFF")
3952 ok = VRMethod("CN_CONDET", "SetFieldAttr", cd.mpidxfh , "Visible", 0)
3953 ok = VRMethod("CN_CONDET", "SetFieldAttr", cd.passwordfh , "Visible", 0)
3954 ok = VRMethod("CN_CONDET", "SetFieldAttr", cd.spasswordfh , "Visible", 0)
3955 ok = VRMethod("CN_CONDET", "SetFieldAttr", cd.masterFH , "Visible", 0)
3956 ok = VRMethod("CN_CONDET", "SetFieldAttr", cd.mtypeFH , "Visible", 0)
3957 ok = VRMethod("CN_CONDET", "SetFieldAttr", cd.memlenfh , "Visible", 0)
3958 ok = VRMethod("CN_CONDET", "SetFieldAttr", cd.logfilefh , "Visible", 0)
3959 ok = VRMethod("CN_CONDET", "SetFieldAttr", cd.loglevelfh , "Visible", 0)
3960 ok = VRMethod("CN_CONDET", "SetFieldAttr", cd.hashfh , "Visible", 0)
3961 end
3962
3963 ok = VRset("CN_CURRENT", "MiniIcons", advanced.!miniicons)
3964 ok = VRset("CN_SMBTREE", "MiniIcons", advanced.!miniicons)
3965 ok = VRset("CN_CONDET", "MiniIcons", advanced.!miniicons)
3966
3967 if advanced.!lmhosts = 1 then do
3968 call _LMHostsRead
3969 call _LMHostsUpdate
3970 end
3971 if advanced.!smbconfchanged = 1 then do
3972 name_resolve_order = VRGet("SPIN_NRO1","value")' 'VRGet("SPIN_NRO2","value")' 'VRGet("SPIN_NRO3","value")' 'VRGet("SPIN_NRO4","value")
3973 handle = IniOpen('global', samba.!smbconf)
3974 call IniSet 'name resolve order', name_resolve_order, handle
3975 /* FIXME: Throw an error in this case */
3976 if \_IsValidIPAddress(VRGet("EF_WINS_SERVER","Value")) then ok = VRSet("EF_WINS_SERVER","Value","")
3977 call IniSet 'wins server', VRGet("EF_WINS_SERVER","Value"), handle
3978 call IniSave handle
3979 call IniClose handle
3980 advanced.!smbconfchanged = 0
3981 ok = VRSet("PB_SETTINGS_UNDO","Enabled", 0)
3982 end
3983return
3984
3985/*:VRX PB_SETTINGS_HELP_Click
3986*/
3987PB_SETTINGS_HELP_Click:
3988 CALL VRMethod 'SW_SETTINGS', 'InvokeHelp'
3989return
3990
3991/*:VRX PB_SETTINGS_UNDO_Click
3992*/
3993PB_SETTINGS_UNDO_Click:
3994 call SW_SETTINGS_Init_Content
3995return
3996
3997/*:VRX PB_SMBTREE_CONNECT_Click
3998*/
3999PB_SMBTREE_CONNECT_Click: PROCEDURE EXPOSE settings. options. icons. fs. advanced. cd. samba.
4000 IF options.!debug == 1 THEN SAY time()' '||"PB_CONNECT_Click started"
4001
4002 ok = VRMethod( "CN_SMBTREE", "GetRecordList", "SourceOrSelected", "SelRH." )
4003
4004 if SelRH.0 = 0 then do
4005 IF options.!debug == 1 THEN SAY time()' '||"PB_CONNECT_Click aborted"
4006 return
4007 end
4008
4009 p_workgroup = ''
4010 p_server = ''
4011 p_share = ''
4012
4013 srcFile = ""
4014 srcCtn = VRGet("CN_SMBTREE","Self")
4015 srcRec = SelRH.1
4016 trgCtn = VRGet("CN_CURRENT","Self")
4017 trgRec = ""
4018
4019 IF options.!debug == 1 THEN do
4020 say ' srcCtn = "'srcCtn'"'
4021 if srcCtn <> "" then say ' srcCtn name = "'VRGet(srcCtn,'Name')'"'
4022 say ' srcRec = "'srcRec'"'
4023 say ' trgCtn = "'trgCtn'"'
4024 if trgCtn <> "" then say ' trgCtn name = "'VRGet(trgCtn,'Name')'"'
4025 say ' trgRec = "'trgRec'"'
4026 end
4027
4028 ok = VRMethod("CB_MOUNT", "GetStringList", "ShareLevels." )
4029
4030 DragCapt = VRMethod(srcCtn, "GetRecordAttr", srcRec, "Caption")
4031 ParentRH = VRMethod(srcCtn, "GetRecordAttr", srcRec, "Parent")
4032
4033 if ParentRH = "" then do /* A workgroup was dragged */
4034 say "Workgroup dragged!"
4035 parse var DragCapt p_workgroup '0D0A'x .
4036 p_workgroup = strip(p_workgroup)
4037 ok = VRSet("EF_NETWORK","Value",strip(p_workgroup))
4038 call _UpdateObject "EF_SERVER", ""
4039 ok = VRSet("EF_SHARE","Value","")
4040
4041 ShareLevel = 3
4042 end
4043 else do
4044 ParDragCapt = VRMethod(srcCtn, "GetRecordAttr", ParentRH, "Caption")
4045 GParentRH = VRMethod(srcCtn, "GetRecordAttr", ParentRH, "Parent")
4046
4047 if GParentRH = "" then do /* A server was dragged */
4048 say "Server dragged!"
4049 parse var ParDragCapt p_workgroup '0D0A'x .
4050 ok = VRSet("EF_NETWORK","Value",strip(p_workgroup))
4051 p_workgroup = strip(p_workgroup)
4052
4053 parse var DragCapt p_server '0D0A'x .
4054 p_server = strip(p_server)
4055 call _UpdateObject "EF_SERVER", p_server
4056 ok = VRSet("EF_Share","Value","")
4057
4058 ShareLevel = 2
4059 end
4060 else do /* A share was dragged */
4061 say "Share dragged!"
4062 GParDragCapt = VRMethod(srcCtn, "GetRecordAttr", GParentRH, "Caption")
4063
4064 parse var GParDragCapt p_workgroup '0D0A'x .
4065 p_workgroup = strip(p_workgroup)
4066 ok = VRSet("EF_NETWORK","Value",strip(p_workgroup))
4067
4068 parse var ParDragCapt p_server '0D0A'x .
4069 p_server = strip(p_server)
4070 call _UpdateObject "EF_SERVER", p_server
4071
4072 parse var DragCapt p_share '0D0A'x .
4073 p_share = strip(p_share)
4074 ok = VRSet("EF_Share","Value",strip(p_share))
4075
4076 ShareLevel = 1
4077 end
4078 end
4079
4080 say 'p_workgroup = "'p_workgroup'"'
4081 say 'p_server = "'p_server'"'
4082 say 'p_share = "'p_share'"'
4083
4084 ok = VRSet( "CB_MOUNT", "Selected", Sharelevel )
4085 call CB_MOUNT_Change
4086
4087 if trgRec = "" then do
4088 window = VRLoadSecondary( "SW_MOUNTPOINT", "W" )
4089 if VRGet("CB_DRIVES","Value") = "" then return
4090 end
4091 else do
4092
4093 TargetString = VRMethod(trgCtn, "GetRecordAttr", trgRec, "Caption")
4094
4095 parTrgRH = VRMethod(trgCtn, "GetRecordAttr", trgRec, "Parent")
4096
4097 do while parTrgRH <> ""
4098 partrgCapt = VRMethod(trgCtn, "GetRecordAttr", partrgRH, "Caption")
4099 TargetString = partrgCapt||'\'||TargetString
4100 parTrgRH = VRMethod(trgCtn, "GetRecordAttr", partrgRH , "Parent")
4101 end
4102 say 'TargetString = "'TargetString'"'
4103 ok = VRSet("CB_DRIVES","Value", left(TargetString,2))
4104 ok = VRSet("EF_DIRECTORY","Value", substr(TargetString,4))
4105 end
4106
4107 window = VRLoadSecondary( "SW_LOGIN", "W" )
4108 if credentials.!entered = 1 then call PB_MOUNT_CLICK
4109
4110 IF options.!debug == 1 THEN SAY time()' '||"PB_CONNECT_Click done"
4111RETURN
4112
4113/*:VRX PB_SMBTREE_HELP_Click
4114*/
4115PB_SMBTREE_HELP_Click:
4116 CALL VRMethod 'GB_SMBTREE', 'InvokeHelp'
4117return
4118
4119/*:VRX PB_SMBTREE_REFRESH_Click
4120*/
4121PB_SMBTREE_REFRESH_Click: /* PROCEDURE EXPOSE settings. options. icons. fs. samba. debuglevel advanced. UserCred Refreshmode Tempdir */
4122 IF options.!debug == 1 THEN SAY time()' '||"PB_REFRESH_Click started"
4123
4124 if advanced.!browseauth = 1 & (UserCred = "--user=%" | UserCred = "" ) then do
4125 window = VRLoadSecondary( "SW_LOGIN", "W" )
4126 end
4127
4128 call _UserCredUpdate
4129 ok = VRset("Pict_Throbber", "Visible", 1)
4130 ok = VRset("Menu_Selected_Connect", "Visible", 0)
4131 ok = VRset("TM_Throbber", "Enabled", 1)
4132 ShowHidden = advanced.!special
4133 BroadCast = advanced.!broadcast
4134 ok = VRSet("TM_RefreshTreeDisplay", "Delay", 1000)
4135 ok = time('R')
4136 call _RefreshTree
4137 IF options.!debug == 1 THEN SAY time()' '||"PB_REFRESH_Click done"
4138RETURN
4139
4140/*:VRX PB_UNMOUNT_Click
4141*/
4142PB_UNMOUNT_Click: PROCEDURE EXPOSE settings. options. icons. fs. cd. samba.
4143 IF options.!debug == 1 THEN SAY time()' '||"PB_UNMOUNT_Click started"
4144 IF options.!debug == 1 THEN SAY time()' '||'options.!editmode = 'options.!editmode
4145 CALL VRMethod "CN_CURRENT", 'GetRecordList', 'Selected', 'select.'
4146 IF select.0 < 1 THEN RETURN
4147
4148 userdata = VRMethod( "CN_CURRENT", 'GetRecordAttr', select.1, 'UserData')
4149 PARSE VAR userdata mountpoint ';' mounts ';' .
4150say 'userdata="'userdata'"'
4151 IF mounts > 0 & options.!editmode = 0 THEN DO
4152 btns.0 = 2
4153 btns.1 = NLVGetMessage( 6 )
4154 btns.2 = NLVGetMessage( 7 )
4155 confirm = VRMessage('Main', NLVGetMessage( 57, mountpoint ), NLVGetMessage( 8 ), 'Q', 'btns.', 1, 2 )
4156 IF confirm \= 1 THEN RETURN
4157 END
4158
4159 /* Unmount any resources */
4160 DO i = 1 TO mounts
4161 CALL _Dynamic "ok = "fs.!prefix"RxUnmount('"mountpoint"', "i-1")"
4162 END
4163
4164 /* Delete mountpoint */
4165 parent = VRMethod("CN_CURRENT", 'GetRecordAttr', select.1, 'Parent')
4166 IF parent \= '' THEN DO
4167 CALL _Dynamic "ok = "fs.!prefix"RxDeleteMountPoint('"mountpoint"')"
4168 END
4169
4170 CALL Refresh
4171 IF options.!debug == 1 THEN SAY time()' '||"PB_UNMOUNT_Click done"
4172RETURN 0
4173
4174/*:VRX Quit
4175*/
4176Quit:
4177 if Fatal <> 1 then CALL _INISave
4178 ok = VRREdirectSTdio("OFF")
4179 window = VRWindow()
4180 call VRSet window, "Shutdown", 1
4181 drop window
4182RETURN
4183
4184/*:VRX Refresh
4185*/
4186Refresh:
4187 IF options.!debug == 1 THEN SAY time()' Refresh started'
4188 CALL VRSet "CN_CURRENT", 'Painting', 0
4189
4190 CALL VRMethod "CN_CURRENT", 'RemoveRecord', 'All'
4191
4192 /* Remove Active connections from details view */
4193 ok = VRMethod( "CN_CONDET", "GetRecordList", 'All', "rh." )
4194
4195 do I = 1 to rh.0
4196 /* This catches the bug we observed exactly once and were unable to reproduce! */
4197 if cd.statusfh = 'CD.STATUSFH' then do
4198 call beep 880, 50
4199 call beep 880, 50
4200 IF options.!debug == 1 THEN say " cd.statusfh is undefined - check why!!!!!!"
4201 leave
4202 end
4203 IF options.!debug == 1 THEN say ' Icon.'i' = "'||VRMethod( "CN_CONDET", "GetFieldData", rh.i, cd.statusfh)'"'
4204 if VRMethod("CN_CONDET","GetFieldData", rh.i, cd.statusfh) = icons.!active then CALL VRMethod "CN_CONDET", 'RemoveRecord', rh.i
4205 end
4206
4207/* call _AddTemplates */
4208 CALL VRSet "PB_DETACH", "Enabled", 0
4209 CALL VRSet "PB_UNMOUNT", "Enabled", 0
4210
4211 ok = VRSet("MENU_CONTEXT_OPEN", "Visible", 0)
4212/* ok = VRSet("MENU_CONTEXT_SEP1", "Visible", 0) */
4213 ok = VRSet("MENU_CONTEXT_DETACH", "Visible", 0)
4214 ok = VRSet("MENU_CONTEXT_UNMOUNT", "Visible", 0)
4215 ok = VRSet("MENU_CONTEXT_EDIT", "Visible", 0)
4216
4217 ok = VRSet("MENU_SELECTED_REMOVE", "Visible", 0)
4218 ok = VRSet("MENU_SELECTED_RETRY", "Visible", 0)
4219
4220 IF options.!debug == 1 THEN SAY ' Remove records, disable buttons done.'
4221
4222 CALL VRMethod 'CB_DRIVES', 'Clear'
4223
4224 CALL VRSet "CN_CURRENT", "Caption", fs.!Name' 'fs.!version
4225
4226 /* Herwig B.: Attention! The SysDrivemap function with the "free" parameter causes hangs in case it is called repeatedly! */
4227 drvs = MyFreeDriveMap('C:', 'FREE')
4228
4229 DO i = 1 TO WORDS( drvs )
4230 drvstem.i = WORD( drvs, i )
4231 END
4232
4233 drvstem.0 = WORDS( drvs )
4234
4235 /* Add any existing EVFS drives */
4236 CALL GetMountPoints
4237
4238 CALL VRMethod "CB_DRIVES", "AddStringList", "drvstem."
4239 CALL VRSet "CN_CURRENT", 'Painting', 1
4240 IF options.!debug == 1 THEN SAY time()' '||"Refresh done"
4241RETURN 0
4242
4243/*:VRX SPIN_NRO1_Change
4244*/
4245SPIN_NRO1_Change:
4246 advanced.!smbconfchanged = 1
4247return
4248
4249/*:VRX SPIN_NRO2_Change
4250*/
4251SPIN_NRO2_Change:
4252 advanced.!smbconfchanged = 1
4253return
4254
4255/*:VRX SPIN_NRO3_Change
4256*/
4257SPIN_NRO3_Change:
4258 advanced.!smbconfchanged = 1
4259return
4260
4261/*:VRX SPIN_NRO4_Change
4262*/
4263SPIN_NRO4_Change:
4264 advanced.!smbconfchanged = 1
4265return
4266
4267/*:VRX SPLIT_Main_Move
4268*/
4269SPLIT_Main_Move:
4270 ok = VRset("Main", "Painting", 0)
4271 NewPos = VRInfo("Left")
4272 OldPos = VRGet("SPLIT_Main","Left")
4273 ok = VRSet("SPLIT_Main","Left", NewPos)
4274 ok = VRset("GB_SMBTREE","Left", NewPos+60)
4275 call Main_Resize
4276 ok = VRset("Main", "Painting", 1)
4277return
4278
4279/*:VRX SW_ABOUT_Close
4280*/
4281SW_ABOUT_Close:
4282 call SW_ABOUT_Fini
4283return
4284
4285/*:VRX SW_ABOUT_Create
4286*/
4287SW_ABOUT_Create:
4288 call SW_ABOUT_Init
4289
4290 CALL NLVSetText 'SW_ABOUT', "Caption", 1
4291 CALL NLVSetText 'PB_ABOUT_CLOSE', "Caption", 29
4292 CALL NLVSetText 'PB_ABOUT_COPY', "Caption", 121
4293 CALL NLVSetText 'CB_TRAC', "Caption", 134
4294
4295 ok = VRSet("DT_About","Caption", 'EVFSGUI (c) 2007-2011 Alexander Taylor and Herwig Bauernfeind')
4296
4297 About.DscFH = VRMethod( "CN_ABOUT", "AddField", "String", "Component" )
4298 About.ValFH = VRMethod( "CN_ABOUT", "AddField", "String", "Version" )
4299
4300 call _AboutSambaClientGetInfo
4301
4302return
4303/*:VRX SW_ABOUT_Fini
4304*/
4305SW_ABOUT_Fini:
4306 window = VRInfo( "Window" )
4307 call VRDestroy window
4308 drop window
4309return
4310/*:VRX SW_ABOUT_Init
4311*/
4312SW_ABOUT_Init:
4313 window = VRInfo( "Object" )
4314 if( \VRIsChildOf( window, "Notebook" ) ) then do
4315 call VRMethod window, "CenterWindow"
4316 call VRSet window, "Visible", 1
4317 call VRMethod window, "Activate"
4318 end
4319 drop window
4320return
4321
4322/*:VRX SW_ADVANCED_Close
4323*/
4324SW_ADVANCED_Close:
4325 call SW_ADVANCED_Fini
4326return
4327
4328/*:VRX SW_ADVANCED_Create
4329*/
4330SW_ADVANCED_Create:
4331 call SW_ADVANCED_Init
4332return
4333
4334/*:VRX SW_ADVANCED_Fini
4335*/
4336SW_ADVANCED_Fini:
4337 window = VRInfo( "Window" )
4338 call VRDestroy window
4339 drop window
4340return
4341/*:VRX SW_ADVANCED_Init
4342*/
4343SW_ADVANCED_Init:
4344 /* Title bar */
4345 CALL NLVSetText "SW_ADVANCED", "Caption", 40
4346
4347 /* Options */
4348 CALL NLVSetText "GB_ADVANCED", "Caption", 43
4349 CALL NLVSetText "CB_EAS", "Caption", 44
4350 CALL NLVSetText "CB_READONLY", "Caption", 45
4351 CALL NLVSetText "CB_ALWAYSMP", "Caption", 65
4352 CALL NLVSetText "DT_CACHETIMEOUT", "Caption", 130
4353 CALL NLVSetText "DT_CACHELISTINGS", "Caption", 131
4354
4355 /* Buttons */
4356 CALL NLVSetText "PB_ADVANCED_APPLY", "Caption", 122
4357 CALL NLVSetText "PB_ADVANCED_UNDO", "Caption", 123
4358 CALL NLVSetText "PB_ADVANCED_HELP", "Caption", 4
4359
4360 CALL VRSet "SW_ADVANCED", "HelpTag", NLVGetMessage(40)
4361
4362/* call VRMethod "SW_ADVANCED", "CenterWindow" */
4363 ok = VRSet("SW_ADVANCED", "Visible", 1)
4364/* call VRMethod "SW_ADVANCED", "Activate" */
4365return
4366
4367/*:VRX SW_ADVANCED_Init_Content
4368*/
4369SW_ADVANCED_Init_Content:
4370 IF advanced.!easupport \= "" THEN ok = VRSet("CB_EAS", "Set", advanced.!easupport)
4371 IF advanced.!readonly \= "" THEN ok = VRSet("CB_READONLY","Set", advanced.!readonly)
4372 IF advanced.!alwaysmp \= "" THEN ok = VRSet("CB_ALWAYSMP","Set", advanced.!alwaysmp)
4373 IF advanced.!cachetimeout \= "" THEN ok = VRSet("SPIN_CACHETIMEOUT", "Value", advanced.!cachetimeout)
4374 IF advanced.!cachelistings \= "" THEN ok = VRSet("SPIN_CACHELISTINGS", "Value", advanced.!cachelistings)
4375
4376 /* Obsolete */
4377 IF advanced.!memlen \= "" THEN ok = VRSet("SPB_MEMLEN", "Value", advanced.!memlen)
4378return
4379
4380/*:VRX SW_CONDET_Close
4381*/
4382SW_CONDET_Close:
4383 call SW_CONDET_Fini
4384return
4385
4386/*:VRX SW_CONDET_Create
4387*/
4388SW_CONDET_Create:
4389 call SW_CONDET_Init
4390return
4391
4392/*:VRX SW_CONDET_Fini
4393*/
4394SW_CONDET_Fini:
4395 window = VRInfo( "Window" )
4396 call VRDestroy window
4397 drop window
4398return
4399/*:VRX SW_CONDET_Init
4400*/
4401SW_CONDET_Init:
4402
4403return
4404
4405/*:VRX SW_CONDET_Init_Content
4406*/
4407SW_CONDET_Init_Content:
4408 if VRGet("TM_Throbber","Enabled") = 1 then ok = VRset("Pict_Throbber", "Visible", 0)
4409
4410 /* Hide any "foreign" menu entries */
4411 ok = VRSet("Menu_Selected_Connect", "Visible", 0)
4412return
4413
4414/*:VRX SW_DIALOG_Close
4415*/
4416SW_DIALOG_Close:
4417 call SW_DIALOG_Fini
4418return
4419
4420/*:VRX SW_DIALOG_Create
4421*/
4422SW_DIALOG_Create:
4423 call SW_DIALOG_Init
4424return
4425
4426/*:VRX SW_DIALOG_Fini
4427*/
4428SW_DIALOG_Fini:
4429 window = VRInfo( "Window" )
4430 call VRDestroy window
4431 drop window
4432return
4433/*:VRX SW_DIALOG_Init
4434*/
4435SW_DIALOG_Init:
4436
4437return
4438
4439/*:VRX SW_DIALOG_Init_Content
4440*/
4441SW_DIALOG_Init_Content:
4442 if VRGet("TM_Throbber","Enabled") = 1 then ok = VRset("Pict_Throbber", "Visible", 0)
4443
4444 ok = VRSet("Menu_Selected_Remove", "Visible", 0)
4445 ok = VRSet("Menu_Selected_Retry", "Visible", 0)
4446 ok = VRSet("Menu_Selected_Connect", "Visible", 0)
4447
4448 call _DialogPopulate
4449return
4450
4451/*:VRX SW_INFO_Close
4452*/
4453SW_INFO_Close:
4454 call SW_INFO_Fini
4455return
4456
4457/*:VRX SW_INFO_Create
4458*/
4459SW_INFO_Create:
4460 IF options.!debug == 1 THEN SAY time()' SW_INFO_Create started'
4461 call SW_INFO_Init
4462 CALL NLVSetText 'SW_INFO', "Caption", 92
4463 CALL NLVSetText 'PB_INFO_OK', "Caption", 2
4464 Info.TypeFH = VRMethod( "CN_INFO", "AddField", "String", "Type" )
4465 Info.ValueFH = VRMethod( "CN_INFO", "AddField", "String", "Value" )
4466
4467 IF options.!debug == 1 THEN do
4468 SAY ' Handle: "'SMBObj.rh'"'
4469 SAY ' Resource: "'SMBObj.resname'"'
4470 SAY ' Comment: "'SMBObj.comment'"'
4471 SAY ' Type: "'SMBObj.udatatype'"'
4472 SAY ' Message: "'SMBObj.udatamsg'"'
4473 SAY ' Icon: "'SMBObj.icon'"'
4474 end
4475
4476 Info.!comment= VRMethod( "CN_INFO", "AddRecord")
4477 Info.!domain = VRMethod( "CN_INFO", "AddRecord")
4478 Info.!DMBLMB = VRMethod( "CN_INFO", "AddRecord")
4479 Info.!os = VRMethod( "CN_INFO", "AddRecord")
4480 Info.!server = VRMethod( "CN_INFO", "AddRecord")
4481 Info.!status = VRMethod( "CN_INFO", "AddRecord")
4482 Info.!IP = VRMethod( "CN_INFO", "AddRecord")
4483 Info.!MAC = VRMethod( "CN_INFO", "AddRecord")
4484
4485
4486 ok = VRMethod( "CN_INFO", "SetFieldData", Info.!domain, Info.TypeFH, strip(NLVGetMessage(21),'T',':'),Info.ValueFH, VRMethod("CN_SMBTREE", "GetFieldData", SMBObj.RH, WorkGroupFH ))
4487 ok = VRMethod( "CN_INFO", "SetFieldData", Info.!os, Info.TypeFH, strip(NLVGetMessage(93),'T',':'),Info.ValueFH, VRMethod("CN_SMBTREE", "GetFieldData", SMBObj.RH, OSFH ))
4488 ok = VRMethod( "CN_INFO", "SetFieldData", Info.!server, Info.TypeFH, strip(NLVGetMessage(19),'T',':'),Info.ValueFH, VRMethod("CN_SMBTREE", "GetFieldData", SMBObj.RH, VersionFH ))
4489 ok = VRMethod( "CN_INFO", "SetFieldData", Info.!DMBLMB, Info.TypeFH, strip(NLVGetMessage(124),'T',':'),Info.ValueFH, VRMethod("CN_SMBTREE", "GetFieldData", SMBObj.RH, MBFH ))
4490 ok = VRMethod( "CN_INFO", "SetFieldData", Info.!IP, Info.TypeFH, "IP" ,Info.ValueFH, VRMethod("CN_SMBTREE", "GetFieldData", SMBObj.RH, IPFH ))
4491 ok = VRMethod( "CN_INFO", "SetFieldData", Info.!MAC, Info.TypeFH, "MAC" ,Info.ValueFH, VRMethod("CN_SMBTREE", "GetFieldData", SMBObj.RH, MacFH ))
4492 ok = VRMethod( "CN_INFO", "SetFieldData", Info.!comment,Info.TypeFH, strip(NLVGetMessage(125),'T',':'),Info.ValueFH, SMBObj.comment)
4493 ok = VRMethod( "CN_INFO", "SetFieldData", Info.!status, Info.TypeFH, strip(NLVGetMessage(67),'T',':'),Info.ValueFH, SMBObj.udatamsg )
4494 IF options.!debug == 1 THEN SAY time()' SW_INFO_Create done'
4495return
4496
4497/*:VRX SW_INFO_Fini
4498*/
4499SW_INFO_Fini:
4500 window = VRInfo( "Window" )
4501 call VRDestroy window
4502 drop window
4503return
4504/*:VRX SW_INFO_Init
4505*/
4506SW_INFO_Init:
4507 window = VRInfo( "Object" )
4508 if( \VRIsChildOf( window, "Notebook" ) ) then do
4509 call VRMethod window, "CenterWindow"
4510 call VRSet window, "Visible", 1
4511 call VRMethod window, "Activate"
4512 end
4513 drop window
4514return
4515
4516/*:VRX SW_LOGIN_Close
4517*/
4518SW_LOGIN_Close:
4519 call SW_LOGIN_Fini
4520return
4521
4522/*:VRX SW_LOGIN_Create
4523*/
4524SW_LOGIN_Create:
4525 call SW_LOGIN_Init
4526 ok = VRSet("SW_LOGIN","Caption",NLVGetMessage(136)' 'strip(p_workgroup' \\'p_server'\'p_share,'T','\'))
4527 CALL NLVSetText 'DT_USER1', "Caption", 25
4528 CALL NLVSetText 'DT_PASSWORD1', "Caption", 26
4529 CALL NLVSetText 'CB_STORECREDS1', "Caption", 135
4530 CALL NLVSetText 'PB_LOGIN_OK', "Caption", 2
4531 CALL NLVSetText 'PB_LOGIN_CANCEL',"Caption", 3
4532
4533 select
4534 when pos("PDC",VRMethod("CN_smbtree", "GetFieldData", SMBObj.rh, MBFH)) > 0 then LoginIcon = "#63:PMWP.DLL" /* icons.!pdc */
4535 when SMBObj.udatatype = "WORKGROUP" then LoginIcon = SMBObj.Icon
4536 when SMBObj.udatatype = "SERVER" then LoginIcon = SMBObj.Icon
4537 when SMBObj.udatatype = "DISK" then do
4538 if pos("PDC",VRMethod("CN_smbtree", "GetFieldData", SMBObj.parentrh, MBFH)) > 0
4539 then LoginIcon = "#63:PMWP.DLL" /* icons.!pdc */
4540 else LoginIcon = "#35:PMWP.DLL" /* icons.!pdc */
4541 end
4542 otherwise LoginIcon = "#35:PMWP.DLL" /* icons.!machine_awake */
4543 end
4544say loginicon
4545 ok = VRSet("Pict_Login","PicturePath", LoginIcon)
4546 ok = VRSet("EF_USER1","Value",VRGet("EF_USER","Value"))
4547 ok = VRSet("EF_PASSWORD1","Value",VRGet("EF_PASSWORD","Value"))
4548 ok = VRSet("CB_STORECREDS1","Set",options.!storecreds)
4549return
4550
4551/*:VRX SW_LOGIN_Fini
4552*/
4553SW_LOGIN_Fini:
4554 window = VRInfo( "Window" )
4555 call VRDestroy window
4556 drop window
4557return
4558/*:VRX SW_LOGIN_Init
4559*/
4560SW_LOGIN_Init:
4561 window = VRInfo( "Object" )
4562 if( \VRIsChildOf( window, "Notebook" ) ) then do
4563 call VRMethod window, "CenterWindow"
4564 call VRSet window, "Visible", 1
4565 call VRMethod window, "Activate"
4566 end
4567 drop window
4568return
4569
4570/*:VRX SW_LOGIN_KeyPress
4571*/
4572SW_LOGIN_KeyPress:
4573 obj = VRInfo( "Object" )
4574 keystr = VRGet( obj, "KeyString" )
4575/* say keystr */
4576 select
4577 when keystr = "{Enter}" then ok = VRMethod( "EF_LoginPassword", "SetFocus" )
4578 when keystr = "{Newline}" then ok = VRMethod( "EF_LoginPassword", "SetFocus" )
4579 when keystr = "{Esc}" then call PB_LOGIN_CANCEL_Click
4580 otherwise nop
4581 end
4582return
4583
4584/*:VRX SW_MOUNTPOINT_Close
4585*/
4586SW_MOUNTPOINT_Close:
4587 call SW_MOUNTPOINT_Fini
4588return
4589
4590/*:VRX SW_MOUNTPOINT_Create
4591*/
4592SW_MOUNTPOINT_Create:
4593 call SW_MOUNTPOINT_Init
4594
4595 ok = VRSet("SW_MOUNTPOINT","Caption",strip(p_workgroup' \\'p_server'\'p_share,'T','\')) /* NLVGetMessage(14)' ' */
4596 CALL NLVSetText 'DT_MPOINT1', "Caption", 27
4597 CALL NLVSetText 'PB_NEWMOUNTPOINTOK', "Caption", 2
4598 CALL NLVSetText 'PB_NEWMOUNTPOINTCANCEL',"Caption", 3
4599 CALL NLVSetText 'CB_EAS1', "Caption", 44
4600 CALL NLVSetText 'CB_READONLY1', "Caption", 45
4601 CALL NLVSetText 'CB_ALWAYSMP1', "Caption", 65
4602 CALL NLVSetText "DT_CACHETIMEOUT1", "Caption", 130
4603 CALL NLVSetText "DT_CACHELISTINGS1", "Caption", 131
4604
4605 ok = VRMethod( "CB_DRIVES", "GetStringList", "freedrives." )
4606 ok = VRMethod( "CB_DRIVES1", "AddStringList", "freedrives." )
4607 ok = VRSet("CB_DRIVES1", "Value", VRGet("CB_Drives","Value"))
4608
4609 if VRGet("EF_Directory","Value") = "" then ok = VRSet("EF_DIRECTORY1", "Value", VRGet("EF_Directory","Value"))
4610
4611 ok = VRMethod("EF_DIRECTORY1","AddString",p_share)
4612
4613 IF advanced.!easupport \= "" THEN ok = VRSet("CB_EAS1", "Set", advanced.!easupport)
4614 IF advanced.!readonly \= "" THEN ok = VRSet("CB_READONLY1", "Set", advanced.!readonly)
4615 IF advanced.!alwaysmp \= "" THEN ok = VRSet("CB_ALWAYSMP1", "Set", advanced.!alwaysmp)
4616 IF advanced.!cachetimeout \= "" THEN ok = VRSet("SPIN_CACHETIMEOUT1", "Value", advanced.!cachetimeout)
4617 IF advanced.!cachelistings \= "" THEN ok = VRSet("SPIN_CACHELISTINGS1","Value", advanced.!cachelistings)
4618return
4619
4620/*:VRX SW_MOUNTPOINT_Fini
4621*/
4622SW_MOUNTPOINT_Fini:
4623 window = VRInfo( "Window" )
4624 call VRDestroy window
4625 drop window
4626return
4627/*:VRX SW_MOUNTPOINT_Init
4628*/
4629SW_MOUNTPOINT_Init:
4630 window = VRInfo( "Object" )
4631 if( \VRIsChildOf( window, "Notebook" ) ) then do
4632 call VRMethod window, "CenterWindow"
4633 call VRSet window, "Visible", 1
4634 call VRMethod window, "Activate"
4635 end
4636 drop window
4637return
4638
4639/*:VRX SW_PORTCONNECT_Close
4640*/
4641SW_PORTCONNECT_Close:
4642 call SW_PORTCONNECT_Fini
4643return
4644
4645/*:VRX SW_PORTCONNECT_Create
4646*/
4647SW_PORTCONNECT_Create:
4648 call SW_PORTCONNECT_Init
4649
4650 ok = VRGetINI("PM_PORT_DRIVER","SMB","SYSTEM")
4651
4652 if ok = "" then do
4653
4654 end
4655 else do
4656 say "Samba Spooler Port driver installed!"
4657 ok = SysINI("SYSTEM","PM_SPOOLER_PORT","ALL:","ports")
4658 smbport.0 = 0
4659 do I = 1 to ports.0
4660 if left(ports.I,3) = "SMB" then do
4661 X = smbport.0
4662 X = X + 1
4663 smbport.0 = X
4664 smbport.X = ports.I
4665 end
4666 end
4667 do I = 1 to smbport.0
4668 say smbport.I
4669 end
4670 end
4671
4672return
4673
4674/*:VRX SW_PORTCONNECT_Fini
4675*/
4676SW_PORTCONNECT_Fini:
4677 window = VRInfo( "Window" )
4678 call VRDestroy window
4679 drop window
4680return
4681/*:VRX SW_PORTCONNECT_Init
4682*/
4683SW_PORTCONNECT_Init:
4684 window = VRInfo( "Object" )
4685 if( \VRIsChildOf( window, "Notebook" ) ) then do
4686 call VRMethod window, "CenterWindow"
4687 call VRSet window, "Visible", 1
4688 call VRMethod window, "Activate"
4689 end
4690 drop window
4691return
4692
4693/*:VRX SW_PROGRESS_Close
4694*/
4695SW_PROGRESS_Close:
4696 options.!delay = 0
4697 call Main_Resize
4698 call VRSet 'Main', 'Visible', 1
4699 call SW_PROGRESS_Fini
4700return
4701
4702/*:VRX SW_PROGRESS_Create
4703*/
4704SW_PROGRESS_Create:
4705 call SW_PROGRESS_Init
4706 CALL NLVSetText 'SW_PROGRESS', "Caption", 1
4707 CALL NLVSetText 'DT_PROGRESS', "Caption", 34
4708 CALL NLVSetText 'PB_PROGRESS_ABORT', "Caption", 3
4709
4710 if options.!delay > 0 then ok = VRSet("TM_TheCloser","Delay", options.!delay*1000)
4711
4712 CALL VRSet "TM_Progress_Throbber","Enabled", 1
4713 CALL VRSet "TM_TheCloser","Enabled", 1
4714return
4715
4716/*:VRX SW_PROGRESS_Fini
4717*/
4718SW_PROGRESS_Fini:
4719 call VRDestroy "SW_PROGRESS"
4720return
4721/*:VRX SW_PROGRESS_Init
4722*/
4723SW_PROGRESS_Init:
4724 call VRMethod "SW_PROGRESS", "CenterWindow", "Parent"
4725 call VRSet "SW_PROGRESS", "Visible", 1
4726 call VRMethod "SW_PROGRESS", "Activate"
4727return
4728
4729/*:VRX SW_SETTINGS_Close
4730*/
4731SW_SETTINGS_Close:
4732 call SW_SETTINGS_Fini
4733return
4734
4735/*:VRX SW_SETTINGS_Create
4736*/
4737SW_SETTINGS_Create:
4738 call SW_SETTINGS_Init
4739return
4740
4741/*:VRX SW_SETTINGS_Fini
4742*/
4743SW_SETTINGS_Fini:
4744 window = VRInfo( "Window" )
4745 call VRDestroy window
4746 drop window
4747return
4748/*:VRX SW_SETTINGS_Init
4749*/
4750SW_SETTINGS_Init:
4751 /* Title bar */
4752 call NLVSetText "SW_SETTINGS", "Caption", 47
4753
4754 /* Options */
4755 call NLVSetText "GB_GLOBAL", "Caption", 47
4756 call NLVSetText "CB_DEBUG", "Caption", 42
4757 call NLVSetText "CB_LOGGING", "Caption", 46
4758 call NLVSetText "CB_BROWSEIMME", "Caption", 48
4759 call NLVSetText "CB_BROWSEAUTH", "Caption", 49
4760 call NLVSetText "CB_SPECIAL", "Caption", 66
4761 call NLVSetText "CB_SAVEPASSIVE", "Caption", 73
4762 call NLVSetText "CB_LMHOSTS", "Caption", 133
4763 call NLVSetText "CB_BROADCAST", "Caption", 74
4764 call NLVSetText "CB_MINIICONS", "Caption", 70
4765 call NLVSetText "CB_STORECREDS", "Caption", 135
4766
4767 /* Buttons */
4768 call NLVSetText "PB_SETTINGS_APPLY", "Caption", 122
4769 call NLVSetText "PB_SETTINGS_UNDO", "Caption", 123
4770 call NLVSetText "PB_SETTINGS_HELP", "Caption", 4
4771
4772/* call VRSet "SW_ADVANCED", "HelpTag", NLVGetMessage(40) */
4773
4774/* call VRMethod "SW_SETTINGS", "CenterWindow" */
4775 ok = VRSet("SW_SETTINGS", "Visible", 1)
4776/* call VRMethod "SW_SETTINGS", "Activate" */
4777return
4778
4779/*:VRX SW_SETTINGS_Init_Content
4780*/
4781SW_SETTINGS_Init_Content:
4782 ok = VRSet("PB_SETTINGS_UNDO","Enabled", 1)
4783
4784 if advanced.!browseauth \= "" then ok = VRSet("CB_BROWSEAUTH", "Set", advanced.!browseauth)
4785 if advanced.!browseimme \= "" then ok = VRSet("CB_BROWSEIMME", "Set", advanced.!browseimme)
4786 if advanced.!broadcast \= "" then ok = VRSet("CB_BROADCAST", "Set", advanced.!broadcast)
4787 if advanced.!special \= "" then ok = VRSet("CB_SPECIAL", "Set", advanced.!special)
4788 if advanced.!savepassive \= "" then ok = VRSet("CB_SAVEPASSIVE","Set", advanced.!savepassive)
4789 if advanced.!lmhosts \= "" then ok = VRSet("CB_LMHOSTS", "Set", advanced.!lmhosts)
4790
4791 call VRSet "CB_LOGGING", "Set", VRFileExists(SysBootDrive()"\ndpsmb.dbg")
4792 if options.!debug \= "" then ok = VRSet("CB_debug", "Set", options.!debug)
4793 if options.!storecreds \= "" then ok = VRSet("CB_STORECREDS", "Set", options.!storecreds)
4794
4795 if advanced.!miniicons \= "" then ok = VRSet("CB_MINIICONS", "Set", advanced.!miniicons)
4796
4797 /* Obsolete */
4798 if advanced.!logfile \= "" then ok = VRSet("EF_LOGFILE", "Value", advanced.!logfile)
4799 if advanced.!loglevel \= "0" then ok = VRSet("SPIN_LOGLEVEL", "Value", advanced.!loglevel)
4800
4801 call _SmbConfCreateShadowCopy
4802
4803 wins_support = translate(IniGet('wins support', 'global', samba.!shadowsmbconf))
4804
4805 if wins_support = "YES" then do /* we are a WINS server ourself */
4806 ok = VRSet("DT_WINS_SERVER","Enabled", 0)
4807 ok = VRSet("EF_WINS_SERVER","BackColor", "PaleGray")
4808 ok = VRSet("EF_WINS_SERVER","Value", "")
4809 ok = VRSet("EF_WINS_SERVER","Enabled", 0)
4810 end
4811 else do
4812 ok = VRSet("EF_WINS_SERVER","Value", IniGet('wins server', 'global', samba.!shadowsmbconf))
4813 end
4814
4815 name_resolve_order = IniGet('name resolve order', 'global', samba.!shadowsmbconf)
4816
4817 do I = 1 to words(name_resolve_order)
4818 ok = VRSet("SPIN_NRO"||I, "value", word(name_resolve_order,I))
4819 end
4820
4821 advanced.!smbconfchanged = 0
4822return
4823
4824/*:VRX SW_SMBTREE_Close
4825*/
4826SW_SMBTREE_Close:
4827 call SW_SMBTREE_Fini
4828return
4829
4830/*:VRX SW_SMBTREE_Create
4831*/
4832SW_SMBTREE_Create:
4833 call SW_SMBTREE_Init
4834return
4835
4836/*:VRX SW_SMBTREE_Fini
4837*/
4838SW_SMBTREE_Fini:
4839 window = VRInfo( "Window" )
4840 call VRDestroy window
4841 drop window
4842return
4843/*:VRX SW_SMBTREE_Init
4844*/
4845SW_SMBTREE_Init:
4846
4847return
4848
4849/*:VRX SW_SMBTREE_Init_Content
4850*/
4851SW_SMBTREE_Init_Content:
4852 if VRGet("TM_Throbber","Enabled") = 1 then ok = VRset("Pict_Throbber", "Visible", 1)
4853
4854 /* Hide any "foreign" menu entries */
4855 ok = VRSet("Menu_Selected_Remove", "Visible", 0)
4856 ok = VRSet("Menu_Selected_Retry", "Visible", 0)
4857return
4858
4859/*:VRX TDL_1_PageSelected
4860*/
4861TDL_1_PageSelected:
4862 page = VRInfo("Page")
4863
4864 /* call _TabsStrip */
4865 select
4866 when page = 1 then do /* dialog */
4867 call _TabFix 1
4868 end
4869 when page = 2 then do /* advanced */
4870 call SW_ADVANCED_Init_Content
4871 end
4872 when page = 3 then do /* smbtree */
4873 call SW_SMBTREE_Init_Content
4874 end
4875 when page = 4 then do /* condet */
4876 call SW_CONDET_Init_Content
4877 end
4878 when page = 5 then do /* Settings */
4879 call SW_SETTINGS_Init_Content
4880 end
4881 otherwise nop
4882 end
4883return
4884
4885/*:VRX TM_AutoClose_Trigger
4886*/
4887TM_AutoClose_Trigger:
4888 call Quit
4889return
4890
4891/*:VRX TM_Progress_Throbber_Trigger
4892*/
4893TM_Progress_Throbber_Trigger:
4894 pIdx = VRGet("Pict_Progress_Throbber","PicturePath")
4895 parse var pIdx '#' pidx
4896 pidx = pidx + 1
4897 if pidx = 36 then pidx = 11
4898 ok = VRSet("Pict_Progress_Throbber","PicturePath","#"pidx)
4899return
4900
4901/*:VRX TM_RefreshCurrentDisplay_Trigger
4902*/
4903TM_RefreshCurrentDisplay_Trigger:
4904 if RefreshMode <> "" then return
4905 if _DaemonRunning() = 0 then do
4906 say " Daemon not running - disable GUI"
4907 ok = VRset("GB_CURRENT", "Enabled", 0)
4908 ok = VRset("TDL_1", "Enabled", 0)
4909 ok = VRSet("Menu_File_Daemon_Start","Enabled", 1)
4910 ok = VRSet("Menu_File_Daemon_Stop", "Enabled", 0)
4911 end
4912 else do
4913 say " Daemon running - enable GUI"
4914 ok = VRset("GB_CURRENT", "Enabled", 1)
4915 ok = VRset("TDL_1", "Enabled", 1)
4916 ok = VRSet("Menu_File_Daemon_Start","Enabled", 0)
4917 ok = VRSet("Menu_File_Daemon_Stop", "Enabled", 1)
4918 end
4919 CALL REFRESH
4920return
4921
4922/*:VRX TM_RefreshTreeDisplay_Trigger
4923*/
4924TM_RefreshTreeDisplay_Trigger:
4925 ShowHidden = advanced.!special
4926 BroadCast = advanced.!broadcast
4927 DoLMHosts = advanced.!lmhosts
4928
4929 select
4930 when RefreshMode = "TREE" then do
4931 call _RefreshTreeDisplay
4932
4933 if smbtree.!workgroup <> 'SMBTREE.!WORKGROUP' then do
4934 ok = VRset("Menu_Selected_Connect", "Visible", VRMethod("CN_SMBTREE", "ValidateRecord", smbtree.!workgroup ) )
4935 end
4936 end
4937 when RefreshMode = "SHARE" then do
4938 call _AddSharesDisplay
4939 end
4940 otherwise say "RefreshMode = "RefreshMode
4941 end
4942 call _DialogPopulate
4943return
4944
4945/*:VRX TM_TheCloser_Trigger
4946*/
4947TM_TheCloser_Trigger:
4948 call SW_PROGRESS_Close
4949return
4950
4951/*:VRX TM_Throbber_Trigger
4952*/
4953TM_Throbber_Trigger:
4954 pIdx = VRGet("Pict_Throbber","PicturePath")
4955 parse var pIdx '#' pidx
4956 pidx = pidx + 1
4957 if pidx = 36 then pidx = 11
4958 ok = VRSet("Pict_Throbber","PicturePath","#"pidx)
4959return
4960
Note: See TracBrowser for help on using the repository browser.