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