source: branches/guitools-2.0/evfsgui/evfsgui.VRX@ 1036

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

GUI-Tools: EVFSGUI 2.1.x: Fetch missing credentials for browsing

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