Ignore:
Timestamp:
Dec 9, 2016, 10:06:20 AM (4 years ago)
Author:
Herwig Bauernfeind
Message:

GUITools: All changes that have built over time.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/guitools/smbmon/smbmon.vrx

    r925 r990  
    123123    ok = VRMethod("CN_CHKTDB", "SetFieldData", RecHandle, ChkTDBFilesFH, TDBFile, ChkTDBIconFH, "$50", ChkTDBSizeFH, TDBSize||" Bytes" )
    124124    address cmd '@tdbtool 'tdb.I' check 2>'tdb.I'.err 1>'tdb.I'.out'
    125     out = linein(tdb.I'.out')
    126     ok = stream(tdb.I'.out','c','close')
     125    ok = file2stem(tdb.I'.out',"out.")
     126    out = out.ok
    127127    say out
    128128    if pos('integrity is OK',out) > 0 then do /* integrity is ok */
     
    489489
    490490    /* Statusbar */
    491     ok = VRSet("DT_STATUSBAR","Caption", VRGet("Main", "HintText"))
     491    ok = VRSet("DT_STATUSBAR","Caption", " "||VRGet("Main", "HintText"))
    492492
    493493    call Main_Resize
     
    587587    advanced.!bigicons = VRGetIni( "Settings", "BigIcons", OurINI)
    588588    if advanced.!bigicons = "" then advanced.!bigicons = 0
     589
     590    advanced.!smbconfchanged = 0
    589591
    590592    /* For Browse page */
     
    664666    call PRLoadFuncs
    665667
     668    call rxfuncadd 'IniLoadFuncs', 'REXXINI', 'IniLoadFuncs'
     669    call IniLoadFuncs
     670
     671    call RxFuncAdd 'RxDate', 'RexxDate', 'RxDate'
     672
    666673    SIGNAL OFF SYNTAX
    667674    IF options.!debug == 1 then say time()' _LoadotherFuncs() done'
     
    698705    ok = VRSet("Main","helpFile", settings.!helpfile)
    699706
     707
     708
    700709    CALL NLVSetText 'PB_Refresh',  'Caption', 11
     710    CALL NLVSetText 'PB_Apply',    'Caption', 10
    701711    CALL NLVSetText 'PB_Cancel',   'Caption', 12
    702712    CALL NLVSetText 'PB_Help',     'Caption', 13
     
    745755    address cmd samba.!smbd' -V --debuglevel=0 2>'refresherr' 1>'refreshoutput
    746756
    747     SambaVer = "Samba "||strip(linein(refreshoutput))
     757    do while lines(refreshoutput) > 0
     758        Hdr = linein(refreshoutput)
     759        if pos("Version ",Hdr) > 0 then leave
     760    end
     761
     762    SambaVer = "Samba "||strip(Hdr)
    748763    say '  smbd.exe:  "'SambaVer'"'
    749764    ok = stream(refreshoutput,'c','close')
     
    752767    address cmd samba.!smbstatusexe' smbd 'DebugLevel' 2>'refresherr' 1>'refreshoutput
    753768
    754     /* First line is usually empty */
    755     Hdr      = linein(refreshoutput)
    756     SambaStVer = strip(linein(refreshoutput)) /* we can detect version mismatches here */
     769    do while lines(refreshoutput) > 0
     770        Hdr = linein(refreshoutput)
     771        if pos("Samba version",Hdr) > 0 then leave
     772    end
     773
     774    SambaStVer = strip(Hdr) /* we can detect version mismatches here */
    757775    say '  smbstatus: "'SambaStVer'"'
    758776
     
    12661284return
    12671285
     1286/*:VRX         _SmbConfCreateShadowCopy
     1287*/
     1288_SmbConfCreateShadowCopy:
     1289    if options.!debug == 1 then say time()' _SmbConfCreateShadowCopy started'
     1290    /* we create a complete version of smb.conf in temporary directory for reading purposes */
     1291    /* as we can only determine a default value from this complete version of the file */
     1292    /* however it is not desirable to always have a complete copy normally */
     1293    ok = SysFileDelete(samba.!shadowsmbconf)
     1294    if dataype(log_Level) <> "NUM" then log_level = 2
     1295    say     '  'samba.!testparmexe' -v -s -d='log_level' 1>'samba.!shadowsmbconf' 2>'TempDir'testparm.stderr'
     1296    address cmd samba.!testparmexe' -v -s -d='log_level' 1>'samba.!shadowsmbconf' 2>'TempDir'testparm.stderr'
     1297    if options.!debug == 1 then say time()' _SmbConfCreateShadowCopy done'
     1298return
     1299
    12681300/*:VRX         _TabbedDialogSetup
    12691301*/
     
    13061338    call About_Init
    13071339    ok = VRSet("About","Caption", NLVGetMessage(20))
    1308     ok = VRSet("PB_AboutOK","Caption", NLVGetMessage(2))
    1309     SambaTeam.0 = 9
     1340    ok = VRSet("PB_AboutOK1","Caption", NLVGetMessage(2))
     1341    SambaTeam.0 = 11
    13101342    SambaTeam.1 = 'Silvan Scherrer'
    13111343    SambaTeam.2 = 'Herwig Bauernfeind'
    1312     SambaTeam.3 = 'Vitali Pelenyov'
    1313     SambaTeam.4 = 'Paul Smedley'
    1314     SambaTeam.5 = 'Yuri Dario'
    1315     SambaTeam.6 = 'Alex Taylor'
    1316     SambaTeam.7 = 'Nikolay Kolosov'
    1317     SambaTeam.8 = 'All the Samba people'
    1318     SambaTeam.9 = 'All the netlabs people'
     1344    SambaTeam.3 = 'Dmitrij Kuminov'
     1345    SambaTeam.4 = 'Vitali Pelenyov'
     1346    SambaTeam.5 = 'Paul Smedley'
     1347    SambaTeam.6 = 'Yuri Dario'
     1348    SambaTeam.7 = 'Alex Taylor'
     1349    SambaTeam.8 = 'Nikolay Kolosov'
     1350    SambaTeam.9 = 'All the Samba people'
     1351    SambaTeam.10= 'All the ArcaNoae people'
     1352    SambaTeam.11= 'All the netlabs people'
    13191353    ok = VRSet("About","Font", VRGet("SW_SETTINGS","Font"))
    13201354    ok = VRMethod("LB_SambaTeam","AddStringList", "SambaTeam." )
     
    13591393        otherwise ok = VRSet("IPB_paper","PicturePath","#5;#5")
    13601394    end */
    1361 return
    1362 
    1363 /*:VRX         CB_Debug_Click
    1364 */
    1365 CB_Debug_Click:
    1366     options.!Debug = VRGet("CB_Debug","set")
    1367     if options.!Debug then ok = VRREdirectStdIO("ON")
    1368                       else ok = VRREdirectStdIO("OFF")
    1369 return
    1370 
    1371 /*:VRX         CB_DetectZombies_Click
    1372 */
    1373 CB_DetectZombies_Click:
    1374     DetectZombies = VRGet("CB_DetectZombies","set")
    1375     say 'DetectZombies = "'DetectZombies'"'
    1376 return
    1377 
    1378 /*:VRX         CB_NoMsgBox_Click
    1379 */
    1380 CB_NoMsgBox_Click:
    1381     NoMsgBox = VRGet("CB_NoMsgBox","set")
    1382     say 'NoMsgBox = "'NoMsgBox'"'
    1383 return
    1384 
    1385 /*:VRX         CB_WPSSTARTSTOP_Click
    1386 */
    1387 CB_WPSSTARTSTOP_Click:
    1388     WPSStartStop = VRGet("CB_WPSStartStop","set")
    1389     say 'WPSStartStop = "'WPSStartStop'"'
    13901395return
    13911396
     
    18371842return
    18381843
     1844/*:VRX         EF_log_file_Change
     1845*/
     1846EF_log_file_Change:
     1847    advanced.!smbconfchanged = 1
     1848return
     1849
    18391850/*:VRX         Fini
    18401851*/
     
    19431954
    19441955    /* if main_iheight < 5500 then ok = VRSet("Main","Height",6200) */
    1945     sbar_height  = 209                                          /* Height of status-bar */
     1956    sbar_height  = margin * 8                                          /* Height of status-bar */
    19461957    marginx2     = margin * 2                                   /* Common margin around controls */
     1958    marginx4     = margin * 4
    19471959
    19481960    pbtn_dist    = 980
    1949     pbtn_nr      = 4
     1961    pbtn_nr      = 5
    19501962    pbtn_pos     = max((main_iwidth - pbtn_Dist * pbtn_Nr)%2, 0)+ margin
    19511963    pbtn_height  = 400                                          /* Height of the panels' internal button areas */
     
    19721984    ok = VRSet("DT_STATUSBAR", "Width", pane_width - 24)
    19731985
    1974     ok = VRSet("PB_Refresh","top", pane_height + margin * 4 )
    1975     ok = VRSet("PB_Help",   "top", pane_height + margin * 4 )
    1976     ok = VRSet("PB_Cancel", "top", pane_height + margin * 4 )
    1977     ok = VRSet("PB_About",  "top", pane_height + margin * 4 )
    1978 
    1979     ok = VRSet("PB_Refresh","left",pbtn_pos + pbtn_dist * (pbtn_nr - 4))
    1980     ok = VRSet("PB_Help",   "left",pbtn_pos + pbtn_dist * (pbtn_nr - 3))
    1981     ok = VRSet("PB_About",  "left",pbtn_pos + pbtn_dist * (pbtn_nr - 2))
     1986    ok = VRSet("PB_Refresh","top", pane_height + marginx4 )
     1987    ok = VRSet("PB_Help",   "top", pane_height + marginx4 )
     1988    ok = VRSet("PB_Cancel", "top", pane_height + marginx4 )
     1989    ok = VRSet("PB_Apply",  "top", pane_height + marginx4 )
     1990    ok = VRSet("PB_About",  "top", pane_height + marginx4 )
     1991
     1992    ok = VRSet("PB_Refresh","left",pbtn_pos + pbtn_dist * (pbtn_nr - 5))
     1993    ok = VRSet("PB_Help",   "left",pbtn_pos + pbtn_dist * (pbtn_nr - 4))
     1994    ok = VRSet("PB_About",  "left",pbtn_pos + pbtn_dist * (pbtn_nr - 3))
     1995    ok = VRSet("PB_Apply",  "left",pbtn_pos + pbtn_dist * (pbtn_nr - 2))
    19821996    ok = VRSet("PB_Cancel", "left",pbtn_pos + pbtn_dist * (pbtn_nr - 1))
    19831997
     
    20542068    ok = VRset("GB_SETTINGS","Left",   marginx2)
    20552069    ok = VRset("GB_SETTINGS","Width",  pane_width - 760)
    2056     ok = VRset("GB_SETTINGS","Height", pane_height- 1020)
     2070    ok = VRset("GB_SETTINGS","Height", pane_height- 1020- marginx2)
    20572071
    20582072
     
    21442158return
    21452159
     2160/*:VRX         PB_AboutOK1_Click
     2161*/
     2162PB_AboutOK1_Click:
     2163    call About_Close
     2164return
     2165
    21462166/*:VRX         PB_AboutOK_Click
    21472167*/
    21482168PB_AboutOK_Click:
    21492169    call About_Close
     2170return
     2171
     2172/*:VRX         PB_Apply_Click
     2173*/
     2174PB_Apply_Click:
     2175    IF options.!debug == 1 then say time()' PB_Apply_Click() started'
     2176    options.!Debug = VRGet("CB_Debug","set")
     2177    if options.!Debug then ok = VRREdirectStdIO("ON")
     2178                      else ok = VRREdirectStdIO("OFF")
     2179    Intervall = VRGet("SPIN_Intervall","Value")
     2180    ok = VRSet("TM_Refresh","Delay", Intervall * 1000)
     2181    IntervallMin = VRGet("SPIN_IntervallMin","Value")
     2182
     2183    NoMsgBox = VRGet("CB_NoMsgBox","set")
     2184    say 'NoMsgBox = "'NoMsgBox'"'
     2185
     2186    WPSStartStop = VRGet("CB_WPSStartStop","set")
     2187    say 'WPSStartStop = "'WPSStartStop'"'
     2188
     2189    DetectZombies = VRGet("CB_DetectZombies","set")
     2190    say 'DetectZombies = "'DetectZombies'"'
     2191
     2192    if advanced.!smbconfchanged = 1 then do
     2193        log_level    = VRGet("SPIN_log_level","Value")
     2194        log_file     = VRGet("EF_log_file","Value")
     2195        max_protocol = VRGet("SPIN_max_protocol","Value")
     2196
     2197        handle = IniOpen('global', samba.!smbconf)
     2198
     2199        ok = IniSet('log level',    log_level,    handle)
     2200        ok = IniSet('log file',     log_file,     handle)
     2201        ok = IniSet('max protocol', max_protocol, handle)
     2202
     2203        ok = IniSave(handle)
     2204        ok = IniClose(handle)
     2205        advanced.!smbconfchanged = 0
     2206    end
     2207    IF options.!debug == 1 then say time()' PB_Apply_Click() done'
    21502208return
    21512209
     
    23682426*/
    23692427SPIN_Intervall_Change:
    2370     Intervall = VRGet("SPIN_Intervall","Value")
    2371     ok = VRSet("TM_Refresh","Delay", Intervall * 1000)
    23722428return
    23732429
     
    23752431*/
    23762432SPIN_IntervallMin_Change:
    2377     IntervallMin = VRGet("SPIN_IntervallMin","Value")
     2433return
     2434
     2435/*:VRX         SPIN_log_level_Change
     2436*/
     2437SPIN_log_level_Change:
     2438    advanced.!smbconfchanged = 1
     2439return
     2440
     2441/*:VRX         SPIN_max_protocol_Change
     2442*/
     2443SPIN_max_protocol_Change:
     2444    advanced.!smbconfchanged = 1
    23782445return
    23792446
     
    25312598    end
    25322599    drop window
     2600return
     2601
     2602/*:VRX         SW_SETTINGS_Init_Content
     2603*/
     2604SW_SETTINGS_Init_Content:
     2605   
     2606    log_level    = IniGet('log level',    'global', samba.!smbconf)
     2607    log_file     = IniGet('log file',     'global', samba.!smbconf)
     2608    max_protocol = IniGet('max_protocol', 'global', samba.!smbconf)
     2609
     2610    if log_level = "" then log_level = 2
     2611    if max_protocol = "" then max_protocol = "NT1"
     2612
     2613    ok = VRSet("SPIN_LOG_LEVEL","Value",log_level)
     2614    ok = VRSet("EF_LOG_FILE","Value",log_file)
    25332615return
    25342616
     
    26672749    select
    26682750        when page = 1 then do /* daemons */
     2751            ok = VRSet("Main","WindowIcon","$46")
    26692752            ok = VRSet("TM_RefreshDaemons","Enabled", 1)
    26702753            ok = VRSet("TM_RefreshDaemons","Delay",   3000)
    26712754        end
    26722755        when page = 2 then do /* smbtree */
     2756            ok = VRSet("Main","WindowIcon","$1")
    26732757            ok = VRMethod( "CN_SMBTree", "GetRecordList", "All", "handle." )
    26742758            /* if the page is empty, populate it */
     
    26762760        end
    26772761        when page = 3 then do /* Users */
    2678             nop
     2762            ok = VRSet("Main","WindowIcon","$44")
    26792763        end
    26802764        when page = 4 then do /* files */
    2681             nop
     2765            ok = VRSet("Main","WindowIcon","$1")
    26822766        end
    26832767        when page = 5 then do /* service */
    2684             nop
     2768            ok = VRSet("Main","WindowIcon","$52")
    26852769        end
    26862770        when page = 6 then do /* chkTDB */
     2771            ok = VRSet("Main","WindowIcon","$53")
    26872772            say "ChkTDB"
    26882773            call _ChkTDB
    26892774        end
    26902775        when page = 7 then do /* Settings */
    2691             nop
     2776            ok = VRSet("Main","WindowIcon","$53")
     2777            call SW_SETTINGS_Init_Content
    26922778        end
    26932779        otherwise nop
Note: See TracChangeset for help on using the changeset viewer.