| 1 | /*:VRX Main
|
|---|
| 2 | */
|
|---|
| 3 | /* Main
|
|---|
| 4 | */
|
|---|
| 5 | Main:
|
|---|
| 6 | /* Process the arguments.
|
|---|
| 7 | Get the parent window.
|
|---|
| 8 | */
|
|---|
| 9 | parse source . calledAs .
|
|---|
| 10 | parent = ""
|
|---|
| 11 | argCount = arg()
|
|---|
| 12 | argOff = 0
|
|---|
| 13 | if( calledAs \= "COMMAND" )then do
|
|---|
| 14 | if argCount >= 1 then do
|
|---|
| 15 | parent = arg(1)
|
|---|
| 16 | argCount = argCount - 1
|
|---|
| 17 | argOff = 1
|
|---|
| 18 | end
|
|---|
| 19 | end; else do
|
|---|
| 20 | call VROptions 'ImplicitNames'
|
|---|
| 21 | call VROptions 'NoEchoQuit'
|
|---|
| 22 | end
|
|---|
| 23 | InitArgs.0 = argCount
|
|---|
| 24 | if( argCount > 0 )then do i = 1 to argCount
|
|---|
| 25 | InitArgs.i = arg( i + argOff )
|
|---|
| 26 | end
|
|---|
| 27 | drop calledAs argCount argOff
|
|---|
| 28 |
|
|---|
| 29 | /* Load the windows
|
|---|
| 30 | */
|
|---|
| 31 | call VRInit
|
|---|
| 32 | parse source . . spec
|
|---|
| 33 | _VREPrimaryWindowPath = ,
|
|---|
| 34 | VRParseFileName( spec, "dpn" ) || ".VRW"
|
|---|
| 35 | _VREPrimaryWindow = ,
|
|---|
| 36 | VRLoad( parent, _VREPrimaryWindowPath )
|
|---|
| 37 | drop parent spec
|
|---|
| 38 | if( _VREPrimaryWindow == "" )then do
|
|---|
| 39 | call VRMessage "", "Cannot load window:" VRError(), ,
|
|---|
| 40 | "Error!"
|
|---|
| 41 | _VREReturnValue = 32000
|
|---|
| 42 | signal _VRELeaveMain
|
|---|
| 43 | end
|
|---|
| 44 |
|
|---|
| 45 | /* Process events
|
|---|
| 46 | */
|
|---|
| 47 | call Init
|
|---|
| 48 | signal on halt
|
|---|
| 49 | do while( \ VRGet( _VREPrimaryWindow, "Shutdown" ) )
|
|---|
| 50 | _VREEvent = VREvent()
|
|---|
| 51 | interpret _VREEvent
|
|---|
| 52 | end
|
|---|
| 53 | _VREHalt:
|
|---|
| 54 | _VREReturnValue = Fini()
|
|---|
| 55 | call VRDestroy _VREPrimaryWindow
|
|---|
| 56 | _VRELeaveMain:
|
|---|
| 57 | call VRFini
|
|---|
| 58 | exit _VREReturnValue
|
|---|
| 59 |
|
|---|
| 60 | VRLoadSecondary:
|
|---|
| 61 | __vrlsWait = abbrev( 'WAIT', translate(arg(2)), 1 )
|
|---|
| 62 | if __vrlsWait then do
|
|---|
| 63 | call VRFlush
|
|---|
| 64 | end
|
|---|
| 65 | __vrlsHWnd = VRLoad( VRWindow(), VRWindowPath(), arg(1) )
|
|---|
| 66 | if __vrlsHWnd = '' then signal __vrlsDone
|
|---|
| 67 | if __vrlsWait \= 1 then signal __vrlsDone
|
|---|
| 68 | call VRSet __vrlsHWnd, 'WindowMode', 'Modal'
|
|---|
| 69 | __vrlsTmp = __vrlsWindows.0
|
|---|
| 70 | if( DataType(__vrlsTmp) \= 'NUM' ) then do
|
|---|
| 71 | __vrlsTmp = 1
|
|---|
| 72 | end
|
|---|
| 73 | else do
|
|---|
| 74 | __vrlsTmp = __vrlsTmp + 1
|
|---|
| 75 | end
|
|---|
| 76 | __vrlsWindows.__vrlsTmp = VRWindow( __vrlsHWnd )
|
|---|
| 77 | __vrlsWindows.0 = __vrlsTmp
|
|---|
| 78 | do while( VRIsValidObject( VRWindow() ) = 1 )
|
|---|
| 79 | __vrlsEvent = VREvent()
|
|---|
| 80 | interpret __vrlsEvent
|
|---|
| 81 | end
|
|---|
| 82 | __vrlsTmp = __vrlsWindows.0
|
|---|
| 83 | __vrlsWindows.0 = __vrlsTmp - 1
|
|---|
| 84 | call VRWindow __vrlsWindows.__vrlsTmp
|
|---|
| 85 | __vrlsHWnd = ''
|
|---|
| 86 | __vrlsDone:
|
|---|
| 87 | return __vrlsHWnd
|
|---|
| 88 |
|
|---|
| 89 | /*:VRX __VXREXX____APPENDS__
|
|---|
| 90 | */
|
|---|
| 91 | __VXREXX____APPENDS__:
|
|---|
| 92 | /*
|
|---|
| 93 | #append U:\Develop\Samba\guitools-1.0\shared\InitTempDir.VRS
|
|---|
| 94 | #append U:\Develop\Samba\guitools-1.0\shared\SambaInit.vrs
|
|---|
| 95 | #append U:\Develop\Samba\guitools-1.0\shared\nlv.vrs
|
|---|
| 96 | */
|
|---|
| 97 | return
|
|---|
| 98 | /*:VRX _ColumnShow
|
|---|
| 99 | */
|
|---|
| 100 | _ColumnShow:
|
|---|
| 101 | userdata = VRGet(VRInfo("Object"),"Userdata")
|
|---|
| 102 | parse var userdata Container '|' fieldh '|' VisStatus
|
|---|
| 103 | say userdata
|
|---|
| 104 | ok = VRMethod(Container,"SetFieldAttr", fieldh, "Visible", \VisStatus )
|
|---|
| 105 | return
|
|---|
| 106 |
|
|---|
| 107 | /*:VRX _ColumnsMenu
|
|---|
| 108 | */
|
|---|
| 109 | _ColumnsMenu:
|
|---|
| 110 | Container = arg(1)
|
|---|
| 111 | ok = VRMethod(Container, "GetFieldList", "Fields." )
|
|---|
| 112 |
|
|---|
| 113 | do I = 1 to 12
|
|---|
| 114 | if I <= fields.0 then do
|
|---|
| 115 | /* say "Columns_"||right("0"||I,2)' 'VRMethod(Container, "GetFieldAttr", fields.I, "Title" ) */
|
|---|
| 116 | ok = VRset("Columns_"||right("0"||I,2), "Visible", 1)
|
|---|
| 117 | ok = VRset("Columns_"||right("0"||I,2), "Caption", VRMethod(Container, "GetFieldAttr", fields.I, "Title" ))
|
|---|
| 118 | ok = VRset("Columns_"||right("0"||I,2), "Checked", VRMethod(Container, "GetFieldAttr", fields.I, "Visible" ))
|
|---|
| 119 | ok = VRset("Columns_"||right("0"||I,2), "Userdata", Container'|'fields.I'|'VRMethod(Container, "GetFieldAttr", fields.I, "Visible" ))
|
|---|
| 120 | end
|
|---|
| 121 | else ok = VRset("Columns_"||right("0"||I,2), "Visible", 0)
|
|---|
| 122 | end
|
|---|
| 123 | ok = VRMethod( "Columns", "Popup", , , "", "" )
|
|---|
| 124 | return
|
|---|
| 125 |
|
|---|
| 126 | /*:VRX _ContainerInit
|
|---|
| 127 | */
|
|---|
| 128 | _ContainerInit:
|
|---|
| 129 | say '_ContainerInit() started.'
|
|---|
| 130 |
|
|---|
| 131 | /* User */
|
|---|
| 132 | UIconH = VRMethod( "CN_Users", "AddField", "Icon", NLVGetMessage(148) )
|
|---|
| 133 | UsernameFH = VRMethod( "CN_Users", "AddField", "String", NLVGetMessage(131) )
|
|---|
| 134 | GroupFH = VRMethod( "CN_Users", "AddField", "String", NLVGetMessage(132) )
|
|---|
| 135 | UMachineFH = VRMethod( "CN_Users", "AddField", "String", NLVGetMessage(133) )
|
|---|
| 136 | UIPAdrFH = VRMethod( "CN_Users", "AddField", "String", NLVGetMessage(147) )
|
|---|
| 137 | UPIDFH = VRMethod( "CN_Users", "AddField", "String", NLVGetMessage(130) )
|
|---|
| 138 |
|
|---|
| 139 | /* Files */
|
|---|
| 140 | FIconH = VRMethod( "CN_Files", "AddField", "Icon", NLVGetMessage(148) )
|
|---|
| 141 | FileFH = VRMethod( "CN_Files", "AddField", "String", NLVGetMessage(134) )
|
|---|
| 142 | FUserFH = VRMethod( "CN_Files", "AddField", "String", NLVGetMessage(131) )
|
|---|
| 143 | FPIDFH = VRMethod( "CN_Files", "AddField", "String", NLVGetMessage(130) )
|
|---|
| 144 | DenyModeFH = VRMethod( "CN_Files", "AddField", "String", NLVGetMessage(135) )
|
|---|
| 145 | TimeFH = VRMethod( "CN_Files", "AddField", "String", NLVGetMessage(136) )
|
|---|
| 146 | DateFH = VRMethod( "CN_Files", "AddField", "String", NLVGetMessage(149) )
|
|---|
| 147 | AccessFH = VRMethod( "CN_Files", "AddField", "String", NLVGetMessage(137) )
|
|---|
| 148 | RWFH = VRMethod( "CN_Files", "AddField", "String", NLVGetMessage(138) )
|
|---|
| 149 | OplockFH = VRMethod( "CN_Files", "AddField", "String", NLVGetMessage(139) )
|
|---|
| 150 | UIDFH = VRMethod( "CN_Files", "AddField", "String", NLVGetMessage(140) )
|
|---|
| 151 | SharePathFH= VRMethod( "CN_Files", "AddField", "String", NLVGetMessage(141) )
|
|---|
| 152 | NameFH = VRMethod( "CN_Files", "AddField", "String", NLVGetMessage(142) )
|
|---|
| 153 |
|
|---|
| 154 | /* service */
|
|---|
| 155 | SIconH = VRMethod( "CN_Service", "AddField", "Icon", NLVGetMessage(148) )
|
|---|
| 156 | SPIDFH = VRMethod( "CN_Service", "AddField", "String", NLVGetMessage(130) )
|
|---|
| 157 | ServiceFH = VRMethod( "CN_Service", "AddField", "String", NLVGetMessage(143) )
|
|---|
| 158 | SMachineFH = VRMethod( "CN_Service", "AddField", "String", NLVGetMessage(133) )
|
|---|
| 159 | ConnectedFH= VRMethod( "CN_Service", "AddField", "String", NLVGetMessage(144) )
|
|---|
| 160 |
|
|---|
| 161 | /* daemons */
|
|---|
| 162 | DaemonFH = VRMethod( "CN_Daemons", "AddField", "String", NLVGetMessage(145) )
|
|---|
| 163 | DStatusFH = VRMethod( "CN_Daemons", "AddField", "String", NLVGetMessage(146) )
|
|---|
| 164 | DPidsFH = VRMethod( "CN_Daemons", "AddField", "String", NLVGetMessage(130) )
|
|---|
| 165 |
|
|---|
| 166 | /* add records for the 3 daemons */
|
|---|
| 167 | smbdHandle = VRMethod("CN_Daemons", "Addrecord",, ,"smbd.exe","$41")
|
|---|
| 168 | ok = VRMethod("CN_Daemons", "SetFieldData", smbdHandle, DaemonFH, "smbd.exe")
|
|---|
| 169 | nmbdHandle = VRMethod("CN_Daemons", "Addrecord", ,,"nmbd.exe","$41")
|
|---|
| 170 | ok = VRMethod("CN_Daemons", "SetFieldData", nmbdHandle, DaemonFH, "nmbd.exe")
|
|---|
| 171 | winbHandle = VRMethod("CN_Daemons", "Addrecord",, ,"winbindd.exe","$41")
|
|---|
| 172 | ok = VRMethod("CN_Daemons", "SetFieldData", winbHandle, DaemonFH, "winbindd.exe")
|
|---|
| 173 | ok = (stream(samba.!bin'\winbindd.exe','c','query exists') <> "")
|
|---|
| 174 | ok = VRMethod("CN_Daemons", "SetRecordAttr", winbHandle, "Visible", ok)
|
|---|
| 175 |
|
|---|
| 176 | ok = VRMethod("CN_Daemons","SetRecordAttr","All", "Collapsed", 0 )
|
|---|
| 177 |
|
|---|
| 178 | say '_ContainerInit() done.'
|
|---|
| 179 | return
|
|---|
| 180 | /*:VRX _GuessIcon
|
|---|
| 181 | */
|
|---|
| 182 | _GuessIcon: procedure
|
|---|
| 183 | text = arg(1)
|
|---|
| 184 | select /* Printer guessing */
|
|---|
| 185 | when pos('LJ',text) > 0 then res = '#65:PMWP.DLL'
|
|---|
| 186 | when pos('LASER',text) > 0 then res = '#65:PMWP.DLL'
|
|---|
| 187 | when pos('EPSON',text) > 0 then res = '#65:PMWP.DLL'
|
|---|
| 188 | when pos('PRINT',text) > 0 then res = '#65:PMWP.DLL'
|
|---|
| 189 | when pos('PRT',text) > 0 then res = '#65:PMWP.DLL'
|
|---|
| 190 | when pos('CANON',text) > 0 then res = '#65:PMWP.DLL'
|
|---|
| 191 | when pos('MINOLTA',text) > 0 then res = '#65:PMWP.DLL'
|
|---|
| 192 | when pos('FAX',text) > 0 then res = '#65:PMWP.DLL'
|
|---|
| 193 | when pos('LEXMARK',text) > 0 then res = '#65:PMWP.DLL'
|
|---|
| 194 | when pos('IPC$',text) > 0 then res = '#59:PMWP.DLL'
|
|---|
| 195 | otherwise res = "#34:PMWP.DLL"
|
|---|
| 196 | end
|
|---|
| 197 | return res
|
|---|
| 198 |
|
|---|
| 199 | /*:VRX _GUIInit
|
|---|
| 200 | */
|
|---|
| 201 | _GUIInit:
|
|---|
| 202 | say '_GUIInit() started'
|
|---|
| 203 |
|
|---|
| 204 | call Paper_Init
|
|---|
| 205 |
|
|---|
| 206 | if datatype(Top) = 'NUM' then do
|
|---|
| 207 | ok = VRset("Main","Top",Top)
|
|---|
| 208 | ok = VRset("Main","Left",Left)
|
|---|
| 209 | ok = VRset("Main","Width",Width)
|
|---|
| 210 | ok = VRset("Main","Height",Height)
|
|---|
| 211 | end
|
|---|
| 212 | ok = VRSet("Main","Font", Font_Main)
|
|---|
| 213 | ok = VRSet("Main","Statusfont", Font_Status)
|
|---|
| 214 | ok = VRSet("Page_1","Font", Font_Page_1)
|
|---|
| 215 | ok = VRSet("Page_2","Font", Font_Page_2)
|
|---|
| 216 | ok = VRSet("Page_3","Font", Font_Page_3)
|
|---|
| 217 | ok = VRSet("Page_4","Font", Font_Page_4)
|
|---|
| 218 | ok = VRSet("Page_5","Font", Font_Page_5)
|
|---|
| 219 | ok = VRSet("Page_6","Font", Font_Page_6)
|
|---|
| 220 | Buttonwidth = VRMethod( "Screen", "PixelsToTwips", 32 )
|
|---|
| 221 |
|
|---|
| 222 | ok = VRSet("SPIN_Intervall", "Value", Intervall)
|
|---|
| 223 | ok = VRSet("SPIN_IntervallMin","Value", IntervallMin)
|
|---|
| 224 | ok = VRSet("TM_Refresh","Delay", Intervall * 1000)
|
|---|
| 225 |
|
|---|
| 226 | ok = VRSet("IPB_Start", "Enabled", VRFileExists(samba.!smbcmd))
|
|---|
| 227 | ok = VRSet("IPB_Stop", "Enabled", VRFileExists(samba.!smbcmd))
|
|---|
| 228 | ok = VRSet("IPB_Restart","Enabled", VRFileExists(samba.!smbcmd))
|
|---|
| 229 | ok = VRSet("IPB_Reload", "Enabled", VRFileExists(samba.!smbcmd))
|
|---|
| 230 |
|
|---|
| 231 | ok = VRSet("CN_Daemons", "View", DaemonView)
|
|---|
| 232 | ok = VRSet("CB_NoMsgBox","Set", NoMsgBox)
|
|---|
| 233 |
|
|---|
| 234 | call _INILayoutRead "CN_Users"
|
|---|
| 235 | call _INILayoutRead "CN_Files"
|
|---|
| 236 | call _INILayoutRead "CN_Service"
|
|---|
| 237 | call _INILayoutRead "CN_Daemons"
|
|---|
| 238 |
|
|---|
| 239 | call Main_Resize
|
|---|
| 240 |
|
|---|
| 241 | ok = VRSet("Main", "Visible", 1)
|
|---|
| 242 | say '_GUIInit() done'
|
|---|
| 243 | return
|
|---|
| 244 |
|
|---|
| 245 | /*:VRX _INILayoutRead
|
|---|
| 246 | */
|
|---|
| 247 | _INILayoutRead:
|
|---|
| 248 | Container = arg(1)
|
|---|
| 249 | ok = VRMethod(Container, "GetFieldList", "Fields." )
|
|---|
| 250 | Layout = VRGetIni( "Layout", Container, OurINI )
|
|---|
| 251 | if Layout = "" then return
|
|---|
| 252 | do I = 1 to Fields.0
|
|---|
| 253 | ok = VRMethod(Container, "SetFieldAttr", fields.I,"Visible", substr(Layout,I,1))
|
|---|
| 254 | end
|
|---|
| 255 | return
|
|---|
| 256 |
|
|---|
| 257 | /*:VRX _INILayoutWrite
|
|---|
| 258 | */
|
|---|
| 259 | _INILayoutWrite:
|
|---|
| 260 | Container = arg(1)
|
|---|
| 261 | ok = VRMethod(Container, "GetFieldList", "Fields." )
|
|---|
| 262 | Layout = ""
|
|---|
| 263 | do I = 1 to fields.0
|
|---|
| 264 | Layout = Layout||VRMethod(Container, "GetFieldAttr", fields.I, "Visible" )
|
|---|
| 265 | end
|
|---|
| 266 | ok = VRSetIni( "Layout", Container , Layout, OurINI, 'NoClose' )
|
|---|
| 267 | return
|
|---|
| 268 |
|
|---|
| 269 | /*:VRX _INIRead
|
|---|
| 270 | */
|
|---|
| 271 | _INIRead:
|
|---|
| 272 | say '_INIRead() started.'
|
|---|
| 273 |
|
|---|
| 274 | OurINI = strip(VRParseFileName(VRget("Application","Program"),'DP')'\SMBSTATUS.INI',,'\')
|
|---|
| 275 | ok = SysFileTree(OurINI, INIFound.,'FO')
|
|---|
| 276 | if INIFound.0 = 1 then OurINI = VRParseFileName(INIFound.1,'DPNE')
|
|---|
| 277 | say 'OurINI='OurINI
|
|---|
| 278 | HelpFIle = VRParseFileName(OurINI,'DPN')'.HLP'
|
|---|
| 279 | say 'HelpFile='HelpFile
|
|---|
| 280 |
|
|---|
| 281 | Top = VRGetIni( "Pos", "Top", OurINI , 'NoClose')
|
|---|
| 282 | Left = VRGetIni( "Pos", "Left", OurINI , 'NoClose')
|
|---|
| 283 | Width = VRGetIni( "Pos", "Width", OurINI , 'NoClose')
|
|---|
| 284 | Height= VRGetIni( "Pos", "Height", OurINI , 'NoClose')
|
|---|
| 285 |
|
|---|
| 286 | Font_Page_1 = VRGetIni( "Fonts", "Page_1", OurINI , 'NoClose' )
|
|---|
| 287 | Font_Page_2 = VRGetIni( "Fonts", "Page_2", OurINI , 'NoClose' )
|
|---|
| 288 | Font_Page_3 = VRGetIni( "Fonts", "Page_3", OurINI , 'NoClose' )
|
|---|
| 289 | Font_Page_4 = VRGetIni( "Fonts", "Page_4", OurINI , 'NoClose' )
|
|---|
| 290 | Font_Page_5 = VRGetIni( "Fonts", "Page_5", OurINI , 'NoClose' )
|
|---|
| 291 | Font_Page_6 = VRGetIni( "Fonts", "Page_6", OurINI , 'NoClose' )
|
|---|
| 292 | Font_Main = VRGetIni( "Fonts", "Main", OurINI , 'NoClose' )
|
|---|
| 293 | Font_Status = VRGetIni( "Fonts", "Statusfont", OurINI , 'NoClose' )
|
|---|
| 294 |
|
|---|
| 295 | if Font_Page_1 = "" then Font_Page_1 = "8.Helv"
|
|---|
| 296 | if Font_Page_2 = "" then Font_Page_2 = "8.Helv"
|
|---|
| 297 | if Font_Page_3 = "" then Font_Page_3 = "8.Helv"
|
|---|
| 298 | if Font_Page_4 = "" then Font_Page_4 = "8.Helv"
|
|---|
| 299 | if Font_Page_5 = "" then Font_Page_5 = "8.Helv"
|
|---|
| 300 | if Font_Main = "" then Font_Main = "8.Helv"
|
|---|
| 301 | if Font_Status = "" then Font_Status = "8.Helv"
|
|---|
| 302 |
|
|---|
| 303 | Intervall = VRGetIni( "Settings", "Intervall", OurINI)
|
|---|
| 304 | if Intervall = "" then Intervall = 60
|
|---|
| 305 |
|
|---|
| 306 | IntervallMin = VRGetIni( "Settings", "IntervallMin", OurINI)
|
|---|
| 307 | if IntervallMin = "" then IntervallMin = 180
|
|---|
| 308 |
|
|---|
| 309 | CurrentPageNr = VRGetIni( "Settings", "CurrentPageNr", OurINI)
|
|---|
| 310 | if CurrentPageNr = "" then CurrentPageNr = 4
|
|---|
| 311 |
|
|---|
| 312 | DaemonView = VRGetIni( "Settings", "DaemonView", OurINI)
|
|---|
| 313 | if DaemonView = "" then DaemonView = "Detail"
|
|---|
| 314 |
|
|---|
| 315 | NoMsgBox = VRGetIni( "Settings", "NoMsgBox", OurINI)
|
|---|
| 316 | if NoMsgBox = "" then NoMsgBox = 0
|
|---|
| 317 |
|
|---|
| 318 | options.!debug = VRGetIni( "Options", "Debug", OurINI)
|
|---|
| 319 | if options.!debug = "" then options.!debug = 0
|
|---|
| 320 |
|
|---|
| 321 | ok = VRSet("CB_Debug","set",options.!Debug)
|
|---|
| 322 | if options.!Debug then ok = VRREdirectStdIO("ON")
|
|---|
| 323 | else ok = VRREdirectStdIO("OFF")
|
|---|
| 324 |
|
|---|
| 325 | /* For Browse page */
|
|---|
| 326 | FirstRun = 1
|
|---|
| 327 | /* For Users page in case connections.tdb is not initialised */
|
|---|
| 328 | IgnoreSmbNoInit = 1
|
|---|
| 329 |
|
|---|
| 330 | smbdpidhandle.0 = 0
|
|---|
| 331 | nmbdpidhandle.0 = 0
|
|---|
| 332 | winbpidhandle.0 = 0
|
|---|
| 333 |
|
|---|
| 334 | prevsmbdct = 0
|
|---|
| 335 | prevnmbdct = 0
|
|---|
| 336 | prevwinbct = 0
|
|---|
| 337 |
|
|---|
| 338 | smbdoutput = TempDir'smbd.out'
|
|---|
| 339 | say '_INIRead() done.'
|
|---|
| 340 | return
|
|---|
| 341 |
|
|---|
| 342 | /*:VRX _INIWrite
|
|---|
| 343 | */
|
|---|
| 344 | _INIWrite:
|
|---|
| 345 | say 'start _INIWrite()'
|
|---|
| 346 | ok = VRSetIni( "Pos", "Top", VRGet("Main","Top"), OurINI, 'NoClose' )
|
|---|
| 347 | ok = VRSetIni( "Pos", "Left", VRGet("Main","Left"), OurINI, 'NoClose' )
|
|---|
| 348 | ok = VRSetIni( "Pos", "Width", VRGet("Main","Width"), OurINI, 'NoClose' )
|
|---|
| 349 | ok = VRSetIni( "Pos", "Height", VRGet("Main","Height"), OurINI, 'NoClose' )
|
|---|
| 350 |
|
|---|
| 351 | ok = VRSetIni( "Settings", "Intervall", VRGet("SPIN_Intervall","Value"),OurINI,'NoClose')
|
|---|
| 352 | ok = VRSetIni( "Settings", "IntervallMin", VRGet("SPIN_IntervallMin","Value"),OurINI,'NoClose')
|
|---|
| 353 | ok = VRSetIni( "Settings", "CurrentPageNr",CurrentPageNr, OurINI,'NoClose')
|
|---|
| 354 | ok = VRSetIni( "Settings", "DaemonView", VRGet("CN_Daemons","View"), OurINI,'NoClose')
|
|---|
| 355 | ok = VRSetIni( "Settings", "NoMsgBox", NoMsgBox, OurINI,'NoClose')
|
|---|
| 356 |
|
|---|
| 357 | ok = VRSetIni( "Options", "Debug", options.!debug, OurINI, 'NoClose' )
|
|---|
| 358 |
|
|---|
| 359 | call _INILayoutWrite "CN_Users"
|
|---|
| 360 | call _INILayoutWrite "CN_Files"
|
|---|
| 361 | call _INILayoutWrite "CN_Service"
|
|---|
| 362 | call _INILayoutWrite "CN_Daemons"
|
|---|
| 363 |
|
|---|
| 364 | ok = VRSetIni( "Fonts", "Page_1", VRGet("Page_1","Font"), OurINI, 'NoClose' )
|
|---|
| 365 | ok = VRSetIni( "Fonts", "Page_2", VRGet("Page_2","Font"), OurINI, 'NoClose' )
|
|---|
| 366 | if VRget("CN_Users", "Font") <> "<default>" then ok = VRset("Page_1", "Font", VRget("CN_Users", "Font"))
|
|---|
| 367 | if VRget("CN_Files", "Font") <> "<default>" then ok = VRset("Page_2", "Font", VRget("CN_Files", "Font"))
|
|---|
| 368 | if VRget("CN_Service", "Font") <> "<default>" then ok = VRset("Page_3", "Font", VRget("CN_Service", "Font"))
|
|---|
| 369 | if VRget("CN_Daemons", "Font") <> "<default>" then ok = VRset("Page_4", "Font", VRget("CN_Daemons", "Font"))
|
|---|
| 370 | ok = VRSetIni( "Fonts", "Page_3", VRGet("Page_3","Font"), OurINI, 'NoClose' )
|
|---|
| 371 | ok = VRSetIni( "Fonts", "Page_4", VRGet("Page_4","Font"), OurINI, 'NoClose' )
|
|---|
| 372 | ok = VRSetIni( "Fonts", "Page_5", VRGet("Page_5","Font"), OurINI, 'NoClose' )
|
|---|
| 373 | ok = VRSetIni( "Fonts", "Page_6", VRGet("Page_6","Font"), OurINI, 'NoClose' )
|
|---|
| 374 | ok = VRSetIni( "Fonts", "Statusfont", VRGet("Main","Statusfont"), OurINI, 'NoClose' )
|
|---|
| 375 | ok = VRSetIni( "Fonts", "Main", VRGet("Main","Font"), OurINI )
|
|---|
| 376 | say 'done _INIWrite()'
|
|---|
| 377 | return
|
|---|
| 378 |
|
|---|
| 379 | /*:VRX _LoadotherFuncs
|
|---|
| 380 | */
|
|---|
| 381 | _LoadotherFuncs:
|
|---|
| 382 | ok = VRRedirectStdIO("OFF")
|
|---|
| 383 |
|
|---|
| 384 | call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
|
|---|
| 385 | call SysLoadFuncs
|
|---|
| 386 |
|
|---|
| 387 | call RxFuncAdd 'PRLoadFuncs', 'PR1UTIL', 'PRLoadFuncs'
|
|---|
| 388 | call PRLoadFuncs
|
|---|
| 389 |
|
|---|
| 390 | return
|
|---|
| 391 |
|
|---|
| 392 | /*:VRX _MsgYesNo
|
|---|
| 393 | */
|
|---|
| 394 | _MsgYesNo:
|
|---|
| 395 | say "_MsgYesNo() started"
|
|---|
| 396 | buttons.0 = 2
|
|---|
| 397 | buttons.1 = NLVGetMessage(6)
|
|---|
| 398 | buttons.2 = NLVGetMessage(7)
|
|---|
| 399 | default = 2
|
|---|
| 400 | buttons.default = NLVGetMessage(7)
|
|---|
| 401 | esc = 2
|
|---|
| 402 | buttons.esc = NLVGetMessage(7)
|
|---|
| 403 | RC = VRMessage( VRWindow(), Msg.Text, Msg.Title,"Q","buttons.",default, esc )
|
|---|
| 404 | say "_MsgYesNo() done, answer "RC
|
|---|
| 405 | return RC
|
|---|
| 406 |
|
|---|
| 407 | /*:VRX _NLVSetup
|
|---|
| 408 | */
|
|---|
| 409 | _NLVSetup:
|
|---|
| 410 | call NLVSetup
|
|---|
| 411 | Msg.Title = NLVGetMessage(1)
|
|---|
| 412 | ok = VRSet("Main","helpFile", settings.!helpfile)
|
|---|
| 413 |
|
|---|
| 414 | CALL NLVSetText 'PB_Refresh', 'Caption', 11
|
|---|
| 415 | CALL NLVSetText 'PB_Cancel', 'Caption', 12
|
|---|
| 416 | CALL NLVSetText 'PB_Help', 'Caption', 13
|
|---|
| 417 | CALL NLVSetText 'PB_About', 'Caption', 14
|
|---|
| 418 |
|
|---|
| 419 | CALL NLVSetText 'PB_Refresh', 'Hinttext', 51
|
|---|
| 420 | CALL NLVSetText 'PB_Cancel', 'Hinttext', 54
|
|---|
| 421 | CALL NLVSetText 'PB_Help', 'Hinttext', 52
|
|---|
| 422 | CALL NLVSetText 'PB_About', 'Hinttext', 53
|
|---|
| 423 |
|
|---|
| 424 | CALL NLVSetText 'TAB_1', 'Userdata', 15
|
|---|
| 425 | CALL NLVSetText 'TAB_2', 'Userdata', 16
|
|---|
| 426 | CALL NLVSetText 'TAB_3', 'Userdata', 17
|
|---|
| 427 | CALL NLVSetText 'TAB_4', 'Userdata', 18
|
|---|
| 428 | CALL NLVSetText 'TAB_5', 'Userdata', 19
|
|---|
| 429 | CALL NLVSetText 'TAB_6', 'Userdata', 24
|
|---|
| 430 |
|
|---|
| 431 | CALL NLVSetText 'TAB_1', 'Hinttext', 55
|
|---|
| 432 | CALL NLVSetText 'TAB_2', 'Hinttext', 56
|
|---|
| 433 | CALL NLVSetText 'TAB_3', 'Hinttext', 57
|
|---|
| 434 | CALL NLVSetText 'TAB_4', 'Hinttext', 58
|
|---|
| 435 | CALL NLVSetText 'TAB_5', 'Hinttext', 59
|
|---|
| 436 | CALL NLVSetText 'TAB_6', 'Hinttext', 60
|
|---|
| 437 |
|
|---|
| 438 | CALL NLVSetText 'Page_1', 'Hinttext', 55
|
|---|
| 439 | CALL NLVSetText 'Page_2', 'Hinttext', 56
|
|---|
| 440 | CALL NLVSetText 'Page_3', 'Hinttext', 57
|
|---|
| 441 | CALL NLVSetText 'Page_4', 'Hinttext', 58
|
|---|
| 442 | CALL NLVSetText 'Page_5', 'Hinttext', 59
|
|---|
| 443 | CALL NLVSetText 'Page_6', 'Hinttext', 60
|
|---|
| 444 |
|
|---|
| 445 | CALL NLVSetText 'DT_Refresh', 'Caption', 25
|
|---|
| 446 | CALL NLVSetText 'DT_RefreshMin', 'Caption', 25
|
|---|
| 447 | CALL NLVSetText 'DT_Intervall', 'Caption', 26
|
|---|
| 448 | ok = VRSet("DT_IntervallMin","Caption", NLVGetMessage(26)' 'NLVGetMessage(28))
|
|---|
| 449 | CALL NLVSetText 'CB_NoMsgBox', 'Caption', 27
|
|---|
| 450 |
|
|---|
| 451 | CALL NLVSetText 'ContextMenu_Daemons_View', 'Caption', 31
|
|---|
| 452 | CALL NLVSetText 'ContextMenu_Daemons_Ping', 'Caption', 32
|
|---|
| 453 | CALL NLVSetText 'ContextMenu_Daemons_Details','Caption', 118
|
|---|
| 454 | CALL NLVSetText 'ContextMenu_Daemons_Tree', 'Caption', 120
|
|---|
| 455 |
|
|---|
| 456 | CALL NLVSetText 'ContextMenu_Service_CloseSHare', 'Caption', 70
|
|---|
| 457 |
|
|---|
| 458 | CALL NLVSetText 'ContextMenu_Users_SendMsg', 'Caption', 80
|
|---|
| 459 | CALL NLVSetText 'ContextMenu_Tree_SendMsg', 'Caption', 80
|
|---|
| 460 | return
|
|---|
| 461 |
|
|---|
| 462 | /*:VRX _Refresh
|
|---|
| 463 | */
|
|---|
| 464 | _Refresh:
|
|---|
| 465 | say "_Refresh() started"
|
|---|
| 466 | ok = VRSet("TM_refresh","Enabled", 0)
|
|---|
| 467 | SmbNoInit = 0
|
|---|
| 468 |
|
|---|
| 469 | refreshoutput = TempDir'refresh.out'
|
|---|
| 470 | refresherr = TempDir'refresh.err'
|
|---|
| 471 |
|
|---|
| 472 | say ' 'samba.!smbd' -V --debuglevel=0 2>'refresherr' 1>'refreshoutput
|
|---|
| 473 | address cmd samba.!smbd' -V --debuglevel=0 2>'refresherr' 1>'refreshoutput
|
|---|
| 474 |
|
|---|
| 475 | SambaVer = "Samba "||strip(linein(refreshoutput))
|
|---|
| 476 | say ' smbd.exe: "'SambaVer'"'
|
|---|
| 477 | ok = stream(refreshoutput,'c','close')
|
|---|
| 478 |
|
|---|
| 479 | say ' 'samba.!smbstatusexe' smbd 'DebugLevel' 2>'refresherr' 1>'refreshoutput
|
|---|
| 480 | address cmd samba.!smbstatusexe' smbd 'DebugLevel' 2>'refresherr' 1>'refreshoutput
|
|---|
| 481 |
|
|---|
| 482 | /* First line is usually empty */
|
|---|
| 483 | Hdr = linein(refreshoutput)
|
|---|
| 484 | SambaStVer = strip(linein(refreshoutput)) /* we can detect version mismatches here */
|
|---|
| 485 | say ' smbstatus: "'SambaStVer'"'
|
|---|
| 486 |
|
|---|
| 487 | select
|
|---|
| 488 | when pos('not initialised',SambaStVer) > 0 then do
|
|---|
| 489 | SambaVer = SambaVer||" (Init)"
|
|---|
| 490 | SmbNoInit = 1
|
|---|
| 491 | end
|
|---|
| 492 | when translate(SambaStVer) <> translate(SambaVer) then SambaVer = SambaVer||" (Hybrid)"
|
|---|
| 493 | otherwise nop
|
|---|
| 494 | end
|
|---|
| 495 |
|
|---|
| 496 | Ok = VRSet("Main", "Caption", SambaVer' - 'NLVGetMessage(146))
|
|---|
| 497 |
|
|---|
| 498 | /* Active User */
|
|---|
| 499 | Hdr1 = linein(refreshoutput)
|
|---|
| 500 | /* say ' 1:'hdr1 */
|
|---|
| 501 | Hdr2 = linein(refreshoutput)
|
|---|
| 502 | /* say ' 2:'hdr2 */
|
|---|
| 503 | Zeile = linein(refreshoutput)
|
|---|
| 504 | say ' 'Zeile
|
|---|
| 505 | if SmbNoInit then do
|
|---|
| 506 | call lineout samba.!msg, SambaStVer
|
|---|
| 507 | call lineout samba.!msg, Hdr1
|
|---|
| 508 | call lineout samba.!msg, Hdr2
|
|---|
| 509 | call lineout samba.!msg, Zeile
|
|---|
| 510 | ok = stream(samba.!msg,'c','close')
|
|---|
| 511 | if IgnoreSmbNoInit then do
|
|---|
| 512 | call _SambaShowMsg
|
|---|
| 513 | IgnoreSmbNoInit = 0
|
|---|
| 514 | end
|
|---|
| 515 | end
|
|---|
| 516 |
|
|---|
| 517 | say 'SmbNoInit = 'SmbNoInit
|
|---|
| 518 |
|
|---|
| 519 | ok = VRSet("CN_Users","Painting", 0)
|
|---|
| 520 | ok = VRMethod("CN_Users", "RemoveRecord", "ALL")
|
|---|
| 521 | Username.0 = 0
|
|---|
| 522 | IP.0 = 0
|
|---|
| 523 | Group.0 = 0
|
|---|
| 524 | I = 0
|
|---|
| 525 | if \SmbNoInit then do
|
|---|
| 526 | do while Zeile <> ''
|
|---|
| 527 | parse var Zeile UPID Username Group Machine IP
|
|---|
| 528 | I = I + 1
|
|---|
| 529 | UPID.I = UPID
|
|---|
| 530 | Username.I = Username
|
|---|
| 531 | Group.I = Group
|
|---|
| 532 | IP = strip(IP)
|
|---|
| 533 | parse var IP '('IP.I')'
|
|---|
| 534 | RecHandle = VRMethod("CN_Users", "Addrecord")
|
|---|
| 535 | ok = VRMethod("CN_Users", "SetFieldData", RecHandle, UIconH, "$44", UPIDFH, UPID, UsernameFH, Username, GroupFH, Group, UMachineFH, Machine, UIPAdrFH, IP.I)
|
|---|
| 536 | Zeile = linein(refreshoutput)
|
|---|
| 537 | end
|
|---|
| 538 | end
|
|---|
| 539 | Username.0 = I
|
|---|
| 540 | Group.0 = I
|
|---|
| 541 | UPID.0 = I
|
|---|
| 542 | ok = VRSet("CN_Users","Painting", 1)
|
|---|
| 543 |
|
|---|
| 544 | /* Active Services */
|
|---|
| 545 | Hdr = linein(refreshoutput)
|
|---|
| 546 | Hdr = linein(refreshoutput)
|
|---|
| 547 | I = 0
|
|---|
| 548 | Zeile = linein(refreshoutput)
|
|---|
| 549 | ok = VRSet("CN_Service","Painting", 0)
|
|---|
| 550 | ok = VRMethod("CN_Service", "RemoveRecord", "ALL")
|
|---|
| 551 | do while Zeile <> ''
|
|---|
| 552 | parse var Zeile Service SPId Machine Connected
|
|---|
| 553 | I = I + 1
|
|---|
| 554 | SPid.I = SPid
|
|---|
| 555 | Machine.I = Machine
|
|---|
| 556 | Service.I = Service
|
|---|
| 557 | Icon = _GuessIcon(Service.I)
|
|---|
| 558 |
|
|---|
| 559 | Connected = strip(Connected)
|
|---|
| 560 | T. = ""
|
|---|
| 561 | parse var Connected T.WDay T.Month T.DoM T.TimeoD T.Year
|
|---|
| 562 | Connected = T.TimeoD', 'T.WDay' 'T.DoM' 'T.Month' 'T.Year
|
|---|
| 563 |
|
|---|
| 564 | RecHandle = VRMethod("CN_Service", "Addrecord")
|
|---|
| 565 | ok = VRMethod("CN_Service", "SetFieldData", RecHandle, SIconH, Icon, ServiceFH, Service, SPIDFH, SPID, SMachineFH, Machine, ConnectedFH, Connected)
|
|---|
| 566 | Zeile = linein(refreshoutput)
|
|---|
| 567 | end
|
|---|
| 568 | SPid.0 = I
|
|---|
| 569 | Machine.0 = I
|
|---|
| 570 | Service.0 = I
|
|---|
| 571 |
|
|---|
| 572 | ok = VRSet("CN_Service","Painting", 1)
|
|---|
| 573 |
|
|---|
| 574 | /* Active Services */
|
|---|
| 575 | Hdr = linein(refreshoutput)
|
|---|
| 576 | Hdr = linein(refreshoutput)
|
|---|
| 577 | Hdr = linein(refreshoutput)
|
|---|
| 578 |
|
|---|
| 579 | Zeile = linein(refreshoutput)
|
|---|
| 580 | ok = VRSet("CN_Files","Painting", 0)
|
|---|
| 581 | ok = VRMethod("CN_Files", "RemoveRecord", "ALL")
|
|---|
| 582 | File.0 = 0
|
|---|
| 583 | FPID.0 = 0
|
|---|
| 584 | do while Zeile <> ''
|
|---|
| 585 | parse var Zeile FPid Uid DenyMode Access RW Oplock Sharepath Rest
|
|---|
| 586 | TimeDate = right(rest,25)
|
|---|
| 587 | Name = strip(left(Rest,length(Rest)-25))
|
|---|
| 588 | I = I + 1
|
|---|
| 589 | sharepath = strip(translate(left(sharepath,1))||translate(substr(SharePath,2),'\','/'),'T','\')
|
|---|
| 590 | Username = UID
|
|---|
| 591 | do J = 1 to UPID.0
|
|---|
| 592 | if FPID = UPID.J then do
|
|---|
| 593 | Username = Username.J
|
|---|
| 594 | leave
|
|---|
| 595 | end
|
|---|
| 596 | end
|
|---|
| 597 | File = SharePath||'\'||translate(Name,'\','/')
|
|---|
| 598 | File.I = File
|
|---|
| 599 | FPID.I = FPID
|
|---|
| 600 | TimeDate = strip(TimeDate)
|
|---|
| 601 | say Timedate
|
|---|
| 602 | T. = ""
|
|---|
| 603 | parse var TimeDate T.WDay T.Month T.DoM T.TimeoD T.Year
|
|---|
| 604 | FileTime = T.TimeoD
|
|---|
| 605 | FileDate = T.WDay' 'T.DoM' 'T.Month' 'T.Year
|
|---|
| 606 | RecHandle = VRMethod("CN_Files", "Addrecord")
|
|---|
| 607 | ok = VRMethod("CN_Files", "SetFieldData", RecHandle, FPidFH, FPid, FileFH, File, FUserFH, Username, UidFH, Uid, DenyModeFH, DenyMode, AccessFH, Access, RWFH, RW)
|
|---|
| 608 | ok = VRMethod("CN_Files", "SetFieldData", RecHandle, FIconH, "$45", TimeFH, FileTime, DateFH, FileDate, OplockFH, Oplock, SharePathFH, Sharepath, NameFH, Name)
|
|---|
| 609 | Zeile = linein(refreshoutput)
|
|---|
| 610 | end
|
|---|
| 611 | File.0 = I
|
|---|
| 612 | FPID.0 = I
|
|---|
| 613 |
|
|---|
| 614 | ok = stream(refreshoutput, 'c','close')
|
|---|
| 615 | ok = SysFileDelete(refreshoutput)
|
|---|
| 616 | ok = stream(refresherr, 'c','close')
|
|---|
| 617 | ok = SysFileDelete(refreshouterr)
|
|---|
| 618 |
|
|---|
| 619 | call _RefreshDaemons
|
|---|
| 620 | ok = VRSet("CN_Files","Painting", 1)
|
|---|
| 621 | if VRGet("Main", "WindowState") = "Minimized" then do
|
|---|
| 622 | ok = VRSet("TM_Refresh","Delay", IntervallMin * 1000)
|
|---|
| 623 | end
|
|---|
| 624 | else do
|
|---|
| 625 | ok = VRSet("TM_Refresh","Delay", Intervall * 1000)
|
|---|
| 626 | end
|
|---|
| 627 | ok = VRSet("TM_refresh","Enabled", 1)
|
|---|
| 628 | say "_Refresh() done"
|
|---|
| 629 | return
|
|---|
| 630 | /*:VRX _RefreshDaemons
|
|---|
| 631 | */
|
|---|
| 632 | _RefreshDaemons:
|
|---|
| 633 | say "_RefreshDaemons() started"
|
|---|
| 634 | ok = VRSet("CN_Daemons","Painting", 0 )
|
|---|
| 635 |
|
|---|
| 636 | call VRSet VRWindow(), 'Pointer', 'Wait'
|
|---|
| 637 |
|
|---|
| 638 | do I = 1 to smbdpidhandle.0
|
|---|
| 639 | ok = VRMethod("CN_Daemons", "RemoveRecord", smbdpidhandle.I )
|
|---|
| 640 | end
|
|---|
| 641 |
|
|---|
| 642 | do I = 1 to nmbdpidhandle.0
|
|---|
| 643 | ok = VRMethod("CN_Daemons", "RemoveRecord", nmbdpidhandle.I )
|
|---|
| 644 | end
|
|---|
| 645 |
|
|---|
| 646 | do I = 1 to winbpidhandle.0
|
|---|
| 647 | ok = VRMethod("CN_Daemons", "RemoveRecord", winbpidhandle.I )
|
|---|
| 648 | end
|
|---|
| 649 |
|
|---|
| 650 | Running = _SambaRunning()
|
|---|
| 651 |
|
|---|
| 652 | call VRSet VRWindow(), 'Pointer', '<default>'
|
|---|
| 653 |
|
|---|
| 654 | smbdpids = pids.!smbd
|
|---|
| 655 | nmbdpids = pids.!nmbd
|
|---|
| 656 | winbpids = pids.!nmbd
|
|---|
| 657 |
|
|---|
| 658 | smbdRunning = running.!smbd
|
|---|
| 659 | nmbdRunning = running.!nmbd
|
|---|
| 660 | winbRunning = running.!winb
|
|---|
| 661 |
|
|---|
| 662 | if smbdRunning then do
|
|---|
| 663 | ok = VRMethod("CN_Daemons", "SetFieldData", smbdHandle, DStatusFH, NLVGetMessage(40), DPidsFH, smbdpids)
|
|---|
| 664 | ok = VRMethod("CN_Daemons", "SetRecordAttr", smbdHandle, "Icon", "$46")
|
|---|
| 665 | smbdpidhandle.0 = words(smbdpids)
|
|---|
| 666 | if options.!debug = 1 then do
|
|---|
| 667 | if smbdpidhandle.0 > prevsmbdct then do
|
|---|
| 668 | prevsmbdct = smbdpidhandle.0
|
|---|
| 669 | call beep 880*1, 10
|
|---|
| 670 | call beep 880*2, 10
|
|---|
| 671 | call beep 880*4, 10
|
|---|
| 672 | end
|
|---|
| 673 | if smbdpidhandle.0 < prevsmbdct then do
|
|---|
| 674 | prevsmbdct = smbdpidhandle.0
|
|---|
| 675 | call beep 880*4, 10
|
|---|
| 676 | call beep 880*2, 10
|
|---|
| 677 | call beep 880*1, 10
|
|---|
| 678 | end
|
|---|
| 679 | end
|
|---|
| 680 |
|
|---|
| 681 | do I = 1 to words(smbdpids)
|
|---|
| 682 | Username = ""
|
|---|
| 683 | do J = 1 to UPID.0
|
|---|
| 684 | if UPID.J = word(smbdpids,I) then do
|
|---|
| 685 | Username = ' 'Username.J
|
|---|
| 686 | leave
|
|---|
| 687 | end
|
|---|
| 688 | end
|
|---|
| 689 | smbdpidhandle.I = VRMethod( "CN_Daemons", "AddRecord", smbdhandle, , 'PID 'word(smbdpids,I)' ('d2x(word(smbdpids,I))'x)', "$48")
|
|---|
| 690 | if Username <> "" then do
|
|---|
| 691 | smbdpidhandle.I.user = VRMethod( "CN_Daemons", "AddRecord", smbdpidhandle.I, , Username, "$44")
|
|---|
| 692 | do J = 1 to FPID.0
|
|---|
| 693 | if FPID.J = word(smbdpids,I) then do
|
|---|
| 694 | dummyHandle = VRMethod( "CN_Daemons", "AddRecord", smbdpidhandle.I.user, , File.J, "$45")
|
|---|
| 695 | end
|
|---|
| 696 | end
|
|---|
| 697 | end
|
|---|
| 698 | end
|
|---|
| 699 | end
|
|---|
| 700 | else do
|
|---|
| 701 | ok = VRMethod("CN_Daemons", "SetFieldData", smbdHandle, DStatusFH, NLVGetMessage(41), DPidsFH, "")
|
|---|
| 702 | ok = VRMethod("CN_Daemons", "SetRecordAttr", smbdHandle, "Icon", "$47")
|
|---|
| 703 | if options.!debug = 1 then do
|
|---|
| 704 | if prevsmbdct > 0 then do
|
|---|
| 705 | prevsmbdct = 0
|
|---|
| 706 | call beep 880*4, 10
|
|---|
| 707 | call beep 880*2, 10
|
|---|
| 708 | call beep 880*1, 10
|
|---|
| 709 | end
|
|---|
| 710 | end
|
|---|
| 711 | end
|
|---|
| 712 |
|
|---|
| 713 | if nmbdRunning then do
|
|---|
| 714 | ok = VRMethod("CN_Daemons", "SetFieldData", nmbdHandle, DStatusFH, NLVGetMessage(40), DPidsFH, nmbdpids)
|
|---|
| 715 | ok = VRMethod("CN_Daemons", "SetRecordAttr", nmbdHandle, "Icon", "$46")
|
|---|
| 716 | nmbdpidhandle.0 = words(nmbdpids)
|
|---|
| 717 | do I = 1 to words(nmbdpids)
|
|---|
| 718 | nmbdpidhandle.I = VRMethod( "CN_Daemons", "AddRecord", nmbdhandle, , 'PID 'word(nmbdpids,I)' ('d2x(word(nmbdpids,I))'x)', "$48")
|
|---|
| 719 | end
|
|---|
| 720 | end
|
|---|
| 721 | else do
|
|---|
| 722 | ok = VRMethod("CN_Daemons", "SetFieldData", nmbdHandle, DStatusFH, NLVGetMessage(41), DPidsFH, "")
|
|---|
| 723 | ok = VRMethod("CN_Daemons", "SetRecordAttr", nmbdHandle, "Icon", "$47")
|
|---|
| 724 | end
|
|---|
| 725 |
|
|---|
| 726 | if winbRunning then do
|
|---|
| 727 | ok = VRMethod("CN_Daemons", "SetFieldData", winbHandle, DStatusFH, NLVGetMessage(40), DPidsFH, winbpids)
|
|---|
| 728 | ok = VRMethod("CN_Daemons", "SetRecordAttr", winbHandle, "Icon", "$46")
|
|---|
| 729 | winbpidhandle.0 = words(winbpids)
|
|---|
| 730 | do I = 1 to words(winbpids)
|
|---|
| 731 | winbpidhandle.I = VRMethod( "CN_Daemons", "AddRecord", winbhandle, , 'PID 'word(winbpids,I)' ('d2x(word(winbpids,I))'x)', "$48")
|
|---|
| 732 | end
|
|---|
| 733 | end
|
|---|
| 734 | else do
|
|---|
| 735 | ok = VRMethod("CN_Daemons", "SetFieldData", winbHandle, DStatusFH, NLVGetMessage(41), DPidsFH, "")
|
|---|
| 736 | ok = VRMethod("CN_Daemons", "SetRecordAttr", winbHandle, "Icon", "$47")
|
|---|
| 737 | end
|
|---|
| 738 |
|
|---|
| 739 | if \(smbdrunning|nmbdrunning|winbrunning) then do
|
|---|
| 740 | ok = VRSet("IPB_Start", "Visible", 1)
|
|---|
| 741 | ok = VRSet("IPB_Stop", "Visible", 0)
|
|---|
| 742 | ok = VRSet("IPB_ReStart", "Enabled", 0)
|
|---|
| 743 | ok = VRSet("IPB_ReLoad", "Enabled", 0)
|
|---|
| 744 | end
|
|---|
| 745 | else do
|
|---|
| 746 | ok = VRSet("IPB_Start", "Visible", 0)
|
|---|
| 747 | ok = VRSet("IPB_Stop", "Visible", 1)
|
|---|
| 748 | ok = VRSet("IPB_ReStart", "Enabled", 1)
|
|---|
| 749 | ok = VRSet("IPB_ReLoad", "Enabled", 1)
|
|---|
| 750 | end
|
|---|
| 751 |
|
|---|
| 752 | ok = (stream(samba.!bin'\winbindd.exe','c','query exists') <> "")
|
|---|
| 753 | ok = VRMethod("CN_Daemons", "SetRecordAttr", winbHandle, "Visible", ok)
|
|---|
| 754 | ok = VRSet("CN_Daemons","Painting", 1 )
|
|---|
| 755 | if Running then call _SambaUptime
|
|---|
| 756 | say "_RefreshDaemons() done"
|
|---|
| 757 | return
|
|---|
| 758 |
|
|---|
| 759 | /*
|
|---|
| 760 | _pids: procedure
|
|---|
| 761 | pongfile = arg(1)
|
|---|
| 762 | pids = ''
|
|---|
| 763 | do until lines(pongfile) = 0
|
|---|
| 764 | pongline = linein(pongfile)
|
|---|
| 765 | if word(Pongline,1) = 'PONG' then do
|
|---|
| 766 | parse var pongline pong from tpid pid
|
|---|
| 767 | pids = pids||pid', '
|
|---|
| 768 | end
|
|---|
| 769 | else pids = pids||pongline
|
|---|
| 770 | end
|
|---|
| 771 | pids = strip(strip(pids),,',')
|
|---|
| 772 | ok = stream(pongfile,'c','close')
|
|---|
| 773 | ok = SysFileDelete(pongfile)
|
|---|
| 774 | return pids
|
|---|
| 775 | */
|
|---|
| 776 |
|
|---|
| 777 | /* pingout = 'ping.out'
|
|---|
| 778 | '@smbcontrol -t 2 smbd ping -d 0 1>'pingout
|
|---|
| 779 | if rc = 0 then smbdRunning = 1
|
|---|
| 780 | ok = VRMethod("CN_Daemons", "SetFieldData", smbdHandle, DPidsFH, _pids(pingout))
|
|---|
| 781 |
|
|---|
| 782 | '@smbcontrol -t 2 nmbd ping -d 0 1>'pingout
|
|---|
| 783 | if rc = 0 then nmbdRunning = 1
|
|---|
| 784 | ok = VRMethod("CN_Daemons", "SetFieldData", nmbdHandle, DPidsFH, _pids(pingout))
|
|---|
| 785 |
|
|---|
| 786 | '@smbcontrol -t 1 winbindd ping -d 0 1>'pingout
|
|---|
| 787 | if rc = 0 then winbRunning = 1
|
|---|
| 788 | ok = VRMethod("CN_Daemons", "SetFieldData", winbHandle, DPidsFH, _pids(pingout))
|
|---|
| 789 |
|
|---|
| 790 | ok = SysFileDelete(PingOut)
|
|---|
| 791 | */
|
|---|
| 792 | /*:VRX _RefreshTree
|
|---|
| 793 | */
|
|---|
| 794 | _RefreshTree:
|
|---|
| 795 | say "_RefreshTree() started"
|
|---|
| 796 | FirstRun = 0
|
|---|
| 797 | ok = VRSet("Main", "StatusText", NLVGetMessage(50))
|
|---|
| 798 | ok = VRSet("Main", 'Enabled', 0 )
|
|---|
| 799 | ok = VRSet("Main", 'Pointer', 'Wait' )
|
|---|
| 800 |
|
|---|
| 801 | address cmd samba.!smbtreeexe' 'debuglevel' -N >'samba.!msg
|
|---|
| 802 |
|
|---|
| 803 | ok = VRMethod("CN_Tree", "RemoveRecord", "ALL")
|
|---|
| 804 |
|
|---|
| 805 | drop smbtree.
|
|---|
| 806 |
|
|---|
| 807 | do until lines(samba.!msg) = 0
|
|---|
| 808 | smbtreeline = linein(samba.!msg)
|
|---|
| 809 | Header = c2x(left(smbtreeline,3))
|
|---|
| 810 | select
|
|---|
| 811 | when Header = "09095C" then do /* share */
|
|---|
| 812 | smbtreeline = strip(smbtreeline,,'09'x)
|
|---|
| 813 | parse var smbtreeline '\\'machine'\'share '09'x comment
|
|---|
| 814 | machine = strip(machine)
|
|---|
| 815 | share = left(strip(share),10)
|
|---|
| 816 | comment = strip(comment)
|
|---|
| 817 | text = translate(share' 'comment)
|
|---|
| 818 | res = _GuessIcon(text)
|
|---|
| 819 | smbtree.!share = VRMethod( "CN_Tree", "AddRecord",smbtree.!machine,, share||'0D0A'x||comment, res)
|
|---|
| 820 | end
|
|---|
| 821 | when Header = "095C5C" then do /* Machine */
|
|---|
| 822 | smbtreeline = strip(smbtreeline,,'09'x)
|
|---|
| 823 | parse var smbtreeline '\\'machine '0909'x comment
|
|---|
| 824 | machine = left(strip(machine),13)
|
|---|
| 825 | comment = strip(comment)
|
|---|
| 826 | smbtree.!machine = VRMethod( "CN_Tree", "AddRecord",smbtree.!workgroup,, machine||'0D0A'x||comment,"#35:PMWP.DLL")
|
|---|
| 827 | end
|
|---|
| 828 | otherwise do
|
|---|
| 829 | say "Workgroup: "smbtreeline
|
|---|
| 830 | if pos("RECEIVING",translate(smbTreeline)) > 0 then do
|
|---|
| 831 | Msg.Type = "W"
|
|---|
| 832 | Msg.Text = smbtreeline
|
|---|
| 833 | call _ShowMsg
|
|---|
| 834 | end
|
|---|
| 835 | else do
|
|---|
| 836 | smbtree.!workgroup = VRMethod( "CN_Tree", "AddRecord",,, smbtreeline,"#62:PMWP.DLL")
|
|---|
| 837 | end
|
|---|
| 838 | end
|
|---|
| 839 | end
|
|---|
| 840 | end
|
|---|
| 841 | ok = stream(samba.!msg,'c','close')
|
|---|
| 842 |
|
|---|
| 843 | ok = VRSet("Main", 'Pointer', '<default>' )
|
|---|
| 844 | ok = VRSet("Main", 'Enabled', 1 )
|
|---|
| 845 | say "_RefreshTree() done"
|
|---|
| 846 | return
|
|---|
| 847 |
|
|---|
| 848 | /*:VRX _SambaFindPIDfile
|
|---|
| 849 | */
|
|---|
| 850 | _SambaFindPIDfile:
|
|---|
| 851 | say "_SambaFindPIDfile() started"
|
|---|
| 852 | ok = SysFileTree(ETC'\samba\pid\nmbd*pid',nmbdpid.,'FO')
|
|---|
| 853 | if nmbdpid.0 = 1 then nmbdpidfile = nmbdpid.1; else nmbdpidfile = ""
|
|---|
| 854 | say " nmbdpidfile = "nmbdpidfile
|
|---|
| 855 | say "_SambaFindPIDfile() done"
|
|---|
| 856 | return
|
|---|
| 857 |
|
|---|
| 858 | /*:VRX _SambaShowError
|
|---|
| 859 | */
|
|---|
| 860 | _SambaShowError: procedure expose samba. settings. options.
|
|---|
| 861 | I = 0
|
|---|
| 862 | do while lines(samba.!error) <> 0
|
|---|
| 863 | I = I + 1
|
|---|
| 864 | smberr.I = linein(samba.!error)
|
|---|
| 865 | end
|
|---|
| 866 | ok = stream(Samba.!error,"c","close")
|
|---|
| 867 | smberr.0 = I
|
|---|
| 868 | Buttons.1 = "OK" /* NLVGetMessage(2) */
|
|---|
| 869 | Buttons.0 = 1
|
|---|
| 870 | id = VRMessageStem( VRWindow(), "smberr.", VRGet("Main", "Caption") , "Error", "Buttons.", buttons.1, buttons.1 )
|
|---|
| 871 | ok = SysFileDelete(Samba.!error)
|
|---|
| 872 | return
|
|---|
| 873 |
|
|---|
| 874 | /*:VRX _SambaShowMsg
|
|---|
| 875 | */
|
|---|
| 876 | _SambaShowMsg: procedure expose samba. settings. options.
|
|---|
| 877 | say "SambaShowMsg started"
|
|---|
| 878 | skipWords = arg(1)
|
|---|
| 879 | skip.0 = words(skipWords)
|
|---|
| 880 | do J = 1 to skip.0
|
|---|
| 881 | skip.J = translate(word(skipWords,J))
|
|---|
| 882 | end
|
|---|
| 883 | I = 0
|
|---|
| 884 | do while lines(samba.!msg) <> 0
|
|---|
| 885 | msgline = linein(samba.!msg)
|
|---|
| 886 | SkipIt = 0
|
|---|
| 887 | do J = 1 to skip.0
|
|---|
| 888 | if pos(skip.J,translate(msgline)) > 0 then do
|
|---|
| 889 | skipit = 1
|
|---|
| 890 | leave
|
|---|
| 891 | end
|
|---|
| 892 | end
|
|---|
| 893 | if \SkipIt then do
|
|---|
| 894 | I = I + 1
|
|---|
| 895 | smbmsg.I = strip(MsgLine)
|
|---|
| 896 | end
|
|---|
| 897 | end
|
|---|
| 898 | ok = stream(Samba.!msg,"c","close")
|
|---|
| 899 | say " stream close "Samba.!msg" = "ok
|
|---|
| 900 | smbmsg.0 = I
|
|---|
| 901 | if smbmsg.0 > 0 then do
|
|---|
| 902 | Buttons.1 = "OK" /* NLVGetMessage(2) */
|
|---|
| 903 | Buttons.0 = 1
|
|---|
| 904 | id = VRMessageStem( VRWindow(), "smbmsg.", VRGet("Main", "Caption") , "I", "Buttons.", buttons.1, buttons.1 )
|
|---|
| 905 | end
|
|---|
| 906 | ok = SysFileDelete(Samba.!msg)
|
|---|
| 907 | say " Delete "Samba.!msg" = "ok
|
|---|
| 908 | say "SambaShowMsg done"
|
|---|
| 909 | return
|
|---|
| 910 | /*:VRX _SambaUptime
|
|---|
| 911 | */
|
|---|
| 912 | _SambaUptime:
|
|---|
| 913 | say "_SambaUptime() started"
|
|---|
| 914 | call _SambaFindPIDfile
|
|---|
| 915 | if nmbdpidfile = "" then do
|
|---|
| 916 | ok = VRset("CN_Daemons", "Caption", NLVGetMessage(42)||" "||NLVGetMessage(41))
|
|---|
| 917 | return
|
|---|
| 918 | end
|
|---|
| 919 |
|
|---|
| 920 | StartTime = SysGetFileDateTime(nmbdpidfile)
|
|---|
| 921 | if StartTime = -1 then return
|
|---|
| 922 |
|
|---|
| 923 | NowTime = substr(date('S'),1,4)'-'substr(date('S'),5,2)'-'substr(date('S'),7,2)' 'time()
|
|---|
| 924 |
|
|---|
| 925 | /* StartTime = "2007-12-31 00:00:00"
|
|---|
| 926 | NowTime = "2008-03-05 08:59:50" */
|
|---|
| 927 |
|
|---|
| 928 | say StartTime
|
|---|
| 929 | say NowTime
|
|---|
| 930 |
|
|---|
| 931 | doM.0 = 12
|
|---|
| 932 | doM.1 = 31; doM.2 = 28; doM.3 = 31; doM.4 = 30; doM.5 = 31; doM.6 = 30;
|
|---|
| 933 | doM.7 = 31; doM.8 = 31; doM.9 = 30; doM.10= 31; doM.11= 30; doM.12= 31
|
|---|
| 934 |
|
|---|
| 935 | parse var StartTime sY'-'sM'-'sD' 'sH':'sMi':'sS
|
|---|
| 936 | parse var NowTime nY'-'nM'-'nD' 'nH':'nMi':'nS
|
|---|
| 937 |
|
|---|
| 938 | if nY//4 = 0 & nY//400 <> 0 then doM.2 = 29
|
|---|
| 939 |
|
|---|
| 940 | say doM.2
|
|---|
| 941 |
|
|---|
| 942 | uY =nY-sY
|
|---|
| 943 | uM =nM-sM
|
|---|
| 944 | uD =nD-sD
|
|---|
| 945 | uH =nH-sH
|
|---|
| 946 | uMi=nMi-sMi
|
|---|
| 947 | uS =nS-sS
|
|---|
| 948 |
|
|---|
| 949 |
|
|---|
| 950 |
|
|---|
| 951 | if uS < 0 then do; uMi= uMi- 1; uS = uS + 60; end
|
|---|
| 952 | if uMi< 0 then do; uH = uH - 1; uMi= uMi+ 60; end
|
|---|
| 953 | if uH < 0 then do; uD = uD - 1; uH = uH + 24; end
|
|---|
| 954 | if uD < 0 then do;
|
|---|
| 955 | /* uM = uM - 1; */
|
|---|
| 956 | if uM < 0 then uMx = uM + 12; else uMx = uM
|
|---|
| 957 | uD = uD + doM.uMx - 1;
|
|---|
| 958 | end
|
|---|
| 959 | if uM < 0 then do; uY = uY - 1; uM = uM + 12; end
|
|---|
| 960 |
|
|---|
| 961 | say uY uM uD uH uMi uS
|
|---|
| 962 |
|
|---|
| 963 | UpTimeStr = ' 'NlvGetMessage(43)':'
|
|---|
| 964 | if uY <> 0 then UpTimeStr = UpTimeStr' 'uY' 'NlvGetMessage(44)
|
|---|
| 965 | if uM <> 0 then UpTimeStr = UpTimeStr' 'uM' 'NlvGetMessage(45)
|
|---|
| 966 | if uD <> 0 then UpTimeStr = UpTimeStr' 'uD' 'NlvGetMessage(46)
|
|---|
| 967 | if uH <> 0 then UpTimeStr = UpTimeStr' 'uH' 'NlvGetMessage(47)
|
|---|
| 968 | if uMi<> 0 then UpTimeStr = UpTimeStr' 'uMi' 'NlvGetMessage(48)
|
|---|
| 969 | if uS <> 0 | UpTimeStr = ' 'NlvGetMessage(43)':' then UpTimeStr = UpTimeStr' 'uS' 'NlvGetMessage(49)
|
|---|
| 970 |
|
|---|
| 971 | ok = VRset("CN_Daemons", "Caption", UpTimeStr)
|
|---|
| 972 | say "_SambaUptime() done"
|
|---|
| 973 | return
|
|---|
| 974 |
|
|---|
| 975 | /*:VRX _SendMsg
|
|---|
| 976 | */
|
|---|
| 977 | _SendMsg:
|
|---|
| 978 | Buttons.1 = NLVGetMessage( 2 )
|
|---|
| 979 | Buttons.2 = NLVGetMessage( 3 )
|
|---|
| 980 | Buttons.0 = 2
|
|---|
| 981 | Message = "Blurp!"
|
|---|
| 982 | id = VRPrompt( VRWindow(), NLVGetMessage( 85 , CurMachine), "Message", NLVGetMessage( 80 ), "Buttons.", buttons.1, buttons.2 )
|
|---|
| 983 |
|
|---|
| 984 | MsgFile = SysTempFileName(TempDir'\smbmsg.'??? )
|
|---|
| 985 | call lineout MsgFile, Message
|
|---|
| 986 | ok = stream(MsgFile,'c','close')
|
|---|
| 987 | say Message
|
|---|
| 988 | address cmd samba.!smbclientexe' --message='CurMachine' 'DebugLevel' <'MsgFile' 2>&1>'samba.!msg
|
|---|
| 989 | /* if rc <> 0 then call _SambaShowError; else */
|
|---|
| 990 | call _SambaShowMsg
|
|---|
| 991 | ok = SysFileDelete(MsgFile)
|
|---|
| 992 | return
|
|---|
| 993 |
|
|---|
| 994 | /*:VRX _ShowMsg
|
|---|
| 995 | */
|
|---|
| 996 | _ShowMsg:
|
|---|
| 997 | Buttons.1 = NLVGetMessage(2)
|
|---|
| 998 | Buttons.0 = 1
|
|---|
| 999 | id = VRMessage( VRWindow(), Msg.Text, Msg.Title, Msg.Type, "Buttons.", buttons.1, buttons.1 )
|
|---|
| 1000 | return
|
|---|
| 1001 |
|
|---|
| 1002 | /*:VRX About_Close
|
|---|
| 1003 | */
|
|---|
| 1004 | About_Close:
|
|---|
| 1005 | call About_Fini
|
|---|
| 1006 | return
|
|---|
| 1007 |
|
|---|
| 1008 | /*:VRX About_Create
|
|---|
| 1009 | */
|
|---|
| 1010 | About_Create:
|
|---|
| 1011 | call About_Init
|
|---|
| 1012 | ok = VRSet("About","Caption", NLVGetMessage(20))
|
|---|
| 1013 | ok = VRSet("PB_AboutOK","Caption", NLVGetMessage(2))
|
|---|
| 1014 | SambaTeam.0 = 8
|
|---|
| 1015 | SambaTeam.1 = 'Paul Smedley'
|
|---|
| 1016 | SambaTeam.2 = 'Yuri Dario'
|
|---|
| 1017 | SambaTeam.3 = 'Herwig Bauernfeind'
|
|---|
| 1018 | SambaTeam.4 = 'Silvan Scherrer'
|
|---|
| 1019 | SambaTeam.5 = 'Alex Taylor'
|
|---|
| 1020 | SambaTeam.6 = 'Nikolay Kolosov'
|
|---|
| 1021 | SambaTeam.7 = 'All the Samba people'
|
|---|
| 1022 | SambaTeam.8 = 'All the netlabs people'
|
|---|
| 1023 | ok = VRSet("About","Font", VRGet("Page_6","Font"))
|
|---|
| 1024 | ok = VRMethod("LB_SambaTeam","AddStringList", "SambaTeam." )
|
|---|
| 1025 | ok = VRSet("DT_SambaTeam","Caption", NLVGetMessage(21))
|
|---|
| 1026 | ok = VRSet("MLE_Version","Value", NLVGetMessage(1)||'0D0A'x||VRGet("Main", "Hinttext")||'0D0A'x||'0D0A'x||SambaVer)
|
|---|
| 1027 | return
|
|---|
| 1028 |
|
|---|
| 1029 | /*:VRX About_Fini
|
|---|
| 1030 | */
|
|---|
| 1031 | About_Fini:
|
|---|
| 1032 | window = VRInfo( "Window" )
|
|---|
| 1033 | call VRDestroy window
|
|---|
| 1034 | drop window
|
|---|
| 1035 | return
|
|---|
| 1036 | /*:VRX About_Init
|
|---|
| 1037 | */
|
|---|
| 1038 | About_Init:
|
|---|
| 1039 | window = VRInfo( "Object" )
|
|---|
| 1040 | if( \VRIsChildOf( window, "Notebook" ) ) then do
|
|---|
| 1041 | call VRMethod window, "CenterWindow"
|
|---|
| 1042 | call VRSet window, "Visible", 1
|
|---|
| 1043 | call VRMethod window, "Activate"
|
|---|
| 1044 | end
|
|---|
| 1045 | drop window
|
|---|
| 1046 | return
|
|---|
| 1047 |
|
|---|
| 1048 | /*:VRX Activate
|
|---|
| 1049 | */
|
|---|
| 1050 | Activate:
|
|---|
| 1051 | parse arg Nr
|
|---|
| 1052 | call PushbackAll
|
|---|
| 1053 | CurrentPageNr = Nr
|
|---|
| 1054 | /* ok = VRSet("PB_"Nr,"Font","9.WarpSans Bold") */
|
|---|
| 1055 | ok = VRSet("TAB_"Nr,"Top", TabTop-8)
|
|---|
| 1056 | ok = VRSet("TAB_"Nr,"Left",TabWidth*(Nr-1)+PageLeft)
|
|---|
| 1057 | ok = VRSet("TAB_"Nr,"PicturePath", "#1"||Nr||";#1"||Nr)
|
|---|
| 1058 | ok = VRset("DT_PageName", "Caption", VRGet("TAB_"Nr, "UserData"))
|
|---|
| 1059 | ok = VRSet("Page_"Nr,"Visible", 1)
|
|---|
| 1060 | select
|
|---|
| 1061 | when Nr = 1 then ok = VRSet("IPB_paper","PicturePath","#4;#4")
|
|---|
| 1062 | when Nr = Pages then ok = VRSet("IPB_paper","PicturePath","#6;#6")
|
|---|
| 1063 | otherwise ok = VRSet("IPB_paper","PicturePath","#5;#5")
|
|---|
| 1064 | end
|
|---|
| 1065 | return
|
|---|
| 1066 |
|
|---|
| 1067 | /*:VRX CB_Debug_Click
|
|---|
| 1068 | */
|
|---|
| 1069 | CB_Debug_Click:
|
|---|
| 1070 | options.!Debug = VRGet("CB_Debug","set")
|
|---|
| 1071 | if options.!Debug then ok = VRREdirectStdIO("ON")
|
|---|
| 1072 | else ok = VRREdirectStdIO("OFF")
|
|---|
| 1073 | return
|
|---|
| 1074 |
|
|---|
| 1075 | /*:VRX CB_NoMsgBox_Click
|
|---|
| 1076 | */
|
|---|
| 1077 | CB_NoMsgBox_Click:
|
|---|
| 1078 | NoMsgBox = VRGet("CB_NoMsgBox","set")
|
|---|
| 1079 | say 'NoMsgBox = "'NoMsgBox'"'
|
|---|
| 1080 | return
|
|---|
| 1081 |
|
|---|
| 1082 | /*:VRX CN_Daemons_ContextMenu
|
|---|
| 1083 | */
|
|---|
| 1084 | CN_Daemons_ContextMenu:
|
|---|
| 1085 | if VRInfo("Top") < 1325 & VRGet("CN_Daemons", "View") = "Detail" then call _ColumnsMenu "CN_Daemons"
|
|---|
| 1086 | else do
|
|---|
| 1087 | ok = VRSet("TM_refresh","Enabled", 0)
|
|---|
| 1088 | DRH = VRInfo("Record")
|
|---|
| 1089 | ok = VRset("ContextMenu_Daemons_Sep1","Visible", 0 )
|
|---|
| 1090 | ok = VRset("ContextMenu_Daemons_Ping","Visible", (DRH <> "") )
|
|---|
| 1091 | ok = VRset("ContextMenu_Daemons_Shutdown","Visible", 0 )
|
|---|
| 1092 | RecCap = ""
|
|---|
| 1093 | if DRH <> "" then RecCap = VRMethod("CN_Daemons", "GetRecordAttr", DRH, "Caption")
|
|---|
| 1094 | select
|
|---|
| 1095 | when Words(RecCap) = 3 then do
|
|---|
| 1096 | RecCap = word(RecCap,2)
|
|---|
| 1097 | ok = VRset("ContextMenu_Daemons_Sep1","Visible", 1 )
|
|---|
| 1098 | end
|
|---|
| 1099 | when Words(RecCap) = 1 then do
|
|---|
| 1100 | parse var RecCap RecCap'.exe'
|
|---|
| 1101 | if strip(VRMethod("CN_Daemons", "GetFieldData", DRH, DPidsFH)) <> "" then do
|
|---|
| 1102 | ok = VRSet("ContextMenu_Daemons_Shutdown", "Caption", NLVGetMessage( 33, RecCap))
|
|---|
| 1103 | ok = VRset("ContextMenu_Daemons_Shutdown", "Visible", 1 )
|
|---|
| 1104 | ok = VRset("ContextMenu_Daemons_Sep1","Visible", 1 )
|
|---|
| 1105 | end
|
|---|
| 1106 | else ok = VRset("ContextMenu_Daemons_Ping","Visible", 0 )
|
|---|
| 1107 | end
|
|---|
| 1108 | otherwise nop
|
|---|
| 1109 | end
|
|---|
| 1110 | say ' Daemon is "'RecCap'"'
|
|---|
| 1111 | ok = VRMethod( "ContextMenu_Daemons", "Popup", , , "", "" )
|
|---|
| 1112 | end
|
|---|
| 1113 | return
|
|---|
| 1114 |
|
|---|
| 1115 | /*:VRX CN_Files_ContextMenu
|
|---|
| 1116 | */
|
|---|
| 1117 | CN_Files_ContextMenu:
|
|---|
| 1118 | if VRInfo("Top") < 1325 & VRGet("CN_Files", "View") = "Detail" then call _ColumnsMenu "CN_Files"
|
|---|
| 1119 | else do
|
|---|
| 1120 | RH = VRInfo("Record")
|
|---|
| 1121 | if RH <> "" then do
|
|---|
| 1122 | /* Does not exist yet
|
|---|
| 1123 | ok = VRMethod( "Contextmenu_Files", "Popup", , , "", "PositionOnItem" ) */
|
|---|
| 1124 | end
|
|---|
| 1125 | end
|
|---|
| 1126 | return
|
|---|
| 1127 |
|
|---|
| 1128 | /*:VRX CN_Service_ContextMenu
|
|---|
| 1129 | */
|
|---|
| 1130 | CN_Service_ContextMenu:
|
|---|
| 1131 | if VRInfo("Top") < 1325 & VRGet("CN_Service", "View") = "Detail" then call _ColumnsMenu "CN_Service"
|
|---|
| 1132 | else do
|
|---|
| 1133 | ok = VRSet("TM_refresh","Enabled", 0)
|
|---|
| 1134 | SRH = VRInfo("Record")
|
|---|
| 1135 | if SRH <> "" then do
|
|---|
| 1136 | Service = VRMethod("CN_Service", "GetFieldData", SRH, ServiceFH)
|
|---|
| 1137 | say ' Service is "'Service'"'
|
|---|
| 1138 | ok = VRMethod( "ContextMenu_Service", "Popup", , , "", "" )
|
|---|
| 1139 | end
|
|---|
| 1140 | end
|
|---|
| 1141 | return
|
|---|
| 1142 |
|
|---|
| 1143 | /*:VRX CN_Tree_ContextMenu
|
|---|
| 1144 | */
|
|---|
| 1145 | CN_Tree_ContextMenu:
|
|---|
| 1146 | RH = VRInfo("Record")
|
|---|
| 1147 | if RH <> "" then do
|
|---|
| 1148 | CurMachine = word(VRMethod( "CN_Tree", "GetRecordAttr", RH, "Caption" ),1)
|
|---|
| 1149 | ok = VRMethod( "Contextmenu_Tree", "Popup", , , "", "PositionOnItem" )
|
|---|
| 1150 | end
|
|---|
| 1151 | return
|
|---|
| 1152 |
|
|---|
| 1153 | /*:VRX CN_Users_ContextMenu
|
|---|
| 1154 | */
|
|---|
| 1155 | CN_Users_ContextMenu:
|
|---|
| 1156 | if VRInfo("Top") < 1325 & VRGet("CN_users", "View") = "Detail" then call _ColumnsMenu "CN_users"
|
|---|
| 1157 | else do
|
|---|
| 1158 | RH = VRInfo("Record")
|
|---|
| 1159 | if RH <> "" then do
|
|---|
| 1160 | CurMachine = VRMethod( "CN_users", "GetFieldData", RH, UMachineFH )
|
|---|
| 1161 | ok = VRMethod( "Contextmenu_Users", "Popup", , , "", "PositionOnItem" )
|
|---|
| 1162 | end
|
|---|
| 1163 | end
|
|---|
| 1164 | return
|
|---|
| 1165 |
|
|---|
| 1166 | /*:VRX Columns_01_Click
|
|---|
| 1167 | */
|
|---|
| 1168 | Columns_01_Click:
|
|---|
| 1169 | call _ColumnShow
|
|---|
| 1170 | return
|
|---|
| 1171 |
|
|---|
| 1172 | /*:VRX Columns_02_Click
|
|---|
| 1173 | */
|
|---|
| 1174 | Columns_02_Click:
|
|---|
| 1175 | call _ColumnShow
|
|---|
| 1176 | return
|
|---|
| 1177 |
|
|---|
| 1178 | /*:VRX Columns_03_Click
|
|---|
| 1179 | */
|
|---|
| 1180 | Columns_03_Click:
|
|---|
| 1181 | call _ColumnShow
|
|---|
| 1182 | return
|
|---|
| 1183 |
|
|---|
| 1184 | /*:VRX Columns_04_Click
|
|---|
| 1185 | */
|
|---|
| 1186 | Columns_04_Click:
|
|---|
| 1187 | call _ColumnShow
|
|---|
| 1188 | return
|
|---|
| 1189 |
|
|---|
| 1190 | /*:VRX Columns_05_Click
|
|---|
| 1191 | */
|
|---|
| 1192 | Columns_05_Click:
|
|---|
| 1193 | call _ColumnShow
|
|---|
| 1194 | return
|
|---|
| 1195 |
|
|---|
| 1196 | /*:VRX Columns_06_Click
|
|---|
| 1197 | */
|
|---|
| 1198 | Columns_06_Click:
|
|---|
| 1199 | call _ColumnShow
|
|---|
| 1200 | return
|
|---|
| 1201 |
|
|---|
| 1202 | /*:VRX Columns_07_Click
|
|---|
| 1203 | */
|
|---|
| 1204 | Columns_07_Click:
|
|---|
| 1205 | call _ColumnShow
|
|---|
| 1206 | return
|
|---|
| 1207 |
|
|---|
| 1208 | /*:VRX Columns_08_Click
|
|---|
| 1209 | */
|
|---|
| 1210 | Columns_08_Click:
|
|---|
| 1211 | call _ColumnShow
|
|---|
| 1212 | return
|
|---|
| 1213 |
|
|---|
| 1214 | /*:VRX Columns_09_Click
|
|---|
| 1215 | */
|
|---|
| 1216 | Columns_09_Click:
|
|---|
| 1217 | call _ColumnShow
|
|---|
| 1218 | return
|
|---|
| 1219 |
|
|---|
| 1220 | /*:VRX Columns_10_Click
|
|---|
| 1221 | */
|
|---|
| 1222 | Columns_10_Click:
|
|---|
| 1223 | call _ColumnShow
|
|---|
| 1224 | return
|
|---|
| 1225 |
|
|---|
| 1226 | /*:VRX Columns_11_Click
|
|---|
| 1227 | */
|
|---|
| 1228 | Columns_11_Click:
|
|---|
| 1229 | call _ColumnShow
|
|---|
| 1230 | return
|
|---|
| 1231 |
|
|---|
| 1232 | /*:VRX Columns_12_Click
|
|---|
| 1233 | */
|
|---|
| 1234 | Columns_12_Click:
|
|---|
| 1235 | call _ColumnShow
|
|---|
| 1236 | return
|
|---|
| 1237 |
|
|---|
| 1238 | /*:VRX ContextMenu_Daemons_Details_Click
|
|---|
| 1239 | */
|
|---|
| 1240 | ContextMenu_Daemons_Details_Click:
|
|---|
| 1241 | ok = VRset("CN_Daemons","View","Detail")
|
|---|
| 1242 | ok = VRset("ContextMenu_Daemons_Tree","Enabled",1)
|
|---|
| 1243 | ok = VRset("ContextMenu_Daemons_Details","Enabled",0)
|
|---|
| 1244 | ok = VRSet("TM_refresh","Enabled", 1)
|
|---|
| 1245 | return
|
|---|
| 1246 |
|
|---|
| 1247 | /*:VRX ContextMenu_Daemons_Ping_Click
|
|---|
| 1248 | */
|
|---|
| 1249 | ContextMenu_Daemons_Ping_Click:
|
|---|
| 1250 | ok = VRSet("Main", 'Pointer', 'Wait' )
|
|---|
| 1251 | address cmd samba.!smbcontrolexe' 'RecCap' ping --timeout=3 --debuglevel=0 2>'samba.!error' 1>'samba.!msg
|
|---|
| 1252 | call _SambaShowMsg "section table registered"
|
|---|
| 1253 |
|
|---|
| 1254 | ok = VRSet("Main", 'Pointer', '<default>' )
|
|---|
| 1255 | ok = VRSet("TM_refresh","Enabled", 1)
|
|---|
| 1256 | return
|
|---|
| 1257 |
|
|---|
| 1258 | /*:VRX ContextMenu_Daemons_Shutdown_Click
|
|---|
| 1259 | */
|
|---|
| 1260 | ContextMenu_Daemons_Shutdown_Click:
|
|---|
| 1261 | Msg.Text = NLVGetMessage(34, RecCap)
|
|---|
| 1262 | Msg.Type = 'Q'
|
|---|
| 1263 | if _MsgYesNo() = 1 then do
|
|---|
| 1264 | address cmd samba.!smbcontrolexe' 'RecCap' shutdown 2>'samba.!error' 1>'samba.!msg
|
|---|
| 1265 | call _SambaShowMsg "section table registered"
|
|---|
| 1266 | end
|
|---|
| 1267 | ok = VRSet("TM_refresh","Enabled", 1)
|
|---|
| 1268 | return
|
|---|
| 1269 |
|
|---|
| 1270 | /*:VRX ContextMenu_Daemons_Tree_Click
|
|---|
| 1271 | */
|
|---|
| 1272 | ContextMenu_Daemons_Tree_Click:
|
|---|
| 1273 | ok = VRset("CN_Daemons","View","IconTree")
|
|---|
| 1274 | ok = VRset("ContextMenu_Daemons_Tree","Enabled",0)
|
|---|
| 1275 | ok = VRset("ContextMenu_Daemons_Details","Enabled",1)
|
|---|
| 1276 | ok = VRSet("TM_refresh","Enabled", 1)
|
|---|
| 1277 | return
|
|---|
| 1278 |
|
|---|
| 1279 | /*:VRX ContextMenu_Service_CloseShare_Click
|
|---|
| 1280 | */
|
|---|
| 1281 | ContextMenu_Service_CloseShare_Click:
|
|---|
| 1282 | Msg.Text = NLVGetMessage(75, Service)
|
|---|
| 1283 | Msg.Type = 'Q'
|
|---|
| 1284 | if _MsgYesNo() = 1 then do
|
|---|
| 1285 | address cmd samba.!smbcontrolexe' smbd close-share 'Service' --debuglevel=0' /* ' 2>'samba.!error' 1>'samba.!msg */
|
|---|
| 1286 | /* No usable output from Samba here ! */
|
|---|
| 1287 | /* call _SambaShowMsg */
|
|---|
| 1288 | Msg.Text = NLVGetMessage(76, Service)
|
|---|
| 1289 | Msg.Type = 'I'
|
|---|
| 1290 | call _ShowMsg
|
|---|
| 1291 | end
|
|---|
| 1292 | ok = VRSet("TM_refresh","Enabled", 1)
|
|---|
| 1293 | return
|
|---|
| 1294 |
|
|---|
| 1295 | /*:VRX ContextMenu_Tree_SendMsg_Click
|
|---|
| 1296 | */
|
|---|
| 1297 | ContextMenu_Tree_SendMsg_Click:
|
|---|
| 1298 | call _SendMsg
|
|---|
| 1299 | return
|
|---|
| 1300 |
|
|---|
| 1301 | /*:VRX ContextMenu_Users_SendMsg_Click
|
|---|
| 1302 | */
|
|---|
| 1303 | ContextMenu_Users_SendMsg_Click:
|
|---|
| 1304 | call _SendMsg
|
|---|
| 1305 | return
|
|---|
| 1306 |
|
|---|
| 1307 | /*:VRX Fini
|
|---|
| 1308 | */
|
|---|
| 1309 | Fini:
|
|---|
| 1310 | window = VRWindow()
|
|---|
| 1311 | call VRSet window, "Visible", 0
|
|---|
| 1312 | drop window
|
|---|
| 1313 | return 0
|
|---|
| 1314 |
|
|---|
| 1315 | /*:VRX GetBootDrive
|
|---|
| 1316 | */
|
|---|
| 1317 | GetBootDrive:
|
|---|
| 1318 | /* Use SysBootDrive if possible */
|
|---|
| 1319 | If Rxfuncadd('SysBootDrive', 'RexxUtil', 'SysBootDrive') Then
|
|---|
| 1320 | Return Left(Value('RUNWORKPLACE',,'OS2ENVIRONMENT'),2)
|
|---|
| 1321 | Else
|
|---|
| 1322 | Return SysBootDrive()
|
|---|
| 1323 |
|
|---|
| 1324 |
|
|---|
| 1325 | /*:VRX Halt
|
|---|
| 1326 | */
|
|---|
| 1327 | Halt:
|
|---|
| 1328 | signal _VREHalt
|
|---|
| 1329 | return
|
|---|
| 1330 |
|
|---|
| 1331 | /*:VRX Init
|
|---|
| 1332 | */
|
|---|
| 1333 | Init:
|
|---|
| 1334 | window = VRWindow()
|
|---|
| 1335 | call VRMethod window, "CenterWindow"
|
|---|
| 1336 | call VRSet window, "Visible", 0
|
|---|
| 1337 | call VRMethod window, "Activate"
|
|---|
| 1338 | drop window
|
|---|
| 1339 | return
|
|---|
| 1340 |
|
|---|
| 1341 | /*:VRX IPB_Paper_Click
|
|---|
| 1342 | */
|
|---|
| 1343 | IPB_Paper_Click:
|
|---|
| 1344 | if VRInfo("Left") > VRInfo("Top") then call Activate min(CurrentPageNr+1,Pages)
|
|---|
| 1345 | if VRInfo("Left") <= VRInfo("Top") then call Activate max(CurrentPageNr-1,1)
|
|---|
| 1346 | return
|
|---|
| 1347 |
|
|---|
| 1348 | /*:VRX IPB_Reload_Click
|
|---|
| 1349 | */
|
|---|
| 1350 | IPB_Reload_Click:
|
|---|
| 1351 | call VRSet VRWindow(), 'Pointer', 'Wait'
|
|---|
| 1352 | address CMD samba.!smbcmd' reload '
|
|---|
| 1353 |
|
|---|
| 1354 | /* 2>'samba.!error' 1>'samba.!msg
|
|---|
| 1355 | if \NoMsgBox then call _SambaShowMsg "[32 Done" */
|
|---|
| 1356 |
|
|---|
| 1357 | ok = VRSet("TM_Refresh","Delay", 1000)
|
|---|
| 1358 | call VRSet VRWindow(), 'Pointer', '<default>'
|
|---|
| 1359 | return
|
|---|
| 1360 |
|
|---|
| 1361 | /*:VRX IPB_Restart_Click
|
|---|
| 1362 | */
|
|---|
| 1363 | IPB_Restart_Click:
|
|---|
| 1364 | call VRSet VRWindow(), 'Pointer', 'Wait'
|
|---|
| 1365 | address CMD samba.!smbcmd' restart '
|
|---|
| 1366 |
|
|---|
| 1367 | /* 2>'samba.!error' 1>'samba.!msg
|
|---|
| 1368 | if \NoMsgBox then call _SambaShowMsg "[32 Done" */
|
|---|
| 1369 |
|
|---|
| 1370 | ok = VRSet("TM_Refresh","Delay", 1000)
|
|---|
| 1371 | call VRSet VRWindow(), 'Pointer', '<default>'
|
|---|
| 1372 | return
|
|---|
| 1373 |
|
|---|
| 1374 | /*:VRX IPB_Start_Click
|
|---|
| 1375 | */
|
|---|
| 1376 | IPB_Start_Click:
|
|---|
| 1377 | say "IPB_Start_Click started"
|
|---|
| 1378 | call VRSet VRWindow(), 'Pointer', 'Wait'
|
|---|
| 1379 |
|
|---|
| 1380 | say " "samba.!smbcmd' start '
|
|---|
| 1381 | /* 2>'samba.!error' 1>'samba.!msg */
|
|---|
| 1382 |
|
|---|
| 1383 | address CMD samba.!smbcmd' start '
|
|---|
| 1384 |
|
|---|
| 1385 | /* 2>'samba.!error' 1>'samba.!msg
|
|---|
| 1386 | if \NoMsgBox then call _SambaShowMsg "[32 Done"
|
|---|
| 1387 | else do
|
|---|
| 1388 | say "Start no msg"
|
|---|
| 1389 | ok = stream(Samba.!msg,"c","close")
|
|---|
| 1390 | say " stream close "Samba.!msg" = "ok
|
|---|
| 1391 | ok = SysFileDelete(Samba.!msg)
|
|---|
| 1392 | say " Delete "Samba.!msg" = "ok
|
|---|
| 1393 | end */
|
|---|
| 1394 | ok = VRSet("TM_Refresh","Delay", 1000)
|
|---|
| 1395 | call VRSet VRWindow(), 'Pointer', '<default>'
|
|---|
| 1396 | say "IPB_Start_Click done"
|
|---|
| 1397 | return
|
|---|
| 1398 |
|
|---|
| 1399 | /*:VRX IPB_Stop_Click
|
|---|
| 1400 | */
|
|---|
| 1401 | IPB_Stop_Click:
|
|---|
| 1402 | say "IPB_Stop_Click started"
|
|---|
| 1403 | call VRSet VRWindow(), 'Pointer', 'Wait'
|
|---|
| 1404 | say " "samba.!smbcmd' stop '
|
|---|
| 1405 | /* 2>'samba.!error' 1>'samba.!msg */
|
|---|
| 1406 |
|
|---|
| 1407 | address CMD samba.!smbcmd' stop'
|
|---|
| 1408 |
|
|---|
| 1409 | /* 2>'samba.!error' 1>'samba.!msg
|
|---|
| 1410 | if \NoMsgBox then call _SambaShowMsg "[32 Done"
|
|---|
| 1411 | else do
|
|---|
| 1412 | say " Stop no msg"
|
|---|
| 1413 | ok = stream(Samba.!msg,"c","close")
|
|---|
| 1414 | say " stream close "Samba.!msg" = "ok
|
|---|
| 1415 | ok = SysFileDelete(Samba.!msg)
|
|---|
| 1416 | say " Delete "Samba.!msg" = "ok
|
|---|
| 1417 | end */
|
|---|
| 1418 | ok = VRSet("TM_Refresh","Delay", 1000)
|
|---|
| 1419 |
|
|---|
| 1420 | call VRSet VRWindow(), 'Pointer', '<default>'
|
|---|
| 1421 | say "IPB_Stop_Click done"
|
|---|
| 1422 | return
|
|---|
| 1423 |
|
|---|
| 1424 | /*:VRX Main_Activate
|
|---|
| 1425 | */
|
|---|
| 1426 | Main_Activate:
|
|---|
| 1427 | call TM_Refresh_Trigger
|
|---|
| 1428 | ok = VRset("TM_Refresh", "Enabled", 1)
|
|---|
| 1429 | return
|
|---|
| 1430 |
|
|---|
| 1431 | /*:VRX Main_Close
|
|---|
| 1432 | */
|
|---|
| 1433 | Main_Close:
|
|---|
| 1434 | call Quit
|
|---|
| 1435 | return
|
|---|
| 1436 |
|
|---|
| 1437 | /*:VRX Main_Create
|
|---|
| 1438 | */
|
|---|
| 1439 | Main_Create:
|
|---|
| 1440 | call _LoadOtherFuncs
|
|---|
| 1441 | call _InitTempDir
|
|---|
| 1442 | call _IniRead
|
|---|
| 1443 | call _NLVSetup
|
|---|
| 1444 | call _SambaInit
|
|---|
| 1445 | if _SambaRunning() then call _SambaFindPIDfile
|
|---|
| 1446 | call _ContainerInit
|
|---|
| 1447 | call _GUIInit
|
|---|
| 1448 |
|
|---|
| 1449 | str = 'call TAB_'CurrentPageNr'_Click'; interpret str
|
|---|
| 1450 | ok = VRMethod("PB_Refresh","SetFocus")
|
|---|
| 1451 | call _Refresh
|
|---|
| 1452 | if FirstRun = 1 & CurrentPageNr = 5 then call _RefreshTree
|
|---|
| 1453 | return
|
|---|
| 1454 | /*:VRX Main_Deactivate
|
|---|
| 1455 | */
|
|---|
| 1456 | Main_Deactivate:
|
|---|
| 1457 | ok = VRset("TM_Refresh", "Enabled", 0)
|
|---|
| 1458 | return
|
|---|
| 1459 |
|
|---|
| 1460 | /*:VRX Main_Resize
|
|---|
| 1461 | */
|
|---|
| 1462 | Main_Resize:
|
|---|
| 1463 | say 'Mainresize() started'
|
|---|
| 1464 | MainWin = "Main"
|
|---|
| 1465 | ok = VRSet(MainWin,"Painting", 0)
|
|---|
| 1466 | if datatype(Pages) <> "NUM" then call PushbackAll
|
|---|
| 1467 | ok = VRSet(MainWin,"Width",max(VRget(MainWin,"Width"),Pages*TabWidth+300))
|
|---|
| 1468 | ok = VRset("GB_Main","width",VRget(MainWin,"Width")-150)
|
|---|
| 1469 | ok = VRset("GB_Main","Height",VRget(MainWin,"Height")-1175-240)
|
|---|
| 1470 | ok = VRset("GB_Main2","width",VRget("GB_Main","Width")-260)
|
|---|
| 1471 | ok = VRset("GB_Main2","Height",VRget("GB_Main","Height")-275)
|
|---|
| 1472 | ok = VRset("GB_VerticalLine","Left",VRget("GB_Main2","Width")-60)
|
|---|
| 1473 | ok = VRset("GB_VerticalLine","Height",VRget("GB_Main2","Height")-410)
|
|---|
| 1474 | ok = VRset("IPB_Paper","Left",VRget("GB_Main2","width")-420)
|
|---|
| 1475 | ok = VRset("GB_HorLineTop","Width",VRget("GB_Main2","width")-440)
|
|---|
| 1476 | ok = VRset("GB_HorLineTop","Width",VRget("GB_Main2","width")-440)
|
|---|
| 1477 | ok = VRset("GB_LineSubtitle","Width",VRget("GB_Main2","width")-480)
|
|---|
| 1478 | do I = 1 to Pages
|
|---|
| 1479 | /*say 'Page_'I'='max(PageHeight,VRget("GB_Main2","Height")-600) */
|
|---|
| 1480 | ok = VRSet("Page_"I,"Height", max(PageHeight,VRget("GB_Main2","Height")-600))
|
|---|
| 1481 | ok = VRSet("Page_"I,"Width", max(PageWidth,VRget("GB_Main2","Width")-450))
|
|---|
| 1482 | end
|
|---|
| 1483 |
|
|---|
| 1484 | ok = VRSEt("PB_Refresh","top",VRGet("GB_Main","Height")+305)
|
|---|
| 1485 | ok = VRSEt("PB_Help", "top",VRGet("GB_Main","Height")+305)
|
|---|
| 1486 | ok = VRSEt("PB_Cancel", "top",VRGet("GB_Main","Height")+305)
|
|---|
| 1487 | ok = VRSEt("PB_About", "top",VRGet("GB_Main","Height")+305)
|
|---|
| 1488 |
|
|---|
| 1489 | ok = VRset("CN_Users","Top", 120)
|
|---|
| 1490 | ok = VRset("CN_Users","Left", 20)
|
|---|
| 1491 | ok = VRset("CN_Users","Width", VRGet("Page_1","Width")-600)
|
|---|
| 1492 | ok = VRset("CN_Users","Height", VRGet("Page_1","Height")-120)
|
|---|
| 1493 |
|
|---|
| 1494 | ok = VRset("CN_Files","Top", 120)
|
|---|
| 1495 | ok = VRset("CN_Files","Left", 20)
|
|---|
| 1496 | ok = VRset("CN_Files","Width", VRGet("Page_2","Width")-600)
|
|---|
| 1497 | ok = VRset("CN_Files","Height", VRGet("Page_2","Height")-120)
|
|---|
| 1498 |
|
|---|
| 1499 | ok = VRset("CN_Service","Top", 120)
|
|---|
| 1500 | ok = VRset("CN_Service","Left", 20)
|
|---|
| 1501 | ok = VRset("CN_Service","Width", VRGet("Page_2","Width")-600)
|
|---|
| 1502 | ok = VRset("CN_Service","Height", VRGet("Page_2","Height")-120)
|
|---|
| 1503 |
|
|---|
| 1504 | ok = VRset("CN_Daemons","Top", 120)
|
|---|
| 1505 | ok = VRset("CN_Daemons","Left", 20)
|
|---|
| 1506 | ok = VRset("CN_Daemons","Width", VRGet("Page_2","Width")-600)
|
|---|
| 1507 | ok = VRset("CN_Daemons","Height", VRGet("Page_2","Height")-120)
|
|---|
| 1508 |
|
|---|
| 1509 | ok = VRSet("IPB_Start","Left", VRGet("CN_Daemons","Width") + 120)
|
|---|
| 1510 | ok = VRSet("IPB_Stop","Top", VRGet("IPB_Start","Top"))
|
|---|
| 1511 | ok = VRSet("IPB_Stop","Left", VRGet("CN_Daemons","Width") + 120)
|
|---|
| 1512 | ok = VRSet("IPB_Restart","Left", VRGet("CN_Daemons","Width") + 120)
|
|---|
| 1513 | ok = VRSet("IPB_Reload","Left", VRGet("CN_Daemons","Width") + 120)
|
|---|
| 1514 |
|
|---|
| 1515 | ok = VRset("CN_Tree","Top", 120)
|
|---|
| 1516 | ok = VRset("CN_Tree","Left", 20)
|
|---|
| 1517 | ok = VRset("CN_Tree","Width", VRGet("Page_5","Width")-120)
|
|---|
| 1518 | ok = VRset("CN_Tree","Height", VRGet("Page_5","Height")-120)
|
|---|
| 1519 |
|
|---|
| 1520 |
|
|---|
| 1521 |
|
|---|
| 1522 | ButtonDist= 980
|
|---|
| 1523 | ButtonNr = 4
|
|---|
| 1524 | ButtonPos = format(max((VRget(MainWin,"Width")-ButtonDist*ButtonNr)/2,0),,0)
|
|---|
| 1525 | ok = VRSEt("PB_Refresh","left",ButtonPos+ButtonDist*(ButtonNr-4))
|
|---|
| 1526 | ok = VRSEt("PB_Help", "left",ButtonPos+ButtonDist*(ButtonNr-3))
|
|---|
| 1527 | ok = VRSEt("PB_About", "left",ButtonPos+ButtonDist*(ButtonNr-2))
|
|---|
| 1528 | ok = VRSEt("PB_Cancel", "left",ButtonPos+ButtonDist*(ButtonNr-1))
|
|---|
| 1529 |
|
|---|
| 1530 | /* check and empty event queue, trash spurious resize events */
|
|---|
| 1531 | EventString = ''
|
|---|
| 1532 | TrashedResize = 0
|
|---|
| 1533 | do until EventString = 'nop'
|
|---|
| 1534 | EventString = VREvent('N')
|
|---|
| 1535 | if EventString <> 'nop' then do
|
|---|
| 1536 | if EventString = 'CALL 'MainWin'_Resize' then TrashedResize = 1
|
|---|
| 1537 | else interpret eventString
|
|---|
| 1538 | end
|
|---|
| 1539 | end
|
|---|
| 1540 | if TrashedResize then CALL Main_Resize
|
|---|
| 1541 | ok = VRSet(MainWin, "Painting", 1)
|
|---|
| 1542 |
|
|---|
| 1543 | /* ok = VRset(MainWin,"Visible", 1) */
|
|---|
| 1544 | say 'Mainresize() done'
|
|---|
| 1545 | return
|
|---|
| 1546 |
|
|---|
| 1547 | /*:VRX Page1_Create
|
|---|
| 1548 | */
|
|---|
| 1549 | Page1_Create:
|
|---|
| 1550 |
|
|---|
| 1551 | Return
|
|---|
| 1552 |
|
|---|
| 1553 | /*:VRX Page1_Init
|
|---|
| 1554 | */
|
|---|
| 1555 | Page1_Init:
|
|---|
| 1556 | call _ContainerInit
|
|---|
| 1557 | return
|
|---|
| 1558 |
|
|---|
| 1559 | /*:VRX Page2_Create
|
|---|
| 1560 | */
|
|---|
| 1561 | Page2_create:
|
|---|
| 1562 |
|
|---|
| 1563 | Return
|
|---|
| 1564 | /*:VRX Page2_init
|
|---|
| 1565 | */
|
|---|
| 1566 | Page2_init:
|
|---|
| 1567 |
|
|---|
| 1568 | return
|
|---|
| 1569 |
|
|---|
| 1570 | /*:VRX Page3_Create
|
|---|
| 1571 | */
|
|---|
| 1572 | Page3_create:
|
|---|
| 1573 |
|
|---|
| 1574 | Return
|
|---|
| 1575 | /*:VRX Page3_Init
|
|---|
| 1576 | */
|
|---|
| 1577 | Page3_Init:
|
|---|
| 1578 |
|
|---|
| 1579 | return
|
|---|
| 1580 |
|
|---|
| 1581 | /*:VRX Page4_Create
|
|---|
| 1582 | */
|
|---|
| 1583 | Page4_Create:
|
|---|
| 1584 |
|
|---|
| 1585 | Return
|
|---|
| 1586 | /*:VRX Page4_init
|
|---|
| 1587 | */
|
|---|
| 1588 | Page4_init:
|
|---|
| 1589 |
|
|---|
| 1590 | return
|
|---|
| 1591 |
|
|---|
| 1592 | /*:VRX Page5_Create
|
|---|
| 1593 | */
|
|---|
| 1594 | Page5_Create:
|
|---|
| 1595 |
|
|---|
| 1596 | return
|
|---|
| 1597 |
|
|---|
| 1598 | /*:VRX Page5_Init
|
|---|
| 1599 | */
|
|---|
| 1600 | Page5_Init:
|
|---|
| 1601 |
|
|---|
| 1602 | return
|
|---|
| 1603 |
|
|---|
| 1604 | /*:VRX Paper_Init
|
|---|
| 1605 | */
|
|---|
| 1606 | Paper_Init:
|
|---|
| 1607 | ok = VRSet("IPB_Paper","Width" ,VRMethod( "Screen", "PixelsToTwips", 32 ))
|
|---|
| 1608 | ok = VRSet("IPB_Paper","Height",VRMethod( "Screen", "PixelsToTwips", 32 ))
|
|---|
| 1609 | ok = VRset("IPB_Paper","Left",VRget("GB_Main2","width")-420)
|
|---|
| 1610 | return
|
|---|
| 1611 |
|
|---|
| 1612 | /*:VRX PB_About_Click
|
|---|
| 1613 | */
|
|---|
| 1614 | PB_About_Click:
|
|---|
| 1615 | window = VRLoadSecondary( "About", "W" )
|
|---|
| 1616 | return
|
|---|
| 1617 |
|
|---|
| 1618 | /*:VRX PB_AboutOK_Click
|
|---|
| 1619 | */
|
|---|
| 1620 | PB_AboutOK_Click:
|
|---|
| 1621 | call About_Close
|
|---|
| 1622 | return
|
|---|
| 1623 |
|
|---|
| 1624 | /*:VRX PB_Cancel_Click
|
|---|
| 1625 | */
|
|---|
| 1626 | PB_Cancel_Click:
|
|---|
| 1627 | say 'start PB_Cancel_Click'
|
|---|
| 1628 | Call Quit
|
|---|
| 1629 | say 'done PB_Cancel_Click'
|
|---|
| 1630 | return
|
|---|
| 1631 |
|
|---|
| 1632 | /*:VRX PB_Help_Click
|
|---|
| 1633 | */
|
|---|
| 1634 | PB_Help_Click:
|
|---|
| 1635 | ok = VRMethod("Page_"CurrentPageNr, "InvokeHelp" )
|
|---|
| 1636 | return
|
|---|
| 1637 |
|
|---|
| 1638 | /*:VRX PB_Refresh_Click
|
|---|
| 1639 | */
|
|---|
| 1640 | PB_Refresh_Click:
|
|---|
| 1641 | ok = SysSleep(0.3)
|
|---|
| 1642 | if CurrentPageNr = 5
|
|---|
| 1643 | then call _RefreshTree
|
|---|
| 1644 | else call _Refresh
|
|---|
| 1645 | return
|
|---|
| 1646 |
|
|---|
| 1647 | /*:VRX PushbackAll
|
|---|
| 1648 | */
|
|---|
| 1649 | PushbackAll:
|
|---|
| 1650 | Pages = 6
|
|---|
| 1651 | /* Tab distance from top */
|
|---|
| 1652 | TabTop = 20
|
|---|
| 1653 | TabWidth = VRMethod( "Screen", "PixelsToTwips", 78 )
|
|---|
| 1654 | TabHeight= VRMethod( "Screen", "PixelsToTwips", 24 )
|
|---|
| 1655 |
|
|---|
| 1656 | /* Page Position */
|
|---|
| 1657 | PageLeft = 120
|
|---|
| 1658 | PageTop = PageLeft + TabTop + 330
|
|---|
| 1659 |
|
|---|
| 1660 | /* Page size */
|
|---|
| 1661 | PageHeight = 3000
|
|---|
| 1662 | PageWidth = 3000
|
|---|
| 1663 | ok = VRset("DT_PageName", "Caption", "")
|
|---|
| 1664 | ok = VRSet("GB_Main","Left", 0)
|
|---|
| 1665 | ok = VRSet("GB_Main","Top", TabTop+230)
|
|---|
| 1666 | do I = 1 to Pages
|
|---|
| 1667 | ok = VRSet("TAB_"I,"Top", TabTop)
|
|---|
| 1668 | ok = VRSet("TAB_"I,"PicturePath","#2"||I||";#2"||I)
|
|---|
| 1669 | ok = VRSet("TAB_"I,"Left",TabWidth*(I-1)+PageLeft)
|
|---|
| 1670 | ok = VRSet("TAB_"I,"Width",TabWidth)
|
|---|
| 1671 | ok = VRSet("TAB_"I,"Height",TabHeight)
|
|---|
| 1672 | ok = VRSet("Page_"I,"Height", max(PageHeight,VRget("GB_Main2","Height")-600))
|
|---|
| 1673 | ok = VRSet("Page_"I,"Width", max(PageWidth,VRget("GB_Main2","Width")-450))
|
|---|
| 1674 | ok = VRSet("Page_"I,"Left", PageLeft)
|
|---|
| 1675 | ok = VRSet("Page_"I,"Top", PageTop)
|
|---|
| 1676 | ok = VRSet("Page_"I,"Visible", 0)
|
|---|
| 1677 | ok = VRSet("Page_"I,"BackColor", "<default>")
|
|---|
| 1678 | end
|
|---|
| 1679 | return
|
|---|
| 1680 |
|
|---|
| 1681 | /*:VRX Quit
|
|---|
| 1682 | */
|
|---|
| 1683 | Quit:
|
|---|
| 1684 | call _IniWrite
|
|---|
| 1685 | ok = VRRedirectStdIO("OFF")
|
|---|
| 1686 | call _SambaFinish
|
|---|
| 1687 |
|
|---|
| 1688 | ok = SysFileDelete(smbdoutput)
|
|---|
| 1689 |
|
|---|
| 1690 | window = VRWindow()
|
|---|
| 1691 | call VRSet window, "Shutdown", 1
|
|---|
| 1692 | drop window
|
|---|
| 1693 | return
|
|---|
| 1694 |
|
|---|
| 1695 | /*:VRX SPIN_Intervall_Change
|
|---|
| 1696 | */
|
|---|
| 1697 | SPIN_Intervall_Change:
|
|---|
| 1698 | Intervall = VRGet("SPIN_Intervall","Value")
|
|---|
| 1699 | ok = VRSet("TM_Refresh","Delay", Intervall * 1000)
|
|---|
| 1700 | return
|
|---|
| 1701 |
|
|---|
| 1702 | /*:VRX SPIN_IntervallMin_Change
|
|---|
| 1703 | */
|
|---|
| 1704 | SPIN_IntervallMin_Change:
|
|---|
| 1705 | IntervallMin = VRGet("SPIN_IntervallMin","Value")
|
|---|
| 1706 | return
|
|---|
| 1707 |
|
|---|
| 1708 | /*:VRX TAB_1_Click
|
|---|
| 1709 | */
|
|---|
| 1710 | TAB_1_Click:
|
|---|
| 1711 | call Activate 1
|
|---|
| 1712 | return
|
|---|
| 1713 |
|
|---|
| 1714 | /*:VRX TAB_2_Click
|
|---|
| 1715 | */
|
|---|
| 1716 | TAB_2_Click:
|
|---|
| 1717 | call Activate 2
|
|---|
| 1718 | return
|
|---|
| 1719 |
|
|---|
| 1720 | /*:VRX TAB_3_Click
|
|---|
| 1721 | */
|
|---|
| 1722 | TAB_3_Click:
|
|---|
| 1723 | call Activate 3
|
|---|
| 1724 | return
|
|---|
| 1725 |
|
|---|
| 1726 | /*:VRX TAB_4_Click
|
|---|
| 1727 | */
|
|---|
| 1728 | TAB_4_Click:
|
|---|
| 1729 | call Activate 4
|
|---|
| 1730 | return
|
|---|
| 1731 |
|
|---|
| 1732 | /*:VRX TAB_5_Click
|
|---|
| 1733 | */
|
|---|
| 1734 | TAB_5_Click:
|
|---|
| 1735 | call Activate 5
|
|---|
| 1736 | if FirstRun = 1 then call _RefreshTree
|
|---|
| 1737 | return
|
|---|
| 1738 |
|
|---|
| 1739 | /*:VRX TAB_6_Click
|
|---|
| 1740 | */
|
|---|
| 1741 | TAB_6_Click:
|
|---|
| 1742 | call Activate 6
|
|---|
| 1743 | return
|
|---|
| 1744 |
|
|---|
| 1745 | /*:VRX TM_Refresh_Trigger
|
|---|
| 1746 | */
|
|---|
| 1747 | TM_Refresh_Trigger:
|
|---|
| 1748 | ok = VRSet("TM_Refresh","Delay", Intervall * 1000)
|
|---|
| 1749 | call _Refresh
|
|---|
| 1750 | return
|
|---|
| 1751 |
|
|---|