Changeset 641


Ignore:
Timestamp:
Oct 3, 2011, 9:44:30 AM (14 years ago)
Author:
Herwig Bauernfeind
Message:

GUI-Tools: EVFSGUI 2.5.x: More work done

Location:
trunk/guitools
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/guitools/evfsgui/evfsgui.vrp

    r640 r641  
    1111VRXWindow: __VREFileListWindow,1,807,11033,1590,3358
    1212VRXWindow: __VRESectionListWindow,1,2674,10648,8696,4782
    13 VRXWindow: __VREToolsWindow,1,2529,723,6489,1667
     13VRXWindow: __VREToolsWindow,1,2529,723,6480,1661
    1414VRXWindow: __VREWindListWindow,1,542,8721,3770,3150
    1515UserFile: 1
    1616UserWindow: Main,1
    1717UserWindow: SW_INFO,1
    18 UserWindow: SW_CONDET,1
     18UserWindow: SW_DIALOG,1
  • trunk/guitools/evfsgui/evfsgui.vrx

    r640 r641  
    9191__VXREXX____APPENDS__:
    9292/*
    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
     93#append U:\Develop\Samba\trunk\guitools\shared\cltinit.vrs
     94#append U:\Develop\Samba\trunk\guitools\shared\inittempdir.vrs
     95#append U:\Develop\Samba\trunk\guitools\shared\nlv.vrs
     96#append U:\Develop\Samba\trunk\guitools\shared\rexx_md5.vrs
     97#append U:\Develop\Samba\trunk\guitools\shared\smbtree.vrs
     98#append U:\Develop\Samba\trunk\guitools\shared\textini.vrs
    9999*/
    100100return
     
    344344    IF options.!debug == 1 THEN SAY time()' _ContainersInit done'
    345345return
     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
     359ok = VRSet("Menu_Selected_TreeView","Visible",1)
     360ok = 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
     382return
     383
    346384/*:VRX         _CreateSmbConf
    347385*/
     
    363401return
    364402
     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
     415return 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
     435return
     436
    365437/*:VRX         _DialogPopulate
    366438*/
     
    395467*/
    396468_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     */
    397473    drop rh     
    398474    drop parentrh     
     475    drop gparentrh
    399476    drop icon     
    400477    drop resname   
     478    drop comment   
    401479    drop udatatype
    402480    drop udatamsg 
     
    420498       SMBObj.rh        = recordhandle of the object
    421499       SMBObj.resname   = resourcename of the object
     500       SMBObj.comment   = commentstring of the object
    422501       SMBObj.icon      = icon of the object
    423502       SMBObj.udatatype = type of object (WORKGROUP, SERVER, DISK, PRINTER, FILE, DIRECTORY)
    424503       SMBObj.udatamsg  = arbitrary object related data (Login message, file properties)
    425504       SMBObj.parentrh  = recordhandle of the object's parent
     505       SMBObj.gparentrh = recordhandle of the object's grandparent
    426506
    427507       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
    429510     */
    430511    call _dropdeprecated
     
    434515
    435516    if VRMethod( "CN_SMBTREE", "ValidateRecord", SMBObj.rh) <> 1 | SMBObj.rh = "" then do
    436         SMBObj. = ""
    437517        IF options.!debug == 1 THEN SAY time()' _GetSMBObjectProperties aborted'
    438518        return
     
    442522
    443523    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")
    444527
    445528    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
    447530    SMBObj.resname = strip(SMBObj.resname)
     531    SMBObj.comment = strip(SMBObj.comment)
    448532
    449533    Userdata = VRMethod("CN_SMBTREE", "GetRecordAttr", SMBObj.rh, "Userdata")
     
    454538    IF options.!debug == 1 THEN do
    455539        SAY '  Handle:   "'SMBObj.rh'"'
     540        say '  GParentrh "'SMBObj.gparentrh'"'
    456541        SAY '  Resource: "'SMBObj.resname'"'
     542        SAY '  Comment:  "'SMBObj.comment'"'
    457543        SAY '  Type:     "'SMBObj.udatatype'"'
    458544        SAY '  Message:  "'SMBObj.udatamsg'"'
     
    461547
    462548    IF options.!debug == 1 THEN SAY time()' _GetSMBObjectProperties done'
     549return
     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
    463580return
    464581
     
    500617    CALL NLVSetText 'Menu_Selected_Retry',            "Caption", 90
    501618    CALL NLVSetText 'Menu_Selected_Info',             "Caption", 92
     619    CALL NLVSetText 'Menu_Selected_Refresh',          "Caption", 38
    502620    CALL NLVSetText 'Menu_Selected_Default_Workgroup',"Caption", 75
    503621
     
    11641282return
    11651283
     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)
     1290return
     1291
    11661292/*:VRX         _UserCredUpdate
    11671293*/
     
    11991325    IF options.!debug == 1 THEN SAY time()' '||"CB_MOUNT_Change started"
    12001326
    1201     mount = VRGet("CB_MOUNT", "Selected")
     1327    mount = VRGet("CB_MOUNT", "Value")
    12021328
    12031329    SELECT
    1204         WHEN mount == 1 THEN DO
     1330        WHEN mount == mtype.1 THEN DO
    12051331            CALL VRSet "DT_SHARE",   "Visible", 1
    12061332            CALL VRSet "EF_SHARE",   "Visible", 1
     
    12101336            CALL NLVSetText "DT_NETWORK", "Caption", 21
    12111337        END
    1212         WHEN mount == 2 THEN DO
     1338        WHEN mount == mtype.2 THEN DO
    12131339            CALL VRSet "DT_SHARE",   "Visible", 0
    12141340            CALL VRSet "EF_SHARE",   "Visible", 0
     
    12181344            CALL NLVSetText "DT_NETWORK", "Caption", 21
    12191345        END
    1220         WHEN mount == 3 THEN DO
     1346        WHEN mount == mtype.3 THEN DO
    12211347            CALL VRSet "DT_SHARE",   "Visible", 0
    12221348            CALL VRSet "EF_SHARE",   "Visible", 0
     
    12261352            CALL NLVSetText "DT_NETWORK", "Caption", 21
    12271353        END
    1228         WHEN mount == 4 THEN DO
     1354        WHEN mount == mtype.4 THEN DO
    12291355            CALL VRSet "DT_SHARE",   "Visible", 0
    12301356            CALL VRSet "EF_SHARE",   "Visible", 0
     
    13511477
    13521478    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
    13611497    IF options.!debug == 1 THEN SAY time()' CN_CURRENT_Click done'
    13621498RETURN
     
    15421678        ok = VRset("CB_MOUNT",  "Value",    mtype.sharelevel)
    15431679
    1544         ok = VRset("EF_SERVER",   "Value", p_server)
     1680        call _UpdateObject "EF_SERVER", p_server
    15451681        ok = VRset("EF_SHARE",    "Value", p_share)
    15461682        ok = VRset("EF_NETWORK",  "Value", p_workgroup)
     
    15541690        ok = VRset("CB_DRIVES",    "Value", p_drv)
    15551691        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
    15761706                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     = ""
    15851710
    15861711                ShareLevel = 2
    15871712            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
    16031719
    16041720                ShareLevel = 1
    16051721            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 */
    16081728
    16091729    IF options.!debug == 1 THEN do
     
    16191739
    16201740    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
    16221746        ok = VRSet("EF_DIRECTORY","Value", "")
    16231747
     
    16511775    IF options.!debug == 1 THEN SAY time()' CN_CURRENT_DragDrop done'
    16521776return
    1653 
    16541777/*:VRX         CN_SMBTREE_Click
    16551778*/
     
    16601783    call _dropdeprecated
    16611784    call _GetSmbObjectProperties VRInfo('Record')
     1785    call _ContextMenuSelectedSet
    16621786
    16631787    ok = VRset("DT_Statusbar", "Caption", SMBObj.udatamsg)
     
    16731797    call _GetSmbObjectProperties VRInfo('Record')
    16741798
    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", , , "", "" )
    17071801
    17081802    IF options.!debug == 1 THEN SAY time()' CN_SMBTREE_ContextMenu done'
     
    18721966    IF options.!debug == 1 THEN SAY time()' EF_SERVER_Change started'
    18731967    Now = VRGet("EF_SERVER","value")
    1874     if Now = "" then return
     1968say now' 'LastServer
     1969    if Now = "" | Now = LastServer then return
    18751970    ok = SysSleep(2)
    18761971    if Now <> VRGet("EF_SERVER","value") then return
     
    18811976    if strip(translate(VRGet("EF_SERVER","value"),copies(' ',11),'01234567890.')) = "" & length(VRGet("EF_SERVER","value")) < 7 then return
    18821977
    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
    19281994        call _RefreshWorkgroups
    1929         machine = VRGet("EF_SERVER","value")
    19301995        smbtree.!machine = _AddSleepingMachine(machine,"","")
    19311996        call _UserCredUpdate
     
    19382003        ok = VRSet("Pict_Throbber","Visible", 0)
    19392004    end
     2005
     2006    LastServer = VRGet("EF_SERVER","value")
    19402007    IF options.!debug == 1 THEN SAY time()' EF_SERVER_Change done'
    19412008return
     
    28222889return
    28232890
     2891/*:VRX         Menu_Selected_Refresh_Click
     2892*/
     2893Menu_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
     2899return
     2900
    28242901/*:VRX         Menu_Selected_Remove_Click
    28252902*/
     
    28752952    if p_workgroup = "" then ShareLevel = 4
    28762953
    2877     ok = VRSet( "CB_MOUNT", "Selected", Sharelevel )
    2878     ok = VRset("CB_MOUNT"  , "Value", mtype.sharelevel)
    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
    28812958    ok = VRset("EF_SHARE"  ,  "Value", p_share)
    28822959    ok = VRset("EF_NETWORK",  "Value", p_workgroup)
     
    33713448    IF options.!debug == 1 THEN SAY time()' '||"PB_MOUNT_Click started"
    33723449    ok = VRSet("TM_RefreshCurrentDisplay","Enabled", 0)
    3373     say "network = "network
     3450    say "  network = "network
    33743451    if options.!editmode = 1 then do
    33753452        CALL PB_UNMOUNT_Click
     
    36393716        p_workgroup = strip(p_workgroup)
    36403717        ok = VRSet("EF_NETWORK","Value",strip(p_workgroup))
    3641         ok = VRSet("EF_SERVER","Value","")
     3718        call _UpdateObject "EF_SERVER", ""
    36423719        ok = VRSet("EF_SHARE","Value","")
    36433720
     
    36563733            parse var DragCapt p_server '0D0A'x .
    36573734            p_server = strip(p_server)
    3658             ok = VRSet("EF_SERVER","Value",strip(p_server))
     3735            call _UpdateObject "EF_SERVER", p_server
    36593736            ok = VRSet("EF_Share","Value","")
    36603737
     
    36713748            parse var ParDragCapt p_server '0D0A'x .
    36723749            p_server = strip(p_server)
    3673             ok = VRSet("EF_SERVER","Value",strip(p_server))
     3750            call _UpdateObject "EF_SERVER", p_server
    36743751
    36753752            parse var DragCapt p_share '0D0A'x .
     
    37353812    ShowHidden = advanced.!special
    37363813    BroadCast = advanced.!broadcast
     3814    ok = VRSet("TM_RefreshTreeDisplay", "Delay", 1000)
    37373815    ok = time('R')
    37383816    call _RefreshTree
     
    41104188    CALL NLVSetText 'SW_INFO',    "Caption", 92
    41114189    CALL NLVSetText 'PB_INFO_OK',    "Caption", 2
    4112 
    41134190    Info.TypeFH    = VRMethod( "CN_INFO", "AddField", "String", "Type" )
    41144191    Info.ValueFH   = VRMethod( "CN_INFO", "AddField", "String", "Value" )
    41154192
     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")
    41164203    Info.!domain = VRMethod( "CN_INFO", "AddRecord")
     4204    Info.!DMBLMB = VRMethod( "CN_INFO", "AddRecord")
    41174205    Info.!os     = VRMethod( "CN_INFO", "AddRecord")
    41184206    Info.!server = VRMethod( "CN_INFO", "AddRecord")
    41194207    Info.!status = VRMethod( "CN_INFO", "AddRecord")
    4120     Info.!DMBLMB = VRMethod( "CN_INFO", "AddRecord")
    41214208    Info.!IP     = VRMethod( "CN_INFO", "AddRecord")
    41224209    Info.!MAC    = VRMethod( "CN_INFO", "AddRecord")
     
    41264213    ok = VRMethod( "CN_INFO", "SetFieldData", Info.!os,     Info.TypeFH, strip(NLVGetMessage(93),'T',':'),Info.ValueFH, VRMethod("CN_SMBTREE", "GetFieldData", SMBObj.RH, OSFH  ))
    41274214    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  ))
    41294216    ok = VRMethod( "CN_INFO", "SetFieldData", Info.!IP,     Info.TypeFH, "IP"  ,Info.ValueFH, VRMethod("CN_SMBTREE", "GetFieldData", SMBObj.RH, IPFH  ))
    41304217    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)
    41324219    ok = VRMethod( "CN_INFO", "SetFieldData", Info.!status, Info.TypeFH, strip(NLVGetMessage(67),'T',':'),Info.ValueFH, SMBObj.udatamsg )
    41334220    IF options.!debug == 1 THEN SAY time()' SW_INFO_Create done'   
     
    42144301SW_MOUNTPOINT_Create:
    42154302    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)' ' */
    42184305    CALL NLVSetText 'DT_MPOINT1',   "Caption", 27
    42194306    CALL NLVSetText 'PB_NEWMOUNTPOINTOK',    "Caption", 2
     
    42274314    ok = VRMethod( "CB_DRIVES",  "GetStringList", "freedrives." )
    42284315    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
    42314320    ok = VRMethod("EF_DIRECTORY1","AddString",p_share)
    42324321
     
    44944583*/
    44954584TM_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
    44964600    CALL REFRESH
    44974601return
  • trunk/guitools/evfsgui/evfsi_de.mkm

    r639 r641  
    132132EVG0122I: ~Anwenden
    133133EVG0123I: ~Zurck
    134 EVG0124?:
    135 EVG0125?:
     134EVG0124I: Rolle
     135EVG0125I: Kommentar
    136136EVG0126?:
    137137EVG0127?:
  • trunk/guitools/evfsgui/evfsi_en.mkm

    r639 r641  
    132132EVG0122I: ~Apply
    133133EVG0123I: ~Undo
    134 EVG0124?:
    135 EVG0125?:
     134EVG0124I: Role
     135EVG0125I: Comment
    136136EVG0126?:
    137137EVG0127?:
  • trunk/guitools/evfsgui/evfsi_fr.mkm

    r639 r641  
    138138EVG0122I: ~Appliquer
    139139EVG0123I: A~nnuler
    140 EVG0124?:
    141 EVG0125?:
     140EVG0124I: R“le
     141EVG0125I: Commentaire
    142142EVG0126?:
    143143EVG0127?:
  • trunk/guitools/evfsgui/evfsi_it.mkm

    r639 r641  
    136136EVG0122I: ~Applicare
    137137EVG0123I: ~Disfare
    138 EVG0124?:
    139 EVG0125?:
     138EVG0124I: Ruolo
     139EVG0125I: Commento
    140140EVG0126?:
    141141EVG0127?:
  • trunk/guitools/shared/smbtree.vrs

    r640 r641  
    1919
    2020    if BroadCast = '-b' then BroadCast = 1; else BroadCast = 0
    21     if UserCred = '-N' then UserCred = ''
     21    if UserCred  = '-N' then UserCred = ''
    2222
    2323    ok = VRMethod("CN_smbtree", "RemoveRecord", "ALL")
     
    7373                else do /* Fill records for details view */
    7474                    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 */
    7882                    parse var IPStr MachineIP ',' .
    7983                    if strip(MachineIP) = "" then MachineIP = machine
     84
    8085                    ok = VRSet("Main", 'Pointer', '<default>' )
    8186
     
    8792                    parse var smbline "Domain=["WorkGroup"] OS=["OS"] Server=["Version"]"Rest
    8893                    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 MACRoles
    93                     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")
    9594                end
    9695            end
     
    169168    if smbmachine.0 = 0 then do /* we are done, no more files around, cleanup, disable Timer and exit */
    170169        RefreshMode = ""
    171         ok = VRset("TM_RefreshTreeDisplay","Enabled",0)
     170        ok = VRset("TM_RefreshTreeDisplay","Enabled", 0)
     171        ok = VRSet("TM_RefreshTreeDisplay","Delay", 1000)
    172172        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 )
    175175        say time()' _AddSharesDisplay() completed'
    176176        return /* exit here */
    177177    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
    179182
    180183    if UserCred   = 'USERCRED'   | UserCred = '' | UserCred = '--user=%' then UserCred = '-N'
     
    186189        stat = stream(smbmachine.I,'c','open read')
    187190        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
    189194        infoline = ""
    190195        if stat = "READY:" then do /* we found a readable output file */
     
    329334
    330335            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
    336343            ok = VRSet("Main", 'Pointer', '<default>' )
    337 
    338             /* Find out server role, MAC */
    339             MACRoles = _GetMachineMACRoles(machineIP)
    340             parse var MACRoles MAC '|' Roles; drop MACRoles
    341             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")
    343344
    344345            say time()' _AddSharesDisplay() success and cleanup'
     
    360361_GetMachinehandle: procedure /* get recordhandle by machine name (also works for workgroups) */
    361362    Machine = translate(arg(1))
    362 
     363    say '  _GetMachineHandle("'Machine'") started.'
    363364    ok = VRMethod("CN_smbtree", "GetRecordList", "All", rh.)
    364365    match = 0
     
    376377    end
    377378    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'"'
    379380return rh.I
    380381
     
    406407_AddWorkGroup: procedure expose WorkGroupFH
    407408    workgroup = arg(1)
     409    say '  _AddWorkGroup("'workgroup'") started.'
    408410    wgh= VRMethod( "CN_smbtree", "AddRecord",,, workgroup,"#62:PMWP.DLL")
    409411    ok = VRMethod( "CN_smbtree", "SetFieldData",  wgh, WorkGroupFH, workgroup)
     
    411413    ok = VRMethod( "CN_smbtree", "SetRecordAttr", wgh, "ReadOnly", 1)
    412414    ok = VRMethod( "CN_smbtree", 'SetRecordAttr', wgh, "UserData", "WORKGROUP|")
     415    say '  _AddWorkGroup("'workgroup'") done.'
    413416return wgh
    414417
     
    474477return MAC'|'Roles
    475478
     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,,',')
     509return IPStr'|'MAC'|'Roles
     510
    476511/*:VRX         file2stem
    477512*/
Note: See TracChangeset for help on using the changeset viewer.