Changeset 1029
- Timestamp:
- Jun 7, 2017, 5:15:14 PM (8 years ago)
- Location:
- trunk/guitools/evfsgui
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/guitools/evfsgui/evfsgui.vrp
r1026 r1029 12 12 VRXWindow: __VREFileListWindow,1,3300,14695,2665,3358 13 13 VRXWindow: __VRESectionListWindow,1,2867,14020,10889,5035 14 VRXWindow: __VREToolsWindow,1, 4011,4963,6986,166114 VRXWindow: __VREToolsWindow,1,2867,337,6989,1667 15 15 VRXWindow: __VREWindListWindow,1,458,14695,4866,3150 16 16 UserFile: 1 17 17 UserWindow: Main,1 18 UserWindow: SW_ ACLS,118 UserWindow: SW_LOGIN,1 -
trunk/guitools/evfsgui/evfsgui.vrx
r1026 r1029 109 109 __VXREXX____APPENDS__: 110 110 /* 111 #append ..\shared\browse.vrs 111 112 #append ..\shared\cltinit.vrs 112 113 #append ..\shared\inittempdir.vrs … … 249 250 VolTplRH = VRMethod("CN_CURRENT", 'AddRecord', , 'First', 'Volume template', icons.!template ) 250 251 MpTplRH = VRMethod("CN_CURRENT", 'AddRecord', VolTplRH, 'First', 'Mountpoint template', icons.!template ) 251 return252 253 /*:VRX _BrowseBuildPath254 */255 _BrowseBuildPath: procedure expose options. icons. samba. sharerh256 if options.!debug == 1 then say time()' _BrowseBuildPath started'257 rh = arg(1)258 259 finished = 0260 BrowsePathStr = ''261 262 do while \finished263 parentrh = VRMethod("CN_SMBTREE","GetRecordAttr",rh,"Parent")264 resname = VRMethod("CN_SMBTREE","GetRecordAttr",rh,"caption")265 userdata = VRMethod("CN_SMBTREE","GetRecordAttr",rh,"userdata")266 parse var userdata udatatype '|' udatamsg267 parse var resname resname '0D0A'x .268 resname = strip(resname)269 /* say " Not connected - cannot open!" */270 select271 when udatatype = "SERVER" then do272 BrowsePathStr = '\\'resname'\'BrowsePathStr273 finished = 1274 end275 when udatatype = "DISK" then do276 BrowsePathStr = resname'\'BrowsePathStr277 sharerh =rh278 rh = parentrh279 end280 otherwise do281 BrowsePathStr = resname'\'BrowsePathStr282 rh = parentrh283 end284 end285 /* say ' BrowsePathStr = "'BrowsePathStr'"' */286 end287 BrowsePathStr = strip(BrowsePathStr,'T','\')288 if options.!debug == 1 then say time()' _BrowseBuildPath done, returning "'BrowsePathStr'"'289 return BrowsePathStr290 291 /*:VRX _BrowseDirectory292 */293 _BrowseDirectory: /* This must not be a procedure */294 if options.!debug == 1 then say time()' _BrowseDirectory started'295 296 /* Turn off painting */297 ok = VRSet("CN_SMBTREE","Painting", 0 )298 call VRSet VRWindow(), 'Pointer', 'Wait'299 300 /* Make sure credentials are usable */301 if UserCred = 'USERCRED' | UserCred = '' | UserCred = '--user=%' then UserCred = '-N'302 303 /* We have to remove the double % for smbclient.exe - not entirely clear why */304 OldUserCred = ""305 if pos('%%',UserCred) > 0 & pos("4OS2", value("COMSPEC",,"OS2ENVIRONMENT")) = 0 then do306 OldUserCred = UserCred307 parse var UserCred '--user='username'%%'password308 UserCred = '--user='username'%'password309 call lineout "debug", " Strip double %%!!!"310 end311 312 say ' 'samba.!smbclientexe' \\'machine'\'sharename' 'UserCred' --command="dir 'browsepath'"'313 address cmd samba.!smbclientexe' \\'machine'\'sharename' 'UserCred' --command="dir 'browsepath'" 'debuglevel' 2>NUL 1>'samba.!msg314 315 if UserCred = '-N' then UserCred = ''316 317 if OldUserCred <> "" then do318 UserCred = OldUserCred319 OldUserCred = ""320 say " Restore double %%!!!"321 end322 323 I = 0324 ok = VRSet("DT_STATUSBAR","Caption", "")325 do until lines(samba.!msg) = 0326 infoline = linein(samba.!msg)327 select328 when pos('blocks',infoline) > 0 then do /* Last line */329 /* we should handle size information here */330 iterate331 end332 when I = 0 & length(infoline) > 0 & left(infoline,2) <> " " then do /* Login message */333 say ' Login message "'Infoline'"'334 ok = VRMethod("CN_SMBTREE", "SetRecordAttr", SMBObj.rh, "Userdata", SMBObj.udatatype'|'infoline )335 ok = VRSet("DT_STATUSBAR","Caption", infoline)336 end337 when left(infoline,2) = " " & length(infoline) > 0 then do /* file or DIR */338 wn = words(infoline)339 fyear = word(infoline,wn)340 ftime = word(infoline,wn-1)341 fday = word(infoline,wn-2)342 fmonth = word(infoline,wn-3)343 fwday = word(infoline,wn-4)344 /* FIXME: This is flaky! */345 pos_attr = max(pos(fwday,infoline)-16,4)346 fsize = word(infoline,wn-5)347 fattr = substr(infoline,pos_attr,6)348 fname = strip( substr(infoline,3,pos_attr-3))349 if fname = '.' | fname = '..' then iterate /* we do not display these */350 if pos('H',fattr) > 0 then iterate /* we do not display hidden files */351 if pos('S',fattr) > 0 then iterate /* we do not display system files */352 I = I + 1353 fh.I = VRMethod( "CN_SMBTREE", "AddRecord", SMBObj.rh, , fname)354 if pos('D',fattr) = 0 then do355 Ext = translate(VRParseFIleName(fname,'E'))356 select357 when Ext = 'EXE' then ficon = icons.!exe /* executable */358 when Ext = 'CMD' then ficon = icons.!cmd /* OS/2 or NT batch */359 when Ext = 'BAT' then ficon = icons.!bat /* DOS batch */360 when Ext = 'PDF' then ficon = icons.!pdf /* PDF document */361 when wordpos(Ext, 'XLS SXC ODS') > 0 then ficon = icons.!spreadsheet362 when wordpos(Ext, 'DOC SXW ODT') > 0 then ficon = icons.!textdocument363 when wordpos(Ext, 'FW2 FW3 FW4') > 0 then ficon = icons.!framework364 when wordpos(Ext, 'JPG BMP PNG GIF TIF') > 0 then ficon = icons.!image365 when wordpos(Ext, 'AVI MPG FLV WMV') > 0 then ficon = icons.!movie366 when wordpos(Ext, 'WAV MP3 OGG MID') > 0 then ficon = icons.!sound367 when wordpos(Ext, 'WPI') > 0 then ficon = icons.!warpin368 when wordpos(Ext, 'ZIP') > 0 then ficon = icons.!zip369 when wordpos(Ext, 'INF HLP') > 0 then ficon = icons.!view370 when wordpos(Ext, 'TXT') > 0 then ficon = icons.!plaintext371 otherwise ficon = icons.!defaultfile /* default file icon */372 end373 ftype = 'FILE'374 end375 else do376 ficon = icons.!folder377 ftype = 'DIRECTORY'378 end379 380 ok = VRmethod("CN_SMBTREE", "SetRecordAttr", fh.I, "userdata", ftype'|'fsize' Bytes 'fday'-'fmonth'-'fyear' 'ftime,'icon',Ficon)381 382 end383 otherwise nop /* no other line type */384 end385 end386 if I > 0 then ok = VRMethod("CN_SMBTREE","SetRecordAttr",SMBObj.rh, "Icon", icons.!folder_open)387 ok = stream(samba.!msg,'c','close')388 ok = SysFileDelete(samba.!msg)389 390 ok = VRMethod( "CN_SMBTREE", "SetRecordAttr", SMBObj.rh,"Collapsed", 0)391 /* Turn on painting */392 call VRSet VRWindow(), 'Pointer', '<default>'393 ok = VRSet("CN_SMBTREE","Painting", 1 )394 if options.!debug == 1 then say time()' _BrowseDirectory done'395 return396 397 /*:VRX _BrowseObjectOpen398 */399 _BrowseObjectOpen: procedure expose samba. options. cd. icons.400 machine = arg(1)401 sharename = arg(2)402 browsepath = arg(3)403 404 CALL VRMethod "CN_CONDET", 'GetRecordList', 'All', 'records.'405 406 OpenOk = 0407 408 DO i = 1 TO records.0409 if VRMethod( "CN_CONDET", "GetFieldData", records.i, CD.StatusFH) = icons.!active then do410 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)411 if machine = VRMethod( "CN_CONDET", "GetFieldData", records.i, CD.ServerFH) &,412 sharename = VRMethod( "CN_CONDET", "GetFieldData", records.i, CD.ShareFH) then do413 Object = strip(VRMethod( "CN_CONDET", "GetFieldData", records.i, CD.MPointFH),'T','\')'\'browsepath414 if options.!debug == 1 then say ' Non UNC object: "'Object'"'415 ID = VRMethod( "Application", "StartThread", "wps_open", Object, "DEFAULT" )416 OpenOK = 1417 end418 end419 if OpenOK = 1 then leave420 end421 return OpenOK422 423 /*:VRX _BrowseResetObject424 */425 _BrowseResetObject: procedure426 ok = VRSet("CN_SMBTREE","Painting", 0 )427 rh = arg(1)428 429 /* Remove all files and directories whose parent is our share */430 ok = VRMethod( "CN_SMBTREE", "GetRecordList", "All", "AllRH." )431 do I = 1 to AllRH.0432 AllParentRH = VRMethod("CN_SMBTREE","GetRecordAttr",AllRH.I,"Parent")433 if AllParentRH = rh then ok = VRMethod( "CN_SMBTREE", "RemoveRecord", AllRH.I )434 end435 ok = VRSet("CN_SMBTREE","Painting", 1 )436 252 return 437 253 … … 673 489 RETURN location 674 490 675 /*:VRX _dropdeprecated676 */677 _dropdeprecated:678 /* The stem-less counterparts of these variables are considered deprecated and should be removed wherever possible679 The _dropdeprecated routine will drop any value in order to make sure the stem actually works680 If another variable is added to the stem, ensure to also drop it in dropdeprecated otherwise it will not be exported681 */682 drop rh683 drop parentrh684 drop gparentrh685 drop icon686 drop resname687 drop comment688 drop udatatype689 drop udatamsg690 return691 692 491 /*:VRX _Dynamic 693 492 */ … … 883 682 884 683 /* Statusbar */ 885 ok = VRSet("DT_STATUSBAR", "Caption", VRGet("Main", "HintText"))684 call _StatusBarWrapper VRGet("Main", "HintText") 886 685 887 686 /* Common margin around controls */ … … 1568 1367 /* preliminary implementation - we just do not ignore it anymore - 1569 1368 - ShowMsg from smbmon/smbusers should become a shared library */ 1570 ok = VRSet("DT_StatusBar", "Caption", Msg.Text)1369 call _StatusBarWrapper Msg.Text 1571 1370 return 1572 1371 … … 1674 1473 mtype.5 = NLVGetMessage(110 ) 1675 1474 1676 if options.!debug == 1 then say ' initializing icons. ' 1677 icons.!bat = '#1:PMWP.DLL' 1678 icons.!cmd = '#2:PMWP.DLL' 1679 icons.!exe = '#3:PMWP.DLL' 1680 icons.!template = '#10:PMWP.DLL' 1681 icons.!drive = '#16:PMWP.DLL' 1682 icons.!defaultfile = '#24:PMWP.DLL' 1683 icons.!folder = '#26:PMWP.DLL' 1684 icons.!folder_open = '#34:PMWP.DLL' 1685 icons.!machine_awake = '#35:PMWP.DLL' 1686 icons.!machine_sleeping = '#61:PMWP.DLL' 1687 icons.!workgroup = '#62:PMWP.DLL' 1688 icons.!pdc = '#63:PMWP.DLL' 1689 icons.!active = '#64:PMWP.DLL' 1690 icons.!passive = '#68:PMWP.DLL' 1691 icons.!printer = '#65:PMWP.DLL' 1692 icons.!drive_inactive = '#70:PMWP.DLL' 1693 icons.!pdf = '#80' 1694 icons.!spreadsheet = '#82' 1695 icons.!textdocument = '#86' 1696 icons.!framework = '#87' 1697 icons.!image = '#88' 1698 icons.!movie = '#89' 1699 icons.!sound = '#90' 1700 icons.!warpin = '#91' 1701 icons.!zip = '#92' 1702 icons.!view = '#93' 1703 icons.!plaintext = '#94' 1475 call _BrowseIconsInit 1704 1476 1705 1477 p_workgroup = "Unknown" … … 2017 1789 */ 2018 1790 CN_CONDET_Click: 2019 /* ok = VRset("DT_StatusBar","Caption", VRGet("Main", "HintText")) */1791 /* call _StatusBarWrapper VRGet("Main", "HintText") */ 2020 1792 return 2021 1793 … … 2068 1840 CN_CURRENT_Click: 2069 1841 if options.!debug == 1 then say time()' CN_CURRENT_Click started' 2070 /* ok = VRset("DT_StatusBar","Caption", VRGet("Main", "HintText")) */1842 /* call _StatusBarWrapper VRGet("Main", "HintText") */ 2071 1843 2072 1844 /* Herwig B. */ … … 2080 1852 options.currentdata = data 2081 1853 2082 /* ok = VRset("DT_StatusBar","Caption", data' - 'VRGet("Main", "HintText")) */1854 /* call _StatusBarWrapper data' - 'VRGet("Main", "HintText") */ 2083 1855 2084 1856 PARSE VAR data p_node ';' p_mounts ';' p_string … … 2449 2221 CN_SMBTREE_Click: 2450 2222 if options.!debug == 1 then say time()' CN_SMBTREE_Click started' 2451 /* ok = VRset("DT_StatusBar","Caption", VRGet("Main", "HintText")) */2223 /* call _StatusBarWrapper VRGet("Main", "HintText") */ 2452 2224 2453 2225 call _dropdeprecated … … 2455 2227 call _ContextMenuSelectedSet 2456 2228 2457 ok = VRset("DT_Statusbar", "Caption", SMBObj.udatamsg)2229 call _StatusBarWrapper SMBObj.udatamsg 2458 2230 2459 2231 if options.!debug == 1 then say time()' CN_SMBTREE_Click done' … … 2463 2235 CN_SMBTREE_ContextMenu: 2464 2236 if options.!debug == 1 then say time()' CN_SMBTREE_ContextMenu started' 2465 2466 call _ContextMenuSelectedSet2467 2468 2237 call _dropdeprecated 2469 call _GetSmbObjectProperties VRInfo('Record') 2470 2471 BrowsePath = _browsebuildpath(SMBObj.rh) 2472 2473 call _BrowseResetObject(SmbObj.rh) 2474 2475 parse var browsepath '\\'machine'\'sharename '\' browsepath 2476 2477 ok = VRMethod( "Menu_Selected", "Popup", , , "", "" ) 2238 RH = VRInfo('Record') 2239 if RH <> "" then do 2240 call _GetSmbObjectProperties RH 2241 call _ContextMenuSelectedSet 2242 2243 BrowsePath = _browsebuildpath(SMBObj.rh) 2244 2245 call _BrowseResetObject(SmbObj.rh) 2246 2247 parse var browsepath '\\'machine'\'sharename '\' browsepath 2248 2249 ok = VRMethod( "Menu_Selected", "Popup", , , "", "PositionOnItem" ) 2250 end 2478 2251 2479 2252 if options.!debug == 1 then say time()' CN_SMBTREE_ContextMenu done' … … 2613 2386 */ 2614 2387 DT_STATUSBAR_ContextMenu: 2615 ok = VRSet("DT_STATUSBAR","Caption", VRGet("Main", "HintText"))2388 call _StatusBarWrapper VRGet("Main", "HintText") 2616 2389 return 2617 2390 … … 4372 4145 4373 4146 if word(ok,1) = "1" then do 4374 ok = VRSet("DT_STATUSBAR","Caption", NLVGetMessage(107, rpc.queryuser.FULL_NAME))4147 call _StatusBarWrapper NLVGetMessage(107, rpc.queryuser.FULL_NAME) 4375 4148 say 'rpc.queryuser.DIR_DRIVE = "'rpc.queryuser.DIR_DRIVE'"' 4376 4149 say 'rpc.queryuser.LOGON_SCRIPT = "'rpc.queryuser.LOGON_SCRIPT'"' … … 5093 4866 end 5094 4867 5095 /* FIXME: We do not show a logon failure - just nothing */5096 4868 say ' 'samba.!smbcaclsexe' \\'machine'\'sharename' "'browsepath'" 'UserCred 5097 address cmd samba.!smbcaclsexe' \\'machine'\'sharename' "'browsepath'" 'UserCred' 'debuglevel' 2>NUL 1>'samba.!msg 5098 5099 do until lines(samba.!msg) = 0 5100 infoline = linein(samba.!msg) 5101 parse var infoline aclstype':'aclsvalue 5102 DummyRH = VRMethod('CN_ACLS', 'AddRecord') 5103 ok = VRMethod("CN_ACLS", "SetFieldData", DummyRH, ACL.typeFH, aclstype, ACL.valueFH, aclsvalue) 5104 end 5105 ok = stream(samba.!msg,'c','close') 5106 ok = SysFileDelete(samba.!msg) 4869 address cmd samba.!smbcaclsexe' \\'machine'\'sharename' "'browsepath'" 'UserCred' 'debuglevel' 2>'samba.!error' 1>'samba.!msg 4870 4871 ok = file2stem(samba.!error,"aclserror.","DEL") 4872 4873 if aclserror.0 = 0 then do 4874 call _StatusBarWrapper "NT_STATUS_OK" 4875 4876 ok = file2stem(samba.!msg,"aclsmsg.","DEL") 4877 do I = 1 to aclsmsg.0 4878 parse var aclsmsg.I aclstype':'aclsvalue 4879 DummyRH = VRMethod('CN_ACLS', 'AddRecord') 4880 ok = VRMethod("CN_ACLS", "SetFieldData", DummyRH, ACL.typeFH, aclstype, ACL.valueFH, aclsvalue) 4881 end 4882 end 4883 else do 4884 call _StatusBarWrapper aclserror.1 4885 call SW_ACLS_close 4886 end 5107 4887 return 5108 4888 … … 5873 5653 return 5874 5654 5655 /*:VRX TM_STATUSBAR_Trigger 5656 */ 5657 TM_STATUSBAR_Trigger: 5658 call _StatusbarReset 5659 return 5660 5875 5661 /*:VRX TM_TheCloser_Trigger 5876 5662 */
Note:
See TracChangeset
for help on using the changeset viewer.