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\trunk\guitools\shared\inittempdir.vrs
|
---|
94 | #append U:\Develop\Samba\trunk\guitools\shared\sambainit.vrs
|
---|
95 | #append U:\Develop\Samba\trunk\guitools\shared\nlv.vrs
|
---|
96 | #append U:\Develop\Samba\trunk\guitools\shared\smbtree.vrs
|
---|
97 | */
|
---|
98 | return
|
---|
99 | /*:VRX _ColumnShow
|
---|
100 | */
|
---|
101 | _ColumnShow:
|
---|
102 | userdata = VRGet(VRInfo("Object"),"Userdata")
|
---|
103 | parse var userdata Container '|' fieldh '|' VisStatus
|
---|
104 | say userdata
|
---|
105 | ok = VRMethod(Container,"SetFieldAttr", fieldh, "Visible", \VisStatus )
|
---|
106 | return
|
---|
107 |
|
---|
108 | /*:VRX _ColumnsMenu
|
---|
109 | */
|
---|
110 | _ColumnsMenu:
|
---|
111 | Container = arg(1)
|
---|
112 | ok = VRMethod(Container, "GetFieldList", "Fields." )
|
---|
113 |
|
---|
114 | do I = 1 to 14
|
---|
115 | R2I = right("0"||I,2)
|
---|
116 | if I <= fields.0 then do
|
---|
117 | /* say "Columns_"||R2I' 'VRMethod(Container, "GetFieldAttr", fields.I, "Title" ) */
|
---|
118 | ok = VRset("Columns_"||R2I, "Visible", 1)
|
---|
119 | ok = VRset("Columns_"||R2I, "Caption", VRMethod(Container, "GetFieldAttr", fields.I, "Title" ))
|
---|
120 | ok = VRset("Columns_"||R2I, "Checked", VRMethod(Container, "GetFieldAttr", fields.I, "Visible" ))
|
---|
121 | ok = VRset("Columns_"||R2I, "Userdata", Container'|'fields.I'|'VRMethod(Container, "GetFieldAttr", fields.I, "Visible" ))
|
---|
122 | end
|
---|
123 | else ok = VRset("Columns_"||R2I, "Visible", 0)
|
---|
124 | end
|
---|
125 | ok = VRMethod( "Columns", "Popup", , , "", "" )
|
---|
126 | return
|
---|
127 |
|
---|
128 | /*:VRX _ContainerInit
|
---|
129 | */
|
---|
130 | _ContainerInit:
|
---|
131 | say '_ContainerInit() started.'
|
---|
132 |
|
---|
133 | /* User */
|
---|
134 | UIconH = VRMethod( "CN_Users", "AddField", "Icon", NLVGetMessage(148) )
|
---|
135 | UsernameFH = VRMethod( "CN_Users", "AddField", "String", NLVGetMessage(131) )
|
---|
136 | GroupFH = VRMethod( "CN_Users", "AddField", "String", NLVGetMessage(132) )
|
---|
137 | UMachineFH = VRMethod( "CN_Users", "AddField", "String", NLVGetMessage(133) )
|
---|
138 | UIPAdrFH = VRMethod( "CN_Users", "AddField", "String", NLVGetMessage(147) )
|
---|
139 | UPIDFH = VRMethod( "CN_Users", "AddField", "String", NLVGetMessage(130) )
|
---|
140 |
|
---|
141 | /* Files */
|
---|
142 | FIconH = VRMethod( "CN_Files", "AddField", "Icon", NLVGetMessage(148) )
|
---|
143 | FileFH = VRMethod( "CN_Files", "AddField", "String", NLVGetMessage(134) )
|
---|
144 | FUserFH = VRMethod( "CN_Files", "AddField", "String", NLVGetMessage(131) )
|
---|
145 | FPIDFH = VRMethod( "CN_Files", "AddField", "String", NLVGetMessage(130) )
|
---|
146 | DenyModeFH = VRMethod( "CN_Files", "AddField", "String", NLVGetMessage(135) )
|
---|
147 | TimeFH = VRMethod( "CN_Files", "AddField", "String", NLVGetMessage(136) )
|
---|
148 | DateFH = VRMethod( "CN_Files", "AddField", "String", NLVGetMessage(149) )
|
---|
149 | AccessFH = VRMethod( "CN_Files", "AddField", "String", NLVGetMessage(137) )
|
---|
150 | RWFH = VRMethod( "CN_Files", "AddField", "String", NLVGetMessage(138) )
|
---|
151 | OplockFH = VRMethod( "CN_Files", "AddField", "String", NLVGetMessage(139) )
|
---|
152 | UIDFH = VRMethod( "CN_Files", "AddField", "String", NLVGetMessage(140) )
|
---|
153 | SharePathFH= VRMethod( "CN_Files", "AddField", "String", NLVGetMessage(141) )
|
---|
154 | NameFH = VRMethod( "CN_Files", "AddField", "String", NLVGetMessage(142) )
|
---|
155 |
|
---|
156 | /* service */
|
---|
157 | SIconH = VRMethod( "CN_Service", "AddField", "Icon", NLVGetMessage(148) )
|
---|
158 | SPIDFH = VRMethod( "CN_Service", "AddField", "String", NLVGetMessage(130) )
|
---|
159 | ServiceFH = VRMethod( "CN_Service", "AddField", "String", NLVGetMessage(143) )
|
---|
160 | SMachineFH = VRMethod( "CN_Service", "AddField", "String", NLVGetMessage(133) )
|
---|
161 | ConnectedFH= VRMethod( "CN_Service", "AddField", "String", NLVGetMessage(144) )
|
---|
162 |
|
---|
163 | /* daemons */
|
---|
164 | DaemonFH = VRMethod( "CN_Daemons", "AddField", "String", NLVGetMessage(145) )
|
---|
165 | DStatusFH = VRMethod( "CN_Daemons", "AddField", "String", NLVGetMessage(146) )
|
---|
166 | DPidsFH = VRMethod( "CN_Daemons", "AddField", "String", NLVGetMessage(130) )
|
---|
167 |
|
---|
168 | /* Browse tree */
|
---|
169 | WorkgroupFH= VRMethod( "CN_smbtree", "AddField", "String", NLVGetMessage(150) )
|
---|
170 | NBFH = VRMethod( "CN_smbtree", "AddField", "String", "NetBIOS name" )
|
---|
171 | IpFH = VRMethod( "CN_smbtree", "AddField", "String", NLVGetMessage(147) )
|
---|
172 | MBFH = VRMethod( "CN_smbtree", "AddField", "String", "DMB/LMB" )
|
---|
173 |
|
---|
174 | OSFH = VRMethod( "CN_smbtree", "AddField", "String", "OS" )
|
---|
175 | /* VersionFH = VRMethod( "CN_SmbTree", "AddField", "String", "Version" ) */
|
---|
176 | CommentFH = VRMethod( "CN_smbtree", "AddField", "String", NLVGetMessage(151) )
|
---|
177 | MacFH = VRMethod( "CN_smbtree", "AddField", "String", "MAC" )
|
---|
178 |
|
---|
179 | ok = VRMethod("CN_smbtree","SetfieldAttr",IPFH, "ReadOnly", 1)
|
---|
180 | ok = VRMethod("CN_smbtree","SetfieldAttr",NBFH, "ReadOnly", 1)
|
---|
181 | ok = VRMethod("CN_smbtree","SetfieldAttr",MBFH, "ReadOnly", 1)
|
---|
182 | ok = VRMethod("CN_smbtree","SetfieldAttr",WorkGroupFH,"ReadOnly", 1)
|
---|
183 | ok = VRMethod("CN_smbtree","SetfieldAttr",OSFH, "ReadOnly", 1)
|
---|
184 | ok = VRMethod("CN_smbtree","SetfieldAttr",MacFH, "ReadOnly", 1)
|
---|
185 |
|
---|
186 |
|
---|
187 | /* add records for the 3 daemons */
|
---|
188 | smbdHandle = VRMethod("CN_Daemons", "Addrecord",, ,"smbd.exe","$41")
|
---|
189 | ok = VRMethod("CN_Daemons", "SetFieldData", smbdHandle, DaemonFH, "smbd.exe")
|
---|
190 | nmbdHandle = VRMethod("CN_Daemons", "Addrecord", ,,"nmbd.exe","$41")
|
---|
191 | ok = VRMethod("CN_Daemons", "SetFieldData", nmbdHandle, DaemonFH, "nmbd.exe")
|
---|
192 | winbHandle = VRMethod("CN_Daemons", "Addrecord",, ,"winbindd.exe","$41")
|
---|
193 | ok = VRMethod("CN_Daemons", "SetFieldData", winbHandle, DaemonFH, "winbindd.exe")
|
---|
194 | ok = (stream(samba.!bin'\winbindd.exe','c','query exists') <> "")
|
---|
195 | ok = VRMethod("CN_Daemons", "SetRecordAttr", winbHandle, "Visible", ok)
|
---|
196 |
|
---|
197 | ok = VRMethod("CN_Daemons","SetRecordAttr","All", "Collapsed", 0 )
|
---|
198 |
|
---|
199 | say '_ContainerInit() done.'
|
---|
200 | return
|
---|
201 | /*:VRX _ContainerSort
|
---|
202 | */
|
---|
203 | _ContainerSort:
|
---|
204 | ok = VRMethod( "LB_SortFields", "GetSelectedList", "SortFields." )
|
---|
205 | if Fields.0 = 0 then return
|
---|
206 | idx = SortFields.1
|
---|
207 | ok = VRset( Container, "DetailSort", Fields.idx )
|
---|
208 | ok = VRSet( Container, "Sort", SortOrder )
|
---|
209 | ok = VRMethod( Container, "SortRecords" )
|
---|
210 | return
|
---|
211 |
|
---|
212 | /*:VRX _CreateSmbStarter
|
---|
213 | */
|
---|
214 | _CreateSmbStarter:
|
---|
215 | ok = SysFileDelete(samba.!bin'\smbstarter.cmd')
|
---|
216 | call lineout samba.!bin'\smbstarter.cmd', '/* REXX */'
|
---|
217 | call lineout samba.!bin'\smbstarter.cmd', 'signal on failure name CLEANUP'
|
---|
218 | call lineout samba.!bin'\smbstarter.cmd', 'signal on halt name CLEANUP'
|
---|
219 | call lineout samba.!bin'\smbstarter.cmd', 'signal on syntax name CLEANUP'
|
---|
220 | call lineout samba.!bin'\smbstarter.cmd', 'say "Samba Server Starter"'
|
---|
221 | call lineout samba.!bin'\smbstarter.cmd', 'address cmd "@echo off"'
|
---|
222 | call lineout samba.!bin'\smbstarter.cmd', 'home:'
|
---|
223 | call lineout samba.!bin'\smbstarter.cmd', 'select'
|
---|
224 | call lineout samba.!bin'\smbstarter.cmd', 'when VRFileExists("smbstart") then do'
|
---|
225 | call lineout samba.!bin'\smbstarter.cmd', 'say "Start"'
|
---|
226 | call lineout samba.!bin'\smbstarter.cmd', 'address cmd "call 'samba.!bin'\smb.cmd start"'
|
---|
227 | call lineout samba.!bin'\smbstarter.cmd', 'ok = SysFileDelete("smbstart")'
|
---|
228 | call lineout samba.!bin'\smbstarter.cmd', 'end'
|
---|
229 | call lineout samba.!bin'\smbstarter.cmd', 'when VRFileExists("smbstop") then do'
|
---|
230 | call lineout samba.!bin'\smbstarter.cmd', 'say "Stop"'
|
---|
231 | call lineout samba.!bin'\smbstarter.cmd', 'address cmd "call 'samba.!bin'\smb.cmd stop"'
|
---|
232 | call lineout samba.!bin'\smbstarter.cmd', 'ok = SysFileDelete("smbstop")'
|
---|
233 | call lineout samba.!bin'\smbstarter.cmd', 'end'
|
---|
234 | call lineout samba.!bin'\smbstarter.cmd', 'when VRFileExists("restart") then do'
|
---|
235 | call lineout samba.!bin'\smbstarter.cmd', 'say "Restart"'
|
---|
236 | call lineout samba.!bin'\smbstarter.cmd', 'address cmd "call 'samba.!bin'\smb.cmd restart"'
|
---|
237 | call lineout samba.!bin'\smbstarter.cmd', 'ok = SysFileDelete("restart")'
|
---|
238 | call lineout samba.!bin'\smbstarter.cmd', 'end'
|
---|
239 | call lineout samba.!bin'\smbstarter.cmd', 'when VRFileExists("reload") then do'
|
---|
240 | call lineout samba.!bin'\smbstarter.cmd', 'say "Reload"'
|
---|
241 | call lineout samba.!bin'\smbstarter.cmd', 'address cmd "call 'samba.!bin'\smb.cmd reload"'
|
---|
242 | call lineout samba.!bin'\smbstarter.cmd', 'ok = SysFileDelete("reload")'
|
---|
243 | call lineout samba.!bin'\smbstarter.cmd', 'end'
|
---|
244 | call lineout samba.!bin'\smbstarter.cmd', 'when VRFileExists("quit") then do'
|
---|
245 | call lineout samba.!bin'\smbstarter.cmd', 'say "Quit"'
|
---|
246 | call lineout samba.!bin'\smbstarter.cmd', 'ok = SysFileDelete("quit")'
|
---|
247 | call lineout samba.!bin'\smbstarter.cmd', 'signal cleanup'
|
---|
248 | call lineout samba.!bin'\smbstarter.cmd', 'end'
|
---|
249 | call lineout samba.!bin'\smbstarter.cmd', 'otherwise nop'
|
---|
250 | call lineout samba.!bin'\smbstarter.cmd', 'end'
|
---|
251 | call lineout samba.!bin'\smbstarter.cmd', 'ok = SysSleep(1)'
|
---|
252 | call lineout samba.!bin'\smbstarter.cmd', 'signal home'
|
---|
253 | call lineout samba.!bin'\smbstarter.cmd', 'cleanup:'
|
---|
254 | call lineout samba.!bin'\smbstarter.cmd', 'say "Aborting..."'
|
---|
255 | call lineout samba.!bin'\smbstarter.cmd', 'exit'
|
---|
256 | ok = stream(samba.!bin'\smbstarter.cmd','c','close')
|
---|
257 |
|
---|
258 | Setup = 'NOPRINT=YES;DEFAULTVIEW=RUNNING;'||,
|
---|
259 | 'EXENAME='samba.!bin'\smbstarter.cmd;'||,
|
---|
260 | 'STARTUPDIR='samba.!bin';'||,
|
---|
261 | 'TITLE=;'||,
|
---|
262 | 'PROGTYPE=WINDOWABLEVIO;'||,
|
---|
263 | 'MINIMIZED=YES;'||,
|
---|
264 | 'VISIBLE=NO;'||,
|
---|
265 | 'NOAUTOCLOSE=NO;'||,
|
---|
266 | 'OBJECTID=<smbstarter>'
|
---|
267 |
|
---|
268 | rc = SysCreateObject('WPProgram', 'SMBSTARTER', '<WP_NOWHERE>', Setup, 'UPDATE' )
|
---|
269 | If rc <> 1 Then Say ' > failed to create SMBSTARTER Object'
|
---|
270 | else ok = SysOpenObject('<smbstarter>', 'DEFAULT', 1)
|
---|
271 |
|
---|
272 |
|
---|
273 | return
|
---|
274 |
|
---|
275 | /*:VRX _GuessIcon
|
---|
276 | */
|
---|
277 | _GuessIcon: procedure
|
---|
278 | text = arg(1)
|
---|
279 | select /* Printer guessing */
|
---|
280 | when pos('LJ',text) > 0 then res = '#65:PMWP.DLL'
|
---|
281 | when pos('LASER',text) > 0 then res = '#65:PMWP.DLL'
|
---|
282 | when pos('EPSON',text) > 0 then res = '#65:PMWP.DLL'
|
---|
283 | when pos('PRINT',text) > 0 then res = '#65:PMWP.DLL'
|
---|
284 | when pos('PRT',text) > 0 then res = '#65:PMWP.DLL'
|
---|
285 | when pos('CANON',text) > 0 then res = '#65:PMWP.DLL'
|
---|
286 | when pos('MINOLTA',text) > 0 then res = '#65:PMWP.DLL'
|
---|
287 | when pos('FAX',text) > 0 then res = '#65:PMWP.DLL'
|
---|
288 | when pos('LEXMARK',text) > 0 then res = '#65:PMWP.DLL'
|
---|
289 | when pos('IPC$',text) > 0 then res = '#59:PMWP.DLL'
|
---|
290 | otherwise res = "#34:PMWP.DLL"
|
---|
291 | end
|
---|
292 | return res
|
---|
293 |
|
---|
294 | /*:VRX _GUIInit
|
---|
295 | */
|
---|
296 | _GUIInit:
|
---|
297 | IF options.!debug == 1 then say time()' _GUIInit() started'
|
---|
298 |
|
---|
299 | if datatype(Top) = 'NUM' then do
|
---|
300 | ok = VRset("Main","Top",Top)
|
---|
301 | ok = VRset("Main","Left",Left)
|
---|
302 | ok = VRset("Main","Width",Width)
|
---|
303 | ok = VRset("Main","Height",Height)
|
---|
304 | end
|
---|
305 | ok = VRSet("Main", "Font", Font.!Main)
|
---|
306 | ok = VRSet("DT_StatusBar","Font", Font.!Status)
|
---|
307 | ok = VRSet("SW_Users", "Font", Font.!Users)
|
---|
308 | ok = VRSet("SW_Files", "Font", Font.!Files)
|
---|
309 | ok = VRSet("SW_Service", "Font", Font.!Service)
|
---|
310 | ok = VRSet("SW_Daemons", "Font", Font.!Daemons)
|
---|
311 | ok = VRSet("SW_SMBTree", "Font", Font.!SMBTree)
|
---|
312 | ok = VRSet("SW_Settings", "Font", Font.!Settings)
|
---|
313 |
|
---|
314 | ok = VRSet("CN_Users", "Font", Font.!Users)
|
---|
315 | ok = VRSet("CN_Files", "Font", Font.!Files)
|
---|
316 | ok = VRSet("CN_Service", "Font", Font.!Service)
|
---|
317 | ok = VRSet("CN_Daemons", "Font", Font.!Daemons)
|
---|
318 | ok = VRSet("CN_SMBTree", "Font", Font.!SMBTree)
|
---|
319 |
|
---|
320 |
|
---|
321 | Buttonwidth = VRMethod( "Screen", "PixelsToTwips", 32 )
|
---|
322 |
|
---|
323 | ok = VRSet("SPIN_Intervall", "Value", Intervall)
|
---|
324 | ok = VRSet("SPIN_IntervallMin","Value", IntervallMin)
|
---|
325 | ok = VRSet("TM_Refresh","Delay", Intervall * 1000)
|
---|
326 |
|
---|
327 | ok = VRSet("PB_START", "Enabled", VRFileExists(samba.!smbcmd))
|
---|
328 | ok = VRSet("PB_Restart","Enabled", VRFileExists(samba.!smbcmd))
|
---|
329 | ok = VRSet("PB_Reload", "Enabled", VRFileExists(samba.!smbcmd))
|
---|
330 |
|
---|
331 | ok = VRSet("CN_Daemons", "View", DaemonView)
|
---|
332 | ok = VRSet("CN_smbtree", "View", TreeView)
|
---|
333 | ok = VRSet("CB_NoMsgBox","Set", NoMsgBox)
|
---|
334 | ok = VRSet("CB_WPSStartStop","Set", WPSStartStop)
|
---|
335 |
|
---|
336 | call _INILayoutRead "CN_Users"
|
---|
337 | call _INILayoutRead "CN_Files"
|
---|
338 | call _INILayoutRead "CN_Service"
|
---|
339 | call _INILayoutRead "CN_Daemons"
|
---|
340 | call _INILayoutRead "CN_smbtree"
|
---|
341 |
|
---|
342 | ok = VRset("CN_DAEMONS", "MiniIcons", \advanced.!bigicons)
|
---|
343 | ok = VRset("CN_SMBTREE", "MiniIcons", \advanced.!bigicons)
|
---|
344 | ok = VRset("ContextMenu_Tree_MiniIcons", "Checked", \advanced.!bigicons)
|
---|
345 | ok = VRset("ContextMenu_Daemons_MiniIcons", "Checked", \advanced.!bigicons)
|
---|
346 | ok = VRSet("CB_Debug","set",options.!Debug)
|
---|
347 |
|
---|
348 | if _ChkTempFreeSpace() < 262144 then do
|
---|
349 | Msg.Type = "W"
|
---|
350 | Msg.Text = NLVGetMessage(116, TempDir)
|
---|
351 | call _ShowMsg
|
---|
352 | end
|
---|
353 |
|
---|
354 | /* Common margin around controls */
|
---|
355 | margin = ((VRGet("Main", "InteriorLeft") / 3) * 2) + 2
|
---|
356 |
|
---|
357 | /* Statusbar */
|
---|
358 | ok = VRSet("DT_STATUSBAR","Caption", VRGet("Main", "HintText"))
|
---|
359 |
|
---|
360 | call Main_Resize
|
---|
361 |
|
---|
362 |
|
---|
363 | ok = VRSet("Main", "Visible", 1)
|
---|
364 | IF options.!debug == 1 then say time()' _GUIInit() done'
|
---|
365 | return
|
---|
366 |
|
---|
367 | /*:VRX _INILayoutRead
|
---|
368 | */
|
---|
369 | _INILayoutRead:
|
---|
370 | Container = arg(1)
|
---|
371 | ok = VRMethod(Container, "GetFieldList", "Fields." )
|
---|
372 | Layout = VRGetIni( "Layout", Container, OurINI )
|
---|
373 | if Layout = "" then return
|
---|
374 | do I = 1 to Fields.0
|
---|
375 | ok = VRMethod(Container, "SetFieldAttr", fields.I,"Visible", substr(Layout,I,1))
|
---|
376 | end
|
---|
377 | return
|
---|
378 |
|
---|
379 | /*:VRX _INILayoutWrite
|
---|
380 | */
|
---|
381 | _INILayoutWrite:
|
---|
382 | Container = arg(1)
|
---|
383 | ok = VRMethod(Container, "GetFieldList", "Fields." )
|
---|
384 | Layout = ""
|
---|
385 | do I = 1 to fields.0
|
---|
386 | Layout = Layout||VRMethod(Container, "GetFieldAttr", fields.I, "Visible" )
|
---|
387 | end
|
---|
388 | ok = VRSetIni( "Layout", Container , Layout, OurINI, 'NoClose' )
|
---|
389 | return
|
---|
390 |
|
---|
391 | /*:VRX _INIRead
|
---|
392 | */
|
---|
393 | _INIRead:
|
---|
394 | IF options.!debug == 1 then say time()' _INIRead() started'
|
---|
395 |
|
---|
396 | OurINI = strip(VRParseFileName(VRget("Application","Program"),'DP')'\SMBSTATUS.INI',,'\')
|
---|
397 | ok = SysFileTree(OurINI, INIFound.,'FO')
|
---|
398 | if INIFound.0 = 1 then OurINI = VRParseFileName(INIFound.1,'DPNE')
|
---|
399 | IF options.!debug == 1 then say ' OurINI='OurINI
|
---|
400 |
|
---|
401 | Top = VRGetIni( "Pos", "Top", OurINI , 'NoClose')
|
---|
402 | Left = VRGetIni( "Pos", "Left", OurINI , 'NoClose')
|
---|
403 | Width = VRGetIni( "Pos", "Width", OurINI , 'NoClose')
|
---|
404 | Height= VRGetIni( "Pos", "Height", OurINI , 'NoClose')
|
---|
405 |
|
---|
406 | Font.!Users = VRGetIni( "Fonts", "SW_USERS", OurINI , 'NoClose' )
|
---|
407 | Font.!Files = VRGetIni( "Fonts", "SW_FILES", OurINI , 'NoClose' )
|
---|
408 | Font.!Service = VRGetIni( "Fonts", "SW_SERVICE", OurINI , 'NoClose' )
|
---|
409 | Font.!Daemons = VRGetIni( "Fonts", "SW_DAEMONS", OurINI , 'NoClose' )
|
---|
410 | Font.!SMBTree = VRGetIni( "Fonts", "SW_SMBTREE", OurINI , 'NoClose' )
|
---|
411 | Font.!Settings= VRGetIni( "Fonts", "SW_SETTINGS", OurINI , 'NoClose' )
|
---|
412 | Font.!Main = VRGetIni( "Fonts", "Main", OurINI , 'NoClose' )
|
---|
413 | Font.!Status = VRGetIni( "Fonts", "Statusfont", OurINI , 'NoClose' )
|
---|
414 |
|
---|
415 | if Font.!Users = "" then Font.!Users = "9.WarpSans"
|
---|
416 | if Font.!Files = "" then Font.!Files = "9.WarpSans"
|
---|
417 | if Font.!Service = "" then Font.!Service = "9.WarpSans"
|
---|
418 | if Font.!Daemons = "" then Font.!Daemons = "9.WarpSans"
|
---|
419 | if Font.!SMBTree = "" then Font.!SMBTree = "9.WarpSans"
|
---|
420 | if Font.!Settings = "" then Font.!Settings = "9.WarpSans"
|
---|
421 | if Font.!Main = "" then Font.!Main = "9.WarpSans"
|
---|
422 | if Font.!Status = "" then Font.!Status = "9.WarpSans"
|
---|
423 |
|
---|
424 | Intervall = VRGetIni( "Settings", "Intervall", OurINI)
|
---|
425 | if Intervall = "" then Intervall = 60
|
---|
426 |
|
---|
427 | IntervallMin = VRGetIni( "Settings", "IntervallMin", OurINI)
|
---|
428 | if IntervallMin = "" then IntervallMin = 180
|
---|
429 |
|
---|
430 | CurrentPageNr = VRGetIni( "Settings", "CurrentPageNr", OurINI)
|
---|
431 | if CurrentPageNr = "" then CurrentPageNr = 4
|
---|
432 |
|
---|
433 | DaemonView = VRGetIni( "Settings", "DaemonView", OurINI)
|
---|
434 | if DaemonView = "" then DaemonView = "Detail"
|
---|
435 |
|
---|
436 | TreeView = VRGetIni( "Settings", "TreeView", OurINI)
|
---|
437 | if TreeView = "" then TreeView = "IconTree"
|
---|
438 |
|
---|
439 | NoMsgBox = VRGetIni( "Settings", "NoMsgBox", OurINI)
|
---|
440 | if NoMsgBox = "" then NoMsgBox = 0
|
---|
441 |
|
---|
442 | WPSStartStop = VRGetIni( "Settings", "WPSStartStop", OurINI)
|
---|
443 | if WPSStartStop = "" then WPSStartStop = 0
|
---|
444 |
|
---|
445 | options.!debug = VRGetIni( "Options", "Debug", OurINI)
|
---|
446 | if options.!debug = "" then options.!debug = 0
|
---|
447 |
|
---|
448 | if options.!Debug then ok = VRRedirectStdIO("ON")
|
---|
449 | else ok = VRRedirectStdIO("OFF")
|
---|
450 |
|
---|
451 | advanced.!bigicons = VRGetIni( "Settings", "BigIcons", OurINI)
|
---|
452 | if advanced.!bigicons = "" then advanced.!bigicons = 0
|
---|
453 |
|
---|
454 | /* For Browse page */
|
---|
455 | FirstRun = 1
|
---|
456 | /* For Users page in case connections.tdb is not initialised */
|
---|
457 | IgnoreSmbNoInit = 1
|
---|
458 |
|
---|
459 | /* For Refresh tree display code */
|
---|
460 | RefreshMode =""
|
---|
461 |
|
---|
462 | smbdpidhandle.0 = 0
|
---|
463 | nmbdpidhandle.0 = 0
|
---|
464 | winbpidhandle.0 = 0
|
---|
465 |
|
---|
466 | prevsmbdct = 0
|
---|
467 | prevnmbdct = 0
|
---|
468 | prevwinbct = 0
|
---|
469 |
|
---|
470 | smbdoutput = TempDir'smbd.out'
|
---|
471 | IF options.!debug == 1 then say time()' _INIRead() done'
|
---|
472 | return
|
---|
473 |
|
---|
474 | /*:VRX _INIWrite
|
---|
475 | */
|
---|
476 | _INIWrite:
|
---|
477 | say 'start _INIWrite()'
|
---|
478 | ok = VRSetIni( "Pos", "Top", VRGet("Main","Top"), OurINI, 'NoClose' )
|
---|
479 | ok = VRSetIni( "Pos", "Left", VRGet("Main","Left"), OurINI, 'NoClose' )
|
---|
480 | ok = VRSetIni( "Pos", "Width", VRGet("Main","Width"), OurINI, 'NoClose' )
|
---|
481 | ok = VRSetIni( "Pos", "Height", VRGet("Main","Height"), OurINI, 'NoClose' )
|
---|
482 |
|
---|
483 | ok = VRSetIni( "Settings", "Intervall", VRGet("SPIN_Intervall","Value"),OurINI,'NoClose')
|
---|
484 | ok = VRSetIni( "Settings", "IntervallMin", VRGet("SPIN_IntervallMin","Value"),OurINI,'NoClose')
|
---|
485 | ok = VRSetIni( "Settings", "CurrentPageNr",CurrentPageNr, OurINI,'NoClose')
|
---|
486 | ok = VRSetIni( "Settings", "DaemonView", VRGet("CN_Daemons","View"), OurINI,'NoClose')
|
---|
487 | ok = VRSetIni( "Settings", "TreeView", VRGet("CN_smbtree","View"), OurINI,'NoClose')
|
---|
488 | ok = VRSetIni( "Settings", "NoMsgBox", NoMsgBox, OurINI,'NoClose')
|
---|
489 | ok = VRSetIni( "Settings", "WPSStartStop", WPSStartStop, OurINI,'NoClose')
|
---|
490 | ok = VRSetIni( "Settings", "BigIcons", \VRGet("CN_SMBTREE", "MiniIcons"),OurINI,'NoClose')
|
---|
491 |
|
---|
492 | ok = VRSetIni( "Options", "Debug", options.!debug, OurINI, 'NoClose' )
|
---|
493 |
|
---|
494 | call _INILayoutWrite "CN_Users"
|
---|
495 | call _INILayoutWrite "CN_Files"
|
---|
496 | call _INILayoutWrite "CN_Service"
|
---|
497 | call _INILayoutWrite "CN_Daemons"
|
---|
498 | call _INILayoutWrite "CN_smbtree"
|
---|
499 |
|
---|
500 | if VRGet("CN_USERS", "Font") <> "<default>" then ok = VRSet("SW_USERS", "Font", VRGet("CN_USERS", "Font"))
|
---|
501 | if VRGet("CN_FILES", "Font") <> "<default>" then ok = VRSet("SW_FILES", "Font", VRGet("CN_FILES", "Font"))
|
---|
502 | if VRGet("CN_SERVICE", "Font") <> "<default>" then ok = VRSet("SW_SERVICE","Font", VRGet("CN_SERVICE","Font"))
|
---|
503 | if VRGet("CN_DAEMONS", "Font") <> "<default>" then ok = VRSet("SW_DAEMONS","Font", VRGet("CN_DAEMONS","Font"))
|
---|
504 | if VRGet("CN_SMBTREE", "Font") <> "<default>" then ok = VRSet("SW_SMBTREE","Font", VRGet("CN_SMBTREE","Font"))
|
---|
505 |
|
---|
506 | ok = VRSetIni( "Fonts", "SW_USERS", VRGet("SW_USERS", "Font"), OurINI, 'NoClose' )
|
---|
507 | ok = VRSetIni( "Fonts", "SW_FILES", VRGet("SW_FILES", "Font"), OurINI, 'NoClose' )
|
---|
508 | ok = VRSetIni( "Fonts", "SW_SERVICE", VRGet("SW_SERVICE", "Font"), OurINI, 'NoClose' )
|
---|
509 | ok = VRSetIni( "Fonts", "SW_DAEMONS", VRGet("SW_DAEMONS", "Font"), OurINI, 'NoClose' )
|
---|
510 | ok = VRSetIni( "Fonts", "SW_SMBTREE", VRGet("SW_SMBTREE", "Font"), OurINI, 'NoClose' )
|
---|
511 | ok = VRSetIni( "Fonts", "SW_SETTINGS",VRGet("SW_SETTINGS","Font"), OurINI, 'NoClose' )
|
---|
512 | ok = VRSetIni( "Fonts", "Statusfont", VRGet("DT_StatusBar","Font"),OurINI, 'NoClose' )
|
---|
513 | ok = VRSetIni( "Fonts", "Main", VRGet("Main","Font"), OurINI )
|
---|
514 | say 'done _INIWrite()'
|
---|
515 | return
|
---|
516 |
|
---|
517 | /*:VRX _LoadotherFuncs
|
---|
518 | */
|
---|
519 | _LoadotherFuncs:
|
---|
520 | IF options.!debug == 1 then say time()' _LoadotherFuncs() started'
|
---|
521 | SIGNAL ON SYNTAX NAME DLLMissing
|
---|
522 |
|
---|
523 | call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
|
---|
524 | call SysLoadFuncs
|
---|
525 |
|
---|
526 | call RxFuncAdd 'PRLoadFuncs', 'PR1UTIL', 'PRLoadFuncs'
|
---|
527 | call PRLoadFuncs
|
---|
528 |
|
---|
529 | SIGNAL OFF SYNTAX
|
---|
530 | IF options.!debug == 1 then say time()' _LoadotherFuncs() done'
|
---|
531 | return
|
---|
532 |
|
---|
533 | DLLMissing:
|
---|
534 | Fatal = 1
|
---|
535 | call VRMessage 'Main', 'REXX function library 'strip(translate(word(sourceline(SIGL-1),4),' ',"',"))'.DLL is missing!', "EVFSGUI fatal error", "E"
|
---|
536 | signal Quit
|
---|
537 | /*:VRX _MsgYesNo
|
---|
538 | */
|
---|
539 | _MsgYesNo:
|
---|
540 | say "_MsgYesNo() started"
|
---|
541 | buttons.0 = 2
|
---|
542 | buttons.1 = NLVGetMessage(6)
|
---|
543 | buttons.2 = NLVGetMessage(7)
|
---|
544 | default = 2
|
---|
545 | buttons.default = NLVGetMessage(7)
|
---|
546 | esc = 2
|
---|
547 | buttons.esc = NLVGetMessage(7)
|
---|
548 | RC = VRMessage( VRWindow(), Msg.Text, Msg.Title,"Q","buttons.",default, esc )
|
---|
549 | say "_MsgYesNo() done, answer "RC
|
---|
550 | return RC
|
---|
551 |
|
---|
552 | /*:VRX _NLVSetup
|
---|
553 | */
|
---|
554 | _NLVSetup:
|
---|
555 |
|
---|
556 | Msg.Title = NLVGetMessage(1)
|
---|
557 | ok = VRSet("Main","helpFile", settings.!helpfile)
|
---|
558 |
|
---|
559 | CALL NLVSetText 'PB_Refresh', 'Caption', 11
|
---|
560 | CALL NLVSetText 'PB_Cancel', 'Caption', 12
|
---|
561 | CALL NLVSetText 'PB_Help', 'Caption', 13
|
---|
562 | CALL NLVSetText 'PB_About', 'Caption', 14
|
---|
563 |
|
---|
564 | CALL NLVSetText 'PB_Refresh', 'Hinttext', 51
|
---|
565 | CALL NLVSetText 'PB_Cancel', 'Hinttext', 54
|
---|
566 | CALL NLVSetText 'PB_Help', 'Hinttext', 52
|
---|
567 | CALL NLVSetText 'PB_About', 'Hinttext', 53
|
---|
568 |
|
---|
569 | /* CALL NLVSetText 'TAB_1', 'Userdata', 15
|
---|
570 | CALL NLVSetText 'TAB_2', 'Userdata', 16
|
---|
571 | CALL NLVSetText 'TAB_3', 'Userdata', 17
|
---|
572 | CALL NLVSetText 'TAB_4', 'Userdata', 18
|
---|
573 | CALL NLVSetText 'TAB_5', 'Userdata', 19
|
---|
574 | CALL NLVSetText 'TAB_6', 'Userdata', 24
|
---|
575 |
|
---|
576 | CALL NLVSetText 'TAB_1', 'Hinttext', 55
|
---|
577 | CALL NLVSetText 'TAB_2', 'Hinttext', 56
|
---|
578 | CALL NLVSetText 'TAB_3', 'Hinttext', 57
|
---|
579 | CALL NLVSetText 'TAB_4', 'Hinttext', 58
|
---|
580 | CALL NLVSetText 'TAB_5', 'Hinttext', 59
|
---|
581 | CALL NLVSetText 'TAB_6', 'Hinttext', 60 */
|
---|
582 |
|
---|
583 | /* CALL NLVSetText 'Page_1', 'Hinttext', 55
|
---|
584 | CALL NLVSetText 'Page_2', 'Hinttext', 56
|
---|
585 | CALL NLVSetText 'Page_3', 'Hinttext', 57
|
---|
586 | CALL NLVSetText 'Page_4', 'Hinttext', 58
|
---|
587 | CALL NLVSetText 'Page_5', 'Hinttext', 59
|
---|
588 | CALL NLVSetText 'Page_6', 'Hinttext', 60 */
|
---|
589 |
|
---|
590 | CALL NLVSetText 'DT_Refresh', 'Caption', 25
|
---|
591 | CALL NLVSetText 'DT_RefreshMin', 'Caption', 25
|
---|
592 | CALL NLVSetText 'DT_Intervall', 'Caption', 26
|
---|
593 | ok = VRSet("DT_IntervallMin","Caption", NLVGetMessage(26)' 'NLVGetMessage(28))
|
---|
594 | CALL NLVSetText 'CB_NoMsgBox', 'Caption', 27
|
---|
595 | CALL NLVSetText 'CB_WPSSTARTSTOP','Caption', 29
|
---|
596 |
|
---|
597 | CALL NLVSetText 'ContextMenu_Daemons_Sort', 'Caption', 35
|
---|
598 | CALL NLVSetText 'ContextMenu_Daemons_Ping', 'Caption', 32
|
---|
599 | CALL NLVSetText 'ContextMenu_Daemons_Details','Caption', 118
|
---|
600 | CALL NLVSetText 'ContextMenu_Daemons_Tree', 'Caption', 120
|
---|
601 |
|
---|
602 | CALL NLVSetText 'ContextMenu_Files_Sort', 'Caption', 35
|
---|
603 |
|
---|
604 | CALL NLVSetText 'ContextMenu_Service_Sort', 'Caption', 35
|
---|
605 | CALL NLVSetText 'ContextMenu_Service_CloseSHare', 'Caption', 70
|
---|
606 |
|
---|
607 | CALL NLVSetText 'ContextMenu_Users_SendMsg', 'Caption', 80
|
---|
608 | CALL NLVSetText 'ContextMenu_Users_Sort', 'Caption', 35
|
---|
609 |
|
---|
610 | CALL NLVSetText 'ContextMenu_Tree_SendMsg', 'Caption', 80
|
---|
611 | CALL NLVSetText 'ContextMenu_Tree_Sort', 'Caption', 35
|
---|
612 | CALL NLVSetText 'ContextMenu_Tree_Tree', 'Caption', 120
|
---|
613 | CALL NLVSetText 'ContextMenu_Tree_Details', 'Caption', 118
|
---|
614 | return
|
---|
615 |
|
---|
616 | /*:VRX _Refresh
|
---|
617 | */
|
---|
618 | _Refresh:
|
---|
619 | IF options.!debug == 1 then say time()' _Refresh() started'
|
---|
620 | ok = VRSet("TM_refresh","Enabled", 0)
|
---|
621 | SmbNoInit = 0
|
---|
622 |
|
---|
623 | refreshoutput = TempDir'refresh.out'
|
---|
624 | refresherr = TempDir'refresh.err'
|
---|
625 |
|
---|
626 | say ' 'samba.!smbd' -V --debuglevel=0 2>'refresherr' 1>'refreshoutput
|
---|
627 | address cmd samba.!smbd' -V --debuglevel=0 2>'refresherr' 1>'refreshoutput
|
---|
628 |
|
---|
629 | SambaVer = "Samba "||strip(linein(refreshoutput))
|
---|
630 | say ' smbd.exe: "'SambaVer'"'
|
---|
631 | ok = stream(refreshoutput,'c','close')
|
---|
632 |
|
---|
633 | say ' 'samba.!smbstatusexe' smbd 'DebugLevel' 2>'refresherr' 1>'refreshoutput
|
---|
634 | address cmd samba.!smbstatusexe' smbd 'DebugLevel' 2>'refresherr' 1>'refreshoutput
|
---|
635 |
|
---|
636 | /* First line is usually empty */
|
---|
637 | Hdr = linein(refreshoutput)
|
---|
638 | SambaStVer = strip(linein(refreshoutput)) /* we can detect version mismatches here */
|
---|
639 | say ' smbstatus: "'SambaStVer'"'
|
---|
640 |
|
---|
641 | select
|
---|
642 | when pos('not initialised',SambaStVer) > 0 then do
|
---|
643 | SambaVer = SambaVer||" (Init)"
|
---|
644 | SmbNoInit = 1
|
---|
645 | end
|
---|
646 | when translate(SambaStVer) <> translate(SambaVer) then SambaVer = SambaVer||" (Hybrid)"
|
---|
647 | otherwise nop
|
---|
648 | end
|
---|
649 |
|
---|
650 | Ok = VRSet("Main", "Caption", SambaVer' - 'NLVGetMessage(146))
|
---|
651 |
|
---|
652 | /* Active User */
|
---|
653 | Hdr1 = linein(refreshoutput)
|
---|
654 | /* say ' 1:'hdr1 */
|
---|
655 | Hdr2 = linein(refreshoutput)
|
---|
656 | /* say ' 2:'hdr2 */
|
---|
657 | Zeile = linein(refreshoutput)
|
---|
658 | say ' 'Zeile
|
---|
659 | if SmbNoInit then do
|
---|
660 | call lineout samba.!msg, SambaStVer
|
---|
661 | call lineout samba.!msg, Hdr1
|
---|
662 | call lineout samba.!msg, Hdr2
|
---|
663 | call lineout samba.!msg, Zeile
|
---|
664 | ok = stream(samba.!msg,'c','close')
|
---|
665 | if IgnoreSmbNoInit then do
|
---|
666 | call _SambaShowMsg
|
---|
667 | IgnoreSmbNoInit = 0
|
---|
668 | end
|
---|
669 | end
|
---|
670 |
|
---|
671 | say ' SmbNoInit = 'SmbNoInit
|
---|
672 |
|
---|
673 | /* Active users */
|
---|
674 | ok = VRSet("CN_Users","Painting", 0)
|
---|
675 | ok = VRMethod("CN_Users", "RemoveRecord", "ALL")
|
---|
676 | Username.0 = 0
|
---|
677 | IP.0 = 0
|
---|
678 | Group.0 = 0
|
---|
679 | I = 0
|
---|
680 | if \SmbNoInit then do
|
---|
681 | do while Zeile <> ''
|
---|
682 | parse var Zeile UPID Username Group Machine IP
|
---|
683 | I = I + 1
|
---|
684 | UPID.I = UPID
|
---|
685 | Username.I = Username
|
---|
686 | Group.I = Group
|
---|
687 | IP = strip(IP)
|
---|
688 | parse var IP '('IP.I')'
|
---|
689 | RecHandle = VRMethod("CN_Users", "Addrecord")
|
---|
690 | ok = VRMethod("CN_Users", "SetFieldData", RecHandle, UIconH, "$44", UPIDFH, UPID, UsernameFH, Username, GroupFH, Group, UMachineFH, Machine, UIPAdrFH, IP.I)
|
---|
691 | Zeile = linein(refreshoutput)
|
---|
692 | end
|
---|
693 | end
|
---|
694 | Username.0 = I
|
---|
695 | Group.0 = I
|
---|
696 | UPID.0 = I
|
---|
697 | ok = VRSet("CN_Users","Painting", 1)
|
---|
698 |
|
---|
699 | /* Active Services */
|
---|
700 | Hdr = linein(refreshoutput)
|
---|
701 | Hdr = linein(refreshoutput)
|
---|
702 | I = 0
|
---|
703 | Zeile = linein(refreshoutput)
|
---|
704 | ok = VRSet("CN_Service","Painting", 0)
|
---|
705 | ok = VRMethod("CN_Service", "RemoveRecord", "ALL")
|
---|
706 | do while Zeile <> ''
|
---|
707 | parse var Zeile Service SPId Machine Connected
|
---|
708 | I = I + 1
|
---|
709 | SPid.I = SPid
|
---|
710 | Machine.I = Machine
|
---|
711 | Service.I = Service
|
---|
712 | Icon = _GuessIcon(Service.I)
|
---|
713 |
|
---|
714 | Connected = strip(Connected)
|
---|
715 | T. = ""
|
---|
716 | parse var Connected T.WDay T.Month T.DoM T.TimeoD T.Year
|
---|
717 | Connected = T.TimeoD', 'T.WDay' 'T.DoM' 'T.Month' 'T.Year
|
---|
718 |
|
---|
719 | RecHandle = VRMethod("CN_Service", "Addrecord")
|
---|
720 | ok = VRMethod("CN_Service", "SetFieldData", RecHandle, SIconH, Icon, ServiceFH, Service, SPIDFH, SPID, SMachineFH, Machine, ConnectedFH, Connected)
|
---|
721 | Zeile = linein(refreshoutput)
|
---|
722 | end
|
---|
723 | SPid.0 = I
|
---|
724 | Machine.0 = I
|
---|
725 | Service.0 = I
|
---|
726 |
|
---|
727 | ok = VRSet("CN_Service","Painting", 1)
|
---|
728 |
|
---|
729 | /* Open files */
|
---|
730 | Hdr = linein(refreshoutput)
|
---|
731 | Hdr = linein(refreshoutput)
|
---|
732 | Hdr = linein(refreshoutput)
|
---|
733 |
|
---|
734 | Zeile = linein(refreshoutput)
|
---|
735 | ok = VRSet("CN_Files","Painting", 0)
|
---|
736 | ok = VRMethod("CN_Files", "RemoveRecord", "ALL")
|
---|
737 | File.0 = 0
|
---|
738 | FPID.0 = 0
|
---|
739 | do while Zeile <> ''
|
---|
740 | parse var Zeile FPid Uid DenyMode Access RW Oplock Sharepath Rest
|
---|
741 | TimeDate = right(rest,25)
|
---|
742 | Name = strip(left(Rest,max(length(Rest)-25),1))
|
---|
743 | I = I + 1
|
---|
744 | sharepath = strip(translate(left(sharepath,1))||translate(substr(SharePath,2),'\','/'),'T','\')
|
---|
745 | Username = UID
|
---|
746 | do J = 1 to UPID.0
|
---|
747 | if FPID = UPID.J then do
|
---|
748 | Username = Username.J
|
---|
749 | leave
|
---|
750 | end
|
---|
751 | end
|
---|
752 | File = SharePath||'\'||translate(Name,'\','/')
|
---|
753 | File.I = File
|
---|
754 | FPID.I = FPID
|
---|
755 | TimeDate = strip(TimeDate)
|
---|
756 | say Timedate
|
---|
757 | T. = ""
|
---|
758 | parse var TimeDate T.WDay T.Month T.DoM T.TimeoD T.Year
|
---|
759 | FileTime = T.TimeoD
|
---|
760 | FileDate = T.WDay' 'T.DoM' 'T.Month' 'T.Year
|
---|
761 | RecHandle = VRMethod("CN_Files", "Addrecord")
|
---|
762 | ok = VRMethod("CN_Files", "SetFieldData", RecHandle, FPidFH, FPid, FileFH, File, FUserFH, Username, UidFH, Uid, DenyModeFH, DenyMode, AccessFH, Access, RWFH, RW)
|
---|
763 | ok = VRMethod("CN_Files", "SetFieldData", RecHandle, FIconH, "$45", TimeFH, FileTime, DateFH, FileDate, OplockFH, Oplock, SharePathFH, Sharepath, NameFH, Name)
|
---|
764 | Zeile = linein(refreshoutput)
|
---|
765 | end
|
---|
766 | File.0 = I
|
---|
767 | FPID.0 = I
|
---|
768 |
|
---|
769 | ok = stream(refreshoutput, 'c','close')
|
---|
770 | ok = SysFileDelete(refreshoutput)
|
---|
771 | ok = stream(refresherr, 'c','close')
|
---|
772 | ok = SysFileDelete(refreshouterr)
|
---|
773 |
|
---|
774 | call _RefreshDaemons
|
---|
775 | ok = VRSet("CN_Files","Painting", 1)
|
---|
776 | if VRGet("Main", "WindowState") = "Minimized" then do
|
---|
777 | ok = VRSet("TM_Refresh","Delay", IntervallMin * 1000)
|
---|
778 | end
|
---|
779 | else do
|
---|
780 | ok = VRSet("TM_Refresh","Delay", Intervall * 1000)
|
---|
781 | end
|
---|
782 | ok = VRSet("TM_refresh","Enabled", 1)
|
---|
783 |
|
---|
784 | IF options.!debug == 1 then say time()' _Refresh() done'
|
---|
785 | return
|
---|
786 | /*:VRX _RefreshDaemons
|
---|
787 | */
|
---|
788 | _RefreshDaemons:
|
---|
789 | IF options.!debug == 1 then say time()' _RefreshDaemons() started'
|
---|
790 | ok = VRSet("TM_RefreshDaemons","Delay",3000)
|
---|
791 |
|
---|
792 | ok = VRSet("CN_Daemons","Painting", 0 )
|
---|
793 | call VRSet VRWindow(), 'Pointer', 'Wait'
|
---|
794 |
|
---|
795 | do I = 1 to smbdpidhandle.0
|
---|
796 | ok = VRMethod("CN_Daemons", "RemoveRecord", smbdpidhandle.I )
|
---|
797 | end
|
---|
798 |
|
---|
799 | do I = 1 to nmbdpidhandle.0
|
---|
800 | ok = VRMethod("CN_Daemons", "RemoveRecord", nmbdpidhandle.I )
|
---|
801 | end
|
---|
802 |
|
---|
803 | do I = 1 to winbpidhandle.0
|
---|
804 | ok = VRMethod("CN_Daemons", "RemoveRecord", winbpidhandle.I )
|
---|
805 | end
|
---|
806 |
|
---|
807 | Running = _SambaRunning()
|
---|
808 |
|
---|
809 | call VRSet VRWindow(), 'Pointer', '<default>'
|
---|
810 |
|
---|
811 | smbdpids = pids.!smbd
|
---|
812 | nmbdpids = pids.!nmbd
|
---|
813 | winbpids = pids.!nmbd
|
---|
814 |
|
---|
815 | smbdRunning = running.!smbd
|
---|
816 | nmbdRunning = running.!nmbd
|
---|
817 | winbRunning = running.!winb
|
---|
818 |
|
---|
819 | if smbdRunning then do
|
---|
820 | ok = VRMethod("CN_Daemons", "SetFieldData", smbdHandle, DStatusFH, NLVGetMessage(40), DPidsFH, smbdpids)
|
---|
821 | ok = VRMethod("CN_Daemons", "SetRecordAttr", smbdHandle, "Icon", "$46")
|
---|
822 | smbdpidhandle.0 = words(smbdpids)
|
---|
823 | if options.!debug = 1 then do
|
---|
824 | if smbdpidhandle.0 > prevsmbdct then do
|
---|
825 | prevsmbdct = smbdpidhandle.0
|
---|
826 | call beep 880*1, 10
|
---|
827 | call beep 880*2, 10
|
---|
828 | call beep 880*4, 10
|
---|
829 | end
|
---|
830 | if smbdpidhandle.0 < prevsmbdct then do
|
---|
831 | prevsmbdct = smbdpidhandle.0
|
---|
832 | call beep 880*4, 10
|
---|
833 | call beep 880*2, 10
|
---|
834 | call beep 880*1, 10
|
---|
835 | end
|
---|
836 | end
|
---|
837 |
|
---|
838 | do I = 1 to words(smbdpids)
|
---|
839 | Username = ""
|
---|
840 | do J = 1 to UPID.0
|
---|
841 | if UPID.J = word(smbdpids,I) then do
|
---|
842 | Username = ' 'Username.J
|
---|
843 | leave
|
---|
844 | end
|
---|
845 | end
|
---|
846 | smbdpidhandle.I = VRMethod( "CN_Daemons", "AddRecord", smbdhandle, , 'PID 'word(smbdpids,I)' ('d2x(word(smbdpids,I))'x)', "$48")
|
---|
847 | if Username <> "" then do
|
---|
848 | smbdpidhandle.I.user = VRMethod( "CN_Daemons", "AddRecord", smbdpidhandle.I, , Username, "$44")
|
---|
849 | do J = 1 to FPID.0
|
---|
850 | if FPID.J = word(smbdpids,I) then do
|
---|
851 | dummyHandle = VRMethod( "CN_Daemons", "AddRecord", smbdpidhandle.I.user, , File.J, "$45")
|
---|
852 | end
|
---|
853 | end
|
---|
854 | end
|
---|
855 | end
|
---|
856 | end
|
---|
857 | else do
|
---|
858 | ok = VRMethod("CN_Daemons", "SetFieldData", smbdHandle, DStatusFH, NLVGetMessage(41), DPidsFH, "")
|
---|
859 | ok = VRMethod("CN_Daemons", "SetRecordAttr", smbdHandle, "Icon", "$47")
|
---|
860 | if options.!debug = 1 then do
|
---|
861 | if prevsmbdct > 0 then do
|
---|
862 | prevsmbdct = 0
|
---|
863 | call beep 880*4, 10
|
---|
864 | call beep 880*2, 10
|
---|
865 | call beep 880*1, 10
|
---|
866 | end
|
---|
867 | end
|
---|
868 | end
|
---|
869 |
|
---|
870 | if nmbdRunning then do
|
---|
871 | ok = VRMethod("CN_Daemons", "SetFieldData", nmbdHandle, DStatusFH, NLVGetMessage(40), DPidsFH, nmbdpids)
|
---|
872 | ok = VRMethod("CN_Daemons", "SetRecordAttr", nmbdHandle, "Icon", "$46")
|
---|
873 | nmbdpidhandle.0 = words(nmbdpids)
|
---|
874 | do I = 1 to words(nmbdpids)
|
---|
875 | nmbdpidhandle.I = VRMethod( "CN_Daemons", "AddRecord", nmbdhandle, , 'PID 'word(nmbdpids,I)' ('d2x(word(nmbdpids,I))'x)', "$48")
|
---|
876 | end
|
---|
877 | end
|
---|
878 | else do
|
---|
879 | ok = VRMethod("CN_Daemons", "SetFieldData", nmbdHandle, DStatusFH, NLVGetMessage(41), DPidsFH, "")
|
---|
880 | ok = VRMethod("CN_Daemons", "SetRecordAttr", nmbdHandle, "Icon", "$47")
|
---|
881 | end
|
---|
882 |
|
---|
883 | if winbRunning then do
|
---|
884 | ok = VRMethod("CN_Daemons", "SetFieldData", winbHandle, DStatusFH, NLVGetMessage(40), DPidsFH, winbpids)
|
---|
885 | ok = VRMethod("CN_Daemons", "SetRecordAttr", winbHandle, "Icon", "$46")
|
---|
886 | winbpidhandle.0 = words(winbpids)
|
---|
887 | do I = 1 to words(winbpids)
|
---|
888 | winbpidhandle.I = VRMethod( "CN_Daemons", "AddRecord", winbhandle, , 'PID 'word(winbpids,I)' ('d2x(word(winbpids,I))'x)', "$48")
|
---|
889 | end
|
---|
890 | end
|
---|
891 | else do
|
---|
892 | ok = VRMethod("CN_Daemons", "SetFieldData", winbHandle, DStatusFH, NLVGetMessage(41), DPidsFH, "")
|
---|
893 | ok = VRMethod("CN_Daemons", "SetRecordAttr", winbHandle, "Icon", "$47")
|
---|
894 | end
|
---|
895 |
|
---|
896 | if \(smbdrunning|nmbdrunning|winbrunning) then do
|
---|
897 | ok = VRSet("PB_START", "Enabled", 1)
|
---|
898 | ok = VRSet("PB_STOP", "Enabled", 0)
|
---|
899 | ok = VRSet("PB_ReStart","Enabled", 0)
|
---|
900 | ok = VRSet("PB_ReLoad", "Enabled", 0)
|
---|
901 | end
|
---|
902 | else do
|
---|
903 | ok = VRSet("PB_START", "Enabled", 0)
|
---|
904 | ok = VRSet("PB_STOP", "Enabled", 1)
|
---|
905 | ok = VRSet("PB_ReStart","Enabled", 1)
|
---|
906 | ok = VRSet("PB_ReLoad", "Enabled", 1)
|
---|
907 | end
|
---|
908 |
|
---|
909 | ok = (stream(samba.!bin'\winbindd.exe','c','query exists') <> "")
|
---|
910 | ok = VRMethod("CN_Daemons", "SetRecordAttr", winbHandle, "Visible", ok)
|
---|
911 | ok = VRSet("CN_Daemons","Painting", 1 )
|
---|
912 | if Running then call _SambaUptime
|
---|
913 |
|
---|
914 | IF options.!debug == 1 then say time()' _RefreshDaemons() done'
|
---|
915 | return
|
---|
916 |
|
---|
917 | /*
|
---|
918 | _pids: procedure
|
---|
919 | pongfile = arg(1)
|
---|
920 | pids = ''
|
---|
921 | do until lines(pongfile) = 0
|
---|
922 | pongline = linein(pongfile)
|
---|
923 | if word(Pongline,1) = 'PONG' then do
|
---|
924 | parse var pongline pong from tpid pid
|
---|
925 | pids = pids||pid', '
|
---|
926 | end
|
---|
927 | else pids = pids||pongline
|
---|
928 | end
|
---|
929 | pids = strip(strip(pids),,',')
|
---|
930 | ok = stream(pongfile,'c','close')
|
---|
931 | ok = SysFileDelete(pongfile)
|
---|
932 | return pids
|
---|
933 | */
|
---|
934 |
|
---|
935 | /* pingout = 'ping.out'
|
---|
936 | '@smbcontrol -t 2 smbd ping -d 0 1>'pingout
|
---|
937 | if rc = 0 then smbdRunning = 1
|
---|
938 | ok = VRMethod("CN_Daemons", "SetFieldData", smbdHandle, DPidsFH, _pids(pingout))
|
---|
939 |
|
---|
940 | '@smbcontrol -t 2 nmbd ping -d 0 1>'pingout
|
---|
941 | if rc = 0 then nmbdRunning = 1
|
---|
942 | ok = VRMethod("CN_Daemons", "SetFieldData", nmbdHandle, DPidsFH, _pids(pingout))
|
---|
943 |
|
---|
944 | '@smbcontrol -t 1 winbindd ping -d 0 1>'pingout
|
---|
945 | if rc = 0 then winbRunning = 1
|
---|
946 | ok = VRMethod("CN_Daemons", "SetFieldData", winbHandle, DPidsFH, _pids(pingout))
|
---|
947 |
|
---|
948 | ok = SysFileDelete(PingOut)
|
---|
949 | */
|
---|
950 | /*:VRX _RefreshDaemonsDelay
|
---|
951 | */
|
---|
952 | _RefreshDaemonsDelay:
|
---|
953 | IF options.!debug == 1 then say time()' _RefreshDaemonsDelay() started'
|
---|
954 | IF options.!debug == 1 then say " Old intervall = "VRGet("TM_RefreshDaemons","Delay")
|
---|
955 | ok = VRSet("TM_RefreshDaemons","Delay", 60000)
|
---|
956 | IF options.!debug == 1 then say " New Intervall = "VRGet("TM_RefreshDaemons","Delay")
|
---|
957 | IF options.!debug == 1 then say time()' _RefreshDaemonsDelay() done'
|
---|
958 | return
|
---|
959 |
|
---|
960 | /*:VRX _SambaFindPIDfile
|
---|
961 | */
|
---|
962 | _SambaFindPIDfile:
|
---|
963 | IF options.!debug == 1 then say time()' _SambaFindPIDfile() started'
|
---|
964 |
|
---|
965 | ok = SysFileTree(ETC'\samba\pid\nmbd*pid',nmbdpid.,'FO')
|
---|
966 | if nmbdpid.0 = 1
|
---|
967 | then nmbdpidfile = nmbdpid.1;
|
---|
968 | else nmbdpidfile = ""
|
---|
969 |
|
---|
970 | IF options.!debug == 1 then say " nmbdpidfile = "nmbdpidfile
|
---|
971 |
|
---|
972 | IF options.!debug == 1 then say time()' _SambaFindPIDfile() done'
|
---|
973 | return
|
---|
974 |
|
---|
975 | /*:VRX _SambaShowError
|
---|
976 | */
|
---|
977 | _SambaShowError: procedure expose samba. settings. options.
|
---|
978 | I = 0
|
---|
979 | do while lines(samba.!error) <> 0
|
---|
980 | I = I + 1
|
---|
981 | smberr.I = linein(samba.!error)
|
---|
982 | end
|
---|
983 | ok = stream(Samba.!error,"c","close")
|
---|
984 | smberr.0 = I
|
---|
985 | Buttons.1 = "OK" /* NLVGetMessage(2) */
|
---|
986 | Buttons.0 = 1
|
---|
987 | id = VRMessageStem( VRWindow(), "smberr.", VRGet("Main", "Caption") , "Error", "Buttons.", buttons.1, buttons.1 )
|
---|
988 | ok = SysFileDelete(Samba.!error)
|
---|
989 | return
|
---|
990 |
|
---|
991 | /*:VRX _SambaShowMsg
|
---|
992 | */
|
---|
993 | _SambaShowMsg: procedure expose samba. settings. options.
|
---|
994 | say "SambaShowMsg started"
|
---|
995 | skipWords = arg(1)
|
---|
996 | skip.0 = words(skipWords)
|
---|
997 | do J = 1 to skip.0
|
---|
998 | skip.J = translate(word(skipWords,J))
|
---|
999 | end
|
---|
1000 | I = 0
|
---|
1001 | do while lines(samba.!msg) <> 0
|
---|
1002 | msgline = linein(samba.!msg)
|
---|
1003 | SkipIt = 0
|
---|
1004 | do J = 1 to skip.0
|
---|
1005 | if pos(skip.J,translate(msgline)) > 0 then do
|
---|
1006 | skipit = 1
|
---|
1007 | leave
|
---|
1008 | end
|
---|
1009 | end
|
---|
1010 | if \SkipIt then do
|
---|
1011 | I = I + 1
|
---|
1012 | smbmsg.I = strip(MsgLine)
|
---|
1013 | end
|
---|
1014 | end
|
---|
1015 | ok = stream(Samba.!msg,"c","close")
|
---|
1016 | say " stream close "Samba.!msg" = "ok
|
---|
1017 | smbmsg.0 = I
|
---|
1018 | if smbmsg.0 > 0 then do
|
---|
1019 | Buttons.1 = "OK" /* NLVGetMessage(2) */
|
---|
1020 | Buttons.0 = 1
|
---|
1021 | id = VRMessageStem( VRWindow(), "smbmsg.", VRGet("Main", "Caption") , "I", "Buttons.", buttons.1, buttons.1 )
|
---|
1022 | end
|
---|
1023 | ok = SysFileDelete(Samba.!msg)
|
---|
1024 | say " Delete "Samba.!msg" = "ok
|
---|
1025 | say "SambaShowMsg done"
|
---|
1026 | return
|
---|
1027 | /*:VRX _SambaUptime
|
---|
1028 | */
|
---|
1029 | _SambaUptime:
|
---|
1030 | IF options.!debug == 1 then say time()' _SambaUptime() started'
|
---|
1031 | call _SambaFindPIDfile
|
---|
1032 | if nmbdpidfile = "" then do
|
---|
1033 | ok = VRset("CN_Daemons", "Caption", NLVGetMessage(42)||" "||NLVGetMessage(41))
|
---|
1034 | return
|
---|
1035 | end
|
---|
1036 |
|
---|
1037 | StartTime = SysGetFileDateTime(nmbdpidfile)
|
---|
1038 | if StartTime = -1 then return
|
---|
1039 |
|
---|
1040 | NowTime = substr(date('S'),1,4)'-'substr(date('S'),5,2)'-'substr(date('S'),7,2)' 'time()
|
---|
1041 |
|
---|
1042 | /* StartTime = "2007-12-31 00:00:00"
|
---|
1043 | NowTime = "2008-03-05 08:59:50" */
|
---|
1044 |
|
---|
1045 | IF options.!debug == 1 then do
|
---|
1046 | say " Start Time ='"StartTime"'"
|
---|
1047 | say " Now Time ='"NowTime"'"
|
---|
1048 | end
|
---|
1049 |
|
---|
1050 | doM.0 = 12
|
---|
1051 | doM.1 = 31; doM.2 = 28; doM.3 = 31; doM.4 = 30; doM.5 = 31; doM.6 = 30;
|
---|
1052 | doM.7 = 31; doM.8 = 31; doM.9 = 30; doM.10= 31; doM.11= 30; doM.12= 31
|
---|
1053 |
|
---|
1054 | parse var StartTime sY'-'sM'-'sD' 'sH':'sMi':'sS
|
---|
1055 | parse var NowTime nY'-'nM'-'nD' 'nH':'nMi':'nS
|
---|
1056 |
|
---|
1057 | if nY//4 = 0 & nY//400 <> 0 then doM.2 = 29
|
---|
1058 |
|
---|
1059 | /* say doM.2 */
|
---|
1060 |
|
---|
1061 | uY =nY-sY
|
---|
1062 | uM =nM-sM
|
---|
1063 | uD =nD-sD
|
---|
1064 | uH =nH-sH
|
---|
1065 | uMi=nMi-sMi
|
---|
1066 | uS =nS-sS
|
---|
1067 |
|
---|
1068 |
|
---|
1069 |
|
---|
1070 | if uS < 0 then do; uMi= uMi- 1; uS = uS + 60; end
|
---|
1071 | if uMi< 0 then do; uH = uH - 1; uMi= uMi+ 60; end
|
---|
1072 | if uH < 0 then do; uD = uD - 1; uH = uH + 24; end
|
---|
1073 | if uD < 0 then do;
|
---|
1074 | /* uM = uM - 1; */
|
---|
1075 | if uM < 0 then uMx = uM + 12; else uMx = uM
|
---|
1076 | uD = uD + doM.uMx - 1;
|
---|
1077 | end
|
---|
1078 | if uM < 0 then do; uY = uY - 1; uM = uM + 12; end
|
---|
1079 |
|
---|
1080 | /* say uY uM uD uH uMi uS */
|
---|
1081 |
|
---|
1082 | UpTimeStr = ' 'NlvGetMessage(43)':'
|
---|
1083 | if uY <> 0 then UpTimeStr = UpTimeStr' 'uY' 'NlvGetMessage(44)
|
---|
1084 | if uM <> 0 then UpTimeStr = UpTimeStr' 'uM' 'NlvGetMessage(45)
|
---|
1085 | if uD <> 0 then UpTimeStr = UpTimeStr' 'uD' 'NlvGetMessage(46)
|
---|
1086 | if uH <> 0 then UpTimeStr = UpTimeStr' 'uH' 'NlvGetMessage(47)
|
---|
1087 | if uMi<> 0 then UpTimeStr = UpTimeStr' 'uMi' 'NlvGetMessage(48)
|
---|
1088 | if uS <> 0 | UpTimeStr = ' 'NlvGetMessage(43)':' then UpTimeStr = UpTimeStr' 'uS' 'NlvGetMessage(49)
|
---|
1089 |
|
---|
1090 | ok = VRset("CN_Daemons", "Caption", UpTimeStr)
|
---|
1091 |
|
---|
1092 | IF options.!debug == 1 then say time()' _SambaUptime() done'
|
---|
1093 | return
|
---|
1094 |
|
---|
1095 | /*:VRX _SendMsg
|
---|
1096 | */
|
---|
1097 | _SendMsg:
|
---|
1098 | Buttons.1 = NLVGetMessage( 2 )
|
---|
1099 | Buttons.2 = NLVGetMessage( 3 )
|
---|
1100 | Buttons.0 = 2
|
---|
1101 | Message = "Blurp!"
|
---|
1102 | id = VRPrompt( VRWindow(), NLVGetMessage( 85 , CurMachine), "Message", NLVGetMessage( 80 ), "Buttons.", buttons.1, buttons.2 )
|
---|
1103 |
|
---|
1104 | MsgFile = SysTempFileName(TempDir'\smbmsg.'??? )
|
---|
1105 | call lineout MsgFile, Message
|
---|
1106 | ok = stream(MsgFile,'c','close')
|
---|
1107 | say Message
|
---|
1108 | address cmd samba.!smbclientexe' --message='CurMachine' 'DebugLevel' <'MsgFile' 2>&1>'samba.!msg
|
---|
1109 | /* if rc <> 0 then call _SambaShowError; else */
|
---|
1110 | call _SambaShowMsg
|
---|
1111 | ok = SysFileDelete(MsgFile)
|
---|
1112 | return
|
---|
1113 |
|
---|
1114 | /*:VRX _ShowMsg
|
---|
1115 | */
|
---|
1116 | _ShowMsg:
|
---|
1117 | Buttons.1 = NLVGetMessage(2)
|
---|
1118 | Buttons.0 = 1
|
---|
1119 | id = VRMessage( VRWindow(), Msg.Text, Msg.Title, Msg.Type, "Buttons.", buttons.1, buttons.1 )
|
---|
1120 | return
|
---|
1121 |
|
---|
1122 | /*:VRX _TabbedDialogSetup
|
---|
1123 | */
|
---|
1124 | _TabbedDialogSetup:
|
---|
1125 | IF options.!debug == 1 THEN SAY time()' _TabbedDialogSetup started'
|
---|
1126 | w = VRLoad( "TDL_1", VRWindowPath(), "SW_USERS" )
|
---|
1127 | ok = VRMethod( "TDL_1", "InsertPage", w,"+ "NLVGetMessage(15)" ")
|
---|
1128 |
|
---|
1129 | w = VRLoad( "TDL_1", VRWindowPath(), "SW_FILES" )
|
---|
1130 | ok = VRMethod( "TDL_1", "InsertPage", w,"+ "NLVGetMessage(16)" ")
|
---|
1131 |
|
---|
1132 | w = VRLoad( "TDL_1", VRWindowPath(), "SW_SERVICE" )
|
---|
1133 | ok = VRMethod( "TDL_1", "InsertPage", w,"+ "NLVGetMessage(17)" ")
|
---|
1134 |
|
---|
1135 | w = VRLoad( "TDL_1", VRWindowPath(), "SW_DAEMONS" )
|
---|
1136 | ok = VRMethod( "TDL_1", "InsertPage", w,"+ "NLVGetMessage(18)" ")
|
---|
1137 |
|
---|
1138 | w = VRLoad( "TDL_1", VRWindowPath(), "SW_SMBTREE" )
|
---|
1139 | ok = VRMethod( "TDL_1", "InsertPage", w,"+ "NLVGetMessage(19)" ")
|
---|
1140 |
|
---|
1141 | w = VRLoad( "TDL_1", VRWindowPath(), "SW_SETTINGS" )
|
---|
1142 | ok = VRMethod( "TDL_1", "InsertPage", w,"+ "NLVGetMessage(24)" ")
|
---|
1143 | IF options.!debug == 1 THEN SAY time()' _TabbedDialogSetup done'
|
---|
1144 | return
|
---|
1145 |
|
---|
1146 | /*:VRX About_Close
|
---|
1147 | */
|
---|
1148 | About_Close:
|
---|
1149 | call About_Fini
|
---|
1150 | return
|
---|
1151 |
|
---|
1152 | /*:VRX About_Create
|
---|
1153 | */
|
---|
1154 | About_Create:
|
---|
1155 | call About_Init
|
---|
1156 | ok = VRSet("About","Caption", NLVGetMessage(20))
|
---|
1157 | ok = VRSet("PB_AboutOK","Caption", NLVGetMessage(2))
|
---|
1158 | SambaTeam.0 = 9
|
---|
1159 | SambaTeam.1 = 'Silvan Scherrer'
|
---|
1160 | SambaTeam.2 = 'Herwig Bauernfeind'
|
---|
1161 | SambaTeam.3 = 'Vitali Pelenyov'
|
---|
1162 | SambaTeam.4 = 'Paul Smedley'
|
---|
1163 | SambaTeam.5 = 'Yuri Dario'
|
---|
1164 | SambaTeam.6 = 'Alex Taylor'
|
---|
1165 | SambaTeam.7 = 'Nikolay Kolosov'
|
---|
1166 | SambaTeam.8 = 'All the Samba people'
|
---|
1167 | SambaTeam.9 = 'All the netlabs people'
|
---|
1168 | ok = VRSet("About","Font", VRGet("SW_SETTINGS","Font"))
|
---|
1169 | ok = VRMethod("LB_SambaTeam","AddStringList", "SambaTeam." )
|
---|
1170 | ok = VRSet("DT_SambaTeam","Caption", NLVGetMessage(21))
|
---|
1171 | ok = VRSet("MLE_Version","Value", NLVGetMessage(1)||'0D0A'x||VRGet("Main", "Hinttext")||'0D0A'x||'0D0A'x||SambaVer)
|
---|
1172 | return
|
---|
1173 |
|
---|
1174 | /*:VRX About_Fini
|
---|
1175 | */
|
---|
1176 | About_Fini:
|
---|
1177 | window = VRInfo( "Window" )
|
---|
1178 | call VRDestroy window
|
---|
1179 | drop window
|
---|
1180 | return
|
---|
1181 | /*:VRX About_Init
|
---|
1182 | */
|
---|
1183 | About_Init:
|
---|
1184 | window = VRInfo( "Object" )
|
---|
1185 | if( \VRIsChildOf( window, "Notebook" ) ) then do
|
---|
1186 | call VRMethod window, "CenterWindow"
|
---|
1187 | call VRSet window, "Visible", 1
|
---|
1188 | call VRMethod window, "Activate"
|
---|
1189 | end
|
---|
1190 | drop window
|
---|
1191 | return
|
---|
1192 |
|
---|
1193 | /*:VRX Activate
|
---|
1194 | */
|
---|
1195 | Activate:
|
---|
1196 | parse arg Nr
|
---|
1197 | /* call PushbackAll */
|
---|
1198 | CurrentPageNr = Nr
|
---|
1199 | /* ok = VRSet("PB_"Nr,"Font","9.WarpSans Bold") */
|
---|
1200 | /* ok = VRSet("TAB_"Nr,"Top", TabTop-8)
|
---|
1201 | ok = VRSet("TAB_"Nr,"Left",TabWidth*(Nr-1)+PageLeft)
|
---|
1202 | ok = VRSet("TAB_"Nr,"PicturePath", "#1"||Nr||";#1"||Nr)
|
---|
1203 | ok = VRset("DT_PageName", "Caption", VRGet("TAB_"Nr, "UserData"))
|
---|
1204 | ok = VRSet("Page_"Nr,"Visible", 1)
|
---|
1205 | select
|
---|
1206 | when Nr = 1 then ok = VRSet("IPB_paper","PicturePath","#4;#4")
|
---|
1207 | when Nr = Pages then ok = VRSet("IPB_paper","PicturePath","#6;#6")
|
---|
1208 | otherwise ok = VRSet("IPB_paper","PicturePath","#5;#5")
|
---|
1209 | end */
|
---|
1210 | return
|
---|
1211 |
|
---|
1212 | /*:VRX CB_Debug_Click
|
---|
1213 | */
|
---|
1214 | CB_Debug_Click:
|
---|
1215 | options.!Debug = VRGet("CB_Debug","set")
|
---|
1216 | if options.!Debug then ok = VRREdirectStdIO("ON")
|
---|
1217 | else ok = VRREdirectStdIO("OFF")
|
---|
1218 | return
|
---|
1219 |
|
---|
1220 | /*:VRX CB_NoMsgBox_Click
|
---|
1221 | */
|
---|
1222 | CB_NoMsgBox_Click:
|
---|
1223 | NoMsgBox = VRGet("CB_NoMsgBox","set")
|
---|
1224 | say 'NoMsgBox = "'NoMsgBox'"'
|
---|
1225 | return
|
---|
1226 |
|
---|
1227 | /*:VRX CB_WPSSTARTSTOP_Click
|
---|
1228 | */
|
---|
1229 | CB_WPSSTARTSTOP_Click:
|
---|
1230 | WPSStartStop = VRGet("CB_WPSStartStop","set")
|
---|
1231 | say 'WPSStartStop = "'WPSStartStop'"'
|
---|
1232 | return
|
---|
1233 |
|
---|
1234 | /*:VRX CN_Daemons_Click
|
---|
1235 | */
|
---|
1236 | CN_Daemons_Click:
|
---|
1237 | IF options.!debug == 1 then say time()' CN_Daemons_Click() started'
|
---|
1238 | NowClickedRecord = VRInfo("Record")
|
---|
1239 | say " NowRecord = '"NowClickedRecord"'"
|
---|
1240 | say " LastRecord = '"LastClickedRecord"'"
|
---|
1241 | if NowClickedRecord <> LastClickedRecord then call _RefreshDaemonsDelay
|
---|
1242 | LastClickedRecord = NowClickedRecord
|
---|
1243 | IF options.!debug == 1 then say time()' CN_Daemons_Click() done'
|
---|
1244 | return
|
---|
1245 |
|
---|
1246 | /*:VRX CN_Daemons_ContextMenu
|
---|
1247 | */
|
---|
1248 | CN_Daemons_ContextMenu:
|
---|
1249 | if VRInfo("Top") < 400 & VRGet("CN_Daemons", "View") = "Detail" then call _ColumnsMenu "CN_Daemons"
|
---|
1250 | else do
|
---|
1251 | say " Record = '"VRInfo("Record")"'"
|
---|
1252 |
|
---|
1253 | call _RefreshDaemonsDelay
|
---|
1254 |
|
---|
1255 | DRH = VRInfo("Record")
|
---|
1256 | OH = VRInfo("Object")
|
---|
1257 | ok = VRset("ContextMenu_Daemons_Sep1","Visible", 0 )
|
---|
1258 | ok = VRset("ContextMenu_Daemons_Ping","Visible", (DRH <> "") )
|
---|
1259 | ok = VRset("ContextMenu_Daemons_Shutdown","Visible", 0 )
|
---|
1260 | DaemonName = ""
|
---|
1261 | if DRH <> "" then DaemonName = VRMethod("CN_Daemons", "GetRecordAttr", DRH, "Caption")
|
---|
1262 | select
|
---|
1263 | when Words(DaemonName) = 3 then do /* a child process with PID in name */
|
---|
1264 | DaemonName = word(DaemonName,2)
|
---|
1265 | ok = VRset("ContextMenu_Daemons_Sep1","Visible", 1 )
|
---|
1266 | ok = VRSet("ContextMenu_Daemons_KillPID", "Caption", NLVGetMessage( 38, DaemonName))
|
---|
1267 | ok = VRset("ContextMenu_Daemons_KillPID", "Visible", 1 )
|
---|
1268 | ok = VRset("ContextMenu_Daemons_Start", "Visible", 0 )
|
---|
1269 | ok = VRset("ContextMenu_Daemons_Ping", "Visible", 1 )
|
---|
1270 | ok = VRset("ContextMenu_Daemons_Sep1", "Visible", 1 )
|
---|
1271 | end
|
---|
1272 | when Words(DaemonName) = 1 then do /* on smbd.exe or nmbd.exe root processes */
|
---|
1273 | parse var DaemonName DaemonName'.exe'
|
---|
1274 | if strip(VRMethod("CN_Daemons", "GetFieldData", DRH, DPidsFH)) <> "" then do
|
---|
1275 | ok = VRSet("ContextMenu_Daemons_Shutdown", "Caption", NLVGetMessage( 33, DaemonName))
|
---|
1276 | ok = VRset("ContextMenu_Daemons_Shutdown", "Visible", 1 )
|
---|
1277 | ok = VRset("ContextMenu_Daemons_Start", "Visible", 0 )
|
---|
1278 | ok = VRset("ContextMenu_Daemons_Sep1", "Visible", 1 )
|
---|
1279 | end
|
---|
1280 | else do
|
---|
1281 | ok = VRSet("ContextMenu_Daemons_Start", "Caption", NLVGetMessage( 36, DaemonName))
|
---|
1282 | ok = VRset("ContextMenu_Daemons_Start", "Visible", 1 )
|
---|
1283 | ok = VRset("ContextMenu_Daemons_KillPID","Visible", 0 )
|
---|
1284 | ok = VRset("ContextMenu_Daemons_Ping", "Visible", 0 )
|
---|
1285 | ok = VRset("ContextMenu_Daemons_Sep1", "Visible", 1 )
|
---|
1286 | end
|
---|
1287 | end
|
---|
1288 | otherwise nop
|
---|
1289 | end
|
---|
1290 | say ' Daemon is "'DaemonName'"'
|
---|
1291 | ok = VRMethod( "ContextMenu_Daemons", "Popup", , , "", "" )
|
---|
1292 | end
|
---|
1293 | return
|
---|
1294 |
|
---|
1295 | /*:VRX CN_Files_ContextMenu
|
---|
1296 | */
|
---|
1297 | CN_Files_ContextMenu:
|
---|
1298 | if VRInfo("Top") < 400 & VRGet("CN_Files", "View") = "Detail" then call _ColumnsMenu "CN_Files"
|
---|
1299 | else do
|
---|
1300 | RH = VRInfo("Record")
|
---|
1301 | OH = VRInfo("Object")
|
---|
1302 | if RH <> "" then do
|
---|
1303 | ok = VRMethod( "Contextmenu_Files", "Popup", , , "", "PositionOnItem" )
|
---|
1304 | end
|
---|
1305 | end
|
---|
1306 | return
|
---|
1307 |
|
---|
1308 | /*:VRX CN_Service_ContextMenu
|
---|
1309 | */
|
---|
1310 | CN_Service_ContextMenu:
|
---|
1311 | if VRInfo("Top") < 400 & VRGet("CN_Service", "View") = "Detail" then call _ColumnsMenu "CN_Service"
|
---|
1312 | else do
|
---|
1313 | ok = VRSet("TM_refresh","Enabled", 0)
|
---|
1314 | SRH = VRInfo("Record")
|
---|
1315 | OH = VRInfo("Object")
|
---|
1316 | if SRH <> "" then do
|
---|
1317 | Service = VRMethod("CN_Service", "GetFieldData", SRH, ServiceFH)
|
---|
1318 | say ' Service is "'Service'"'
|
---|
1319 | ok = VRMethod( "ContextMenu_Service", "Popup", , , "", "" )
|
---|
1320 | end
|
---|
1321 | end
|
---|
1322 | return
|
---|
1323 |
|
---|
1324 | /*:VRX CN_smbtree_Click
|
---|
1325 | */
|
---|
1326 | CN_smbtree_Click:
|
---|
1327 | rh = VRInfo('Record')
|
---|
1328 | if VRMethod( 'CN_SMBTREE', "ValidateRecord", rh) <> 1 then return
|
---|
1329 | userdata = VRMethod('CN_smbtree', 'GetRecordAttr', rh, 'UserData')
|
---|
1330 | parse var userdata . '|' userdata
|
---|
1331 | ok = VRset("Main","StatusText", userdata)
|
---|
1332 |
|
---|
1333 |
|
---|
1334 | return
|
---|
1335 |
|
---|
1336 | /*:VRX CN_smbtree_ContextMenu
|
---|
1337 | */
|
---|
1338 | CN_smbtree_ContextMenu:
|
---|
1339 | if VRInfo("Top") < 400 & VRGet("CN_smbtree", "View") = "Detail" then call _ColumnsMenu "CN_smbtree"
|
---|
1340 | else do
|
---|
1341 | RH = VRInfo("Record")
|
---|
1342 | if RH <> "" then do
|
---|
1343 | CurMachine = word(VRMethod( "CN_smbtree", "GetRecordAttr", RH, "Caption" ),1)
|
---|
1344 | ok = VRMethod( "Contextmenu_Tree", "Popup", , , "", "PositionOnItem" )
|
---|
1345 | end
|
---|
1346 | end
|
---|
1347 | return
|
---|
1348 |
|
---|
1349 | /*:VRX CN_Users_ContextMenu
|
---|
1350 | */
|
---|
1351 | CN_Users_ContextMenu:
|
---|
1352 | if VRInfo("Top") < 400 & VRGet("CN_users", "View") = "Detail" then call _ColumnsMenu "CN_users"
|
---|
1353 | else do
|
---|
1354 | RH = VRInfo("Record")
|
---|
1355 | OH = VRInfo("Object")
|
---|
1356 | if RH <> "" then do
|
---|
1357 | CurMachine = VRMethod( "CN_users", "GetFieldData", RH, UMachineFH )
|
---|
1358 | ok = VRMethod( "Contextmenu_Users", "Popup", , , "", "PositionOnItem" )
|
---|
1359 | end
|
---|
1360 | end
|
---|
1361 | return
|
---|
1362 |
|
---|
1363 | /*:VRX Columns_01_Click
|
---|
1364 | */
|
---|
1365 | Columns_01_Click:
|
---|
1366 | call _ColumnShow
|
---|
1367 | return
|
---|
1368 |
|
---|
1369 | /*:VRX Columns_02_Click
|
---|
1370 | */
|
---|
1371 | Columns_02_Click:
|
---|
1372 | call _ColumnShow
|
---|
1373 | return
|
---|
1374 |
|
---|
1375 | /*:VRX Columns_03_Click
|
---|
1376 | */
|
---|
1377 | Columns_03_Click:
|
---|
1378 | call _ColumnShow
|
---|
1379 | return
|
---|
1380 |
|
---|
1381 | /*:VRX Columns_04_Click
|
---|
1382 | */
|
---|
1383 | Columns_04_Click:
|
---|
1384 | call _ColumnShow
|
---|
1385 | return
|
---|
1386 |
|
---|
1387 | /*:VRX Columns_05_Click
|
---|
1388 | */
|
---|
1389 | Columns_05_Click:
|
---|
1390 | call _ColumnShow
|
---|
1391 | return
|
---|
1392 |
|
---|
1393 | /*:VRX Columns_06_Click
|
---|
1394 | */
|
---|
1395 | Columns_06_Click:
|
---|
1396 | call _ColumnShow
|
---|
1397 | return
|
---|
1398 |
|
---|
1399 | /*:VRX Columns_07_Click
|
---|
1400 | */
|
---|
1401 | Columns_07_Click:
|
---|
1402 | call _ColumnShow
|
---|
1403 | return
|
---|
1404 |
|
---|
1405 | /*:VRX Columns_08_Click
|
---|
1406 | */
|
---|
1407 | Columns_08_Click:
|
---|
1408 | call _ColumnShow
|
---|
1409 | return
|
---|
1410 |
|
---|
1411 | /*:VRX Columns_09_Click
|
---|
1412 | */
|
---|
1413 | Columns_09_Click:
|
---|
1414 | call _ColumnShow
|
---|
1415 | return
|
---|
1416 |
|
---|
1417 | /*:VRX Columns_10_Click
|
---|
1418 | */
|
---|
1419 | Columns_10_Click:
|
---|
1420 | call _ColumnShow
|
---|
1421 | return
|
---|
1422 |
|
---|
1423 | /*:VRX Columns_11_Click
|
---|
1424 | */
|
---|
1425 | Columns_11_Click:
|
---|
1426 | call _ColumnShow
|
---|
1427 | return
|
---|
1428 |
|
---|
1429 | /*:VRX Columns_12_Click
|
---|
1430 | */
|
---|
1431 | Columns_12_Click:
|
---|
1432 | call _ColumnShow
|
---|
1433 | return
|
---|
1434 |
|
---|
1435 | /*:VRX Columns_13_Click
|
---|
1436 | */
|
---|
1437 | Columns_13_Click:
|
---|
1438 | call _ColumnShow
|
---|
1439 | return
|
---|
1440 |
|
---|
1441 | /*:VRX Columns_14_Click
|
---|
1442 | */
|
---|
1443 | Columns_14_Click:
|
---|
1444 | call _ColumnShow
|
---|
1445 | return
|
---|
1446 |
|
---|
1447 | /*:VRX ContextMenu_Daemons_Details_Click
|
---|
1448 | */
|
---|
1449 | ContextMenu_Daemons_Details_Click:
|
---|
1450 | ok = VRset("CN_Daemons","View","Detail")
|
---|
1451 | ok = VRset("ContextMenu_Daemons_Tree","Enabled",1)
|
---|
1452 | ok = VRset("ContextMenu_Daemons_Details","Enabled",0)
|
---|
1453 | ok = VRSet("TM_refresh","Enabled", 1)
|
---|
1454 | return
|
---|
1455 |
|
---|
1456 | /*:VRX ContextMenu_Daemons_KillPID_Click
|
---|
1457 | */
|
---|
1458 | ContextMenu_Daemons_KillPID_Click:
|
---|
1459 | Msg.Text = NLVGetMessage(39, DaemonName)
|
---|
1460 | Msg.Type = 'Q'
|
---|
1461 | if _MsgYesNo() = 1 then do
|
---|
1462 | say 'kill -9 'DaemonName
|
---|
1463 | address cmd 'kill -9 'DaemonName
|
---|
1464 | end
|
---|
1465 | ok = VRSet("TM_Refresh","Enabled", 1)
|
---|
1466 | return
|
---|
1467 |
|
---|
1468 | /*:VRX ContextMenu_Daemons_MiniIcons_Click
|
---|
1469 | */
|
---|
1470 | ContextMenu_Daemons_MiniIcons_Click:
|
---|
1471 | advanced.!bigicons = \advanced.!bigicons
|
---|
1472 | ok = VRset("CN_DAEMONS", "MiniIcons", \advanced.!bigicons)
|
---|
1473 | ok = VRset("CN_SMBTREE", "MiniIcons", \advanced.!bigicons)
|
---|
1474 | ok = VRset("ContextMenu_Tree_MiniIcons", "Checked", \advanced.!bigicons)
|
---|
1475 | ok = VRset("ContextMenu_Daemons_MiniIcons", "Checked", \advanced.!bigicons)
|
---|
1476 | return
|
---|
1477 |
|
---|
1478 | /*:VRX ContextMenu_Daemons_Ping_Click
|
---|
1479 | */
|
---|
1480 | ContextMenu_Daemons_Ping_Click:
|
---|
1481 | ok = VRSet("Main", 'Pointer', 'Wait' )
|
---|
1482 | address cmd samba.!smbcontrolexe' 'DaemonName' ping --timeout=3 --debuglevel=0 2>'samba.!error' 1>'samba.!msg
|
---|
1483 | call _SambaShowMsg "section table registered"
|
---|
1484 |
|
---|
1485 | ok = VRSet("Main", 'Pointer', '<default>' )
|
---|
1486 | ok = VRSet("TM_refresh","Enabled", 1)
|
---|
1487 | return
|
---|
1488 |
|
---|
1489 | /*:VRX ContextMenu_Daemons_Shutdown_Click
|
---|
1490 | */
|
---|
1491 | ContextMenu_Daemons_Shutdown_Click:
|
---|
1492 | Msg.Text = NLVGetMessage(34, DaemonName)
|
---|
1493 | Msg.Type = 'Q'
|
---|
1494 | if _MsgYesNo() = 1 then do
|
---|
1495 | address cmd samba.!smbcontrolexe' 'DaemonName' shutdown 2>'samba.!error' 1>'samba.!msg
|
---|
1496 | call _SambaShowMsg "section table registered tdb"
|
---|
1497 | end
|
---|
1498 | ok = VRSet("TM_Refresh","Enabled", 1)
|
---|
1499 | return
|
---|
1500 |
|
---|
1501 | /*:VRX ContextMenu_Daemons_Sort_Click
|
---|
1502 | */
|
---|
1503 | ContextMenu_Daemons_Sort_Click:
|
---|
1504 | window = VRLoadSecondary( "SW_SORT", "W" )
|
---|
1505 | return
|
---|
1506 |
|
---|
1507 | /*:VRX ContextMenu_Daemons_Start_Click
|
---|
1508 | */
|
---|
1509 | ContextMenu_Daemons_Start_Click:
|
---|
1510 | Msg.Text = NLVGetMessage(37, DaemonName)
|
---|
1511 | Msg.Type = 'Q'
|
---|
1512 | if _MsgYesNo() = 1 then do
|
---|
1513 | say samba.!smbcmd' start 'DaemonName
|
---|
1514 | address cmd samba.!smbcmd' start 'DaemonName
|
---|
1515 | end
|
---|
1516 | ok = VRSet("TM_Refresh","Enabled", 1)
|
---|
1517 | return
|
---|
1518 |
|
---|
1519 | /*:VRX ContextMenu_Daemons_Tree_Click
|
---|
1520 | */
|
---|
1521 | ContextMenu_Daemons_Tree_Click:
|
---|
1522 | ok = VRset("CN_Daemons","View","IconTree")
|
---|
1523 | ok = VRset("ContextMenu_Daemons_Tree","Enabled",0)
|
---|
1524 | ok = VRset("ContextMenu_Daemons_Details","Enabled",1)
|
---|
1525 | ok = VRSet("TM_refresh","Enabled", 1)
|
---|
1526 | return
|
---|
1527 |
|
---|
1528 | /*:VRX ContextMenu_Files_Sort_Click
|
---|
1529 | */
|
---|
1530 | ContextMenu_Files_Sort_Click:
|
---|
1531 | window = VRLoadSecondary( "SW_SORT", "W" )
|
---|
1532 | return
|
---|
1533 |
|
---|
1534 | /*:VRX ContextMenu_Service_CloseShare_Click
|
---|
1535 | */
|
---|
1536 | ContextMenu_Service_CloseShare_Click:
|
---|
1537 | Msg.Text = NLVGetMessage(75, Service)
|
---|
1538 | Msg.Type = 'Q'
|
---|
1539 | if _MsgYesNo() = 1 then do
|
---|
1540 | address cmd samba.!smbcontrolexe' smbd close-share 'Service' --debuglevel=0' /* ' 2>'samba.!error' 1>'samba.!msg */
|
---|
1541 | /* No usable output from Samba here ! */
|
---|
1542 | /* call _SambaShowMsg */
|
---|
1543 | Msg.Text = NLVGetMessage(76, Service)
|
---|
1544 | Msg.Type = 'I'
|
---|
1545 | call _ShowMsg
|
---|
1546 | end
|
---|
1547 | ok = VRSet("TM_refresh","Enabled", 1)
|
---|
1548 | return
|
---|
1549 |
|
---|
1550 | /*:VRX ContextMenu_Service_Sort_Click
|
---|
1551 | */
|
---|
1552 | ContextMenu_Service_Sort_Click:
|
---|
1553 | window = VRLoadSecondary( "SW_SORT", "W" )
|
---|
1554 | return
|
---|
1555 |
|
---|
1556 | /*:VRX ContextMenu_Tree_Details_Click
|
---|
1557 | */
|
---|
1558 | ContextMenu_Tree_Details_Click:
|
---|
1559 | ok = VRset("CN_smbtree","View","Detail")
|
---|
1560 | ok = VRset("ContextMenu_Tree_Tree","Enabled",1)
|
---|
1561 | ok = VRset("ContextMenu_Tree_Details","Enabled",0)
|
---|
1562 | ok = VRset("ContextMenu_Tree_Icons","Enabled",1)
|
---|
1563 | ok = VRset("TM_Throbber", "Enabled", 1)
|
---|
1564 | ok = VRset("Pict_Throbber", "Visible", 0)
|
---|
1565 | call _RefreshTree
|
---|
1566 | return
|
---|
1567 |
|
---|
1568 | /*:VRX ContextMenu_Tree_Icons_Click
|
---|
1569 | */
|
---|
1570 | ContextMenu_Tree_Icons_Click:
|
---|
1571 | ok = VRset("CN_smbtree","View","Icon")
|
---|
1572 | ok = VRset("ContextMenu_Tree_Icons","Enabled",0)
|
---|
1573 | ok = VRset("ContextMenu_Tree_Tree","Enabled",1)
|
---|
1574 | ok = VRset("ContextMenu_Tree_Details","Enabled",1)
|
---|
1575 | ok = VRset("TM_Throbber", "Enabled", 1)
|
---|
1576 | ok = VRset("Pict_Throbber", "Visible", 1)
|
---|
1577 | call _RefreshTree
|
---|
1578 | return
|
---|
1579 |
|
---|
1580 | /*:VRX ContextMenu_Tree_MiniIcons_Click
|
---|
1581 | */
|
---|
1582 | ContextMenu_Tree_MiniIcons_Click:
|
---|
1583 | advanced.!bigicons = \advanced.!bigicons
|
---|
1584 | ok = VRset("CN_DAEMONS", "MiniIcons", \advanced.!bigicons)
|
---|
1585 | ok = VRset("CN_SMBTREE", "MiniIcons", \advanced.!bigicons)
|
---|
1586 | ok = VRset("ContextMenu_Tree_MiniIcons", "Checked", \advanced.!bigicons)
|
---|
1587 | ok = VRset("ContextMenu_Daemons_MiniIcons", "Checked", \advanced.!bigicons)
|
---|
1588 | return
|
---|
1589 |
|
---|
1590 | /*:VRX ContextMenu_Tree_SendMsg_Click
|
---|
1591 | */
|
---|
1592 | ContextMenu_Tree_SendMsg_Click:
|
---|
1593 | call _SendMsg
|
---|
1594 | return
|
---|
1595 |
|
---|
1596 | /*:VRX ContextMenu_Tree_Sort_Click
|
---|
1597 | */
|
---|
1598 | ContextMenu_Tree_Sort_Click:
|
---|
1599 | window = VRLoadSecondary( "SW_SORT", "W" )
|
---|
1600 | return
|
---|
1601 |
|
---|
1602 | /*:VRX ContextMenu_Tree_Tree_Click
|
---|
1603 | */
|
---|
1604 | ContextMenu_Tree_Tree_Click:
|
---|
1605 | ok = VRset("CN_smbtree","View","IconTree")
|
---|
1606 | ok = VRset("ContextMenu_Tree_Tree","Enabled",0)
|
---|
1607 | ok = VRset("ContextMenu_Tree_Details","Enabled",1)
|
---|
1608 | ok = VRset("ContextMenu_Tree_Icons","Enabled",1)
|
---|
1609 | ok = VRset("TM_Throbber", "Enabled", 1)
|
---|
1610 | ok = VRset("Pict_Throbber", "Visible", 1)
|
---|
1611 | call _RefreshTree
|
---|
1612 | return
|
---|
1613 |
|
---|
1614 | /*:VRX ContextMenu_Users_SendMsg_Click
|
---|
1615 | */
|
---|
1616 | ContextMenu_Users_SendMsg_Click:
|
---|
1617 | call _SendMsg
|
---|
1618 | return
|
---|
1619 |
|
---|
1620 | /*:VRX ContextMenu_Users_Sort_Click
|
---|
1621 | */
|
---|
1622 | ContextMenu_Users_Sort_Click:
|
---|
1623 | window = VRLoadSecondary( "SW_SORT", "W" )
|
---|
1624 | return
|
---|
1625 |
|
---|
1626 | /*:VRX DT_STATUSBAR_ContextMenu
|
---|
1627 | */
|
---|
1628 | DT_STATUSBAR_ContextMenu:
|
---|
1629 | ok = VRSet("DT_STATUSBAR","Caption", VRGet("Main", "HintText"))
|
---|
1630 | return
|
---|
1631 |
|
---|
1632 | /*:VRX Fini
|
---|
1633 | */
|
---|
1634 | Fini:
|
---|
1635 | window = VRWindow()
|
---|
1636 | call VRSet window, "Visible", 0
|
---|
1637 | drop window
|
---|
1638 | return 0
|
---|
1639 |
|
---|
1640 | /*:VRX GetBootDrive
|
---|
1641 | */
|
---|
1642 | GetBootDrive:
|
---|
1643 | /* Use SysBootDrive if possible */
|
---|
1644 | If Rxfuncadd('SysBootDrive', 'RexxUtil', 'SysBootDrive') Then
|
---|
1645 | Return Left(Value('RUNWORKPLACE',,'OS2ENVIRONMENT'),2)
|
---|
1646 | Else
|
---|
1647 | Return SysBootDrive()
|
---|
1648 |
|
---|
1649 |
|
---|
1650 | /*:VRX Halt
|
---|
1651 | */
|
---|
1652 | Halt:
|
---|
1653 | signal _VREHalt
|
---|
1654 | return
|
---|
1655 |
|
---|
1656 | /*:VRX Init
|
---|
1657 | */
|
---|
1658 | Init:
|
---|
1659 | window = VRWindow()
|
---|
1660 | call VRMethod window, "CenterWindow"
|
---|
1661 | call VRSet window, "Visible", 0
|
---|
1662 | call VRMethod window, "Activate"
|
---|
1663 | drop window
|
---|
1664 | return
|
---|
1665 |
|
---|
1666 | /*:VRX LB_SortFields_Click
|
---|
1667 | */
|
---|
1668 | LB_SortFields_Click:
|
---|
1669 | call _ContainerSort
|
---|
1670 | return
|
---|
1671 |
|
---|
1672 | /*:VRX Main_Activate
|
---|
1673 | */
|
---|
1674 | Main_Activate:
|
---|
1675 | call TM_Refresh_Trigger
|
---|
1676 | ok = VRset("TM_Refresh", "Enabled", 1)
|
---|
1677 | return
|
---|
1678 |
|
---|
1679 | /*:VRX Main_Close
|
---|
1680 | */
|
---|
1681 | Main_Close:
|
---|
1682 | call Quit
|
---|
1683 | return
|
---|
1684 |
|
---|
1685 | /*:VRX Main_Create
|
---|
1686 | */
|
---|
1687 | Main_Create:
|
---|
1688 | options.!debug = 1
|
---|
1689 | if options.!debug == 1 then do
|
---|
1690 | ok = VRRedirectStdIO("ON")
|
---|
1691 | say time()' Main_Create started'
|
---|
1692 | end
|
---|
1693 | else ok = VRRedirectStdIO("OFF")
|
---|
1694 |
|
---|
1695 | call _LoadOtherFuncs
|
---|
1696 | call _InitTempDir
|
---|
1697 |
|
---|
1698 | call _IniRead
|
---|
1699 | call NLVSetup
|
---|
1700 |
|
---|
1701 | call _TabbeddialogSetup
|
---|
1702 | call _NLVSetup
|
---|
1703 | call _SambaInit
|
---|
1704 | if \WPSStartStop then call _CreateSmbStarter
|
---|
1705 | if _SambaRunning() then call _SambaFindPIDfile
|
---|
1706 | call _ContainerInit
|
---|
1707 | call _GUIInit
|
---|
1708 |
|
---|
1709 | /* str = 'call TAB_'CurrentPageNr'_Click';
|
---|
1710 | say str
|
---|
1711 | interpret str
|
---|
1712 | say 'Done 'str
|
---|
1713 | if CurrentPageNr <> 5 then do
|
---|
1714 | ok = VRSet("TM_Throbber", "Enabled", 1)
|
---|
1715 | call _RefreshTree
|
---|
1716 | end */
|
---|
1717 | ok = VRMethod("PB_Refresh","SetFocus")
|
---|
1718 |
|
---|
1719 | if options.!debug == 1 then say time()' Main_Create done'
|
---|
1720 | return
|
---|
1721 | /*:VRX Main_Deactivate
|
---|
1722 | */
|
---|
1723 | Main_Deactivate:
|
---|
1724 | ok = VRset("TM_Refresh", "Enabled", 0)
|
---|
1725 | return
|
---|
1726 |
|
---|
1727 | /*:VRX Main_Resize
|
---|
1728 | */
|
---|
1729 | Main_Resize:
|
---|
1730 | IF options.!debug == 1 THEN SAY time()' Main_Resize started'
|
---|
1731 | ok = VRSet("Main","Painting", 0)
|
---|
1732 |
|
---|
1733 | /* Basic measurements */
|
---|
1734 | main_iwidth = VRGet("Main","InteriorWidth") /* Width of window client-area */
|
---|
1735 | main_iheight = VRGet("Main","InteriorHeight") /* Height of window client-area */
|
---|
1736 |
|
---|
1737 | /* if main_iheight < 5500 then ok = VRSet("Main","Height",6200) */
|
---|
1738 | sbar_height = 209 /* Height of status-bar */
|
---|
1739 | marginx2 = margin * 2 /* Common margin around controls */
|
---|
1740 |
|
---|
1741 | pbtn_dist = 980
|
---|
1742 | pbtn_nr = 4
|
---|
1743 | pbtn_pos = max((main_iwidth - pbtn_Dist * pbtn_Nr)%2, 0)+ margin
|
---|
1744 | pbtn_height = 400 /* Height of the panels' internal button areas */
|
---|
1745 | pbtn_width = 940
|
---|
1746 |
|
---|
1747 | pane_height = main_iheight- sbar_height - pbtn_height - margin * 7 /* Height of notebook */
|
---|
1748 | pane_width = main_iwidth - marginx2 /* Width of the notebook panel */
|
---|
1749 |
|
---|
1750 | /* Tabbed Dialog */
|
---|
1751 | ok = VRset("TDL_1", "Top", marginx2 )
|
---|
1752 | ok = VRset("TDL_1", "Left", margin )
|
---|
1753 | ok = VRset("TDL_1", "Width", pane_width )
|
---|
1754 | ok = VRset("TDL_1", "Height", pane_height )
|
---|
1755 |
|
---|
1756 | /* Statusbar */
|
---|
1757 | ok = VRSet("GB_STATUSBAR", "Left", margin )
|
---|
1758 | ok = VRSet("GB_STATUSBAR", "Top", main_iheight - sbar_height - margin )
|
---|
1759 | ok = VRSet("GB_STATUSBAR", "Height",sbar_height )
|
---|
1760 | ok = VRSet("GB_STATUSBAR", "Width", pane_width )
|
---|
1761 |
|
---|
1762 | ok = VRSet("DT_STATUSBAR", "Top", 12 )
|
---|
1763 | ok = VRSet("DT_STATUSBAR", "Left", 12 )
|
---|
1764 | ok = VRSet("DT_STATUSBAR", "Height",sbar_height- 24)
|
---|
1765 | ok = VRSet("DT_STATUSBAR", "Width", pane_width - 24)
|
---|
1766 |
|
---|
1767 | ok = VRSet("PB_Refresh","top", pane_height + margin * 4 )
|
---|
1768 | ok = VRSet("PB_Help", "top", pane_height + margin * 4 )
|
---|
1769 | ok = VRSet("PB_Cancel", "top", pane_height + margin * 4 )
|
---|
1770 | ok = VRSet("PB_About", "top", pane_height + margin * 4 )
|
---|
1771 |
|
---|
1772 | ok = VRSet("PB_Refresh","left",pbtn_pos + pbtn_dist * (pbtn_nr - 4))
|
---|
1773 | ok = VRSet("PB_Help", "left",pbtn_pos + pbtn_dist * (pbtn_nr - 3))
|
---|
1774 | ok = VRSet("PB_About", "left",pbtn_pos + pbtn_dist * (pbtn_nr - 2))
|
---|
1775 | ok = VRSet("PB_Cancel", "left",pbtn_pos + pbtn_dist * (pbtn_nr - 1))
|
---|
1776 |
|
---|
1777 | ok = VRset("GB_USERS","Top", margin )
|
---|
1778 | ok = VRset("GB_USERS","Left", marginx2)
|
---|
1779 | ok = VRset("GB_USERS","Width", pane_width - 760)
|
---|
1780 | ok = VRset("GB_USERS","Height", pane_height- 1020)
|
---|
1781 | ok = VRset("CN_USERS","Top", margin)
|
---|
1782 | ok = VRset("CN_USERS","Left", margin)
|
---|
1783 | ok = VRset("CN_USERS","Width", pane_width - 760 - marginx2 )
|
---|
1784 | ok = VRset("CN_USERS","Height", pane_height- 1020- marginx2 )
|
---|
1785 |
|
---|
1786 | ok = VRset("GB_FILES","Top", margin )
|
---|
1787 | ok = VRset("GB_FILES","Left", marginx2)
|
---|
1788 | ok = VRset("GB_FILES","Width", pane_width - 760)
|
---|
1789 | ok = VRset("GB_FILES","Height", pane_height- 1020)
|
---|
1790 | ok = VRset("CN_FILES","Top", margin)
|
---|
1791 | ok = VRset("CN_FILES","Left", margin)
|
---|
1792 | ok = VRset("CN_FILES","Width", pane_width - 760 - marginx2 )
|
---|
1793 | ok = VRset("CN_FILES","Height", pane_height- 1020- marginx2 )
|
---|
1794 |
|
---|
1795 | ok = VRset("GB_SERVICE","Top", margin )
|
---|
1796 | ok = VRset("GB_SERVICE","Left", marginx2)
|
---|
1797 | ok = VRset("GB_SERVICE","Width", pane_width - 760)
|
---|
1798 | ok = VRset("GB_SERVICE","Height", pane_height- 1020)
|
---|
1799 | ok = VRset("CN_SERVICE","Top", margin)
|
---|
1800 | ok = VRset("CN_SERVICE","Left", margin)
|
---|
1801 | ok = VRset("CN_SERVICE","Width", pane_width - 760 - marginx2 )
|
---|
1802 | ok = VRset("CN_SERVICE","Height", pane_height- 1020- marginx2 )
|
---|
1803 |
|
---|
1804 | ok = VRset("GB_DAEMONS","Top", margin )
|
---|
1805 | ok = VRset("GB_DAEMONS","Left", marginx2)
|
---|
1806 | ok = VRset("GB_DAEMONS","Width", pane_width - 760)
|
---|
1807 | ok = VRset("GB_DAEMONS","Height", pane_height- 1020)
|
---|
1808 | ok = VRset("CN_DAEMONS","Top", margin)
|
---|
1809 | ok = VRset("CN_DAEMONS","Left", margin)
|
---|
1810 | ok = VRset("CN_DAEMONS","Width", pane_width - 760 - margin*4 - pbtn_width)
|
---|
1811 | ok = VRset("CN_DAEMONS","Height", pane_height- 1020 - marginx2 )
|
---|
1812 |
|
---|
1813 | ok = VRSet("PB_START", "Top", pbtn_height*2 - marginx2)
|
---|
1814 | ok = VRSet("PB_STOP", "Top", pbtn_height*3 - marginx2)
|
---|
1815 | ok = VRSet("PB_Restart","Top", pbtn_height*4 - marginx2)
|
---|
1816 | ok = VRSet("PB_Reload", "Top", pbtn_height*5 - marginx2)
|
---|
1817 | ok = VRSet("PB_DelLogs","Top", pbtn_height*6 - marginx2)
|
---|
1818 |
|
---|
1819 | ok = VRSet("PB_START", "Left", pane_width - 760 - marginx2 - pbtn_width)
|
---|
1820 | ok = VRSet("PB_STOP", "Left", pane_width - 760 - marginx2 - pbtn_width)
|
---|
1821 | ok = VRSet("PB_Restart","Left", pane_width - 760 - marginx2 - pbtn_width)
|
---|
1822 | ok = VRSet("PB_Reload", "Left", pane_width - 760 - marginx2 - pbtn_width)
|
---|
1823 | ok = VRSet("PB_DelLogs","Left", pane_width - 760 - marginx2 - pbtn_width)
|
---|
1824 |
|
---|
1825 | ok = VRset("GB_SMBTREE","Top", margin )
|
---|
1826 | ok = VRset("GB_SMBTREE","Left", marginx2)
|
---|
1827 | ok = VRset("GB_SMBTREE","Width", pane_width - 760)
|
---|
1828 | ok = VRset("GB_SMBTREE","Height", pane_height- 1020)
|
---|
1829 | ok = VRset("CN_SMBTREE","Top", margin)
|
---|
1830 | ok = VRset("CN_SMBTREE","Left", margin)
|
---|
1831 | ok = VRset("CN_SMBTREE","Width", pane_width - 760 - marginx2 )
|
---|
1832 | ok = VRset("CN_SMBTREE","Height", pane_height- 1020- marginx2 )
|
---|
1833 |
|
---|
1834 | ok = VRset("PICT_THROBBER", "Top", VRGet("CN_SMBTREE","Height") % 2 - 100 )
|
---|
1835 | ok = VRset("PICT_THROBBER", "Left", VRGet("CN_SMBTREE","Width") % 2 - 200 )
|
---|
1836 |
|
---|
1837 | ok = VRset("GB_SETTINGS","Top", margin )
|
---|
1838 | ok = VRset("GB_SETTINGS","Left", marginx2)
|
---|
1839 | ok = VRset("GB_SETTINGS","Width", pane_width - 760)
|
---|
1840 | ok = VRset("GB_SETTINGS","Height", pane_height- 1020)
|
---|
1841 |
|
---|
1842 |
|
---|
1843 | /* check and empty event queue, trash spurious resize events */
|
---|
1844 | EventString = ''
|
---|
1845 | TrashedResize = 0
|
---|
1846 | do until EventString = 'nop'
|
---|
1847 | EventString = VREvent('N')
|
---|
1848 | if EventString <> 'nop' then do
|
---|
1849 | if EventString = 'CALL Main_Resize' then TrashedResize = 1
|
---|
1850 | else interpret eventString
|
---|
1851 | end
|
---|
1852 | end
|
---|
1853 | if TrashedResize then CALL Main_Resize
|
---|
1854 | ok = VRSet("Main", "Painting", 1)
|
---|
1855 |
|
---|
1856 | IF options.!debug == 1 THEN SAY time()' Main_Resize done'
|
---|
1857 | return
|
---|
1858 |
|
---|
1859 | /*:VRX Page1_Create
|
---|
1860 | */
|
---|
1861 | Page1_Create:
|
---|
1862 |
|
---|
1863 | Return
|
---|
1864 |
|
---|
1865 | /*:VRX Page1_Init
|
---|
1866 | */
|
---|
1867 | Page1_Init:
|
---|
1868 | call _ContainerInit
|
---|
1869 | return
|
---|
1870 |
|
---|
1871 | /*:VRX Page2_Create
|
---|
1872 | */
|
---|
1873 | Page2_create:
|
---|
1874 |
|
---|
1875 | Return
|
---|
1876 | /*:VRX Page2_init
|
---|
1877 | */
|
---|
1878 | Page2_init:
|
---|
1879 |
|
---|
1880 | return
|
---|
1881 |
|
---|
1882 | /*:VRX Page3_Create
|
---|
1883 | */
|
---|
1884 | Page3_create:
|
---|
1885 |
|
---|
1886 | Return
|
---|
1887 | /*:VRX Page3_Init
|
---|
1888 | */
|
---|
1889 | Page3_Init:
|
---|
1890 |
|
---|
1891 | return
|
---|
1892 |
|
---|
1893 | /*:VRX Page4_Create
|
---|
1894 | */
|
---|
1895 | Page4_Create:
|
---|
1896 |
|
---|
1897 | Return
|
---|
1898 | /*:VRX Page4_init
|
---|
1899 | */
|
---|
1900 | Page4_init:
|
---|
1901 |
|
---|
1902 | return
|
---|
1903 |
|
---|
1904 | /*:VRX Page5_Create
|
---|
1905 | */
|
---|
1906 | Page5_Create:
|
---|
1907 |
|
---|
1908 | return
|
---|
1909 |
|
---|
1910 | /*:VRX Page5_Init
|
---|
1911 | */
|
---|
1912 | Page5_Init:
|
---|
1913 |
|
---|
1914 | return
|
---|
1915 |
|
---|
1916 | /*:VRX Paper_Init
|
---|
1917 | */
|
---|
1918 | Paper_Init:
|
---|
1919 | ok = VRSet("IPB_Paper","Width" ,VRMethod( "Screen", "PixelsToTwips", 32 ))
|
---|
1920 | ok = VRSet("IPB_Paper","Height",VRMethod( "Screen", "PixelsToTwips", 32 ))
|
---|
1921 | ok = VRset("IPB_Paper","Left",VRget("GB_Main2","width")-420)
|
---|
1922 | return
|
---|
1923 |
|
---|
1924 | /*:VRX PB_About_Click
|
---|
1925 | */
|
---|
1926 | PB_About_Click:
|
---|
1927 | window = VRLoadSecondary( "About", "W" )
|
---|
1928 | return
|
---|
1929 |
|
---|
1930 | /*:VRX PB_AboutOK_Click
|
---|
1931 | */
|
---|
1932 | PB_AboutOK_Click:
|
---|
1933 | call About_Close
|
---|
1934 | return
|
---|
1935 |
|
---|
1936 | /*:VRX PB_Cancel_Click
|
---|
1937 | */
|
---|
1938 | PB_Cancel_Click:
|
---|
1939 | say 'start PB_Cancel_Click'
|
---|
1940 | Call Quit
|
---|
1941 | say 'done PB_Cancel_Click'
|
---|
1942 | return
|
---|
1943 |
|
---|
1944 | /*:VRX PB_DELLOGS_Click
|
---|
1945 | */
|
---|
1946 | PB_DELLOGS_Click:
|
---|
1947 | call VRSet VRWindow(), 'Pointer', 'Wait'
|
---|
1948 |
|
---|
1949 | /* Fixme - this needs to be read from smb.conf */
|
---|
1950 | samba.!logdir = ETC'\samba\log'
|
---|
1951 |
|
---|
1952 | ok = SysFileTree(samba.!logdir'\log.*', logs.,'FO')
|
---|
1953 | do I = 1 to logs.0
|
---|
1954 | ok = VRMethod( "CN_Daemons", "GetRecordList", "All", "handle." )
|
---|
1955 | KeepLog = 0
|
---|
1956 | do J = 1 to handle.0
|
---|
1957 | CurPID = VRMethod("CN_Daemons", "GetFieldData", handle.J, DPidsFH)
|
---|
1958 | if pos(CurPID,logs.I) > 0 then KeepLog = 1
|
---|
1959 | end
|
---|
1960 | if KeepLog = 0 then ok = SysFileDelete(logs.I)
|
---|
1961 | end
|
---|
1962 |
|
---|
1963 | call VRSet VRWindow(), 'Pointer', '<default>'
|
---|
1964 | return
|
---|
1965 |
|
---|
1966 | /*:VRX PB_Help_Click
|
---|
1967 | */
|
---|
1968 | PB_Help_Click:
|
---|
1969 | ok = VRMethod("Page_"CurrentPageNr, "InvokeHelp" )
|
---|
1970 | return
|
---|
1971 |
|
---|
1972 | /*:VRX PB_Refresh_Click
|
---|
1973 | */
|
---|
1974 | PB_Refresh_Click:
|
---|
1975 | IF options.!debug == 1 then say time()' PB_Refresh_Click() started'
|
---|
1976 | ok = SysSleep(0.3)
|
---|
1977 |
|
---|
1978 | say " CurrentPageNr = "CurrentPageNr
|
---|
1979 |
|
---|
1980 | if CurrentPageNr = 5 then do
|
---|
1981 | ok = VRset("Pict_Throbber", "Visible", 1)
|
---|
1982 | ok = VRset("TM_Throbber", "Enabled", 1)
|
---|
1983 | call _RefreshTree
|
---|
1984 | end
|
---|
1985 | else call _Refresh
|
---|
1986 | IF options.!debug == 1 then say time()' PB_Refresh_Click() done'
|
---|
1987 | return
|
---|
1988 |
|
---|
1989 | /*:VRX PB_RELOAD_Click
|
---|
1990 | */
|
---|
1991 | PB_RELOAD_Click:
|
---|
1992 | call VRSet VRWindow(), 'Pointer', 'Wait'
|
---|
1993 | if WPSStartStop then do
|
---|
1994 | ok = SysOpenObject('<smb_reload>', 'DEFAULT', 1)
|
---|
1995 | end
|
---|
1996 | else do
|
---|
1997 | call lineout samba.!bin"\smbstart", "reload"
|
---|
1998 | ok = stream(samba.!bin"\reload","c","close")
|
---|
1999 | end
|
---|
2000 | ok = VRSet("TM_Refresh","Delay", 2000)
|
---|
2001 | call VRSet VRWindow(), 'Pointer', '<default>'
|
---|
2002 | return
|
---|
2003 |
|
---|
2004 | /*:VRX PB_RESTART_Click
|
---|
2005 | */
|
---|
2006 | PB_RESTART_Click:
|
---|
2007 | call VRSet VRWindow(), 'Pointer', 'Wait'
|
---|
2008 | if WPSStartStop then do
|
---|
2009 | ok = SysOpenObject('<smb_restart>', 'DEFAULT', 1)
|
---|
2010 | end
|
---|
2011 | else do
|
---|
2012 | call lineout samba.!bin"\restart", "restart"
|
---|
2013 | ok = stream(samba.!bin"\restart","c","close")
|
---|
2014 | end
|
---|
2015 | ok = VRSet("TM_Refresh","Delay", 1000)
|
---|
2016 | call VRSet VRWindow(), 'Pointer', '<default>'
|
---|
2017 | return
|
---|
2018 |
|
---|
2019 | /*:VRX PB_Sort_Cancel_Click
|
---|
2020 | */
|
---|
2021 | PB_Sort_Cancel_Click:
|
---|
2022 | ok = VRset( Container, "DetailSort", Old.SortField )
|
---|
2023 | ok = VRSet( Container, "Sort", Old.SortOrder )
|
---|
2024 | ok = VRMethod( Container, "SortRecords" )
|
---|
2025 | drop Old.
|
---|
2026 | call SW_SORT_Close
|
---|
2027 | return
|
---|
2028 |
|
---|
2029 | /*:VRX PB_Sort_OK_Click
|
---|
2030 | */
|
---|
2031 | PB_Sort_OK_Click:
|
---|
2032 | drop Old.
|
---|
2033 | call SW_SORT_Close
|
---|
2034 | return
|
---|
2035 |
|
---|
2036 | /*:VRX PB_START_Click
|
---|
2037 | */
|
---|
2038 | PB_START_Click:
|
---|
2039 | say "IPB_Start_Click started"
|
---|
2040 | call VRSet VRWindow(), 'Pointer', 'Wait'
|
---|
2041 | if WPSStartStop then do
|
---|
2042 | ok = SysOpenObject('<smb_start>', 'DEFAULT', 1)
|
---|
2043 | end
|
---|
2044 | else do
|
---|
2045 | call lineout samba.!bin"\smbstart", "smbstart"
|
---|
2046 | ok = stream(samba.!bin"\smbstart","c","close")
|
---|
2047 | end
|
---|
2048 | ok = VRSet("TM_Refresh","Delay", 1000)
|
---|
2049 | call VRSet VRWindow(), 'Pointer', '<default>'
|
---|
2050 | say "IPB_Start_Click done"
|
---|
2051 | return
|
---|
2052 | /*:VRX PB_STOP_Click
|
---|
2053 | */
|
---|
2054 | PB_STOP_Click:
|
---|
2055 | say "IPB_Stop_Click started"
|
---|
2056 | call VRSet VRWindow(), 'Pointer', 'Wait'
|
---|
2057 | if WPSStartStop then do
|
---|
2058 | ok = SysOpenObject('<smb_stop>', 'DEFAULT', 1)
|
---|
2059 | end
|
---|
2060 | else do
|
---|
2061 | call lineout samba.!bin"\smbstop", "smbstop"
|
---|
2062 | ok = stream(samba.!bin"\smbstop","c","close")
|
---|
2063 | end
|
---|
2064 | ok = VRSet("TM_Refresh","Delay", 1000)
|
---|
2065 | call VRSet VRWindow(), 'Pointer', '<default>'
|
---|
2066 | say "IPB_Stop_Click done"
|
---|
2067 | return
|
---|
2068 | /*:VRX PushbackAll
|
---|
2069 | */
|
---|
2070 | PushbackAll:
|
---|
2071 | Pages = 6
|
---|
2072 | /* Tab distance from top */
|
---|
2073 | TabTop = 20
|
---|
2074 | TabWidth = VRMethod( "Screen", "PixelsToTwips", 78 )
|
---|
2075 | TabHeight= VRMethod( "Screen", "PixelsToTwips", 24 )
|
---|
2076 |
|
---|
2077 | /* Page Position */
|
---|
2078 | PageLeft = 120
|
---|
2079 | PageTop = PageLeft + TabTop + 330
|
---|
2080 |
|
---|
2081 | /* Page size */
|
---|
2082 | PageHeight = 3000
|
---|
2083 | PageWidth = 3000
|
---|
2084 | call beep 880, 20
|
---|
2085 | /* ok = VRset("DT_PageName", "Caption", "")
|
---|
2086 | ok = VRSet("GB_Main","Left", 0)
|
---|
2087 | ok = VRSet("GB_Main","Top", TabTop+230)
|
---|
2088 | do I = 1 to Pages
|
---|
2089 | ok = VRSet("TAB_"I,"Top", TabTop)
|
---|
2090 | ok = VRSet("TAB_"I,"PicturePath","#2"||I||";#2"||I)
|
---|
2091 | ok = VRSet("TAB_"I,"Left",TabWidth*(I-1)+PageLeft)
|
---|
2092 | ok = VRSet("TAB_"I,"Width",TabWidth)
|
---|
2093 | ok = VRSet("TAB_"I,"Height",TabHeight)
|
---|
2094 | ok = VRSet("Page_"I,"Height", max(PageHeight,VRget("GB_Main2","Height")-600))
|
---|
2095 | ok = VRSet("Page_"I,"Width", max(PageWidth,VRget("GB_Main2","Width")-450))
|
---|
2096 | ok = VRSet("Page_"I,"Left", PageLeft)
|
---|
2097 | ok = VRSet("Page_"I,"Top", PageTop)
|
---|
2098 | ok = VRSet("Page_"I,"Visible", 0)
|
---|
2099 | ok = VRSet("Page_"I,"BackColor", "<default>")
|
---|
2100 | end */
|
---|
2101 | return
|
---|
2102 |
|
---|
2103 | /*:VRX Quit
|
---|
2104 | */
|
---|
2105 | Quit:
|
---|
2106 | call VRSet VRWindow(), 'Pointer', 'Wait'
|
---|
2107 | call _IniWrite
|
---|
2108 | ok = VRRedirectStdIO("OFF")
|
---|
2109 | call _SambaFinish
|
---|
2110 |
|
---|
2111 | ok = SysFileDelete(smbdoutput)
|
---|
2112 |
|
---|
2113 | call lineout samba.!bin"\quit", "quit"
|
---|
2114 | ok = stream(samba.!bin"\quit","c","close")
|
---|
2115 | ok = SysSleep(1)
|
---|
2116 | ok = SysDestroyObject('<smbstarter>')
|
---|
2117 | ok = SysFileDelete(samba.!bin'\smbstarter.cmd')
|
---|
2118 | ok = SysFileDelete(samba.!bin'\quit')
|
---|
2119 | call VRSet VRWindow(), 'Pointer', '<default>'
|
---|
2120 |
|
---|
2121 | window = VRWindow()
|
---|
2122 | call VRSet window, "Shutdown", 1
|
---|
2123 | drop window
|
---|
2124 | return
|
---|
2125 |
|
---|
2126 | /*:VRX RB_Sort_Ascending_Click
|
---|
2127 | */
|
---|
2128 | RB_Sort_Ascending_Click:
|
---|
2129 | SortOrder = "Ascending"
|
---|
2130 | call _ContainerSort
|
---|
2131 | return
|
---|
2132 |
|
---|
2133 | /*:VRX RB_Sort_Descending_Click
|
---|
2134 | */
|
---|
2135 | RB_Sort_Descending_Click:
|
---|
2136 | SortOrder = "Descending"
|
---|
2137 | call _ContainerSort
|
---|
2138 | return
|
---|
2139 |
|
---|
2140 | /*:VRX RB_Sort_None_Click
|
---|
2141 | */
|
---|
2142 | RB_Sort_None_Click:
|
---|
2143 | SortOrder = "None"
|
---|
2144 | call _ContainerSort
|
---|
2145 | return
|
---|
2146 |
|
---|
2147 | /*:VRX SPIN_Intervall_Change
|
---|
2148 | */
|
---|
2149 | SPIN_Intervall_Change:
|
---|
2150 | Intervall = VRGet("SPIN_Intervall","Value")
|
---|
2151 | ok = VRSet("TM_Refresh","Delay", Intervall * 1000)
|
---|
2152 | return
|
---|
2153 |
|
---|
2154 | /*:VRX SPIN_IntervallMin_Change
|
---|
2155 | */
|
---|
2156 | SPIN_IntervallMin_Change:
|
---|
2157 | IntervallMin = VRGet("SPIN_IntervallMin","Value")
|
---|
2158 | return
|
---|
2159 |
|
---|
2160 | /*:VRX SW_DAEMONS_Close
|
---|
2161 | */
|
---|
2162 | SW_DAEMONS_Close:
|
---|
2163 | call SW_DAEMONS_Fini
|
---|
2164 | return
|
---|
2165 |
|
---|
2166 | /*:VRX SW_DAEMONS_Create
|
---|
2167 | */
|
---|
2168 | SW_DAEMONS_Create:
|
---|
2169 | call SW_DAEMONS_Init
|
---|
2170 | return
|
---|
2171 |
|
---|
2172 | /*:VRX SW_DAEMONS_Fini
|
---|
2173 | */
|
---|
2174 | SW_DAEMONS_Fini:
|
---|
2175 | window = VRInfo( "Window" )
|
---|
2176 | call VRDestroy window
|
---|
2177 | drop window
|
---|
2178 | return
|
---|
2179 | /*:VRX SW_DAEMONS_Init
|
---|
2180 | */
|
---|
2181 | SW_DAEMONS_Init:
|
---|
2182 | window = VRInfo( "Object" )
|
---|
2183 | if( \VRIsChildOf( window, "Notebook" ) ) then do
|
---|
2184 | call VRMethod window, "CenterWindow"
|
---|
2185 | call VRSet window, "Visible", 1
|
---|
2186 | call VRMethod window, "Activate"
|
---|
2187 | end
|
---|
2188 | drop window
|
---|
2189 | return
|
---|
2190 |
|
---|
2191 | /*:VRX SW_FILES_Close
|
---|
2192 | */
|
---|
2193 | SW_FILES_Close:
|
---|
2194 | call SW_FILES_Fini
|
---|
2195 | return
|
---|
2196 |
|
---|
2197 | /*:VRX SW_FILES_Create
|
---|
2198 | */
|
---|
2199 | SW_FILES_Create:
|
---|
2200 | call SW_FILES_Init
|
---|
2201 | return
|
---|
2202 |
|
---|
2203 | /*:VRX SW_FILES_Fini
|
---|
2204 | */
|
---|
2205 | SW_FILES_Fini:
|
---|
2206 | window = VRInfo( "Window" )
|
---|
2207 | call VRDestroy window
|
---|
2208 | drop window
|
---|
2209 | return
|
---|
2210 | /*:VRX SW_FILES_Init
|
---|
2211 | */
|
---|
2212 | SW_FILES_Init:
|
---|
2213 | window = VRInfo( "Object" )
|
---|
2214 | if( \VRIsChildOf( window, "Notebook" ) ) then do
|
---|
2215 | call VRMethod window, "CenterWindow"
|
---|
2216 | call VRSet window, "Visible", 1
|
---|
2217 | call VRMethod window, "Activate"
|
---|
2218 | end
|
---|
2219 | drop window
|
---|
2220 | return
|
---|
2221 |
|
---|
2222 | /*:VRX SW_SERVICE_Close
|
---|
2223 | */
|
---|
2224 | SW_SERVICE_Close:
|
---|
2225 | call SW_SERVICE_Fini
|
---|
2226 | return
|
---|
2227 |
|
---|
2228 | /*:VRX SW_SERVICE_Create
|
---|
2229 | */
|
---|
2230 | SW_SERVICE_Create:
|
---|
2231 | call SW_SERVICE_Init
|
---|
2232 | return
|
---|
2233 |
|
---|
2234 | /*:VRX SW_SERVICE_Fini
|
---|
2235 | */
|
---|
2236 | SW_SERVICE_Fini:
|
---|
2237 | window = VRInfo( "Window" )
|
---|
2238 | call VRDestroy window
|
---|
2239 | drop window
|
---|
2240 | return
|
---|
2241 | /*:VRX SW_SERVICE_Init
|
---|
2242 | */
|
---|
2243 | SW_SERVICE_Init:
|
---|
2244 | window = VRInfo( "Object" )
|
---|
2245 | if( \VRIsChildOf( window, "Notebook" ) ) then do
|
---|
2246 | call VRMethod window, "CenterWindow"
|
---|
2247 | call VRSet window, "Visible", 1
|
---|
2248 | call VRMethod window, "Activate"
|
---|
2249 | end
|
---|
2250 | drop window
|
---|
2251 | return
|
---|
2252 |
|
---|
2253 | /*:VRX SW_SETTINGS_Close
|
---|
2254 | */
|
---|
2255 | SW_SETTINGS_Close:
|
---|
2256 | call SW_SETTINGS_Fini
|
---|
2257 | return
|
---|
2258 |
|
---|
2259 | /*:VRX SW_SETTINGS_Create
|
---|
2260 | */
|
---|
2261 | SW_SETTINGS_Create:
|
---|
2262 | call SW_SETTINGS_Init
|
---|
2263 | return
|
---|
2264 |
|
---|
2265 | /*:VRX SW_SETTINGS_Fini
|
---|
2266 | */
|
---|
2267 | SW_SETTINGS_Fini:
|
---|
2268 | window = VRInfo( "Window" )
|
---|
2269 | call VRDestroy window
|
---|
2270 | drop window
|
---|
2271 | return
|
---|
2272 | /*:VRX SW_SETTINGS_Init
|
---|
2273 | */
|
---|
2274 | SW_SETTINGS_Init:
|
---|
2275 | window = VRInfo( "Object" )
|
---|
2276 | if( \VRIsChildOf( window, "Notebook" ) ) then do
|
---|
2277 | call VRMethod window, "CenterWindow"
|
---|
2278 | call VRSet window, "Visible", 1
|
---|
2279 | call VRMethod window, "Activate"
|
---|
2280 | end
|
---|
2281 | drop window
|
---|
2282 | return
|
---|
2283 |
|
---|
2284 | /*:VRX SW_SMBTREE_Close
|
---|
2285 | */
|
---|
2286 | SW_SMBTREE_Close:
|
---|
2287 | call SW_SMBTREE_Fini
|
---|
2288 | return
|
---|
2289 |
|
---|
2290 | /*:VRX SW_SMBTREE_Create
|
---|
2291 | */
|
---|
2292 | SW_SMBTREE_Create:
|
---|
2293 | call SW_SMBTREE_Init
|
---|
2294 | return
|
---|
2295 |
|
---|
2296 | /*:VRX SW_SMBTREE_Fini
|
---|
2297 | */
|
---|
2298 | SW_SMBTREE_Fini:
|
---|
2299 | window = VRInfo( "Window" )
|
---|
2300 | call VRDestroy window
|
---|
2301 | drop window
|
---|
2302 | return
|
---|
2303 | /*:VRX SW_SMBTREE_Init
|
---|
2304 | */
|
---|
2305 | SW_SMBTREE_Init:
|
---|
2306 | window = VRInfo( "Object" )
|
---|
2307 | if( \VRIsChildOf( window, "Notebook" ) ) then do
|
---|
2308 | call VRMethod window, "CenterWindow"
|
---|
2309 | call VRSet window, "Visible", 1
|
---|
2310 | call VRMethod window, "Activate"
|
---|
2311 | end
|
---|
2312 | drop window
|
---|
2313 | return
|
---|
2314 |
|
---|
2315 | /*:VRX SW_SMBTREE_Init_Content
|
---|
2316 | */
|
---|
2317 | SW_SMBTREE_Init_Content:
|
---|
2318 | ok = VRset("Pict_Throbber", "Visible", 1)
|
---|
2319 | ok = VRset("TM_Throbber", "Enabled", 1)
|
---|
2320 | call _RefreshTree
|
---|
2321 | return
|
---|
2322 |
|
---|
2323 | /*:VRX SW_SORT_Close
|
---|
2324 | */
|
---|
2325 | SW_SORT_Close:
|
---|
2326 | call SW_SORT_Fini
|
---|
2327 | return
|
---|
2328 |
|
---|
2329 | /*:VRX SW_SORT_Create
|
---|
2330 | */
|
---|
2331 | SW_SORT_Create:
|
---|
2332 | call SW_SORT_Init
|
---|
2333 |
|
---|
2334 | CALL NLVSetText 'SW_SORT', 'Caption', 35
|
---|
2335 | CALL NLVSetText 'PB_Sort_OK', 'Caption', 2
|
---|
2336 | CALL NLVSetText 'PB_Sort_Cancel', 'Caption', 3
|
---|
2337 |
|
---|
2338 | CALL NLVSetText 'RB_Sort_Ascending', 'Caption', 90
|
---|
2339 | CALL NLVSetText 'RB_Sort_Descending', 'Caption', 91
|
---|
2340 | CALL NLVSetText 'RB_Sort_None', 'Caption', 92
|
---|
2341 |
|
---|
2342 | Container = OH
|
---|
2343 | say OH
|
---|
2344 | say Container
|
---|
2345 | ok = VRMethod(Container, "GetFieldList", "Fields." )
|
---|
2346 |
|
---|
2347 | SortOrder = "None"
|
---|
2348 |
|
---|
2349 | do I = 1 to Fields.0
|
---|
2350 | ok = VRMethod("LB_SortFields","AddString", VRMethod(Container, "GetFieldAttr", fields.I, "Title" ))
|
---|
2351 | end
|
---|
2352 | Old.SortField = VRGet( Container, "DetailSort" )
|
---|
2353 | Old.SortOrder = VRGet( Container, "Sort" )
|
---|
2354 | say Old.SortField
|
---|
2355 | say Old.SortOrder
|
---|
2356 | return
|
---|
2357 |
|
---|
2358 | /*:VRX SW_SORT_Fini
|
---|
2359 | */
|
---|
2360 | SW_SORT_Fini:
|
---|
2361 | window = VRInfo( "Window" )
|
---|
2362 | call VRDestroy window
|
---|
2363 | drop window
|
---|
2364 | return
|
---|
2365 | /*:VRX SW_SORT_Init
|
---|
2366 | */
|
---|
2367 | SW_SORT_Init:
|
---|
2368 | window = VRInfo( "Object" )
|
---|
2369 | if( \VRIsChildOf( window, "Notebook" ) ) then do
|
---|
2370 | call VRMethod window, "CenterWindow"
|
---|
2371 | call VRSet window, "Visible", 1
|
---|
2372 | call VRMethod window, "Activate"
|
---|
2373 | end
|
---|
2374 | drop window
|
---|
2375 | return
|
---|
2376 |
|
---|
2377 | /*:VRX SW_USERS_Close
|
---|
2378 | */
|
---|
2379 | SW_USERS_Close:
|
---|
2380 | call SW_USERS_Fini
|
---|
2381 | return
|
---|
2382 |
|
---|
2383 | /*:VRX SW_USERS_Create
|
---|
2384 | */
|
---|
2385 | SW_USERS_Create:
|
---|
2386 | call SW_USERS_Init
|
---|
2387 | return
|
---|
2388 |
|
---|
2389 | /*:VRX SW_USERS_Fini
|
---|
2390 | */
|
---|
2391 | SW_USERS_Fini:
|
---|
2392 | window = VRInfo( "Window" )
|
---|
2393 | call VRDestroy window
|
---|
2394 | drop window
|
---|
2395 | return
|
---|
2396 | /*:VRX SW_USERS_Init
|
---|
2397 | */
|
---|
2398 | SW_USERS_Init:
|
---|
2399 | window = VRInfo( "Object" )
|
---|
2400 | if( \VRIsChildOf( window, "Notebook" ) ) then do
|
---|
2401 | call VRMethod window, "CenterWindow"
|
---|
2402 | call VRSet window, "Visible", 1
|
---|
2403 | call VRMethod window, "Activate"
|
---|
2404 | end
|
---|
2405 | drop window
|
---|
2406 | return
|
---|
2407 |
|
---|
2408 | /*:VRX TDL_1_PageSelected
|
---|
2409 | */
|
---|
2410 | TDL_1_PageSelected:
|
---|
2411 | page = VRInfo("Page")
|
---|
2412 | CurrentPageNr = page
|
---|
2413 | ok = VRSet("TM_RefreshDaemons","Enabled", 0)
|
---|
2414 | ok = VRSet("DT_STATUSBAR","Caption", VRGet("Main", "HintText"))
|
---|
2415 | /* call _TabsStrip */
|
---|
2416 | select
|
---|
2417 | when page = 1 then do /* Users */
|
---|
2418 | nop
|
---|
2419 | end
|
---|
2420 | when page = 2 then do /* files */
|
---|
2421 | nop
|
---|
2422 | end
|
---|
2423 | when page = 3 then do /* service */
|
---|
2424 | nop
|
---|
2425 | end
|
---|
2426 | when page = 4 then do /* daemons */
|
---|
2427 | ok = VRSet("TM_RefreshDaemons","Enabled", 1)
|
---|
2428 | ok = VRSet("TM_RefreshDaemons","Delay", 3000)
|
---|
2429 | end
|
---|
2430 | when page = 5 then do /* smbtree */
|
---|
2431 | ok = VRMethod( "CN_SMBTree", "GetRecordList", "All", "handle." )
|
---|
2432 | /* if the page is empty, populate it */
|
---|
2433 | if handle.0 = 0 then call PB_Refresh_Click
|
---|
2434 | end
|
---|
2435 | when page = 6 then do /* Settings */
|
---|
2436 | nop
|
---|
2437 | end
|
---|
2438 | otherwise nop
|
---|
2439 | end
|
---|
2440 | return
|
---|
2441 |
|
---|
2442 | /*:VRX TM_Refresh_Trigger
|
---|
2443 | */
|
---|
2444 | TM_Refresh_Trigger:
|
---|
2445 | /* call beep 1200, 20 */
|
---|
2446 | ok = VRSet("TM_Refresh","Delay", Intervall * 1000)
|
---|
2447 | call _Refresh
|
---|
2448 | return
|
---|
2449 |
|
---|
2450 | /*:VRX TM_RefreshDaemons_Trigger
|
---|
2451 | */
|
---|
2452 | TM_RefreshDaemons_Trigger:
|
---|
2453 | ok = VRSet("TM_RefreshDaemons","Delay", 3000)
|
---|
2454 | call _RefreshDaemons
|
---|
2455 | return
|
---|
2456 |
|
---|
2457 | /*:VRX TM_RefreshTreeDisplay_Trigger
|
---|
2458 | */
|
---|
2459 | TM_RefreshTreeDisplay_Trigger:
|
---|
2460 | select
|
---|
2461 | when RefreshMode = "TREE" then do
|
---|
2462 | call _RefreshTreeDisplay
|
---|
2463 | end
|
---|
2464 | when RefreshMode = "SHARE" then do
|
---|
2465 | call _AddSharesDisplay
|
---|
2466 | end
|
---|
2467 | otherwise say "RefreshMode = "RefreshMode
|
---|
2468 | end
|
---|
2469 | return
|
---|
2470 |
|
---|
2471 | /*:VRX TM_Throbber_Trigger
|
---|
2472 | */
|
---|
2473 | TM_Throbber_Trigger:
|
---|
2474 | pIdx = VRGet("Pict_Throbber","PicturePath")
|
---|
2475 | parse var pIdx '#' pidx
|
---|
2476 | pidx = pidx + 1
|
---|
2477 | if pidx = 136 then pidx = 111
|
---|
2478 | ok = VRSet("Pict_Throbber","PicturePath","#"pidx)
|
---|
2479 | return
|
---|
2480 |
|
---|