Ignore:
Timestamp:
Oct 30, 2009, 4:17:35 PM (16 years ago)
Author:
Herwig Bauernfeind
Message:

GUI-Tools: EVFSGUI Version 2.0 beta3 level code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/guitools-2.0/smbmon/smbmon.vrx

    r334 r345  
    378378    /* For Users page in case connections.tdb is not initialised */
    379379    IgnoreSmbNoInit = 1
     380
     381    /* For Refresh tree display code */
     382    RefreshMode =""
    380383
    381384    smbdpidhandle.0 = 0
     
    647650        parse var Zeile FPid Uid DenyMode Access RW Oplock Sharepath Rest
    648651        TimeDate = right(rest,25)
    649         Name = strip(left(Rest,length(Rest)-25))
     652        Name = strip(left(Rest,max(length(Rest)-25),1))
    650653        I = I + 1
    651654        sharepath = strip(translate(left(sharepath,1))||translate(substr(SharePath,2),'\','/'),'T','\')
     
    10971100        ok = VRset("ContextMenu_Daemons_Ping","Visible", (DRH <> "") )
    10981101        ok = VRset("ContextMenu_Daemons_Shutdown","Visible", 0 )
    1099         RecCap = ""
    1100         if DRH <> "" then RecCap = VRMethod("CN_Daemons", "GetRecordAttr", DRH, "Caption")
     1102        DaemonName = ""
     1103        if DRH <> "" then DaemonName = VRMethod("CN_Daemons", "GetRecordAttr", DRH, "Caption")
    11011104        select
    1102             when Words(RecCap) = 3 then do
    1103                 RecCap = word(RecCap,2)
     1105            when Words(DaemonName) = 3 then do
     1106                DaemonName = word(DaemonName,2)
    11041107                ok = VRset("ContextMenu_Daemons_Sep1","Visible", 1 )
    11051108            end
    1106             when Words(RecCap) = 1 then do
    1107                 parse var RecCap RecCap'.exe'
     1109            when Words(DaemonName) = 1 then do
     1110                parse var DaemonName DaemonName'.exe'
    11081111                if strip(VRMethod("CN_Daemons", "GetFieldData", DRH, DPidsFH)) <> "" then do
    1109                     ok = VRSet("ContextMenu_Daemons_Shutdown", "Caption", NLVGetMessage( 33, RecCap))
     1112                    ok = VRSet("ContextMenu_Daemons_Shutdown", "Caption", NLVGetMessage( 33, DaemonName))
    11101113                    ok = VRset("ContextMenu_Daemons_Shutdown", "Visible", 1 )
    1111                     ok = VRset("ContextMenu_Daemons_Sep1","Visible", 1 )
     1114                    ok = VRset("ContextMenu_Daemons_Start", "Visible", 0 )
     1115                    ok = VRset("ContextMenu_Daemons_Sep1",  "Visible", 1 )
    11121116                end
    1113                 else ok = VRset("ContextMenu_Daemons_Ping","Visible", 0 )
     1117                else do
     1118                    ok = VRSet("ContextMenu_Daemons_Start", "Caption", NLVGetMessage( 36, DaemonName))
     1119                    ok = VRset("ContextMenu_Daemons_Start", "Visible", 1 )
     1120                    ok = VRset("ContextMenu_Daemons_Ping",  "Visible", 0 )
     1121                    ok = VRset("ContextMenu_Daemons_Sep1",  "Visible", 1 )
     1122                end
    11141123            end
    11151124            otherwise nop
    11161125        end
    1117         say '  Daemon is "'RecCap'"'
     1126        say '  Daemon is "'DaemonName'"'
    11181127        ok = VRMethod( "ContextMenu_Daemons", "Popup", , , "", "" )
    11191128    end
     
    11491158return
    11501159
     1160/*:VRX         CN_smbtree_Click
     1161*/
     1162CN_smbtree_Click:
     1163    rh = VRInfo('Record')
     1164    if VRMethod( 'CN_SMBTREE', "ValidateRecord", rh) <> 1 then return
     1165    userdata = VRMethod('CN_smbtree', 'GetRecordAttr', rh, 'UserData')
     1166    parse var userdata . '|' userdata
     1167    ok = VRset("Main","StatusText", userdata)
     1168 
     1169
     1170return
     1171
    11511172/*:VRX         CN_smbtree_ContextMenu
    11521173*/
     
    12721293ContextMenu_Daemons_Ping_Click:
    12731294    ok = VRSet("Main", 'Pointer', 'Wait' )
    1274     address cmd samba.!smbcontrolexe' 'RecCap' ping --timeout=3 --debuglevel=0 2>'samba.!error' 1>'samba.!msg
     1295    address cmd samba.!smbcontrolexe' 'DaemonName' ping --timeout=3 --debuglevel=0 2>'samba.!error' 1>'samba.!msg
    12751296    call _SambaShowMsg "section table registered"
    12761297
     
    12821303*/
    12831304ContextMenu_Daemons_Shutdown_Click:
    1284     Msg.Text = NLVGetMessage(34, RecCap)
     1305    Msg.Text = NLVGetMessage(34, DaemonName)
    12851306    Msg.Type = 'Q'
    12861307    if _MsgYesNo() = 1 then do
    1287         address cmd samba.!smbcontrolexe' 'RecCap' shutdown 2>'samba.!error' 1>'samba.!msg
    1288         call _SambaShowMsg "section table registered"
     1308        address cmd samba.!smbcontrolexe' 'DaemonName' shutdown 2>'samba.!error' 1>'samba.!msg
     1309        call _SambaShowMsg "section table registered tdb"
    12891310    end
    12901311    ok = VRSet("TM_refresh","Enabled", 1)
     
    12951316ContextMenu_Daemons_Sort_Click:
    12961317    window = VRLoadSecondary( "SW_SORT", "W" )
     1318return
     1319
     1320/*:VRX         ContextMenu_Daemons_Start_Click
     1321*/
     1322ContextMenu_Daemons_Start_Click:
     1323    Msg.Text = NLVGetMessage(37, DaemonName)
     1324    Msg.Type = 'Q'
     1325    if _MsgYesNo() = 1 then do
     1326        say samba.!smbcmd' start 'DaemonName
     1327        address cmd samba.!smbcmd' start 'DaemonName
     1328    end
     1329    ok = VRSet("TM_refresh","Enabled", 1)
    12971330return
    12981331
     
    19702003*/
    19712004TM_RefreshTreeDisplay_Trigger:
    1972     call _RefreshTreeDisplay
     2005    select
     2006        when RefreshMode = "TREE" then do
     2007            call _RefreshTreeDisplay
     2008        end
     2009        when RefreshMode = "SHARE" then do
     2010            call _AddSharesDisplay   
     2011        end
     2012        otherwise say "RefreshMode = "RefreshMode
     2013    end
    19732014return
    19742015
Note: See TracChangeset for help on using the changeset viewer.