From: <cod...@go...> - 2009-01-09 22:24:41
|
Author: M0...@gm... Date: Fri Jan 9 13:50:23 2009 New Revision: 454 Added: branches/speedy/.icon.png (contents, props changed) branches/speedy/.project branches/speedy/ClsGlobal.class branches/speedy/FMain.class branches/speedy/FMain.form branches/speedy/MdlObjSizer.module branches/speedy/Step1.class branches/speedy/Step1.form branches/speedy/Step2.class branches/speedy/Step2.form branches/speedy/images/ branches/speedy/images/16px-Nocheck.png (contents, props changed) branches/speedy/images/16px-check.png (contents, props changed) branches/speedy/images/arrow.png (contents, props changed) branches/speedy/images/arrow_old.png (contents, props changed) branches/speedy/images/category.png (contents, props changed) branches/speedy/images/check.png (contents, props changed) branches/speedy/images/check_old.png (contents, props changed) branches/speedy/images/circle.png (contents, props changed) branches/speedy/images/circle_old.png (contents, props changed) branches/speedy/images/ethernet.png (contents, props changed) branches/speedy/images/installer.png (contents, props changed) branches/speedy/images/installer_new.png (contents, props changed) branches/speedy/images/throbber.gif (contents, props changed) branches/speedy/images/throbber.gif_old (contents, props changed) branches/speedy/images/throbber.gif_simple (contents, props changed) branches/speedy/images/wireless.png (contents, props changed) Log: Begin speedy development Added: branches/speedy/.icon.png ============================================================================== Binary file. No diff available. Added: branches/speedy/.project ============================================================================== --- (empty file) +++ branches/speedy/.project Fri Jan 9 13:50:23 2009 @@ -0,0 +1,13 @@ +# Gambas Project File 2.0 +# Compiled with Gambas 2.10.0 +Title=VectorLinux Installer +Startup=FMain +Version=0.0.1 +Library=gb.gtk +Library=gb.form +Library=gb.gtk.ext +TabSize=2 +Translate=1 +Language=en_US +ControlPublic=1 +ModulePublic=1 Added: branches/speedy/ClsGlobal.class ============================================================================== --- (empty file) +++ branches/speedy/ClsGlobal.class Fri Jan 9 13:50:23 2009 @@ -0,0 +1,4 @@ +' Gambas class file + +STATIC PUBLIC sDistroName AS String +STATIC PUBLIC sDistroVer AS String \ No newline at end of file Added: branches/speedy/FMain.class ============================================================================== --- (empty file) +++ branches/speedy/FMain.class Fri Jan 9 13:50:23 2009 @@ -0,0 +1,111 @@ +' Gambas class file + +PRIVATE $aPrev AS NEW Object[] +PRIVATE $oCurrent AS Object + +PUBLIC SUB _new() + +END + +PUBLIC SUB Form_Open() + +$oCurrent = NEW Step1(pnlStack) +btBack.Enabled = FALSE +ME.auto_setup_for_resolution() +END + +PUBLIC SUB auto_setup_for_resolution() + + SidePanel1.Visible = Desktop.Width >= 1024 + + +END + + + +PUBLIC SUB btQuit_Click() + + FMain.Close + +END + +PUBLIC SUB btBack_Click() + + $oCurrent = $aPrev.Pop() + btBack.Enabled = $aPrev.count > 0 + btNext.Enabled = TRUE + $oCurrent.Raise() + +END + +PUBLIC SUB btNext_Click() + + DIM o AS Object + DIM sTmp AS String + DIM bExist AS Boolean +'Get the next One + +sTmp = $oCurrent.GetNext() +$oCurrent.width = pnlStack.Width +$oCurrent.Height = pnlStack.Height +'$oCurrent.Form_Open() +'$oCurrent.Startup() +'Is this form already opened ? +'if true it may have no been closed to preserve entries +FOR EACH o IN pnlStack.Children + + IF Object.Type(o) = sTmp THEN + bExist = TRUE + BREAK + ENDIF + +NEXT + + +'strore the previous + $aPrev.Push($oCurrent) + btBack.Enabled = $aPrev.Count > 0 + + +IF NOT bExist THEN + $oCurrent = Object.New(sTmp, [pnlStack]) + $oCurrent.Visible = TRUE +ELSE + $OCurrent = o +ENDIF + + + IF IsNull($oCurrent.GetNext()) THEN btNext.Enabled = FALSE +'Push to the foreground + $oCurrent.Raise() + $oCurrent.Startup() + +END + +PUBLIC SUB Form_Resize() + + $oCurrent.width = pnlStack.Width + $oCurrent.height = pnlStack.Height + ME.SidePanel1.Height = pnlStack.Height + 'hpanel1.Width = SidePanel1.Width + +END + + +PUBLIC SUB pnlStack_Enter() + + $oCurrent.resize(pnlStack.Width, pnlStack.Height) + +END + +PUBLIC SUB SidePanel1_Show() + + $oCurrent.resize(pnlStack.Width, pnlStack.Height) + +END + +PUBLIC SUB SidePanel1_Resize() + + $oCurrent.resize(pnlStack.Width, pnlStack.Height) + +END Added: branches/speedy/FMain.form ============================================================================== --- (empty file) +++ branches/speedy/FMain.form Fri Jan 9 13:50:23 2009 @@ -0,0 +1,67 @@ +# Gambas Form File 2.0 + +{ Form Form + MoveScaled(0,0,146.2857,85.7143) + Text = ("") + Arrangement = Arrange.Vertical + { HBox2 HBox + MoveScaled(12,1,63,7) + Background = Color.SelectedBackground + { Panel2 Panel + MoveScaled(1,3,4,2) + Expand = True + } + { PictureBox1 PictureBox + MoveScaled(7,1,46,5) + Picture = Picture["images/installer.png"] + Stretch = True + } + { Panel3 Panel + MoveScaled(49,2,7,3) + Expand = True + } + } + { Panel1 Panel + MoveScaled(1,10,80,40) + Expand = True + Arrangement = Arrange.Horizontal + { SidePanel1 SidePanel + MoveScaled(1,2,26,35) + Arrangement = Arrange.Fill + Orientation = Align.Left + Resizable = False + { ListBox1 ListBox + MoveScaled(2,2,21,31) + Background = Color.SelectedBackground + Expand = True + } + } + { pnlStack Panel + MoveScaled(28,2,50,37) + Expand = True + Border = Border.Plain + } + } + { HBox1 HBox + MoveScaled(2,49,72,1) + } + { HBox3 HBox + MoveScaled(2,51,72,3) + { Panel4 Panel + MoveScaled(0,0,17,3) + Expand = True + } + { btBack Button + MoveScaled(40,1,11,2) + Text = ("Back") + } + { btNext Button + MoveScaled(53,1,11,2) + Text = ("Next") + } + { btQuit Button + MoveScaled(66,1,10,2) + Text = ("Quit") + } + } +} Added: branches/speedy/MdlObjSizer.module ============================================================================== --- (empty file) +++ branches/speedy/MdlObjSizer.module Fri Jan 9 13:50:23 2009 @@ -0,0 +1,41 @@ +' Gambas module file + +' This file is part of vasmCC + +' vasmCC is free software: you can redistribute it and/or modify +' it under the terms of the GNU General Public License as published by +' the Free Software Foundation, either version 2 of the License, or +' (at your option) any later version. + +' vasmCC is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU General Public License for more details. + +' You should have received a copy of the GNU General Public License +' along with vasmCC. If not, see <http://www.gnu.org/licenses/>. + + + +PUBLIC fvirtfrm AS Form +PUBLIC datemp AS DrawingArea +PUBLIC SUB get_object_width(sText AS String) AS Integer + + + DIM iRetVal AS Integer + + + fvirtfrm = NEW Form + WITH fvirtfrm + .Width = 300 + .Height = 200 + END WITH + datemp = NEW DrawingArea(fvirtfrm) + + Draw.Begin(datemp) + iRetVal = Draw.RichTextWidth(sText) + Draw.End + RETURN iRetVal + + +END Added: branches/speedy/Step1.class ============================================================================== --- (empty file) +++ branches/speedy/Step1.class Fri Jan 9 13:50:23 2009 @@ -0,0 +1,159 @@ +' Gambas class file + +PUBLIC SUB _new() ' executed every time the form is instanciated. + + ME.StartUp() + +END + + +PUBLIC SUB Form_Open() + + ME.TextLabel1.Text = "<h2>" & TextLabel1.text & "</h2>" + ME.FIND_CD_INSTALL_MEDIA() + ME.FIND_ISO_INSTALL_MEDIA() + 'ComboBox1.ReadOnly = TRUE + +END + +PUBLIC FUNCTION GetNext() AS String + + IF bcheckmedia.Value = TRUE THEN + RETURN "Step2" + ELSE + RETURN "Step3" + END IF + + +END + +PUBLIC SUB StartUp() ' Executed every time the Next button is pressed + + +'Message("Starup sub here") +'ME.FIND_CD_INSTALL_MEDIA + + +END + +PUBLIC SUB FIND_CD_INSTALL_MEDIA() + + DIM sDump, sDrive, sOutput, sShortDrive AS String + DIM sName, sVersion AS String + DIM i AS Integer + DIM sDriveList AS String[] + + Step1.tlStatus.Text = ("Scanning for CD Media ... Please wait") + + SHELL "/sbin/probedisk | grep \"cdrom\" | cut -f 1 -d \'|\'" TO sOutput + + sOutput = Trim(sOutput) + IF Len(sOutput) < 1 THEN RETURN + + sDriveList = Split(sOutput, "\n") + FOR i = 0 TO sDriveList.Count - 1 + sShortDrive = Right(Trim(sDriveList[i]), Len(Trim(sDriveList[i])) - RInStr(Trim(sDriveList[i]), "/")) + EXEC ["mkdir", "-p", "/mnt" &/ sShortDrive] WAIT + EXEC ["mount", "-o", "ro", Trim(sDriveList[i]), "/mnt" &/ sShortDrive] WAIT + PRINT ("Scanning") & Space(1) & sDriveList[i] + IF Exist("/mnt" &/ sShortDrive &/ "veclinux" &/ "SETUP.CONF") THEN + SHELL "grep \"^DISTRO=\" /mnt" &/ sShortDrive &/ "veclinux" &/ "SETUP.CONF | cut -f 2 -d \'=\'" TO sName + SHELL "grep \"^VERSION=\" /mnt" &/ sShortDrive &/ "veclinux" &/ "SETUP.CONF | cut -f 2 -d \'=\'" TO sVersion + sName = Trim(Replace(sName, "\'", "")) + sVersion = Trim(Replace(sVersion, "\'", "")) + File.Save(Temp(sShortDrive), File.Load("/mnt" &/ sShortDrive &/ "veclinux" &/ "SETUP.CONF")) + IF ME.ComboBox1.Find(sName & Space(1) & sVersion & Space(1) & ("on") & Space(1) & Trim(sDriveList[i])) = -1 THEN + ME.ComboBox1.Add(sName & Space(1) & sVersion & Space(1) & ("on") & Space(1) & Trim(sDriveList[i])) + END IF + PRINT ("... Found") & Space(1) & sName & "-" & sVersion & Space(1) & ("in") & Space(1) & sDriveList[i] + END IF + EXEC ["umount", "/mnt" &/ sShortDrive] WAIT + EXEC ["rm", "-rf", "/mnt" &/ sShortDrive] WAIT + + 'Message(sShortDrive) + NEXT + +Step1.tlStatus.Text = "" + + 'ComboBox1.ReadOnly = TRUE + + +END + +PUBLIC SUB FIND_ISO_INSTALL_MEDIA() + + DIM sOutput, sPart AS String + DIM sName, sVersion AS String + DIM i AS Integer + DIM sPartList AS String[] + + tlStatus.Text = ("Scanning system for installable ISO images") + SHELL "/sbin/probepart | grep \"^/dev\" | grep -v -i \"linux swap\" | tr -s \' \'\"\" | cut -f 1 -d \' \'" TO sOutput + sOutput = Trim(sOutput) + IF Len(sOutput) < 1 THEN RETURN + sPartList = Split(sOutput, "\n") + FOR i = 0 TO sPartList.Count - 1 + sPart = Trim(Right(Trim(sPartList[i]), Len(Trim(sPartList[i])) - RInStr(Trim(sPartList[i]), "/"))) + 'Message(sPart) + NEXT + + tlStatus.Text = "" + +END + + + +PUBLIC SUB ComboBox1_Click() + + DIM sAddr AS String = Right(Trim(ComboBox1.Text), Len(Trim(ComboBox1.Text)) - RInStr(Trim(ComboBox1.Text), "/")) + + IF sAddr LIKE "[0-9]" THEN + 'PRINT ("Installing from") & Space(1) & Left(Trim(ComboBox1.Text), InStr(Trim(ComboBox1.Text), " ")) + ELSE + 'PRINT ("Installing from") & Space(1) & sAddr + ME.DESCRIBE_CD_INSTALL_MEDIA(sAddr) + 'PRINT File.Load(Temp(sAddr)) + END IF + + +END + +PUBLIC SUB DESCRIBE_CD_INSTALL_MEDIA(sAddress AS String) + + DIM sDistro, sVersion, sLine AS String + DIM sSetup AS String[] + DIM sFile AS String = File.Load(Temp(sAddress)) + DIM i, ir AS Integer + + + sSetup = Split(sFile, "\n") + FOR i = 0 TO sSetup.count - 1 + sLine = Trim(sSetup[i]) + IF Left(sLine, Len("DISTRO=")) = "DISTRO=" THEN + sDistro = Right(sLine, Len(sLine) - InStr(sline, "\'")) + sDistro = Replace(sDistro, "\'", "") + sDistro = Trim(sDistro) + ELSE IF Left(sline, Len("VERSION=")) = "VERSION=" THEN + sVersion = Right(sLine, Len(sLine) - InStr(sline, "\'")) + sVersion = Replace(sVersion, "\'", "") + sVersion = Trim(sVersion) + END IF + + + NEXT + + gvdistdetails.Rows.Count = 2 + gvdistdetails.Columns.count = 2 + gvdistdetails[0, 0].Text = ("DISTRIBUTION") + gvdistdetails.Columns[0].Width = 150 + gvdistdetails[0, 1].Text = sDistro + gvdistdetails[1, 0].Text = ("VERSION") + gvdistdetails[1, 1].Text = sVersion + +END + + +PUBLIC SUB Form_Resize() + + +END Added: branches/speedy/Step1.form ============================================================================== --- (empty file) +++ branches/speedy/Step1.form Fri Jan 9 13:50:23 2009 @@ -0,0 +1,66 @@ +# Gambas Form File 2.0 + +{ Form Form + MoveScaled(0,0,65,45) + Text = ("") + Arrangement = Arrange.Vertical + { HPanel1 HPanel + MoveScaled(1,1,54,6) + { TextLabel1 TextLabel + MoveScaled(9,1,29,3) + Expand = True + Text = ("Select Installation Source") + Alignment = Align.Left + } + { Separator1 Separator + MoveScaled(9,4,25,1) + Expand = True + } + } + { Panel1 Panel + MoveScaled(1,8,60,34) + Expand = True + Arrangement = Arrange.Row + { TextLabel2 TextLabel + MoveScaled(1,0,54,3) + Expand = True + Text = ("Select Installation source from the list below") + } + { HBox1 HBox + MoveScaled(1,3,54,3) + Expand = True + { ComboBox1 ComboBox + MoveScaled(0,0,22,1) + Expand = True + Text = ("ComboBox1") + ReadOnly = True + } + { TextLabel3 TextLabel + MoveScaled(23,1,3,1) + Text = ("") + } + { btRescan Button + MoveScaled(30,0,19,3) + Text = ("Search Again") + } + } + { HBox2 HBox + MoveScaled(1,7,47,3) + Expand = True + { tlStatus TextLabel + MoveScaled(0,0,40,3) + Expand = True + Text = ("") + } + } + { gvDistDetails GridView + MoveScaled(1,11,52,9) + Expand = True + } + { bCheckMedia CheckBox + MoveScaled(1,21,41,3) + Expand = True + Text = ("Check Installation media before installing") + } + } +} Added: branches/speedy/Step2.class ============================================================================== --- (empty file) +++ branches/speedy/Step2.class Fri Jan 9 13:50:23 2009 @@ -0,0 +1,36 @@ +' Gambas class file + + +PUBLIC SUB Form_Open() + + ME.Width = FMain.pnlstack.Width + ME.Height = FMain.pnlstack.Height + ME.set_label_text() + ME.tlbanner.Text = "<h2>" & ("Verify Installation Files") & "</h2>" + ME.StartUp() + 'FMain.btNext.Enabled = FALSE +END + +PUBLIC FUNCTION GetNext() AS String + + RETURN "Step1" + +END +PUBLIC SUB set_label_text() + + DIM sMsg AS String + + sMsg = ("Verifying installation files can prevent you from performing an unsuccessful install") & "<br>" & + ("Keep in mind however, that this process can take a while to complete.") + + ME.TextLabel1.Text = sMsg + ME.TextLabel1.Adjust + + +END + +PUBLIC SUB StartUp() + + FMain.btNext.Enabled = FALSE + +END Added: branches/speedy/Step2.form ============================================================================== --- (empty file) +++ branches/speedy/Step2.form Fri Jan 9 13:50:23 2009 @@ -0,0 +1,29 @@ +# Gambas Form File 2.0 + +{ Form Form + MoveScaled(0,0,78,40) + Text = ("") + Arrangement = Arrange.Vertical + { HPanel1 HPanel + MoveScaled(2,1,60,5) + { tlbanner TextLabel + MoveScaled(12,1,19,3) + Expand = True + Text = ("TextLabel2") + } + { Separator1 Separator + MoveScaled(13,4,25,1) + Expand = True + } + } + { Panel1 Panel + MoveScaled(1,7,76,32) + Expand = True + Arrangement = Arrange.Row + { TextLabel1 TextLabel + MoveScaled(1,1,72,7) + Expand = True + Text = ("") + } + } +} Added: branches/speedy/images/16px-Nocheck.png ============================================================================== Binary file. No diff available. Added: branches/speedy/images/16px-check.png ============================================================================== Binary file. No diff available. Added: branches/speedy/images/arrow.png ============================================================================== Binary file. No diff available. Added: branches/speedy/images/arrow_old.png ============================================================================== Binary file. No diff available. Added: branches/speedy/images/category.png ============================================================================== Binary file. No diff available. Added: branches/speedy/images/check.png ============================================================================== Binary file. No diff available. Added: branches/speedy/images/check_old.png ============================================================================== Binary file. No diff available. Added: branches/speedy/images/circle.png ============================================================================== Binary file. No diff available. Added: branches/speedy/images/circle_old.png ============================================================================== Binary file. No diff available. Added: branches/speedy/images/ethernet.png ============================================================================== Binary file. No diff available. Added: branches/speedy/images/installer.png ============================================================================== Binary file. No diff available. Added: branches/speedy/images/installer_new.png ============================================================================== Binary file. No diff available. Added: branches/speedy/images/throbber.gif ============================================================================== Binary file. No diff available. Added: branches/speedy/images/throbber.gif_old ============================================================================== Binary file. No diff available. Added: branches/speedy/images/throbber.gif_simple ============================================================================== Binary file. No diff available. Added: branches/speedy/images/wireless.png ============================================================================== Binary file. No diff available. |