Changeset 641
- Timestamp:
- Oct 3, 2011, 9:44:30 AM (14 years ago)
- Location:
- trunk/guitools
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/guitools/evfsgui/evfsgui.vrp
r640 r641 11 11 VRXWindow: __VREFileListWindow,1,807,11033,1590,3358 12 12 VRXWindow: __VRESectionListWindow,1,2674,10648,8696,4782 13 VRXWindow: __VREToolsWindow,1,2529,723,648 9,166713 VRXWindow: __VREToolsWindow,1,2529,723,6480,1661 14 14 VRXWindow: __VREWindListWindow,1,542,8721,3770,3150 15 15 UserFile: 1 16 16 UserWindow: Main,1 17 17 UserWindow: SW_INFO,1 18 UserWindow: SW_ CONDET,118 UserWindow: SW_DIALOG,1 -
trunk/guitools/evfsgui/evfsgui.vrx
r640 r641 91 91 __VXREXX____APPENDS__: 92 92 /* 93 #append U:\Develop\Samba\ guitools-2.0\shared\cltinit.vrs94 #append U:\Develop\Samba\ guitools-2.0\shared\inittempdir.vrs95 #append U:\Develop\Samba\ guitools-2.0\shared\nlv.vrs96 #append U:\Develop\Samba\ guitools-2.0\shared\rexx_md5.vrs97 #append U:\Develop\Samba\ guitools-2.0\shared\smbtree.vrs98 #append U:\Develop\Samba\ guitools-2.0\shared\textini.vrs93 #append U:\Develop\Samba\trunk\guitools\shared\cltinit.vrs 94 #append U:\Develop\Samba\trunk\guitools\shared\inittempdir.vrs 95 #append U:\Develop\Samba\trunk\guitools\shared\nlv.vrs 96 #append U:\Develop\Samba\trunk\guitools\shared\rexx_md5.vrs 97 #append U:\Develop\Samba\trunk\guitools\shared\smbtree.vrs 98 #append U:\Develop\Samba\trunk\guitools\shared\textini.vrs 99 99 */ 100 100 return … … 344 344 IF options.!debug == 1 THEN SAY time()' _ContainersInit done' 345 345 return 346 /*:VRX _ContextMenuSelectedSet 347 */ 348 _ContextMenuSelectedSet: 349 /* Hide all context menu entries */ 350 ok = VRSet("Menu_Selected_Remove", "Visible", 0) /* CN_CONDET */ 351 ok = VRSet("Menu_Selected_Retry", "Visible", 0) /* CN_CONDET */ 352 ok = VRSet("Menu_Selected_Connect", "Visible", 0) /* CN_SMBTREE */ 353 ok = VRSet("Menu_Selected_Sep1", "Visible", 0) /* CN_SMBTREE */ 354 ok = VRSet("Menu_Selected_Info", "Visible", 0) /* CN_SMBTREE */ 355 ok = VRSet("Menu_Selected_Refresh", "Visible", 0) /* CN_SMBTREE */ 356 ok = VRSet("Menu_Selected_Default_Workgroup","Visible", 0) /* CN_SMBTREE */ 357 358 359 ok = VRSet("Menu_Selected_TreeView","Visible",1) 360 ok = VRSet("Menu_Selected_DetailsView","Visible",1) 361 select 362 when SMBObj.udatatype = "DISK" then do 363 ok = VRSet("Menu_Selected_Connect", "Visible", 1) 364 end 365 when SMBObj.udatatype = "SERVER" then do 366 ok = VRSet("Menu_Selected_Connect", "Visible", 1) 367 ok = VRSet("Menu_Selected_Sep1", "Visible", 1) 368 ok = VRSet("Menu_Selected_Info", "Visible", 1) 369 ok = VRSet("Menu_Selected_Refresh", "Visible", 1) 370 end 371 when SMBObj.udatatype = "WORKGROUP" then do 372 ok = VRSet("Menu_Selected_Connect", "Visible", 1) 373 ok = VRSet("Menu_Selected_Sep1", "Visible", 1) 374 ok = VRSet("Menu_Selected_Default_Workgroup","Visible", 1) 375 end 376 when SMBObj.udatatype = "PRINTER" then do 377 call _PrinterInfo 378 /* CALL VRMessage 'Main', NLVGetMessage( 62 ), NLVGetMessage( 5 ), 'E' */ 379 end 380 otherwise nop /* FILE DIRECTORY */ 381 end 382 return 383 346 384 /*:VRX _CreateSmbConf 347 385 */ … … 363 401 return 364 402 403 /*:VRX _DaemonRunning 404 */ 405 _DaemonRunning: procedure expose fs. 406 ok = PRProcessList(proc) 407 PID = 0 408 do I = 1 to proc.0 409 CurProc = VRParseFileName(proc.i.name,'NE') 410 if CurProc = fs.!prefix"CTL.EXE" then do 411 PID = proc.i.pid 412 leave 413 end 414 end 415 return PID 416 417 /*:VRX _DelSMBObjectShares 418 */ 419 _DelSMBObjectShares: procedure expose options. SMBObj. rh 420 /* Purpose: Delete shares for a given Object (as handle) */ 421 422 rh = arg(1) 423 424 ok = VRMethod("CN_smbtree", "GetRecordList", "All", rh.) 425 426 do J = 1 to rh.0 /* populate shares with valid entries */ 427 ParentRH = VRMethod("CN_SMBTREE","GetRecordAttr",rh.J,"Parent") 428 429 if ParentRH = rh then do /* we found a share belonging to our server */ 430 ok = VRMethod("CN_SMBTree", "RemoveRecord", rh.J ) 431 end 432 end 433 SmbObj.shares. = '' 434 SmbObj.shares.0 = 0 435 return 436 365 437 /*:VRX _DialogPopulate 366 438 */ … … 395 467 */ 396 468 _dropdeprecated: 469 /* The stem-less counterparts of these variables are considered deprecated and should be removed wherever possible 470 The _dropdeprecated routine will drop any value in order to make sure the stem actually works 471 If another variable is added to the stem, ensure to also drop it in dropdeprecated otherwise it will not be exported 472 */ 397 473 drop rh 398 474 drop parentrh 475 drop gparentrh 399 476 drop icon 400 477 drop resname 478 drop comment 401 479 drop udatatype 402 480 drop udatamsg … … 420 498 SMBObj.rh = recordhandle of the object 421 499 SMBObj.resname = resourcename of the object 500 SMBObj.comment = commentstring of the object 422 501 SMBObj.icon = icon of the object 423 502 SMBObj.udatatype = type of object (WORKGROUP, SERVER, DISK, PRINTER, FILE, DIRECTORY) 424 503 SMBObj.udatamsg = arbitrary object related data (Login message, file properties) 425 504 SMBObj.parentrh = recordhandle of the object's parent 505 SMBObj.gparentrh = recordhandle of the object's grandparent 426 506 427 507 The stem-less counterparts of these variables are considered deprecated and should be removed wherever possible 428 This routine will drop any value in order to make sure the stem actually works 508 The _dropdeprecated routine will drop any value in order to make sure the stem actually works 509 If another variable is added to the stem, ensure to also drop it in dropdeprecated otherwise it will not be exported 429 510 */ 430 511 call _dropdeprecated … … 434 515 435 516 if VRMethod( "CN_SMBTREE", "ValidateRecord", SMBObj.rh) <> 1 | SMBObj.rh = "" then do 436 SMBObj. = ""437 517 IF options.!debug == 1 THEN SAY time()' _GetSMBObjectProperties aborted' 438 518 return … … 442 522 443 523 SMBObj.parentrh = VRMethod("CN_SMBTREE", "GetRecordAttr", SMBObj.rh, "Parent") 524 if SMBObj.parentrh = "" 525 then SMBObj.gparentrh = "" 526 else SMBObj.gparentrh = VRMethod("CN_SMBTREE", "GetRecordAttr", SMBObj.parentrh, "Parent") 444 527 445 528 SMBObj.resname = VRMethod("CN_SMBTREE", "GetRecordAttr", SMBObj.rh, "Caption") 446 parse var SMBObj.resname SMBObj.resname '0D0A'x .529 parse var SMBObj.resname SMBObj.resname '0D0A'x SMBObj.comment 447 530 SMBObj.resname = strip(SMBObj.resname) 531 SMBObj.comment = strip(SMBObj.comment) 448 532 449 533 Userdata = VRMethod("CN_SMBTREE", "GetRecordAttr", SMBObj.rh, "Userdata") … … 454 538 IF options.!debug == 1 THEN do 455 539 SAY ' Handle: "'SMBObj.rh'"' 540 say ' GParentrh "'SMBObj.gparentrh'"' 456 541 SAY ' Resource: "'SMBObj.resname'"' 542 SAY ' Comment: "'SMBObj.comment'"' 457 543 SAY ' Type: "'SMBObj.udatatype'"' 458 544 SAY ' Message: "'SMBObj.udatamsg'"' … … 461 547 462 548 IF options.!debug == 1 THEN SAY time()' _GetSMBObjectProperties done' 549 return 550 551 /*:VRX _GetSMBObjectShares 552 */ 553 _GetSMBObjectShares: procedure expose options. SMBObj. rh 554 /* Purpose: Return stem with shares for a given Object (as handle) */ 555 556 rh = arg(1) 557 558 SmbObj.shares. = '' 559 SmbObj.shares.0 = 0 560 561 ok = VRMethod("CN_smbtree", "GetRecordList", "All", rh.) 562 563 do J = 1 to rh.0 /* populate shares with valid entries */ 564 Userdata = VRMethod("CN_SMBTREE","GetRecordAttr",rh.J,"Userdata") 565 ResName = VRMethod("CN_SMBTREE","GetRecordAttr",rh.J,"Caption") 566 ParentRH = VRMethod("CN_SMBTREE","GetRecordAttr",rh.J,"Parent") 567 568 parse var ResName ResName '0D0A'x . 569 ResName = strip(ResName) 570 parse var userdata ResType '|' . 571 I = 0 572 if ParentRH = rh then do /* we found a share belonging to our server */ 573 if ResType = "DISK" then do 574 I = I + 1 575 SmbObj.shares.I = ResName 576 end 577 end 578 end 579 SmbObj.shares.0 = I 463 580 return 464 581 … … 500 617 CALL NLVSetText 'Menu_Selected_Retry', "Caption", 90 501 618 CALL NLVSetText 'Menu_Selected_Info', "Caption", 92 619 CALL NLVSetText 'Menu_Selected_Refresh', "Caption", 38 502 620 CALL NLVSetText 'Menu_Selected_Default_Workgroup',"Caption", 75 503 621 … … 1164 1282 return 1165 1283 1284 /*:VRX _UpdateObject 1285 */ 1286 _UpdateObject: procedure 1287 Object = arg(1) 1288 ObjValue = arg(2) 1289 if VRGet(Object,"Value") <> ObjValue then ok = VRset(Object,"Value",ObjValue) 1290 return 1291 1166 1292 /*:VRX _UserCredUpdate 1167 1293 */ … … 1199 1325 IF options.!debug == 1 THEN SAY time()' '||"CB_MOUNT_Change started" 1200 1326 1201 mount = VRGet("CB_MOUNT", " Selected")1327 mount = VRGet("CB_MOUNT", "Value") 1202 1328 1203 1329 SELECT 1204 WHEN mount == 1 THEN DO1330 WHEN mount == mtype.1 THEN DO 1205 1331 CALL VRSet "DT_SHARE", "Visible", 1 1206 1332 CALL VRSet "EF_SHARE", "Visible", 1 … … 1210 1336 CALL NLVSetText "DT_NETWORK", "Caption", 21 1211 1337 END 1212 WHEN mount == 2 THEN DO1338 WHEN mount == mtype.2 THEN DO 1213 1339 CALL VRSet "DT_SHARE", "Visible", 0 1214 1340 CALL VRSet "EF_SHARE", "Visible", 0 … … 1218 1344 CALL NLVSetText "DT_NETWORK", "Caption", 21 1219 1345 END 1220 WHEN mount == 3 THEN DO1346 WHEN mount == mtype.3 THEN DO 1221 1347 CALL VRSet "DT_SHARE", "Visible", 0 1222 1348 CALL VRSet "EF_SHARE", "Visible", 0 … … 1226 1352 CALL NLVSetText "DT_NETWORK", "Caption", 21 1227 1353 END 1228 WHEN mount == 4 THEN DO1354 WHEN mount == mtype.4 THEN DO 1229 1355 CALL VRSet "DT_SHARE", "Visible", 0 1230 1356 CALL VRSet "EF_SHARE", "Visible", 0 … … 1351 1477 1352 1478 ok = VRSet("EF_NETWORK","Value", p_workgroup) 1353 wgh = _GetMachineHandle(p_workgroup) 1354 if wgh = "" then wgh = _AddWorkGroup(p_workgroup) 1355 ok = VRSet("EF_SERVER","Value", p_server) 1356 mh = _GetMachineHandle(p_server) 1357 if mh = "" then mh = _AddSleepingMachine(p_server,'',wgh) 1358 machine = p_server 1359 call _RefreshShares 1360 ok = VRSet("EF_SHARE","Value", p_share) 1479 if p_workgroup <> "" then do 1480 wgh = _GetMachineHandle(p_workgroup) 1481 if wgh = "" then wgh = _AddWorkGroup(p_workgroup) 1482 call _UpdateObject "EF_SERVER", p_server 1483 mh = _GetMachineHandle(p_server) 1484 if mh = "" & p_server <> "*" then do 1485 mh = _AddSleepingMachine(p_server,'',wgh) 1486 machine = p_server 1487 call _RefreshShares 1488 end 1489 ok = VRSet("EF_Share","Value", p_share) 1490 select 1491 when p_workgroup = "*" then ok = VRSet("CB_MOUNT","Value", mtype.4) 1492 when p_server = "*" then ok = VRSet("CB_MOUNT","Value", mtype.3) 1493 when p_share = "*" then ok = VRSet("CB_MOUNT","Value", mtype.2) 1494 otherwise ok = VRSet("CB_MOUNT","Value", mtype.1) 1495 end 1496 end 1361 1497 IF options.!debug == 1 THEN SAY time()' CN_CURRENT_Click done' 1362 1498 RETURN … … 1542 1678 ok = VRset("CB_MOUNT", "Value", mtype.sharelevel) 1543 1679 1544 ok = VRset("EF_SERVER", "Value", p_server)1680 call _UpdateObject "EF_SERVER", p_server 1545 1681 ok = VRset("EF_SHARE", "Value", p_share) 1546 1682 ok = VRset("EF_NETWORK", "Value", p_workgroup) … … 1554 1690 ok = VRset("CB_DRIVES", "Value", p_drv) 1555 1691 ok = VRset("EF_DIRECTORY", "Value", p_dir) 1556 end 1557 else do /* SmbTree */ 1558 DragCapt = VRMethod(srcCtn, "GetRecordAttr", srcRec, "Caption") 1559 ParentRH = VRMethod(srcCtn, "GetRecordAttr", srcRec, "Parent") 1560 1561 if ParentRH = "" then do /* A workgroup was dragged */ 1562 say "Workgroup dragged!" 1563 parse var DragCapt p_workgroup '0D0A'x . 1564 p_workgroup = strip(p_workgroup) 1565 ok = VRSet("EF_NETWORK","Value",strip(p_workgroup)) 1566 ok = VRSet("EF_SERVER","Value","") 1567 ok = VRSet("EF_SHARE","Value","") 1568 1569 ShareLevel = 3 1570 end 1571 else do 1572 ParDragCapt = VRMethod(srcCtn, "GetRecordAttr", ParentRH, "Caption") 1573 GParentRH = VRMethod(srcCtn, "GetRecordAttr", ParentRH, "Parent") 1574 1575 if GParentRH = "" then do /* A server was dragged */ 1692 end /* Drag from CN_CONDET */ 1693 1694 else do /* Drag from CN_SMBTREE */ 1695 call _GetSMBObjectProperties srcRec 1696 select 1697 when SMBObj.udatatype = "WORKGROUP" then do 1698 say "Workgroup dragged!" 1699 p_workgroup = SMBObj.resname 1700 p_server = "" 1701 p_share = "" 1702 1703 ShareLevel = 3 1704 end 1705 when SMBObj.udatatype = "SERVER" then do 1576 1706 say "Server dragged!" 1577 parse var ParDragCapt p_workgroup '0D0A'x . 1578 ok = VRSet("EF_NETWORK","Value",strip(p_workgroup)) 1579 p_workgroup = strip(p_workgroup) 1580 1581 parse var DragCapt p_server '0D0A'x . 1582 p_server = strip(p_server) 1583 ok = VRSet("EF_SERVER","Value",strip(p_server)) 1584 ok = VRSet("EF_Share","Value","") 1707 p_workgroup = VRMethod("CN_SMBTREE", "GetRecordAttr", SMBObj.parentrh, "Caption") 1708 p_server = SMBObj.resname 1709 p_share = "" 1585 1710 1586 1711 ShareLevel = 2 1587 1712 end 1588 else do /* A share was dragged */ 1589 say "Share dragged!" 1590 GParDragCapt = VRMethod(srcCtn, "GetRecordAttr", GParentRH, "Caption") 1591 1592 parse var GParDragCapt p_workgroup '0D0A'x . 1593 p_workgroup = strip(p_workgroup) 1594 ok = VRSet("EF_NETWORK","Value",strip(p_workgroup)) 1595 1596 parse var ParDragCapt p_server '0D0A'x . 1597 p_server = strip(p_server) 1598 ok = VRSet("EF_SERVER","Value",strip(p_server)) 1599 1600 parse var DragCapt p_share '0D0A'x . 1601 p_share = strip(p_share) 1602 ok = VRSet("EF_Share","Value",strip(p_share)) 1713 when SMBObj.udatatype = "DISK" then do 1714 say "Shared disk dragged!" 1715 p_workgroup = VRMethod("CN_SMBTREE", "GetRecordAttr", SMBObj.gparentrh, "Caption") 1716 p_server = VRMethod("CN_SMBTREE", "GetRecordAttr", SMBObj.parentrh, "Caption") 1717 parse var p_server p_server '0D0A'x . 1718 p_share = SMBObj.resname 1603 1719 1604 1720 ShareLevel = 1 1605 1721 end 1606 end 1607 end 1722 otherwise nop /* Printer */ 1723 end 1724 ok = VRSet("EF_NETWORK","Value",p_workgroup) 1725 call _UpdateObject "EF_SERVER", p_server 1726 ok = VRSet("EF_Share","Value", p_share) 1727 end /* Drag from CN_SMBTREE */ 1608 1728 1609 1729 IF options.!debug == 1 THEN do … … 1619 1739 1620 1740 if trgRec = "" then do 1621 ok = VRSet("CB_DRIVES","Value", "") 1741 ok = VRMethod("CB_DRIVES", "GetStringList", "freedrives.") 1742 if freedrives.0 > 0 1743 then ok = VRSet("CB_DRIVES","Value", freedrives.1) 1744 else ok = VRSet("CB_DRIVES","Value", "") 1745 1622 1746 ok = VRSet("EF_DIRECTORY","Value", "") 1623 1747 … … 1651 1775 IF options.!debug == 1 THEN SAY time()' CN_CURRENT_DragDrop done' 1652 1776 return 1653 1654 1777 /*:VRX CN_SMBTREE_Click 1655 1778 */ … … 1660 1783 call _dropdeprecated 1661 1784 call _GetSmbObjectProperties VRInfo('Record') 1785 call _ContextMenuSelectedSet 1662 1786 1663 1787 ok = VRset("DT_Statusbar", "Caption", SMBObj.udatamsg) … … 1673 1797 call _GetSmbObjectProperties VRInfo('Record') 1674 1798 1675 /* Hide all context menu entries */ 1676 ok = VRSet("Menu_Selected_Remove", "Visible", 0) /* CN_CONDET */ 1677 ok = VRSet("Menu_Selected_Retry", "Visible", 0) /* CN_CONDET */ 1678 ok = VRSet("Menu_Selected_Connect", "Visible", 0) /* CN_SMBTREE */ 1679 ok = VRSet("Menu_Selected_Sep1", "Visible", 0) /* CN_SMBTREE */ 1680 ok = VRSet("Menu_Selected_Info", "Visible", 0) /* CN_SMBTREE */ 1681 ok = VRSet("Menu_Selected_Default_Workgroup","Visible", 0) /* CN_SMBTREE */ 1682 ok = VRSet("Menu_Selected_TreeView","Visible",1) 1683 ok = VRSet("Menu_Selected_DetailsView","Visible",1) 1684 select 1685 when SMBObj.udatatype = "DISK" then do 1686 ok = VRSet("Menu_Selected_Connect", "Visible", 1) 1687 ok = VRMethod( "Menu_Selected", "Popup", , , "", "" ) 1688 end 1689 when SMBObj.udatatype = "SERVER" then do 1690 ok = VRSet("Menu_Selected_Connect", "Visible", 1) 1691 ok = VRSet("Menu_Selected_Sep1", "Visible", 1) 1692 ok = VRSet("Menu_Selected_Info", "Visible", 1) 1693 ok = VRMethod( "Menu_Selected", "Popup", , , "", "" ) 1694 end 1695 when SMBObj.udatatype = "WORKGROUP" then do 1696 ok = VRSet("Menu_Selected_Connect", "Visible", 1) 1697 ok = VRSet("Menu_Selected_Sep1", "Visible", 1) 1698 ok = VRSet("Menu_Selected_Default_Workgroup","Visible", 1) 1699 ok = VRMethod( "Menu_Selected", "Popup", , , "", "" ) 1700 end 1701 when SMBObj.udatatype = "PRINTER" then do 1702 call _PrinterInfo 1703 /* CALL VRMessage 'Main', NLVGetMessage( 62 ), NLVGetMessage( 5 ), 'E' */ 1704 end 1705 otherwise nop /* FILE DIRECTORY */ 1706 end 1799 call _ContextMenuSelectedSet 1800 ok = VRMethod( "Menu_Selected", "Popup", , , "", "" ) 1707 1801 1708 1802 IF options.!debug == 1 THEN SAY time()' CN_SMBTREE_ContextMenu done' … … 1872 1966 IF options.!debug == 1 THEN SAY time()' EF_SERVER_Change started' 1873 1967 Now = VRGet("EF_SERVER","value") 1874 if Now = "" then return 1968 say now' 'LastServer 1969 if Now = "" | Now = LastServer then return 1875 1970 ok = SysSleep(2) 1876 1971 if Now <> VRGet("EF_SERVER","value") then return … … 1881 1976 if strip(translate(VRGet("EF_SERVER","value"),copies(' ',11),'01234567890.')) = "" & length(VRGet("EF_SERVER","value")) < 7 then return 1882 1977 1883 ok = VRMethod( "CN_SMBTREE", "GetRecordList", "Visible", "rh." ) 1884 1885 FoundServer = 0 1886 1887 do I = 1 to rh.0 1888 Userdata = VRMethod("CN_SMBTREE","GetRecordAttr",rh.I,"Userdata") 1889 ResName = VRMethod("CN_SMBTREE","GetRecordAttr",rh.I,"Caption") 1890 ParentRH = VRMethod("CN_SMBTREE","GetRecordAttr",rh.I,"Parent") 1891 1892 parse var ResName ResName '0D0A'x . 1893 ResName = strip(ResName) 1894 parse var userdata ResType '|' . 1895 1896 if VRGet("EF_SERVER","value") = ResName then do /* we found the server the field was changed to */ 1897 /* Workgroup properly */ 1898 if ParentRH = "" then do 1899 ok = VRSet("EF_NETWORK","Value", "") /* The workgroup might be unknown at this moment */ 1900 end 1901 else do 1902 ok = VRSet("EF_NETWORK","Value", VRMethod("CN_SMBTREE","GetRecordAttr",ParentRH,"Caption")) 1903 end 1904 1905 /* clear shares */ 1906 ok = VRMethod("EF_SHARE", "Reset") 1907 ok = VRset("EF_SHARE","Value", "") 1908 1909 do J = 1 to rh.0 /* populate shares with valid entries */ 1910 1911 Userdata = VRMethod("CN_SMBTREE","GetRecordAttr",rh.J,"Userdata") 1912 ResName = VRMethod("CN_SMBTREE","GetRecordAttr",rh.J,"Caption") 1913 ParentRH = VRMethod("CN_SMBTREE","GetRecordAttr",rh.J,"Parent") 1914 1915 parse var ResName ResName '0D0A'x . 1916 ResName = strip(ResName) 1917 parse var userdata ResType '|' . 1918 1919 if ParentRH = rh.I then do /* we found a share belonging to our server */ 1920 if ResType = "DISK" then ok = VRMethod("EF_SHARE","AddString", ResName) 1921 end 1922 end 1923 FoundServer = 1 1924 leave 1925 end 1926 end 1927 if Foundserver = 0 then do 1978 machine = VRGet("EF_SERVER","value") 1979 rh = _GetMachineHandle(machine) 1980 1981 if rh <> "" then do 1982 call _GetSMBObjectProperties rh 1983 1984 if SMBObj.parentrh = "" 1985 then ok = VRSet("EF_NETWORK","Value", "") /* The workgroup might be unknown at this moment */ 1986 else ok = VRSet("EF_NETWORK","Value", VRMethod("CN_SMBTREE","GetRecordAttr",SMBObj.parentRH,"Caption")) 1987 1988 call _GetSMBObjectShares rh 1989 1990 ok = VRMethod("EF_SHARE", "Reset") 1991 if SMBObj.shares.0 > 0 then ok = VRMethod("EF_SHARE", "AddRecordList", "SMBObj.shares.") 1992 end 1993 else do 1928 1994 call _RefreshWorkgroups 1929 machine = VRGet("EF_SERVER","value")1930 1995 smbtree.!machine = _AddSleepingMachine(machine,"","") 1931 1996 call _UserCredUpdate … … 1938 2003 ok = VRSet("Pict_Throbber","Visible", 0) 1939 2004 end 2005 2006 LastServer = VRGet("EF_SERVER","value") 1940 2007 IF options.!debug == 1 THEN SAY time()' EF_SERVER_Change done' 1941 2008 return … … 2822 2889 return 2823 2890 2891 /*:VRX Menu_Selected_Refresh_Click 2892 */ 2893 Menu_Selected_Refresh_Click: 2894 ok = VRMethod( "CN_smbtree", "SetRecordAttr", SMBObj.rh, "Icon","#61:PMWP.DLL") 2895 call _DelSMBObjectShares SMBObj.rh 2896 machine = SMBObj.resname 2897 ok = VRSet("TM_RefreshTreeDisplay", "Delay", 1000) 2898 call _RefreshShares 2899 return 2900 2824 2901 /*:VRX Menu_Selected_Remove_Click 2825 2902 */ … … 2875 2952 if p_workgroup = "" then ShareLevel = 4 2876 2953 2877 ok = VRSet( 2878 ok = VRset("CB_MOUNT" 2879 2880 ok = VRset("EF_SERVER" , "Value", p_server)2954 ok = VRSet("CB_MOUNT", "Selected", Sharelevel ) 2955 ok = VRset("CB_MOUNT", "Value", mtype.sharelevel) 2956 2957 call _UpdateObject "EF_SERVER", p_server 2881 2958 ok = VRset("EF_SHARE" , "Value", p_share) 2882 2959 ok = VRset("EF_NETWORK", "Value", p_workgroup) … … 3371 3448 IF options.!debug == 1 THEN SAY time()' '||"PB_MOUNT_Click started" 3372 3449 ok = VRSet("TM_RefreshCurrentDisplay","Enabled", 0) 3373 say " network = "network3450 say " network = "network 3374 3451 if options.!editmode = 1 then do 3375 3452 CALL PB_UNMOUNT_Click … … 3639 3716 p_workgroup = strip(p_workgroup) 3640 3717 ok = VRSet("EF_NETWORK","Value",strip(p_workgroup)) 3641 ok = VRSet("EF_SERVER","Value","")3718 call _UpdateObject "EF_SERVER", "" 3642 3719 ok = VRSet("EF_SHARE","Value","") 3643 3720 … … 3656 3733 parse var DragCapt p_server '0D0A'x . 3657 3734 p_server = strip(p_server) 3658 ok = VRSet("EF_SERVER","Value",strip(p_server))3735 call _UpdateObject "EF_SERVER", p_server 3659 3736 ok = VRSet("EF_Share","Value","") 3660 3737 … … 3671 3748 parse var ParDragCapt p_server '0D0A'x . 3672 3749 p_server = strip(p_server) 3673 ok = VRSet("EF_SERVER","Value",strip(p_server))3750 call _UpdateObject "EF_SERVER", p_server 3674 3751 3675 3752 parse var DragCapt p_share '0D0A'x . … … 3735 3812 ShowHidden = advanced.!special 3736 3813 BroadCast = advanced.!broadcast 3814 ok = VRSet("TM_RefreshTreeDisplay", "Delay", 1000) 3737 3815 ok = time('R') 3738 3816 call _RefreshTree … … 4110 4188 CALL NLVSetText 'SW_INFO', "Caption", 92 4111 4189 CALL NLVSetText 'PB_INFO_OK', "Caption", 2 4112 4113 4190 Info.TypeFH = VRMethod( "CN_INFO", "AddField", "String", "Type" ) 4114 4191 Info.ValueFH = VRMethod( "CN_INFO", "AddField", "String", "Value" ) 4115 4192 4193 IF options.!debug == 1 THEN do 4194 SAY ' Handle: "'SMBObj.rh'"' 4195 SAY ' Resource: "'SMBObj.resname'"' 4196 SAY ' Comment: "'SMBObj.comment'"' 4197 SAY ' Type: "'SMBObj.udatatype'"' 4198 SAY ' Message: "'SMBObj.udatamsg'"' 4199 SAY ' Icon: "'SMBObj.icon'"' 4200 end 4201 4202 Info.!comment= VRMethod( "CN_INFO", "AddRecord") 4116 4203 Info.!domain = VRMethod( "CN_INFO", "AddRecord") 4204 Info.!DMBLMB = VRMethod( "CN_INFO", "AddRecord") 4117 4205 Info.!os = VRMethod( "CN_INFO", "AddRecord") 4118 4206 Info.!server = VRMethod( "CN_INFO", "AddRecord") 4119 4207 Info.!status = VRMethod( "CN_INFO", "AddRecord") 4120 Info.!DMBLMB = VRMethod( "CN_INFO", "AddRecord")4121 4208 Info.!IP = VRMethod( "CN_INFO", "AddRecord") 4122 4209 Info.!MAC = VRMethod( "CN_INFO", "AddRecord") … … 4126 4213 ok = VRMethod( "CN_INFO", "SetFieldData", Info.!os, Info.TypeFH, strip(NLVGetMessage(93),'T',':'),Info.ValueFH, VRMethod("CN_SMBTREE", "GetFieldData", SMBObj.RH, OSFH )) 4127 4214 ok = VRMethod( "CN_INFO", "SetFieldData", Info.!server, Info.TypeFH, strip(NLVGetMessage(19),'T',':'),Info.ValueFH, VRMethod("CN_SMBTREE", "GetFieldData", SMBObj.RH, VersionFH )) 4128 ok = VRMethod( "CN_INFO", "SetFieldData", Info.!DMBLMB, Info.TypeFH, "Role",Info.ValueFH, VRMethod("CN_SMBTREE", "GetFieldData", SMBObj.RH, MBFH ))4215 ok = VRMethod( "CN_INFO", "SetFieldData", Info.!DMBLMB, Info.TypeFH, strip(NLVGetMessage(124),'T',':'),Info.ValueFH, VRMethod("CN_SMBTREE", "GetFieldData", SMBObj.RH, MBFH )) 4129 4216 ok = VRMethod( "CN_INFO", "SetFieldData", Info.!IP, Info.TypeFH, "IP" ,Info.ValueFH, VRMethod("CN_SMBTREE", "GetFieldData", SMBObj.RH, IPFH )) 4130 4217 ok = VRMethod( "CN_INFO", "SetFieldData", Info.!MAC, Info.TypeFH, "MAC" ,Info.ValueFH, VRMethod("CN_SMBTREE", "GetFieldData", SMBObj.RH, MacFH )) 4131 4218 ok = VRMethod( "CN_INFO", "SetFieldData", Info.!comment,Info.TypeFH, strip(NLVGetMessage(125),'T',':'),Info.ValueFH, SMBObj.comment) 4132 4219 ok = VRMethod( "CN_INFO", "SetFieldData", Info.!status, Info.TypeFH, strip(NLVGetMessage(67),'T',':'),Info.ValueFH, SMBObj.udatamsg ) 4133 4220 IF options.!debug == 1 THEN SAY time()' SW_INFO_Create done' … … 4214 4301 SW_MOUNTPOINT_Create: 4215 4302 call SW_MOUNTPOINT_Init 4216 /* NLVGetMessage(14)' ' */ 4217 ok = VRSet("SW_MOUNTPOINT","Caption",strip(p_workgroup' \\'p_server'\'p_share,'T','\')) 4303 4304 ok = VRSet("SW_MOUNTPOINT","Caption",strip(p_workgroup' \\'p_server'\'p_share,'T','\')) /* NLVGetMessage(14)' ' */ 4218 4305 CALL NLVSetText 'DT_MPOINT1', "Caption", 27 4219 4306 CALL NLVSetText 'PB_NEWMOUNTPOINTOK', "Caption", 2 … … 4227 4314 ok = VRMethod( "CB_DRIVES", "GetStringList", "freedrives." ) 4228 4315 ok = VRMethod( "CB_DRIVES1", "AddStringList", "freedrives." ) 4229 ok = VRSet("CB_DRIVES1", "Value", freedrives.1) /* VRGet("CB_Drives","Value") */ 4230 ok = VRSet("EF_DIRECTORY1", "Value", VRGet("EF_Directory","Value")) 4316 ok = VRSet("CB_DRIVES1", "Value", VRGet("CB_Drives","Value")) 4317 4318 if VRGet("EF_Directory","Value") = "" then ok = VRSet("EF_DIRECTORY1", "Value", VRGet("EF_Directory","Value")) 4319 4231 4320 ok = VRMethod("EF_DIRECTORY1","AddString",p_share) 4232 4321 … … 4494 4583 */ 4495 4584 TM_RefreshCurrentDisplay_Trigger: 4585 if RefreshMode <> "" then return 4586 if _DaemonRunning() = 0 then do 4587 say " Daemon not running - disable GUI" 4588 ok = VRset("GB_CURRENT", "Enabled", 0) 4589 ok = VRset("TDL_1", "Enabled", 0) 4590 ok = VRSet("Menu_File_Daemon_Start","Enabled", 1) 4591 ok = VRSet("Menu_File_Daemon_Stop", "Enabled", 0) 4592 end 4593 else do 4594 say " Daemon running - enable GUI" 4595 ok = VRset("GB_CURRENT", "Enabled", 1) 4596 ok = VRset("TDL_1", "Enabled", 1) 4597 ok = VRSet("Menu_File_Daemon_Start","Enabled", 0) 4598 ok = VRSet("Menu_File_Daemon_Stop", "Enabled", 1) 4599 end 4496 4600 CALL REFRESH 4497 4601 return -
trunk/guitools/evfsgui/evfsi_de.mkm
r639 r641 132 132 EVG0122I: ~Anwenden 133 133 EVG0123I: ~Zurck 134 EVG0124 ?:135 EVG0125 ?:134 EVG0124I: Rolle 135 EVG0125I: Kommentar 136 136 EVG0126?: 137 137 EVG0127?: -
trunk/guitools/evfsgui/evfsi_en.mkm
r639 r641 132 132 EVG0122I: ~Apply 133 133 EVG0123I: ~Undo 134 EVG0124 ?:135 EVG0125 ?:134 EVG0124I: Role 135 EVG0125I: Comment 136 136 EVG0126?: 137 137 EVG0127?: -
trunk/guitools/evfsgui/evfsi_fr.mkm
r639 r641 138 138 EVG0122I: ~Appliquer 139 139 EVG0123I: A~nnuler 140 EVG0124 ?:141 EVG0125 ?:140 EVG0124I: Rle 141 EVG0125I: Commentaire 142 142 EVG0126?: 143 143 EVG0127?: -
trunk/guitools/evfsgui/evfsi_it.mkm
r639 r641 136 136 EVG0122I: ~Applicare 137 137 EVG0123I: ~Disfare 138 EVG0124 ?:139 EVG0125 ?:138 EVG0124I: Ruolo 139 EVG0125I: Commento 140 140 EVG0126?: 141 141 EVG0127?: -
trunk/guitools/shared/smbtree.vrs
r640 r641 19 19 20 20 if BroadCast = '-b' then BroadCast = 1; else BroadCast = 0 21 if UserCred = '-N' then UserCred = ''21 if UserCred = '-N' then UserCred = '' 22 22 23 23 ok = VRMethod("CN_smbtree", "RemoveRecord", "ALL") … … 73 73 else do /* Fill records for details view */ 74 74 ok = VRSet("Main", 'Pointer', 'Wait' ) 75 /* Get all IP addresses of the machine */ 76 IPStr = _GetMachineIP(machine) 77 ok = VRMethod( "CN_smbtree", "SetFieldData", smbtree.!machine, IPFH, IPStr) 75 /* Get NMBLookup Status for machine */ 76 NMBStatus = _GetMachineNMBSTatus(machine) 77 parse var NMBStatus IPStr'|'MAC '|' Roles; drop NMBStatus 78 if pos("PDC",Roles) > 0 then ok = VRMethod( "CN_smbtree", "SetRecordAttr", smbtree.!machine, "Icon","#63:PMWP.DLL") 79 ok = VRMethod( "CN_smbtree", "SetFieldData", smbtree.!machine, IPFH, IPStr,MBFH, Roles, MacFH,MAC) 80 81 /* FIXME: Possibly obsolete */ 78 82 parse var IPStr MachineIP ',' . 79 83 if strip(MachineIP) = "" then MachineIP = machine 84 80 85 ok = VRSet("Main", 'Pointer', '<default>' ) 81 86 … … 87 92 parse var smbline "Domain=["WorkGroup"] OS=["OS"] Server=["Version"]"Rest 88 93 ok = VRMethod( "CN_smbtree", "SetFieldData", smbtree.!machine, OSFH, OS, VersionFH, Version, WorkgroupFH, WorkGroup) 89 90 /* Find out server role, MAC */91 MACRoles = _GetMachineMACRoles(machineIP)92 parse var MACRoles MAC '|' Roles; drop MACRoles93 ok = VRMethod( "CN_smbtree", "SetFieldData", smbtree.!machine, MBFH, Roles, MacFH,MAC)94 if pos("PDC",Roles) > 0 then ok = VRMethod( "CN_smbtree", "SetRecordAttr", smbtree.!machine, "Icon","#63:PMWP.DLL")95 94 end 96 95 end … … 169 168 if smbmachine.0 = 0 then do /* we are done, no more files around, cleanup, disable Timer and exit */ 170 169 RefreshMode = "" 171 ok = VRset("TM_RefreshTreeDisplay","Enabled",0) 170 ok = VRset("TM_RefreshTreeDisplay","Enabled", 0) 171 ok = VRSet("TM_RefreshTreeDisplay","Delay", 1000) 172 172 ok = VRSet("CN_smbtree","Enabled", 1) 173 ok = VRSet("CN_smbtree", "Painting", 0 174 ok = VRSet("CN_smbtree", "Painting", 1 173 ok = VRSet("CN_smbtree", "Painting", 0 ) 174 ok = VRSet("CN_smbtree", "Painting", 1 ) 175 175 say time()' _AddSharesDisplay() completed' 176 176 return /* exit here */ 177 177 end 178 else say ' 'smbmachine.0' file(s) to process.' 178 else do 179 say ' 'smbmachine.0' file(s) to process.' 180 if smbmachine.0 = 1 then ok = VRSet("TM_RefreshTreeDisplay", "Delay", VRGet("TM_RefreshTreeDisplay", "Delay") * 2) 181 end 179 182 180 183 if UserCred = 'USERCRED' | UserCred = '' | UserCred = '--user=%' then UserCred = '-N' … … 186 189 stat = stream(smbmachine.I,'c','open read') 187 190 say '"'stat'"' 188 191 if stat = "READY:" & smbmachine.0 = 1 then do /* We just found out we are processing the last machine */ 192 ok = VRSet("TM_RefreshTreeDisplay","Delay", 1000) 193 end 189 194 infoline = "" 190 195 if stat = "READY:" then do /* we found a readable output file */ … … 329 334 330 335 ok = VRSet("Main", 'Pointer', 'Wait' ) 331 /* Find out IPs */ 332 IPStr = _GetMachineIP(machine) 333 ok = VRMethod( "CN_smbtree", "SetFieldData", smbtree.!machine, IPFH, IPStr) 334 parse var IPStr MachineIP ',' . 335 if strip(MachineIP) = "" then MachineIP = machine 336 337 /* Get NMBLookup Status for machine */ 338 NMBStatus = _GetMachineNMBSTatus(machine) 339 parse var NMBStatus IPStr'|'MAC '|' Roles; drop NMBStatus 340 if pos("PDC",Roles) > 0 then ok = VRMethod( "CN_smbtree", "SetRecordAttr", smbtree.!machine, "Icon","#63:PMWP.DLL") 341 ok = VRMethod( "CN_smbtree", "SetFieldData", smbtree.!machine, IPFH, IPStr,MBFH, Roles, MacFH,MAC) 342 336 343 ok = VRSet("Main", 'Pointer', '<default>' ) 337 338 /* Find out server role, MAC */339 MACRoles = _GetMachineMACRoles(machineIP)340 parse var MACRoles MAC '|' Roles; drop MACRoles341 ok = VRMethod( "CN_smbtree", "SetFieldData", smbtree.!machine, MBFH, Roles, MacFH,MAC)342 if pos("PDC",Roles) > 0 then ok = VRMethod( "CN_smbtree", "SetRecordAttr", smbtree.!machine, "Icon","#63:PMWP.DLL")343 344 344 345 say time()' _AddSharesDisplay() success and cleanup' … … 360 361 _GetMachinehandle: procedure /* get recordhandle by machine name (also works for workgroups) */ 361 362 Machine = translate(arg(1)) 362 363 say ' _GetMachineHandle("'Machine'") started.' 363 364 ok = VRMethod("CN_smbtree", "GetRecordList", "All", rh.) 364 365 match = 0 … … 376 377 end 377 378 if match = 0 then rh.I = "" /* return an empty handle, if there was no match */ 378 say ' Handle for "'Machine'"= "'rh.I'"'379 say ' _GetMachineHandle("'Machine'") done, handle = "'rh.I'"' 379 380 return rh.I 380 381 … … 406 407 _AddWorkGroup: procedure expose WorkGroupFH 407 408 workgroup = arg(1) 409 say ' _AddWorkGroup("'workgroup'") started.' 408 410 wgh= VRMethod( "CN_smbtree", "AddRecord",,, workgroup,"#62:PMWP.DLL") 409 411 ok = VRMethod( "CN_smbtree", "SetFieldData", wgh, WorkGroupFH, workgroup) … … 411 413 ok = VRMethod( "CN_smbtree", "SetRecordAttr", wgh, "ReadOnly", 1) 412 414 ok = VRMethod( "CN_smbtree", 'SetRecordAttr', wgh, "UserData", "WORKGROUP|") 415 say ' _AddWorkGroup("'workgroup'") done.' 413 416 return wgh 414 417 … … 474 477 return MAC'|'Roles 475 478 479 /*:VRX _GetMachineNMBStatus 480 */ 481 _GetMachineNMBStatus: procedure expose debuglevel samba. 482 machine = arg(1) /* name only allowed */ 483 say ' 'samba.!nmblookupexe' -S 'machine' 'debuglevel' >'samba.!msg 484 address cmd samba.!nmblookupexe' -S 'machine' 'debuglevel' >'samba.!msg 485 ok = file2stem(samba.!msg,"nmblookup.") 486 IPStr = "" 487 Roles = "" 488 MAC = 'xx-xx-xx-xx-xx-xx' 489 do I = 1 to nmblookup.0 490 select 491 when pos(machine'<',nmblookup.I) > 0 then do 492 parse var nmblookup.i ip . 493 ip = strip(ip) 494 if pos(ip, ipstr) = 0 then ipstr = ipstr||ip',' 495 end 496 when pos('<1c>', nmblookup.I) > 0 then Roles = Roles||"PDC," /* # */ 497 when pos('<1b>', nmblookup.I) > 0 then Roles = Roles||"LMB," /* + */ 498 when pos('<1d>', nmblookup.I) > 0 then Roles = Roles||"DMB," /* * */ 499 when pos('MAC', nmblookup.I) > 0 then do 500 parse var nmblookup.I . '=' MAC 501 MAC = strip(MAC) 502 end 503 otherwise nop 504 end 505 end 506 Roles = strip(Roles,,',') 507 if Roles = "" then Roles = "Workstation" 508 ipstr = strip(ipstr,,',') 509 return IPStr'|'MAC'|'Roles 510 476 511 /*:VRX file2stem 477 512 */
Note:
See TracChangeset
for help on using the changeset viewer.