From: <cod...@go...> - 2008-07-20 03:54:49
|
Author: M0...@gm... Date: Sat Jul 19 20:54:23 2008 New Revision: 56 Added: branches/iVL/images/installer.png (contents, props changed) Modified: branches/iVL/.project branches/iVL/FMain.class branches/iVL/FMain.form branches/iVL/FrmPkgSel.class branches/iVL/FrmPkgSel.form branches/iVL/MdlPkgSel.module branches/iVL/installer.gambas Log: Finished the package selection interface. Ready to begin installing packages to the system. Modified: branches/iVL/.project ============================================================================== --- branches/iVL/.project (original) +++ branches/iVL/.project Sat Jul 19 20:54:23 2008 @@ -1,9 +1,10 @@ # Gambas Project File 2.0 Title=VectorLinux Installer Startup=MdlCore -Version=0.0.10 +Version=0.0.17 Library=gb.gtk Library=gb.form +Library=gb.debug Library=gb.desktop Library=gb.form.dialog Library=gb.form.mdi Modified: branches/iVL/FMain.class ============================================================================== --- branches/iVL/FMain.class (original) +++ branches/iVL/FMain.class Sat Jul 19 20:54:23 2008 @@ -32,10 +32,13 @@ FrmSelISO.Width = pnlWinHost.Width FrmSelISO.Height = pnlWinHost.Height FrmSelISO.Show + MdlCore.PREPARE_INSTALL_LAYOUT WITH ME .btback.Enabled = FALSE .btback.ForeColor = Color.Gray + .Frame1.BackColor = Color.Transparent + .tvPlan.BackColor = Color.transparent .btQuit.Text = "Exit Installation" END WITH 'ME.TreeView1.BackColor = Color.Transparent @@ -81,12 +84,12 @@ .tlBanner.width = ME.width '.Frame1.Move(.tlBanner.left + 4, .tlBanner.Top + .tlBanner.Height + 4, .tlBanner.Width - ((.tlBanner.Width / 10) * 7), .Height - (.tlbanner.height + (.tlbanner.height / 2))) .Frame1.Resize(MdlCore.iLeftWidth * 1.60, .ClientHeight - tlBanner.Height - (.btback.Height * 1.5)) - .tvPlan.Move(4, 30, .Frame1.Width - 8, Frame1.Height - (.Frame1.Height / 20)) + .tvPlan.Move(4, 24, .Frame1.Width - 8, Frame1.Height - (.Frame1.Height / 20)) '.tvPlan.Resize(.Frame1.Width - (.Frame1.Width / 20), Frame1.Height - (.Frame1.Height / 20)) '.tvPlan.Resize(.Frame1.Width - 20, .Frame1.Height - 36) '.tvPlan.Width = MdlCore.iLeftWidth + (MdlCore.iLeftWidth / 20) '.Frame1.Width = .tvPlan.Width + (.tvPlan.Width / 20) - .pnlWinHost.Move(.Frame1.left + .Frame1.Width + 4, .Frame1.top, .tlBanner.Width - (.Frame1.Width + 8), .Frame1.Height) + .pnlWinHost.Move(.Frame1.left + .Frame1.Width + 4, .Frame1.top, .tlBanner.Width - (.Frame1.Width + 8), .ClientHeight - (.tlbanner.height + (.btback.height * 2))) .btback.Move(.pnlWinHost.Left, .pnlWinHost.Top + .pnlWinHost.Height - (.btback.Height), MdlObjSizer.get_object_width(.btback.text) + 36) .btnext.Move(.pnlWinHost.Left + .pnlWinHost.Width - (.btnext.Width + 8), .btback.Top, MdlObjSizer.get_object_width(.btnext.text) + 36) ' for the quit button, it'll get a little tricky @@ -137,7 +140,23 @@ ' move to package selection frmNext = FrmPkgSel END IF + END IF + CASE "FrmPkgSel" + 'here we check what kind of install it is, simple or custom + 'IF FrmPkgSel.rbCustom.Value = TRUE THEN + + IF ClsPkgSel.bCustom = TRUE THEN + 'get the list of selected bulks only + 'MdlPkgSel.GET_USER_BULK_SELECTION() + 'Message("Going for a custom install") + MdlPkgSel.GET_USER_BULK_SELECTION() + frmNext = FrmPkgsel2 + ELSE + ' now we are ready to summarize + Message("Going for a simple install") + frmNext = FrmSummary + END IF END SELECT Modified: branches/iVL/FMain.form ============================================================================== --- branches/iVL/FMain.form (original) +++ branches/iVL/FMain.form Sat Jul 19 20:54:23 2008 @@ -23,17 +23,17 @@ MoveScaled(28,9,66,56) } { btnext Button - MoveScaled(89,69,8,3.375) + MoveScaled(89,69,8,3.3333) Text = ("Next") Picture = Picture["icon:/16/right"] } { btback Button - MoveScaled(28,67,8,3.375) + MoveScaled(28,67,8,3.3333) Text = ("Back") Picture = Picture["icon:/16/left"] } { btQuit Button - MoveScaled(54,67,11,3.375) + MoveScaled(54,67,11,3.3333) Text = ("Exit") Picture = Picture["icon:/16/cancel"] } Modified: branches/iVL/FrmPkgSel.class ============================================================================== --- branches/iVL/FrmPkgSel.class (original) +++ branches/iVL/FrmPkgSel.class Sat Jul 19 20:54:23 2008 @@ -22,8 +22,7 @@ .tlBanner.Text = "Choose your installation mode" .rbFull_Click() END WITH - MdlPkgSel.LIST_PACKAGE_SELECTION - + FMain.FrmCurr = ME END PUBLIC SUB Form_Resize() @@ -44,7 +43,7 @@ tlActionDesc.Text = "Installs everything in your VectorLinux media to your system" tlActionDesc.Adjust scrlInstallOpts.Visible = FALSE - + ClsPkgSel.bCustom = FALSE END @@ -53,5 +52,13 @@ tlActionDesc.Text = "Choose your optional components to install." tlActionDesc.Adjust scrlInstallOpts.Visible = TRUE + MdlPkgSel.LIST_BULK_SELECTION + ClsPkgSel.bCustom = TRUE + +END + +PUBLIC SUB Form_Hide() + + END Modified: branches/iVL/FrmPkgSel.form ============================================================================== --- branches/iVL/FrmPkgSel.form (original) +++ branches/iVL/FrmPkgSel.form Sat Jul 19 20:54:23 2008 @@ -9,11 +9,11 @@ Alignment = Align.Normal } { rbFull RadioButton - MoveScaled(1,8,40,4.5) + MoveScaled(1,8,40,4.4444) Text = ("Full Install") } { rbCustom RadioButton - MoveScaled(1,14,55,4.5) + MoveScaled(1,14,55,4.4444) Text = ("Custom Install") } { tlActionDesc TextLabel @@ -21,6 +21,6 @@ Text = ("") } { scrlInstallOpts ScrollView - MoveScaled(1,30,52,28) + MoveScaled(1,30,57,28) } } Modified: branches/iVL/MdlPkgSel.module ============================================================================== --- branches/iVL/MdlPkgSel.module (original) +++ branches/iVL/MdlPkgSel.module Sat Jul 19 20:54:23 2008 @@ -16,8 +16,9 @@ ' You should have received a copy of the GNU General Public License ' along with vinstall-ng. If not, see <http://www.gnu.org/licenses/>. -PUBLIC options AS Object[] -PUBLIC SUB LIST_PACKAGE_SELECTION() +PUBLIC Bulks AS Object[] +PUBLIC Pkgs AS Object[] +PUBLIC SUB LIST_BULK_SELECTION() DIM cb AS CheckBox DIM i, ii, cby AS Integer @@ -30,10 +31,11 @@ cby = 4 'File.Save(Temp("SETUP.CONF"), DConv(File.Load(ClsGlobal.sSourceMnt &/ "veclinux" &/ "SETUP.CONF"))) 'Message(File.Load(Temp("SETUP.CONF"))) + Bulks = NEW Object[] sFIle = Split(File.Load(Temp("SETUP.CONF")), gb.NewLine) FOR i = 0 TO sFIle.count - 1 - sLine = Trim(sFIle[i]) + sLine = Trim(sFIle[i]) IF Left(sLine, Len("BULK")) = "BULK" THEN sCurrLine = Split(sLine, ":") 'line format is File_name.tlz:Size_kb:Description @@ -52,16 +54,110 @@ .x = 4 .y = cby .Height = 27 - .Tag = sPkg + .Tag = Right(sPkg, Len(sPkg) - InStr(sPkg, "=") - 1) .Value = TRUE END WITH + ME.Bulks.Add(cb) cby = cby + cb.Height + 4 END IF END IF NEXT +END + + +PUBLIC SUB LIST_PACKAGE_SELECTION() + + DIM cb AS CheckBox + DIM sName, sDesc, sLoc, sSize AS String + DIM i, y AS Integer + DIM sRawFile AS String[] + DIM sLine AS String + ' THis one is kind of tricky.. it will read the whole PACKAGES.TXT + y = 4 + File.Save(Temp("PACKAGES.TXT"), DConv(File.Load(ClsGlobal.sSourceMnt &/ "packages" &/ "PACKAGES.TXT"))) + 'Message(File.Load(Temp("PACKAGES.TXT"))) + sRawFile = Split(File.Load(Temp("PACKAGES.TXT")), "\n") + ME.Pkgs = NEW Object[] + FOR i = 0 TO sRawFile.Count - 1 + sLine = Trim(sRawFile[i]) + IF InStr(sLine, "PACKAGE NAME:") THEN + sName = Trim(Right(sLine, Len(sLine) - InStr(sLine, ":"))) + sLoc = Trim(Right(sRawFile[i + 1], Len(sRawFile[i + 1]) - InStr(sRawFile[i + 1], ":"))) + IF Left(sLoc, 2) = "./" THEN + sLoc = Right(sLoc, Len(sLoc) - 2) + END IF + sSize = Trim(Right(sRawFile[i + 2], Len(sRawFile[i + 2]) - InStr(sRawFile[i + 2], ":"))) + 'Message(sName & " in " & sLoc) + cb = NEW CheckBox(FrmPkgsel2.scrPkgs) AS "Packages" + WITH cb + .Text = sName & " [ " & sSize & " ]" 'Trim(Right(sLine, Len(sLine) - InStr(sLine, ":"))) + .Tag = sLoc &/ sName + .x = 4 + .y = y + .Height = 27 + .Width = MdlObjSizer.get_object_width(.Text) * 2 + .Value = TRUE + END WITH + ME.Pkgs.Add(cb) + y = y + cb.Height + 4 + + END IF + + NEXT + +END + + +PUBLIC SUB Packages_click() + 'Message(LAST.tag) + +END + + + + +PUBLIC SUB OptBulks_click() + + IF ClsPkgSel.arrBulks THEN + ClsPkgSel.arrBulks.Clear + END IF + ME.GET_USER_BULK_SELECTION + +END + + +PUBLIC SUB GET_USER_BULK_SELECTION() + + DIM cb AS CheckBox + DIM sList AS String + DIM sItem AS String + DIM i AS Integer + ' start the list + ClsPkgSel.arrBulks = NEW String[] + FOR EACH cb IN ME.Bulks + IF cb.Value = TRUE THEN + ClsPkgSel.arrBulks.Add(cb.tag) + END IF + NEXT + + FOR i = 0 TO ClsPkgSel.arrBulks.count - 1 + sItem = ClsPkgSel.arrBulks[i] + IF sItem LIKE " " THEN + ClsPkgSel.arrBulks.Delete(ClsPkgSel.arrBulks.Find(sItem)) + ELSE + sList = sList & ", " & sItem + ENDIF + NEXT + IF Left(sList) = "," THEN + sList = Right(sList, Len(sList) - 1) + ELSE IF Right(sList) = "," THEN + sList = Left(sList, Len(sList) - 1) + END IF + sList = Trim(sList) + END Added: branches/iVL/images/installer.png ============================================================================== Binary file. No diff available. Modified: branches/iVL/installer.gambas ============================================================================== Binary files. No diff available. |