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