From: <cod...@go...> - 2008-12-18 21:10:00
|
Author: M0...@gm... Date: Thu Dec 18 12:52:17 2008 New Revision: 428 Modified: branches/iVL/MdlInstallSys.module branches/iVL/MdlLilo.module branches/iVL/MdlNetConf.module branches/iVL/MdlPartFrmt.module branches/iVL/MdlSetup.module Log: reverted to fix broken shell command Modified: branches/iVL/MdlInstallSys.module ============================================================================== --- branches/iVL/MdlInstallSys.module (original) +++ branches/iVL/MdlInstallSys.module Thu Dec 18 12:52:17 2008 @@ -552,106 +552,106 @@ END - ' PUBLIC SUB PERFORM_FULL_INSTALL_OLD() AS Integer - ' - ' 'Will need to read SETUP.CONF to determine what to do here - ' - ' DIM sFile AS String[] - ' DIM sEntry AS String[] - ' DIM stlzList AS String[] - ' DIM sTlz AS String - ' DIM sPak AS String - ' DIM sPakPath AS String - ' DIM sPakSize AS Variant - ' DIM sTargetSize AS Variant - ' DIM iTotalSize AS Integer - ' DIM iCurrSize AS Variant - ' DIM sPakDesc AS String - ' DIM i AS Integer - ' DIM ii AS Integer - ' DIM sLine AS String - ' DIM sBulkPath AS String - ' DIM sConfPath AS String - ' DIM sOptPkgPath AS String - ' DIM iVal AS Float - ' DIM sBasePath AS String = ClsGlobal.sSourceMnt &/ "veclinux" - ' - ' WITH FrmInstallSys - ' .Resize(FMain.pnlWinHost.Width, FMain.pnlWinHost.Height) - ' END WITH - ' ClsGlobal.iPkgCnt = MdlSetup.CALCULATE_PACKAGE_COUNT(FALSE) - ' 'Message.Info("Total packages = " & iPkgCnt) - ' 'RETURN - ' ' make sure the progress is revealed at the main window - ' WITH FMain - ' .tvPlan["Inst1"].Picture = MdlCore.sDonePic - ' .tvPlan["Inst2"].Selected = TRUE - ' .tvPlan["Inst2"].Picture = MdlCore.sNowPic - ' END WITH - ' - ' MdlSetup.SHOW_PROGRESS_CONTROLS() - ' FrmInstallSys.tlBanner.Text = ("Vectorlinux is now being installed. Please wait...") - ' ClsGlobal.sTargetMnt = "/mnt/target" - ' sFile = Split(File.Load(Temp$("SETUP.CONF")), "\n") - ' FOR i = 0 TO sFile.count - 1 - ' sLine = Trim(sFile[i]) - ' IF Left(sLine, Len("BULK") + 1) LIKE "BULK" & "*[0-9]*" THEN - ' sLine = Right(sLine, Len(sLine) - InStr(sLine, "\'")) - ' sLine = Left(sLine, Len(sLine) - 1) - ' sPak = Right(sLine, Len(sLine) - InStr(sLine, "\'")) - ' sPak = Left(sPak, Len(sPak) - 1) - ' sEntry = Split(sPak, ":") - ' sPakPath = sEntry[0] - ' sPakSize = sEntry[1] - ' sPakDesc = sEntry[2] - ' 'PRINT sBasePath &/ sPakPath & " = " & sPakDesc & " size= " & CStr(sPakSize) - ' ' figure out the sizing and the progrss meter - ' SHELL "export gsize=$(df| grep " & ClsPartSel.sRoot & " ) && echo $gsize | cut -f3 -d \' \'" TO sTargetSize - ' 'Message(CStr(sTargetSize)) - ' sTargetSize = Trim(CStr(sTargetSize)) - ' sPakSize = Trim(CStr(sPakSize)) ' - ' - ' 'RETURN - ' FrmInstallSys.tlCurrPkg.Text = "Installing " & sPakDesc & " ..." - ' FrmInstallSys.pbInstallProg.Value = 0.0 - ' - ' PRINT "Installing " & sPakDesc & " Total size (KB) = " & CStr(sPakSize) - ' sDump = "" - ' sErr = "" - ' MdlCore.LOCK_GUI() - ' 'inc iPkgNum - ' hproc = SHELL "lzmadec <" & sBasePath &/ sPakPath & " | tar -xp -C " & ClsGlobal.sTargetMnt & " || echo \'FAILED\' 2> /tmp/installdump" 'FOR READ - ' - ' WAIT 2 - ' IF hproc.State = Process.Running THEN - ' REPEAT - ' WAIT 2 - ' UPDATE_STEP_PROGRESS(sTargetSize, sPakSize, ClsGlobal.iPkgNum) - ' UNTIL - ' hproc.State = Process.Stopped - ' ' error check - ' sDump = File.Load("/tmp/installdump") - ' IF InStr(sDump, "FAILED") > 0 THEN - ' Message.Error(("There has been an error extracting") & Space(1) & sPakDesc & gb.NewLine & - ' "<b>ERROR</b>" & gb.NewLine & - ' sErr) - ' RETURN 1 - ' ELSE - ' FrmInstallSys.pbInstallProg.Value = 1 - ' END IF - ' PRINT sPak & " is installed... " - ' INC ClsGlobal.iPkgNum - ' FrmInstallSys.pbInstallProg2.Value = MdlSetup.UPDATE_OVERALL_PROGRESS(ClsGlobal.iPkgCnt, ClsGlobal.iPkgNum) - ' END IF - ' 'PRINT "Needs to install " & sPak - ' END IF - ' NEXT - ' FrmInstallSys.tlBanner.Text = ("Finished intalling Bulks") - ' - ' ' now to the packages individually - ' ' FrmInstallSys.tlBanner.Text = "Installing additional software." - ' ' ME.INSTALL_PACKAGES - ' END +PUBLIC SUB PERFORM_FULL_INSTALL_OLD() AS Integer + + 'Will need to read SETUP.CONF to determine what to do here + + DIM sFile AS String[] + DIM sEntry AS String[] + DIM stlzList AS String[] + DIM sTlz AS String + DIM sPak AS String + DIM sPakPath AS String + DIM sPakSize AS Variant + DIM sTargetSize AS Variant + DIM iTotalSize AS Integer + DIM iCurrSize AS Variant + DIM sPakDesc AS String + DIM i AS Integer + DIM ii AS Integer + DIM sLine AS String + DIM sBulkPath AS String + DIM sConfPath AS String + DIM sOptPkgPath AS String + DIM iVal AS Float + DIM sBasePath AS String = ClsGlobal.sSourceMnt &/ "veclinux" + + WITH FrmInstallSys + .Resize(FMain.pnlWinHost.Width, FMain.pnlWinHost.Height) + END WITH + ClsGlobal.iPkgCnt = MdlSetup.CALCULATE_PACKAGE_COUNT(FALSE) + 'Message.Info("Total packages = " & iPkgCnt) + 'RETURN + ' make sure the progress is revealed at the main window + WITH FMain + .tvPlan["Inst1"].Picture = MdlCore.sDonePic + .tvPlan["Inst2"].Selected = TRUE + .tvPlan["Inst2"].Picture = MdlCore.sNowPic + END WITH + + MdlSetup.SHOW_PROGRESS_CONTROLS() + FrmInstallSys.tlBanner.Text = ("Vectorlinux is now being installed. Please wait...") + ClsGlobal.sTargetMnt = "/mnt/target" + sFile = Split(File.Load(Temp$("SETUP.CONF")), "\n") + FOR i = 0 TO sFile.count - 1 + sLine = Trim(sFile[i]) + IF Left(sLine, Len("BULK") + 1) LIKE "BULK" & "*[0-9]*" THEN + sLine = Right(sLine, Len(sLine) - InStr(sLine, "\'")) + sLine = Left(sLine, Len(sLine) - 1) + sPak = Right(sLine, Len(sLine) - InStr(sLine, "\'")) + sPak = Left(sPak, Len(sPak) - 1) + sEntry = Split(sPak, ":") + sPakPath = sEntry[0] + sPakSize = sEntry[1] + sPakDesc = sEntry[2] + 'PRINT sBasePath &/ sPakPath & " = " & sPakDesc & " size= " & CStr(sPakSize) + ' figure out the sizing and the progrss meter + SHELL "export gsize=$(df| grep " & ClsPartSel.sRoot & " ) && echo $gsize | cut -f3 -d \' \'" TO sTargetSize + 'Message(CStr(sTargetSize)) + sTargetSize = Trim(CStr(sTargetSize)) + sPakSize = Trim(CStr(sPakSize)) ' + + 'RETURN + FrmInstallSys.tlCurrPkg.Text = "Installing " & sPakDesc & " ..." + FrmInstallSys.pbInstallProg.Value = 0.0 + + PRINT "Installing " & sPakDesc & " Total size (KB) = " & CStr(sPakSize) + sDump = "" + sErr = "" + MdlCore.LOCK_GUI() + 'inc iPkgNum + hproc = SHELL "lzmadec <" & sBasePath &/ sPakPath & " | tar -xp -C " & ClsGlobal.sTargetMnt & " || echo \'FAILED\' 2> /tmp/installdump" 'FOR READ + + WAIT 2 + IF hproc.State = Process.Running THEN + REPEAT + WAIT 2 + UPDATE_STEP_PROGRESS(sTargetSize, sPakSize, ClsGlobal.iPkgNum) + UNTIL + hproc.State = Process.Stopped + ' error check + sDump = File.Load("/tmp/installdump") + IF InStr(sDump, "FAILED") > 0 THEN + Message.Error(("There has been an error extracting") & Space(1) & sPakDesc & gb.NewLine & + "<b>ERROR</b>" & gb.NewLine & + sErr) + RETURN 1 + ELSE + FrmInstallSys.pbInstallProg.Value = 1 + END IF + PRINT sPak & " is installed... " + INC ClsGlobal.iPkgNum + FrmInstallSys.pbInstallProg2.Value = MdlSetup.UPDATE_OVERALL_PROGRESS(ClsGlobal.iPkgCnt, ClsGlobal.iPkgNum) + END IF + 'PRINT "Needs to install " & sPak + END IF + NEXT + FrmInstallSys.tlBanner.Text = ("Finished intalling Bulks") + + ' now to the packages individually + ' FrmInstallSys.tlBanner.Text = "Installing additional software." + ' ME.INSTALL_PACKAGES +END PUBLIC SUB UPDATE_STEP_PROGRESS(sTargetSize AS Float, sPakSize AS Float, iCurrPkg AS Integer) Modified: branches/iVL/MdlLilo.module ============================================================================== --- branches/iVL/MdlLilo.module (original) +++ branches/iVL/MdlLilo.module Thu Dec 18 12:52:17 2008 @@ -38,7 +38,7 @@ IF Exist("/usr/bin/ms-sys") THEN 'dd if=/dev/hda of=/boot/MBR.$( date '+%m%d%y') bs=512 count=1 - SHELL "dd if=/" & Trim(sTarget) & " of=/mnt/target/boot/MBR.$( date +\'%m%d%y\') bs=512 count=1" WAIT + SHELL "dd if=/dev/" & Trim(sTarget) & " of=/mnt/target/boot/MBR.$( date +\'%m%d%y\') bs=512 count=1" WAIT SHELL "/usr/bin/ms-sys -z " & Trim(sTarget) WAIT ELSE Modified: branches/iVL/MdlNetConf.module ============================================================================== --- branches/iVL/MdlNetConf.module (original) +++ branches/iVL/MdlNetConf.module Thu Dec 18 12:52:17 2008 @@ -34,37 +34,55 @@ PRIVATE pWiredPic AS Picture = picture["images/ethernet.png"] PRIVATE pWirelessPic AS picture = picture["images/wireless.png"] -PRIVATE iFrameTop AS Integer -PUBLIC SUB LIST_NETWORK_INTERFACES() - - DIM sDevAddr, sEths, sDump, sDev, sType, sStatus, sApDump AS String - DIM sDevList, sLine AS String[] - DIM i, ii, y, x AS Integer - DIM tl AS TextLabel - DIM tb AS TextBox - DIM cb AS ComboBox - DIM bcb AS CheckBox - DIM ptabpic AS Picture - - ' INITIATE THE ARRAYS - objCombos = NEW Object[] - objFrames = NEW Object[] - objtlDetails = NEW Object[] - objtxtIps = NEW Object[] - objtxtNetMasks = NEW Object[] - objtxtDNS = NEW Object[] - objCheckboxes = NEW Object[] -' objcbWifi = NEW Object[] -' objtxtWifiKey = NEW Object[] -' objcbWifiessid = NEW Object[] - objIntTypes = NEW Object[] + +PUBLIC SUB LIST_NETWORK_INTERFACES() - SHELL "res=$(ifconfig -a | grep ^[a-z] | grep -v ^lo); echo \"$res\" | tr -s \' \'\"\" " TO seths - seths = Trim(seths) + ' This SUB will detect network interfaces and offer setup options for each one of them + DIM seths AS String + DIM sDump AS String + DIM sDevList AS String[] + DIM sLine AS String[] + DIM sDev AS String + DIM sType, sStatus AS String + DIM sDevAddr AS String + DIM tl AS TextLabel + DIM tb AS TextBox + DIM cb AS ComboBox + DIM bCb AS CheckBox + DIM i, ii, y, x, cbwidth AS Integer + DIM pTabPic AS picture + DIM iwifiboxwidth, iwifiboxleft AS Integer + DIM sApDump AS String + 'DIM iwifix, iwifiy, iwifiboxwidth AS Integer + + MdlCore.WARN_STATUS(("Probing your networking hardware ... Please wait")) - IF seths = "" THEN ' WARN IF NO NETWORK HARDWARE CAN BE DETECTED AND EXIT WITHOUT ERROR + 'initiate the arrays + objCombos = NEW Object[] + objFrames = NEW Object[] + objtlDetails = NEW Object[] + objtxtIps = NEW Object[] + objtxtNetMasks = NEW Object[] + objtxtDNS = NEW Object[] + objCheckboxes = NEW Object[] + objcbWifi = NEW Object[] + objtxtWifiKey = NEW Object[] + objcbWifiessid = NEW Object[] + objIntTypes = NEW Object[] + + ' SHELL "iwconfig &>/tmp/nics; cat /tmp/nics|grep ^e|grep \"no wireles\"|cut -d \' \' -f1 >/tmp/nowifi" WAIT + ' SHELL "for i in $(cat /tmp/nowifi);do ifconfig -a | grep ^$i >>/tmp/nic;done" WAIT + ' SHELL "cat /tmp/nic| tr -s \' \'\"\" " TO seths + SHELL "res=$(ifconfig -a | grep ^[a-z] | grep -v ^lo); echo \"$res\" | tr -s \' \'\"\" " TO seths + 'SHELL "ifconfig -a | grep ^[a-z]|grep -v ^lo | tr -s \' \'\"\"" TO seths + 'File.Save(Temp("eths"), Trim(seths)) + 'Message(File.Load(Temp("eths"))) + + seths = Trim(seths) + + IF seths = "" THEN WITH FrmNetConf .cbUseManDNS.Enabled = FALSE .tlPrimaryDNS.Enabled = FALSE @@ -82,8 +100,10 @@ ME.ifaceCnt = 0 RETURN END IF -' - sDevList = Split(seths, gb.NewLine) + + + + sDevList = Split(seths, gb.NewLine) 'Message(seths) ME.ifaceCnt = sDevList.Count FOR i = 0 TO sDevList.count - 1 @@ -92,9 +112,21 @@ sDev = sLine[0] 'Message(sLine[1]) sDevAddr = sLine[4] ' This may be off depending on which box this runs one... needs careful testing - 'Message(sDevAddr) - sType = ("Wired") ' Not detecting wireless, so lets just leave it at this - + ' try to detect wirelesss here + sDump = "" + SHELL "iwconfig " & sDev & " > /tmp/iwdump 2>&1" WAIT + 'Message(File.Load("/tmp/iwdump")) + sDump = Trim(File.Load("/tmp/iwdump")) + IF InStr(sDump, "no wireless extensions") > 0 THEN + sType = ("Wired") + pTabPic = pWiredPic + ELSE + CONTINUE + 'BREAK + ' sType = ("Wireless") + ' pTabPic = pWirelessPic + END IF + ' detect status SHELL "ifplugstatus | grep ^" & sDev & " | cut -f 2 -d \':\'" TO sStatus 'Message(sStatus) @@ -104,872 +136,678 @@ ELSE sStatus = ("Unplugged") END IF - 'Message(sDev & gb.NewLine & sDevAddr & gb.NewLine & sStatus) -' BEGIN POPULATING TABSTRIP. ========================================================================= - -WITH FrmNetConf.TSNetDevices - .Index = i - .Text = sDev - - ' **************** tabs strip objects - tl = NEW TextLabel(FrmNetConf.TSNetDevices) ' MACK ADDRESS LABEL - WITH tl - .Text = ("Hardware Address") - .Width = MdlObjSizer.get_object_width(.Text) - .Height = 21 - .Alignment = Align.Normal - .Move(4, 16) - END WITH - 'y = y + tl.Top + tl.Height + 4 - tb = NEW TextBox(FrmNetConf.TSNetDevices) AS "txtDevAddresses" ' MAC ADDRESS BOX - WITH tb - .Text = sDevAddr - .ReadOnly = TRUE - .Height = 21 - .Width = MdlObjSizer.get_object_width(.Text) + 16 - .Move(tl.Left + tl.Width + 4, tl.Top) - END WITH - ' ' ' ' ' tl = NEW TextLabel(FrmNetConf.TSNetDevices) ' INTERFACE TYPE LABEL - ' ' ' ' ' WITH tl - ' ' ' ' ' .Text = ("Interface Type") - ' ' ' ' ' .Width = MdlObjSizer.get_object_width(.Text) - ' ' ' ' ' .Height = 21 - ' ' ' ' ' .Alignment = Align.Normal - ' ' ' ' ' .Move(tb.Left + tb.Width + 4, tb.Top) - ' ' ' ' ' END WITH - ' ' ' ' ' - y = y + tb.Top + tb.Height + 4 - bcb = NEW CheckBox(FrmNetConf.TSNetDevices) AS "bEnableInterface" '************ enabled / disabled checkbox ************************** - WITH bcb - .Value = TRUE - .Text = ("Automatically activate this interface at start-up") - .Height = 21 - .Width = MdlObjSizer.get_object_width(.Text) + 36 - .Move(4, y) - END WITH - ME.objCheckboxes.Add(bcb) - y = bcb.top + bcb.Height + 8 - - tl = NEW TextLabel(FrmNetConf.TSNetDevices) - WITH tl - .Text = ("Setup Mode") - .Alignment = Align.Normal - .Height = 21 - .Width = MdlObjSizer.get_object_width(.Text) - .Move(24, y) ' indent this a little - END WITH - - cb = NEW ComboBox(FrmNetConf.TSNetDevices) AS "MethodSel" ' ******************************* - WITH cb - .ReadOnly = TRUE - .list = ["DHCP", "STATIC"] - .Height = 21 - .Width = MdlObjSizer.get_object_width("STATIC") * 2 - .move(tl.Left + tl.Width + 4, y) - END WITH - ME.objCombos.Add(cb) - - tl = NEW TextLabel(FrmNetConf.TSNetDevices) '*********************************************************** - WITH tl - .Text = ("Current Status:") & Space(1) & "<b>" & sStatus & "</b>" - .Alignment = Align.Normal - .Height = 21 - .Width = MdlObjSizer.get_object_width(.Text) - .Move(cb.Left + cb.Width + 4, y) - END WITH - iFrameTop = tl.top + tl.Height + 8 + + ' LIST WIRED NETWORKIN ONLY + WITH FrmNetConf.TSNetDevices + 'PRINT .Count + + .index = i + '.text = Left(sDevList[i], 4) + .text = sDev + IF sDevList[i] <> "" THEN + INC .Count + END IF + .picture = pTabPic + ' populate it with the objects + tl = NEW TextLabel(FrmNetConf.TSNetDevices) AS "DevAddresses" + WITH tl + .Move(4, 16) + .text = ("Hardware Address") + .Height = 21 + .Alignment = Align.Normal + .Width = MdlObjSizer.get_object_width(.text) + 'y = .top + .Height + 4 + END WITH + tb = NEW TextBox(FrmNetConf.TSNetDevices) AS "txtDevAddresses" ' MAC Address box + WITH tb + .Move(tl.left + tl.Width + 8, tl.top) + .text = DConv(sDevAddr) + .ReadOnly = TRUE + .Width = MdlObjSizer.get_object_width(.text) + 24 + .Height = tl.Height + x = .Left + cbwidth = .Width + iwifiboxwidth = .Width + END WITH + + tl = NEW TextLabel(FrmNetConf.TSNetDevices) AS "DevTYpeLbl" + WITH tl + .Move(x + tb.Width + 8, tb.top) + .text = ("Interface Type") + .Height = 21 + .Width = MdlObjSizer.get_object_width(.text) + .Alignment = Align.Normal + END WITH + tb = NEW TextBox(FrmNetConf.TSNetDevices) AS "txtDevType" ' Interface Type (wireless, wired) + WITH tb + .Move(tl.left + tl.width + 8, tl.top) + .text = sType + .Width = MdlObjSizer.get_object_width(.text) + 24 + .Height = 21 + .ReadOnly = TRUE + .tag = sDev + END WITH + objIntTypes.Add(tb) + 'add a box here to enable/disable the interface + bCb = NEW CheckBox(FrmNetConf.TSNetDevices) AS "bEnableInterface" ' enable/disable interface box + WITH bCb + .Move(4, tb.top + tb.Height + 4) + .text = ("Automatically activate this interface at start-up") + .Value = TRUE + .Height = 21 + .Width = MdlObjSizer.get_object_width(.text) + 36 + .tag = sDev + y = .top + .Height + 8 + objCheckboxes.Add(bCb) + END WITH + + + + tl = NEW TextLabel(FrmNetConf.TSNetDevices) + WITH tl + .text = ("STATUS:") & " <b>" & sStatus & "</b>" + .Width = MdlObjSizer.get_object_width(.text) + .Height = 21 + .Move(x + cb.Width + 12, y - .Height - 4) + .Alignment = Align.Normal + END WITH + + tl = NEW TextLabel(FrmNetConf.TSNetDevices) + WITH tl - - + .Move(12, y + 8) + IF sType = ("Wired") THEN + .Width = .Parent.Width - (.left * 2) + ELSE + .Width = 250 + END IF + .text = "<b>" & ("Dynamic Host Control Protocol") & "</b><br>" & ("Automatic settings via DHCP.") & "<br><br>" & ("This will work if you use a cable or DSL modem on a home network.") & "<br>" & ("If in doubt, choose this option") + .Adjust + '.border = Border.Raised + .Height = 21 * 6 + .Tag = LAST.tag + + - - - + END WITH + + + END WITH ' STOP JACKING WITH TABSTRIP + +' END IF + + NEXT + FrmNetConf.TSNetDevices[FrmNetConf.TSNetDevices.count - 1].Delete ' Ugly hack to delete the trailing blank tab + IF ERROR THEN Message(Error.text & gb.newline & Error.where) -END WITH ' END JACKING WITH TABSTRIP ======================================================================== + IF Exist("/tmp/iwdump") THEN KILL "/tmp/iwdump" + MdlCore.warn_status_off() + + ' ================================================================ + ' ' + ' ' + ' ' ' + ' ' ' + ' ' ' + ' ' ' + ' ' ' IF sType <> ("Wireless") THEN + ' ' ' + ' ' ' ' WITH FrmNetConf.TSNetDevices + ' ' ' ' ' PRINT .Count + ' ' ' ' + ' ' ' ' + ' ' ' ' .index = i + ' ' ' ' '.text = Left(sDevList[i], 4) + ' ' ' ' .text = sDev + ' ' ' ' IF sDevList[i] <> "" THEN + ' ' ' ' INC .Count + ' ' ' ' END IF + ' ' ' ' .picture = pTabPic + ' ' ' ' ' populate it with the objects + ' ' ' ' tl = NEW TextLabel(FrmNetConf.TSNetDevices) AS "DevAddresses" + ' ' ' ' WITH tl + ' ' ' ' .Move(4, 16) + ' ' ' ' .text = ("Hardware Address") + ' ' ' ' .Height = 21 + ' ' ' ' .Alignment = Align.Normal + ' ' ' ' .Width = MdlObjSizer.get_object_width(.text) + ' ' ' ' 'y = .top + .Height + 4 + ' ' ' ' END WITH + ' ' ' ' tb = NEW TextBox(FrmNetConf.TSNetDevices) AS "txtDevAddresses" ' MAC Address box + ' ' ' ' WITH tb + ' ' ' ' .Move(tl.left + tl.Width + 8, tl.top) + ' ' ' ' .text = DConv(sDevAddr) + ' ' ' ' .ReadOnly = TRUE + ' ' ' ' .Width = MdlObjSizer.get_object_width(.text) + 24 + ' ' ' ' .Height = tl.Height + ' ' ' ' x = .Left + ' ' ' ' cbwidth = .Width + ' ' ' ' iwifiboxwidth = .Width + ' ' ' ' END WITH + ' ' ' ' + ' ' ' ' tl = NEW TextLabel(FrmNetConf.TSNetDevices) AS "DevTYpeLbl" + ' ' ' ' WITH tl + ' ' ' ' .Move(x + tb.Width + 8, tb.top) + ' ' ' ' .text = ("Interface Type") + ' ' ' ' .Height = 21 + ' ' ' ' .Width = MdlObjSizer.get_object_width(.text) + ' ' ' ' .Alignment = Align.Normal + ' ' ' ' END WITH + ' ' ' ' tb = NEW TextBox(FrmNetConf.TSNetDevices) AS "txtDevType" ' Interface Type (wireless, wired) + ' ' ' ' WITH tb + ' ' ' ' .Move(tl.left + tl.width + 8, tl.top) + ' ' ' ' .text = sType + ' ' ' ' .Width = MdlObjSizer.get_object_width(.text) + 24 + ' ' ' ' .Height = 21 + ' ' ' ' .ReadOnly = TRUE + ' ' ' ' .tag = sDev + ' ' ' ' END WITH + ' ' ' ' objIntTypes.Add(tb) + ' ' ' ' 'add a box here to enable/disable the interface + ' ' ' ' bCb = NEW CheckBox(FrmNetConf.TSNetDevices) AS "bEnableInterface" ' enable/disable interface box + ' ' ' ' WITH bCb + ' ' ' ' .Move(4, tb.top + tb.Height + 4) + ' ' ' ' .text = ("Automatically activate this interface at start-up") + ' ' ' ' .Value = TRUE + ' ' ' ' .Height = 21 + ' ' ' ' .Width = MdlObjSizer.get_object_width(.text) + 36 + ' ' ' ' .tag = sDev + ' ' ' ' y = .top + .Height + 8 + ' ' ' ' objCheckboxes.Add(bCb) + ' ' ' ' END WITH + ' ' ' ' ' Split the design here for wireless and wired devices + ' ' ' ' 'IF sType = "Wireless" THEN + ' ' ' ' tl = NEW TextLabel(FrmNetConf.TSNetDevices) AS "ConfModeLbl" + ' ' ' ' WITH tl + ' ' ' ' .Move(4, y) + ' ' ' ' .text = ("Setup Mode") + ' ' ' ' .height = 21 + ' ' ' ' .Width = MdlObjSizer.get_object_width(.text) + ' ' ' ' .Alignment = Align.BottomLeft + ' ' ' ' 'y = .top + .Height + 4 + ' ' ' ' iLeft = .Left + ' ' ' ' END WITH + ' ' ' ' cb = NEW ComboBox(FrmNetConf.TSNetDevices) AS "MethodSel" ' Setup Method combobox + ' ' ' ' WITH cb + ' ' ' ' .Move(x, y) + ' ' ' ' .width = cbwidth + ' ' ' ' .Height = 21 + ' ' ' ' .ReadOnly = TRUE + ' ' ' ' .list = ["DHCP", "STATIC"] + ' ' ' ' + ' ' ' ' .tag = sDev + ' ' ' ' '.ReadOnly = TRUE + ' ' ' ' 'itop = y + ' ' ' ' icbleft = .Left + ' ' ' ' END WITH + ' ' ' ' y = cb.top + cb.Height + 4 + ' ' ' ' itop = y + ' ' ' ' objCombos.Add(cb) + ' ' ' IF StYPE = ("Wireless") THEN + ' ' ' tl = NEW TextLabel(FrmNetConf.TSNetDevices) + ' ' ' WITH tl + ' ' ' .text = ("Encryption type") + ' ' ' .Width = MdlObjSizer.get_object_width(.text) + ' ' ' .Height = 21 + ' ' ' '.Move(x + cb.Width + 96, y - .Height - 8) + ' ' ' .Move(ileft + 300 + 24, itop + 12) + ' ' ' .Alignment = Align.BottomLeft + ' ' ' '.Border = Border.Plain + ' ' ' END WITH + ' ' ' iWifix = tl.Left + ' ' ' iwifiy = tl.Top + ' ' ' cb = NEW ComboBox(FrmNetConf.TSNetDevices) AS "cbWifiEnc" + ' ' ' WITH cb + ' ' ' .ReadOnly = TRUE + ' ' ' .list = [("None"), "WPA", "WEP"] + ' ' ' .Width = tb.Width + ' ' ' .tag = sDev + ' ' ' .Height = tl.Height + ' ' ' .Move(tl.left + tl.Width + 12, tl.top) + ' ' ' + ' ' ' iwifiboxleft = .Left + ' ' ' + ' ' ' END WITH + ' ' ' objcbWifi.Add(cb) + ' ' ' + ' ' ' tl = NEW TextLabel(FrmNetConf.TSNetDevices) + ' ' ' WITH tl + ' ' ' .text = ("Encryption key") + ' ' ' .Width = MdlObjSizer.get_object_width(.text) + ' ' ' .Height = 21 + ' ' ' .Move(iwifix, iwifiy + .Height + 12) + ' ' ' .Alignment = Align.Normal + ' ' ' END WITH + ' ' ' tb = NEW TextBox(FrmNetConf.TSNetDevices) + ' ' ' WITH tb + ' ' ' .text = "" + ' ' ' .Width = iwifiboxwidth + ' ' ' .Height = 21 + ' ' ' .Password = TRUE + ' ' ' .Move(iwifiboxleft, tl.Top) + ' ' ' .Enabled = TRUE + ' ' ' .tag = sDev + ' ' ' END WITH WITH FrmNetConf.TSNetDevices + ' ' ' PRINT .Count + ' ' + ' ' + ' ' .index = i + ' ' '.text = Left(sDevList[i], 4) + ' ' .text = sDev + ' ' IF sDevList[i] <> "" THEN + ' ' INC .Count + ' ' END IF + ' ' .picture = pTabPic + ' ' ' populate it with the objects + ' ' tl = NEW TextLabel(FrmNetConf.TSNetDevices) AS "DevAddresses" + ' ' WITH tl + ' ' .Move(4, 16) + ' ' .text = ("Hardware Address") + ' ' .Height = 21 + ' ' .Alignment = Align.Normal + ' ' .Width = MdlObjSizer.get_object_width(.text) + ' ' 'y = .top + .Height + 4 + ' ' END WITH + ' ' tb = NEW TextBox(FrmNetConf.TSNetDevices) AS "txtDevAddresses" ' MAC Address box + ' ' WITH tb + ' ' .Move(tl.left + tl.Width + 8, tl.top) + ' ' .text = DConv(sDevAddr) + ' ' .ReadOnly = TRUE + ' ' .Width = MdlObjSizer.get_object_width(.text) + 24 + ' ' .Height = tl.Height + ' ' x = .Left + ' ' cbwidth = .Width + ' ' iwifiboxwidth = .Width + ' ' END WITH + ' ' + ' ' tl = NEW TextLabel(FrmNetConf.TSNetDevices) AS "DevTYpeLbl" + ' ' WITH tl + ' ' .Move(x + tb.Width + 8, tb.top) + ' ' .text = ("Interface Type") + ' ' .Height = 21 + ' ' .Width = MdlObjSizer.get_object_width(.text) + ' ' .Alignment = Align.Normal + ' ' END WITH + ' ' tb = NEW TextBox(FrmNetConf.TSNetDevices) AS "txtDevType" ' Interface Type (wireless, wired) + ' ' WITH tb + ' ' .Move(tl.left + tl.width + 8, tl.top) + ' ' .text = sType + ' ' .Width = MdlObjSizer.get_object_width(.text) + 24 + ' ' .Height = 21 + ' ' .ReadOnly = TRUE + ' ' .tag = sDev + ' ' END WITH + ' ' objIntTypes.Add(tb) + ' ' 'add a box here to enable/disable the interface + ' ' bCb = NEW CheckBox(FrmNetConf.TSNetDevices) AS "bEnableInterface" ' enable/disable interface box + ' ' WITH bCb + ' ' .Move(4, tb.top + tb.Height + 4) + ' ' .text = ("Automatically activate this interface at start-up") + ' ' .Value = TRUE + ' ' .Height = 21 + ' ' .Width = MdlObjSizer.get_object_width(.text) + 36 + ' ' .tag = sDev + ' ' y = .top + .Height + 8 + ' ' objCheckboxes.Add(bCb) + ' ' END WITH + ' ' ' Split the design here for wireless and wired devices + ' ' 'IF sType = "Wireless" THEN + ' ' tl = NEW TextLabel(FrmNetConf.TSNetDevices) AS "ConfModeLbl" + ' ' WITH tl + ' ' .Move(4, y) + ' ' .text = ("Setup Mode") + ' ' .height = 21 + ' ' .Width = MdlObjSizer.get_object_width(.text) + ' ' .Alignment = Align.BottomLeft + ' ' WITH FrmNetConf.TSNetDevices + ' ' PRINT .Count + ' + ' + ' .index = i + ' '.text = Left(sDevList[i], 4) + ' .text = sDev + ' IF sDevList[i] <> "" THEN + ' INC .Count + ' END IF + ' .picture = pTabPic + ' ' populate it with the objects + ' tl = NEW TextLabel(FrmNetConf.TSNetDevices) AS "DevAddresses" + ' WITH tl + ' .Move(4, 16) + ' .text = ("Hardware Address") + ' .Height = 21 + ' .Alignment = Align.Normal + ' .Width = MdlObjSizer.get_object_width(.text) + ' 'y = .top + .Height + 4 + ' END WITH + ' tb = NEW TextBox(FrmNetConf.TSNetDevices) AS "txtDevAddresses" ' MAC Address box + ' WITH tb + ' .Move(tl.left + tl.Width + 8, tl.top) + ' .text = DConv(sDevAddr) + ' .ReadOnly = TRUE + ' .Width = MdlObjSizer.get_object_width(.text) + 24 + ' .Height = tl.Height + ' x = .Left + ' cbwidth = .Width + ' iwifiboxwidth = .Width + ' END WITH + ' + ' tl = NEW TextLabel(FrmNetConf.TSNetDevices) AS "DevTYpeLbl" + ' WITH tl + ' .Move(x + tb.Width + 8, tb.top) + ' .text = ("Interface Type") + ' .Height = 21 + ' .Width = MdlObjSizer.get_object_width(.text) + ' .Alignment = Align.Normal + ' END WITH + ' tb = NEW TextBox(FrmNetConf.TSNetDevices) AS "txtDevType" ' Interface Type (wireless, wired) + ' WITH tb + ' .Move(tl.left + tl.width + 8, tl.top) + ' .text = sType + ' .Width = MdlObjSizer.get_object_width(.text) + 24 + ' .Height = 21 + ' .ReadOnly = TRUE + ' .tag = sDev + ' END WITH + ' objIntTypes.Add(tb) + ' 'add a box here to enable/disable the interface + ' bCb = NEW CheckBox(FrmNetConf.TSNetDevices) AS "bEnableInterface" ' enable/disable interface box + ' WITH bCb + ' .Move(4, tb.top + tb.Height + 4) + ' .text = ("Automatically activate this interface at start-up") + ' .Value = TRUE + ' .Height = 21 + ' .Width = MdlObjSizer.get_object_width(.text) + 36 + ' .tag = sDev + ' y = .top + .Height + 8 + ' objCheckboxes.Add(bCb) + ' END WITH + ' ' Split the design here for wireless and wired devices + ' 'IF sType = "Wireless" THEN + ' tl = NEW TextLabel(FrmNetConf.TSNetDevices) AS "ConfModeLbl" + ' WITH tl + ' .Move(4, y) + ' .text = ("Setup Mode") + ' .height = 21 + ' .Width = MdlObjSizer.get_object_width(.text) + ' .Alignment = Align.BottomLeft + ' 'y = .top + .Height + 4 + ' iLeft = .Left + ' END WITH + ' cb = NEW ComboBox(FrmNetConf.TSNetDevices) AS "MethodSel" ' Setup Method combobox + ' WITH cb + ' .Move(x, y) + ' .width = cbwidth + ' .Height = 21 + ' .ReadOnly = TRUE + ' .list = ["DHCP", "STATIC"] + ' + ' .tag = sDev + ' '.ReadOnly = TRUE + ' 'itop = y + ' icbleft = .Left + ' END WITH + ' y = cb.top + cb.Height + 4 + ' itop = y + ' objCombos.Add(cb) + ' 'y = .top + .Height + 4 + ' ' iLeft = .Left + ' ' END WITH + ' ' cb = NEW ComboBox(FrmNetConf.TSNetDevices) AS "MethodSel" ' Setup Method combobox + ' ' WITH cb + ' ' .Move(x, y) + ' ' .width = cbwidth + ' ' .Height = 21 + ' ' .ReadOnly = TRUE + ' ' .list = ["DHCP", "STATIC"] + ' ' + ' ' .tag = sDev + ' ' '.ReadOnly = TRUE + ' ' 'itop = y + ' ' icbleft = .Left + ' ' END WITH + ' ' y = cb.top + cb.Height + 4 + ' ' itop = y + ' ' objCombos.Add(cb) + ' ' WITH FrmNetConf.TSNetDevices + ' ' PRINT .Count + ' + ' + ' .index = i + ' '.text = Left(sDevList[i], 4) + ' .text = sDev + ' IF sDevList[i] <> "" THEN + ' INC .Count + ' END IF + ' .picture = pTabPic + ' ' populate it with the objects + ' tl = NEW TextLabel(FrmNetConf.TSNetDevices) AS "DevAddresses" + ' WITH tl + ' .Move(4, 16) + ' .text = ("Hardware Address") + ' .Height = 21 + ' .Alignment = Align.Normal + ' .Width = MdlObjSizer.get_object_width(.text) + ' 'y = .top + .Height + 4 + ' END WITH + ' tb = NEW TextBox(FrmNetConf.TSNetDevices) AS "txtDevAddresses" ' MAC Address box + ' WITH tb + ' .Move(tl.left + tl.Width + 8, tl.top) + ' .text = DConv(sDevAddr) + ' .ReadOnly = TRUE + ' .Width = MdlObjSizer.get_object_width(.text) + 24 + ' .Height = tl.Height + ' x = .Left + ' cbwidth = .Width + ' iwifiboxwidth = .Width + ' END WITH + ' + ' tl = NEW TextLabel(FrmNetConf.TSNetDevices) AS "DevTYpeLbl" + ' WITH tl + ' .Move(x + tb.Width + 8, tb.top) + ' .text = ("Interface Type") + ' .Height = 21 + ' .Width = MdlObjSizer.get_object_width(.text) + ' .Alignment = Align.Normal + ' END WITH + ' tb = NEW TextBox(FrmNetConf.TSNetDevices) AS "txtDevType" ' Interface Type (wireless, wired) + ' WITH tb + ' .Move(tl.left + tl.width + 8, tl.top) + ' .text = sType + ' .Width = MdlObjSizer.get_object_width(.text) + 24 + ' .Height = 21 + ' .ReadOnly = TRUE + ' .tag = sDev + ' END WITH + ' objIntTypes.Add(tb) + ' 'add a box here to enable/disable the interface + ' bCb = NEW CheckBox(FrmNetConf.TSNetDevices) AS "bEnableInterface" ' enable/disable interface box + ' WITH bCb + ' .Move(4, tb.top + tb.Height + 4) + ' .text = ("Automatically activate this interface at start-up") + ' .Value = TRUE + ' .Height = 21 + ' .Width = MdlObjSizer.get_object_width(.text) + 36 + ' .tag = sDev + ' y = .top + .Height + 8 + ' objCheckboxes.Add(bCb) + ' END WITH + ' ' Split the design here for wireless and wired devices + ' 'IF sType = "Wireless" THEN + ' tl = NEW TextLabel(FrmNetConf.TSNetDevices) AS "ConfModeLbl" + ' WITH tl + ' .Move(4, y) + ' .text = ("Setup Mode") + ' .height = 21 + ' .Width = MdlObjSizer.get_object_width(.text) + ' .Alignment = Align.BottomLeft + ' 'y = .top + .Height + 4 + ' iLeft = .Left + ' END WITH + ' cb = NEW ComboBox(FrmNetConf.TSNetDevices) AS "MethodSel" ' Setup Method combobox + ' WITH cb + ' .Move(x, y) + ' .width = cbwidth + ' .Height = 21 + ' .ReadOnly = TRUE + ' .list = ["DHCP", "STATIC"] + ' + ' .tag = sDev + ' '.ReadOnly = TRUE + ' 'itop = y + ' icbleft = .Left + ' END WITH + ' y = cb.top + cb.Height + 4 + ' itop = y + ' objCombos.Add(cb) + ' + ' ' ' objtxtWifiKey.Add(tb) + ' ' ' tl = NEW TextLabel(FrmNetConf.TSNetDevices) + ' ' ' WITH tl + ' ' ' .text = ("Access Point") + ' ' ' .Width = MdlObjSizer.get_object_width(.Text) + ' ' ' .Height = 21 + ' ' ' .Alignment = Align.Normal + ' ' ' .Move(iWifix, tb.top + tb.Height + 4) + ' ' ' '.Enabled = TRUE + ' ' ' '.ReadOnly = FALSE + ' ' ' END WITH + ' ' ' tb = NEW TextBox(FrmNetConf.TSNetDevices) + ' ' ' WITH tb + ' ' ' .tag = sDev + ' ' ' '.ReadOnly = TRUE + ' ' ' .Width = iwifiboxwidth + ' ' ' .Height = 21 + ' ' ' .Move(iwifiboxleft, tl.Top) + ' ' ' .ReadOnly = FALSE + ' ' ' + ' ' ' ' add the access points here + ' ' ' END WITH + ' ' ' objcbWifiessid.Add(tb) + ' ' ' + ' ' ' + ' ' ' END IF + ' ' ' + ' ' ' + ' ' ' IF sType = ("Wired") THEN + ' ' ' + ' ' ' ' ' WITH FrmNetConf.TSNetDevices + ' ' ' ' ' PRINT .Count + ' ' ' ' ' + ' ' ' ' ' + ' ' ' ' ' .index = i + ' ' ' ' ' '.text = Left(sDevList[i], 4) + ' ' ' ' ' .text = sDev + ' ' ' ' ' IF sDevList[i] <> "" THEN + ' ' ' ' ' INC .Count + ' ' ' ' ' END IF + ' ' ' ' ' .picture = pTabPic + ' ' ' ' ' ' populate it with the objects + ' ' ' ' ' tl = NEW TextLabel(FrmNetConf.TSNetDevices) AS "DevAddresses" + ' ' ' ' ' WITH tl + ' ' ' ' ' .Move(4, 16) + ' ' ' ' ' .text = ("Hardware Address") + ' ' ' ' ' .Height = 21 + ' ' ' ' ' .Alignment = Align.Normal + ' ' ' ' ' .Width = MdlObjSizer.get_object_width(.text) + ' ' ' ' ' 'y = .top + .Height + 4 + ' ' ' ' ' END WITH + ' ' ' ' ' tb = NEW TextBox(FrmNetConf.TSNetDevices) AS "txtDevAddresses" ' MAC Address box + ' ' ' ' ' WITH tb + ' ' ' ' ' .Move(tl.left + tl.Width + 8, tl.top) + ' ' ' ' ' .text = DConv(sDevAddr) + ' ' ' ' ' .ReadOnly = TRUE + ' ' ' ' ' .Width = MdlObjSizer.get_object_width(.text) + 24 + ' ' ' ' ' .Height = tl.Height + ' ' ' ' ' x = .Left + ' ' ' ' ' cbwidth = .Width + ' ' ' ' ' iwifiboxwidth = .Width + ' ' ' ' ' END WITH + ' ' ' ' ' + ' ' ' ' ' tl = NEW TextLabel(FrmNetConf.TSNetDevices) AS "DevTYpeLbl" + ' ' ' ' ' WITH tl + ' ' ' ' ' .Move(x + tb.Width + 8, tb.top) + ' ' ' ' ' .text = ("Interface Type") + ' ' ' ' ' .Height = 21 + ' ' ' ' ' .Width = MdlObjSizer.get_object_width(.text) + ' ' ' ' ' .Alignment = Align.Normal + ' ' ' ' ' END WITH + ' ' ' ' ' tb = NEW TextBox(FrmNetConf.TSNetDevices) AS "txtDevType" ' Interface Type (wireless, wired) + ' ' ' ' ' WITH tb + ' ' ' ' ' .Move(tl.left + tl.width + 8, tl.top) + ' ' ' ' ' .text = sType + ' ' ' ' ' .Width = MdlObjSizer.get_object_width(.text) + 24 + ' ' ' ' ' .Height = 21 + ' ' ' ' ' .ReadOnly = TRUE + ' ' ' ' ' .tag = sDev + ' ' ' ' ' END WITH + ' ' ' ' ' objIntTypes.Add(tb) + ' ' ' ' ' 'add a box here to enable/disable the interface + ' ' ' ' ' bCb = NEW CheckBox(FrmNetConf.TSNetDevices) AS "bEnableInterface" ' enable/disable interface box + ' ' ' ' ' WITH bCb + ' ' ' ' ' .Move(4, tb.top + tb.Height + 4) + ' ' ' ' ' .text = ("Automatically activate this interface at start-up") + ' ' ' ' ' .Value = TRUE + ' ' ' ' ' .Height = 21 + ' ' ' ' ' .Width = MdlObjSizer.get_object_width(.text) + 36 + ' ' ' ' ' .tag = sDev + ' ' ' ' ' y = .top + .Height + 8 + ' ' ' ' ' objCheckboxes.Add(bCb) + ' ' ' ' ' END WITH + ' ' ' ' ' + ' ' ' ' ' + ' ' ' ' ' + ' ' ' ' ' tl = NEW TextLabel(FrmNetConf.TSNetDevices) + ' ' ' ' ' WITH tl + ' ' ' ' ' .text = ("STATUS:") & " <b>" & sStatus & "</b>" + ' ' ' ' ' .Width = MdlObjSizer.get_object_width(.text) + ' ' ' ' ' .Height = 21 + ' ' ' ' ' .Move(x + cb.Width + 12, y - .Height - 4) + ' ' ' ' ' .Alignment = Align.Normal + ' ' ' ' ' END WITH + ' ' ' ' ' + ' ' ' ' ' tl = NEW TextLabel(FrmNetConf.TSNetDevices) + ' ' ' ' ' WITH tl + ' ' ' ' ' + ' ' ' ' ' .Move(12, y + 8) + ' ' ' ' ' IF sType = ("Wired") THEN + ' ' ' ' ' .Width = .Parent.Width - (.left * 2) + ' ' ' ' ' ELSE + ' ' ' ' ' .Width = 250 + ' ' ' ' ' END IF + ' ' ' ' ' .text = "<b>" & ("Dynamic Host Control Protocol") & "</b><br>" & ("Automatic settings via DHCP.") & "<br><br>" & ("This will work if you use a cable or DSL modem on a home network.") & "<br>" & ("If in doubt, choose this option") + ' ' ' ' ' .Adjust + ' ' ' ' ' '.border = Border.Raised + ' ' ' ' ' .Height = 21 * 6 + ' ' ' ' ' .Tag = LAST.tag + ' ' ' ' ' + ' ' ' ' ' + ' ' ' ' ' + ' ' ' ' ' END WITH + ' ' ' 'END IF + ' ' ' ' END IF + ' ' ' + ' ' ' + ' ' ' + ' ' ' END WITH + ' ' ' END IF + ' ' ' + ' ' ' NEXT + ' ' ' FrmNetConf.TSNetDevices[FrmNetConf.TSNetDevices.count - 1].Delete ' Ugly hack to delete the trailing blank tab + ' ' ' + ' ' ' IF ERROR THEN Message(Error.text & gb.newline & Error.where) + ' ' ' + ' ' ' + ' ' ' IF Exist("/tmp/iwdump") THEN KILL "/tmp/iwdump" + ' ' ' MdlCore.warn_status_off() - - - - NEXT END -' PUBLIC SUB LIST_NETWORK_INTERFACES() -' -' ' This SUB will detect network interfaces and offer setup options for each one of them -' DIM seths AS String -' DIM sDump AS String -' DIM sDevList AS String[] -' DIM sLine AS String[] -' DIM sDev AS String -' DIM sType, sStatus AS String -' DIM sDevAddr AS String -' DIM tl AS TextLabel -' DIM tb AS TextBox -' DIM cb AS ComboBox -' DIM bCb AS CheckBox -' DIM i, ii, y, x, cbwidth AS Integer -' DIM pTabPic AS picture -' DIM iwifiboxwidth, iwifiboxleft AS Integer -' DIM sApDump AS String -' 'DIM iwifix, iwifiy, iwifiboxwidth AS Integer -' -' MdlCore.WARN_STATUS(("Probing your networking hardwar... [truncated message content] |