Changeset 562


Ignore:
Timestamp:
Feb 24, 2011, 8:31:39 AM (14 years ago)
Author:
Herwig Bauernfeind
Message:

GUI-Tools: SMBMON 2.1 NLV, INI

Location:
branches/guitools-2.0/smbmon-2.1
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/guitools-2.0/smbmon-2.1/smbmon.VRP

    r561 r562  
    88VRXWindow: __VREMainWindow,1,2180,3710,903,8010
    99VRXWindow: __VRESectionListWindow,1,3589,11708,7938,3342
    10 VRXWindow: __VREToolsWindow,1,3211,9877,6480,1661
     10VRXWindow: __VREToolsWindow,1,3211,9877,6486,1665
    1111VRXWindow: __VREWindListWindow,1,927,11708,2650,3324
    1212UserFile: 1
  • branches/guitools-2.0/smbmon-2.1/smbmon.VRX

    r561 r562  
    9393#append U:\Develop\Samba\guitools-2.0\shared\nlv.vrs
    9494#append U:\Develop\Samba\guitools-2.0\shared\inittempdir.vrs
     95#append U:\Develop\Samba\guitools-1.0\shared\sambainit.vrs
    9596*/
    9697return
     
    9899*/
    99100_ContainerInit:
    100     say '_ContainerInit() started.'
     101    if options.!debug == 1 THEN SAY time()' _ContainerInit() started.'
    101102
    102103    /* User */
     
    166167    ok = VRMethod("CN_Daemons","SetRecordAttr","All", "Collapsed", 0 )
    167168
    168     say '_ContainerInit() done.'
     169    if options.!debug == 1 THEN SAY time()' _ContainerInit() done.'
    169170return
    170171
     
    172173*/
    173174_GUIInit:
    174     FirstRun = 1
     175
     176
    175177    if datatype(Top) = 'NUM' then do
    176178        ok = VRset("Main","Top",Top)
     
    179181        ok = VRset("Main","Height",Height)
    180182    end
     183
     184    /* Initialize Notebook pages */
     185
     186    wh.1 = VRLoad( "TDL_1", VRWindowPath(), "SW_1" ) /* Users */
     187    ok = VRMethod( "TDL_1", "InsertPage", wh.1, "+"NLVGetMessage(15) )
     188
     189    wh.2 = VRLoad( "TDL_1", VRWindowPath(), "SW_2" ) /* Files */
     190    ok = VRMethod( "TDL_1", "InsertPage", wh.2, "+"NLVGetMessage(16) )
     191
     192    wh.3 = VRLoad( "TDL_1", VRWindowPath(), "SW_3" ) /* Service */
     193    ok = VRMethod( "TDL_1", "InsertPage", wh.3, "+"NLVGetMessage(17) )
     194
     195    wh.4 = VRLoad( "TDL_1", VRWindowPath(), "SW_4" ) /* Daemons */
     196    ok = VRMethod( "TDL_1", "InsertPage", wh.4, "+"NLVGetMessage(18) )
     197
     198    wh.5 = VRLoad( "TDL_1", VRWindowPath(), "SW_5" ) /* Browse */
     199    ok = VRMethod( "TDL_1", "InsertPage", wh.5, "+"NLVGetMessage(19) )
     200
     201    wh.6 = VRLoad( "TDL_1", VRWindowPath(), "SW_6" ) /* Settings */
     202    ok = VRMethod( "TDL_1", "InsertPage", wh.6, "+"NLVGetMessage(24) )
     203
     204    call _ContainerInit
     205
     206    ok = VRSet("CB_Debug","set",options.!Debug)
     207    if options.!Debug then ok = VRREdirectStdIO("ON")
     208                      else ok = VRREdirectStdIO("OFF")
     209    ok = VRSet("SPIN_Intervall",   "Value", settings.!intervall)
     210    ok = VRSet("SPIN_IntervallMin","Value", settings.!intervallMin)
     211    ok = VRSet("TM_Refresh","Delay", settings.!intervall * 1000)
     212
     213    ok = VRSet("CB_NoMsgBox","Set", settings.!NoMsgBox)
     214
     215/*  CALL NLVSetText 'SW_1',       'Userdata', 15
     216    CALL NLVSetText 'SW_2',       'Userdata', 16
     217    CALL NLVSetText 'SW_3',       'Userdata', 17
     218    CALL NLVSetText 'SW_4',       'Userdata', 18
     219    CALL NLVSetText 'SW_5',       'Userdata', 19
     220    CALL NLVSetText 'SW_6',       'Userdata', 24 */
     221
     222    CALL NLVSetText 'SW_1',       'Hinttext', 55
     223    CALL NLVSetText 'SW_2',       'Hinttext', 56
     224    CALL NLVSetText 'SW_3',       'Hinttext', 57
     225    CALL NLVSetText 'SW_4',       'Hinttext', 58
     226    CALL NLVSetText 'SW_5',       'Hinttext', 59
     227    CALL NLVSetText 'SW_6',       'Hinttext', 60
     228
     229    CALL NLVSetText 'DT_Refresh',     'Caption',  25
     230    CALL NLVSetText 'DT_RefreshMin',  'Caption',  25
     231    CALL NLVSetText 'DT_Intervall',   'Caption',  26
     232    ok = VRSet("DT_IntervallMin","Caption", NLVGetMessage(26)' 'NLVGetMessage(28))
     233    CALL NLVSetText 'CB_NoMsgBox',    'Caption',  27
    181234return
    182235
     
    196249    Width = VRGetIni( "Pos", "Width",  OurINI , 'NoClose')
    197250    Height= VRGetIni( "Pos", "Height", OurINI , 'NoClose')
     251
     252    settings.!intervall = VRGetIni( "Settings", "Intervall", OurINI)
     253    if settings.!intervall = "" then settings.!intervall = 60
     254
     255    settings.!intervallMin = VRGetIni( "Settings", "IntervallMin", OurINI)
     256    if settings.!intervallMin = "" then settings.!intervallMin = 180
     257
     258    settings.!NoMsgBox = VRGetIni( "Settings", "NoMsgBox", OurINI)
     259    if settings.!NoMsgBox = "" then settings.!NoMsgBox = 0
     260
     261    options.!debug = VRGetIni( "Options", "Debug", OurINI)
     262    if options.!debug = "" then options.!debug = 0
    198263
    199264    if options.!debug == 1 THEN SAY time()' _INIRead() done'
     
    208273    ok = VRSetIni( "Pos", "Width",        VRGet("Main","Width"),       OurINI, 'NoClose' )   
    209274    ok = VRSetIni( "Pos", "Height",       VRGet("Main","Height"),      OurINI, 'NoClose' )
     275
     276    ok = VRSetIni( "Settings", "Intervall",    settings.!intervall,    OurINI, 'NoClose' )
     277    ok = VRSetIni( "Settings", "IntervallMin", settings.!intervallmin, OurINI, 'NoClose' )
     278    ok = VRSetIni( "Settings", "NoMsgBox",     settings.!NoMsgBox,     OurINI, 'NoClose' )
     279    ok = VRSetIni( "Options",  "Debug",        options.!debug,         OurINI, 'NoClose' )     
     280
     281/*  ok = VRSetIni( "Settings", "BigIcons",     \VRGet("CN_SMBTREE", "MiniIcons"),OurINI,'NoClose')
     282    ok = VRSetIni( "Settings", "CurrentPageNr",CurrentPageNr,              OurINI,'NoClose')
     283    ok = VRSetIni( "Settings", "DaemonView",   VRGet("CN_Daemons","View"), OurINI,'NoClose')
     284    ok = VRSetIni( "Settings", "TreeView",     VRGet("CN_smbtree","View"), OurINI,'NoClose') */
     285
    210286    if options.!debug == 1 THEN SAY time()' _INIWrite() done'
     287return
     288
     289/*:VRX         _LoadOtherFuncs
     290*/
     291_LoadOtherFuncs:
     292    if options.!debug == 1 then ok = VRRedirectStdIO("ON")
     293                           else ok = VRRedirectStdIO("OFF")
     294
     295    call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
     296    call SysLoadFuncs
     297
     298    call RxFuncAdd 'PRLoadFuncs',  'PR1UTIL', 'PRLoadFuncs'
     299    call PRLoadFuncs
     300return
     301
     302/*:VRX         _NLVSetup
     303*/
     304_NLVSetup:
     305    if options.!debug == 1 THEN SAY time()' _NLVSetup() started'
     306    call NLVSetup
     307    Msg.Title = NLVGetMessage(1)
     308    ok = VRSet("Main","helpFile", settings.!helpfile)
     309
     310    CALL NLVSetText 'PB_Refresh',  'Caption', 11
     311    CALL NLVSetText 'PB_Cancel',   'Caption', 12
     312    CALL NLVSetText 'PB_Help',     'Caption', 13
     313    CALL NLVSetText 'PB_About',    'Caption', 14
     314
     315    CALL NLVSetText 'PB_Refresh',  'Hinttext', 51
     316    CALL NLVSetText 'PB_Cancel',   'Hinttext', 54
     317    CALL NLVSetText 'PB_Help',     'Hinttext', 52
     318    CALL NLVSetText 'PB_About',    'Hinttext', 53
     319
     320
     321/*  CALL NLVSetText 'ContextMenu_Daemons_Sort',   'Caption', 35
     322    CALL NLVSetText 'ContextMenu_Daemons_Ping',   'Caption', 32
     323    CALL NLVSetText 'ContextMenu_Daemons_Details','Caption', 118
     324    CALL NLVSetText 'ContextMenu_Daemons_Tree',   'Caption', 120
     325
     326    CALL NLVSetText 'ContextMenu_Files_Sort',     'Caption', 35
     327
     328    CALL NLVSetText 'ContextMenu_Service_Sort',   'Caption', 35
     329    CALL NLVSetText 'ContextMenu_Service_CloseSHare', 'Caption', 70
     330
     331    CALL NLVSetText 'ContextMenu_Users_SendMsg', 'Caption', 80
     332    CALL NLVSetText 'ContextMenu_Users_Sort',    'Caption', 35   
     333
     334    CALL NLVSetText 'ContextMenu_Tree_SendMsg',  'Caption', 80
     335    CALL NLVSetText 'ContextMenu_Tree_Sort',     'Caption', 35   
     336    CALL NLVSetText 'ContextMenu_Tree_Tree',     'Caption', 120
     337    CALL NLVSetText 'ContextMenu_Tree_Details',  'Caption', 118 */
     338    if options.!debug == 1 THEN SAY time()' _NLVSetup() done'
     339return
     340
     341/*:VRX         _SambaFindPIDFile
     342*/
     343_SambaFindPIDFile:
     344    if options.!debug == 1 THEN SAY time()' _SambaFindPIDfile() started'
     345    ok = SysFileTree(ETC'\samba\pid\nmbd*pid',nmbdpid.,'FO')
     346    if nmbdpid.0 = 1 then nmbdpidfile = nmbdpid.1; else nmbdpidfile = ""
     347    if options.!debug == 1 THEN SAY "  nmbdpidfile = "nmbdpidfile
     348    if options.!debug == 1 THEN SAY time()' _SambaFindPIDfile() done'
     349return
     350
     351/*:VRX         CB_Debug_Click
     352*/
     353CB_Debug_Click:
     354    options.!debug = VRGet("CB_Debug","Set")
     355    if options.!Debug then ok = VRREdirectStdIO("ON")
     356                      else ok = VRREdirectStdIO("OFF")
     357return
     358
     359/*:VRX         CB_NoMsgBox_Click
     360*/
     361CB_NoMsgBox_Click:
     362    settings.!NoMsgBox = VRGet("CB_NoMsgBox","Set")
    211363return
    212364
     
    244396*/
    245397Main_Create:
     398    options.!debug = 1
     399
     400    call _LoadOtherFuncs
     401    call _InitTempDir
     402    call _SambaInit
     403    if _SambaRunning() then call _SambaFindPIDfile
    246404    call _INIRead
    247     call NLVSetup
     405    call _NLVSetup
    248406    call _GUIInit
     407
     408    ok = VRMethod("PB_Refresh","SetFocus")
    249409return
    250410
     
    265425
    266426    ok = VRSet("PB_Refresh","Top", iHeight - ButtonVDist)
    267     ok = VRSet("PB_Quit",   "Top", iHeight - ButtonVDist)
    268427    ok = VRSet("PB_About",  "Top", iHeight - ButtonVDist)
    269428    ok = VRSet("PB_Help",   "Top", iHeight - ButtonVDist)
     429    ok = VRSet("PB_Cancel", "Top", iHeight - ButtonVDist)
    270430
    271431    ok = VRSEt("PB_Refresh","Left",ButtonHPos+ButtonHDist*(ButtonNr-4))
    272     ok = VRSEt("PB_Quit",   "Left",ButtonHPos+ButtonHDist*(ButtonNr-3))
    273     ok = VRSEt("PB_About",  "Left",ButtonHPos+ButtonHDist*(ButtonNr-2))
    274     ok = VRSEt("PB_Help",  "Left",ButtonHPos+ButtonHDist*(ButtonNr-1))
     432    ok = VRSEt("PB_About",  "Left",ButtonHPos+ButtonHDist*(ButtonNr-3))
     433    ok = VRSEt("PB_Help",   "Left",ButtonHPos+ButtonHDist*(ButtonNr-2))
     434    ok = VRSEt("PB_Cancel", "Left",ButtonHPos+ButtonHDist*(ButtonNr-1))
    275435
    276436    cLeft   = 120
     
    317477return
    318478
    319 /*:VRX         PB_Quit_Click
    320 */
    321 PB_Quit_Click:
     479/*:VRX         PB_Cancel_Click
     480*/
     481PB_Cancel_Click:
    322482    call Quit
    323483return
     
    330490    call VRSet window, "Shutdown", 1
    331491    drop window
     492return
     493
     494/*:VRX         SPIN_Intervall_Change
     495*/
     496SPIN_Intervall_Change:
     497    settings.!intervall = VRget("SPIN_Intervall","Value")
     498    ok = VRSet("TM_Refresh","Delay", settings.!intervall * 1000)
     499return
     500
     501/*:VRX         SPIN_IntervallMin_Change
     502*/
     503SPIN_IntervallMin_Change:
     504    settings.!intervallmin = VRget("SPIN_IntervallMin","Value")
    332505return
    333506
     
    518691return
    519692
    520 /*:VRX         TDL_1_PageSelected
    521 */
    522 TDL_1_PageSelected:
    523     if FirstRun = 1 then do
    524         ok = VRSet("TDL_1","Painting", 0)
    525         call _ContainerInit
    526         FirstRun = 0
    527         ok = VRSet("TDL_1","Painting", 1)
    528     end
    529 return
    530 
Note: See TracChangeset for help on using the changeset viewer.