From: <cod...@go...> - 2008-11-06 19:09:14
|
Author: M0E.lnx Date: Thu Nov 6 11:08:02 2008 New Revision: 267 Modified: branches/iVL/.lang/FMain.pot branches/iVL/.lang/FrmPkgSel.pot branches/iVL/.lang/FrmSelISO.pot branches/iVL/.lang/FrmSummary.pot branches/iVL/FrmPkgSel.class branches/iVL/FrmPkgSel.form branches/iVL/MdlInstallCustom.module Log: - Implemented Bulk package selection to match that of Individual packages. Using a gridview instead of Checkboxes created @ runtime. Modified: branches/iVL/.lang/FMain.pot ============================================================================== --- branches/iVL/.lang/FMain.pot (original) +++ branches/iVL/.lang/FMain.pot Thu Nov 6 11:08:02 2008 @@ -1,4 +1,4 @@ -# /home/remote/devel/installer/FMain.class +# /home/vluser/devel/installer/FMain.class # Generated by Gambas compiler # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. Modified: branches/iVL/.lang/FrmPkgSel.pot ============================================================================== --- branches/iVL/.lang/FrmPkgSel.pot (original) +++ branches/iVL/.lang/FrmPkgSel.pot Thu Nov 6 11:08:02 2008 @@ -14,27 +14,27 @@ "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: FrmPkgSel.class:22 +#: FrmPkgSel.class:25 msgid "Choose your installation mode" msgstr "" -#: FrmPkgSel.class:51 -msgid "Installs everything in your VectorLinux media to your system" +#: FrmPkgSel.class:70 +msgid "Installs all optional components in your VectorLinux media to your system" msgstr "" -#: FrmPkgSel.class:60 +#: FrmPkgSel.class:80 msgid "Choose your optional components to install." msgstr "" -#: FrmPkgSel.class:101 +#: FrmPkgSel.class:195 msgid "TextLabel1" msgstr "" -#: FrmPkgSel.class:107 +#: FrmPkgSel.class:205 msgid "Full Install" msgstr "" -#: FrmPkgSel.class:112 +#: FrmPkgSel.class:210 msgid "Custom Install" msgstr "" Modified: branches/iVL/.lang/FrmSelISO.pot ============================================================================== --- branches/iVL/.lang/FrmSelISO.pot (original) +++ branches/iVL/.lang/FrmSelISO.pot Thu Nov 6 11:08:02 2008 @@ -1,4 +1,4 @@ -# /home/remote/devel/installer/FrmSelISO.class +# /home/vluser/devel/installer/FrmSelISO.class # Generated by Gambas compiler # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. Modified: branches/iVL/.lang/FrmSummary.pot ============================================================================== --- branches/iVL/.lang/FrmSummary.pot (original) +++ branches/iVL/.lang/FrmSummary.pot Thu Nov 6 11:08:02 2008 @@ -1,4 +1,4 @@ -# /home/remote/devel/installer/FrmSummary.class +# /home/vluser/devel/installer/FrmSummary.class # Generated by Gambas compiler # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. Modified: branches/iVL/FrmPkgSel.class ============================================================================== --- branches/iVL/FrmPkgSel.class (original) +++ branches/iVL/FrmPkgSel.class Thu Nov 6 11:08:02 2008 @@ -15,6 +15,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 pYes AS picture = Picture.load("images/16px-check.png") +PUBLIC pNo AS Picture = picture.load("images/16px-Nocheck.png") + PUBLIC SUB Form_Open() @@ -23,12 +26,27 @@ .rbFull_Click() END WITH FMain.FrmCurr = ME - FMain.tvPlan["Prep3"].Selected = TRUE - FMain.tvPlan["Prep2"].Picture = MdlCore.sDonePic - FMain.tvPlan["Prep3"].Picture = MdlCore.sNowPic + ' ' FMain.tvPlan["Prep3"].Selected = TRUE + ' ' FMain.tvPlan["Prep2"].Picture = MdlCore.sDonePic + ' ' FMain.tvPlan["Prep3"].Picture = MdlCore.sNowPic FMain.btback.Enabled = TRUE FMain.btback.ForeColor = Color.Black +'ME.scrlInstallOpts.Columns.count = 4 +WITH ME.scrlInstallOpts +.Columns.count = 4 +.Rows.count = 1 +.Header = TRUE +.Columns[1].text = ("Package") +.Columns[2].Text = ("Description") +.Columns[3].Text = ("Size") +.Columns[0].Width = 32 +.Columns[1].Width = 120 +.Columns[2].Width = 350 +END WITH + +ME.FILL_IN_BULK_LIST() + END PUBLIC SUB Form_Resize() @@ -36,10 +54,11 @@ WITH ME '.tlBanner.Width = .ClientWidth - 8 .tlBanner.Move(4, 4, .ClientWidth - (.tlBanner.Left * 2), 27) - .hrSep.Move(4, .tlBanner.top + .tlBanner.Height - (.hrSep.H), .tlBanner.Width) + .hrSep.Move(4, .tlBanner.top + .tlBanner.Height, .tlBanner.Width) .rbFull.Move(.tlBanner.Left, .tlBanner.top + .tlBanner.Height + 12, MdlObjSizer.get_object_width(.rbfull.text) + 36) .rbCustom.Move(.tlBanner.Left, .rbFull.top + .rbFull.Height + 4, MdlObjSizer.get_object_width(.rbcustom.text) + 36) - .tlActionDesc.Width = .tlBanner.Width - 4 + .tlActionDesc.Move(4, .rbCustom.top + .rbCustom.Height + 12, .tlBanner.Width - 4) + '.tlActionDesc.Width = .tlBanner.Width - 4 .scrlInstallOpts.Move(.tlActionDesc.Left, .tlActionDesc.top + .tlActionDesc.Height + 8, .tlActionDesc.Width - 12, .ClientHeight - (.tlActionDesc.top + (.tlActionDesc.height * 2.75))) END WITH @@ -48,9 +67,10 @@ PUBLIC SUB rbFull_Click() - tlActionDesc.Text = ("Installs everything in your VectorLinux media to your system") + tlActionDesc.Text = ("Installs all optional components in your VectorLinux media to your system") tlActionDesc.Adjust - scrlInstallOpts.Visible = FALSE + 'scrlInstallOpts.Visible = FALSE + scrlInstallOpts.Enabled = FALSE ClsPkgSel.bCustom = FALSE END @@ -59,12 +79,63 @@ tlActionDesc.Text = ("Choose your optional components to install.") tlActionDesc.Adjust - scrlInstallOpts.Visible = TRUE - MdlPkgSel.LIST_BULK_SELECTION + 'scrlInstallOpts.Visible = TRUE + scrlInstallOpts.Enabled = TRUE + 'MdlPkgSel.LIST_BULK_SELECTION ClsPkgSel.bCustom = TRUE END +PUBLIC SUB FILL_IN_BULK_LIST() + + DIM i, ii AS Integer + DIM sBulk AS String + DIM sDesc AS String + DIM sLine, sSize AS String + DIM arrLine AS String[] + DIM sBasePath AS String = ClsGlobal.sSourceMnt &/ "veclinux" &/ "optional" '"/mnt/cdrom/veclinux/optional" ' temporary path ... needs to change to global variable + DIM sFile AS String[] = Split(File.Load(ClsGlobal.sSourceMnt &/ "veclinux" &/ "SETUP.CONF"), gb.NewLine) + DIM fsiZe AS Float + + FOR i = 0 TO sFile.count - 1 + sLine = sFile[i] + IF Left(sLine, Len("BULK")) = "BULK" AND InStr(sLine, "optional") THEN + + arrLine = Split(sLine, ":") + sBulk = Right(arrLine[0], Len(arrLine[0]) - InStr(arrLine[0], "/")) + sBulk = File.BaseName(sBulk) + sSize = arrLine[1] + fsiZe = Round((arrLine[1] / 1024), -2) + 'Message(fsiZe) + sDesc = arrLine[2] + sDesc = Replace(sDesc, "\'", "") + + scrlInstallOpts[ii, 0].Picture = pYes + scrlInstallOpts[ii, 1].Text = sBulk + scrlInstallOpts[ii, 2].Text = sDesc + scrlInstallOpts[ii, 3].Text = fsiZe & " MB" + + INC ii + INC scrlInstallOpts.Rows.Count + 'Message.Info(sBulk) + END IF +NEXT + + + + + + + +END + + + + + + + + PUBLIC SUB Form_Hide() ' IF ClsPkgSel.bCustom = FALSE THEN @@ -76,5 +147,28 @@ PUBLIC SUB Form_Show() Form_Open() + +END + +PUBLIC SUB Form_Menu() + + ME.FILL_IN_BULK_LIST + +END + +PUBLIC SUB scrlInstallOpts_Click() + + IF LAST.column = 0 THEN + IF scrlInstallOpts[LAST.row, LAST.column].Picture = pyes THEN + scrlInstallOpts[LAST.row, LAST.column].Picture = pNo + ELSE IF scrlInstallOpts[LAST.row, LAST.column].Picture = pNo THEN + scrlInstallOpts[LAST.row, LAST.column].Picture = pyes + END IF +'GridView1[LAST.row, LAST.column].Refresh() +END IF + +'Message(GridView1[LAST.row, 4].Text) +scrlInstallOpts.Refresh() + END Modified: branches/iVL/FrmPkgSel.form ============================================================================== --- branches/iVL/FrmPkgSel.form (original) +++ branches/iVL/FrmPkgSel.form Thu Nov 6 11:08:02 2008 @@ -8,22 +8,23 @@ Text = ("TextLabel1") Alignment = Align.Normal } + { hrSep Separator + MoveScaled(34,6,20,1) + } { rbFull RadioButton - MoveScaled(1,9,40,3.2857) + MoveScaled(1,10,40,3.1429) Text = ("Full Install") } { rbCustom RadioButton - MoveScaled(1,13,55,3.2857) + MoveScaled(1,14,55,3.1429) Text = ("Custom Install") } { tlActionDesc TextLabel - MoveScaled(1,17,63,6) + MoveScaled(1,19,63,4) Text = ("") } - { scrlInstallOpts ScrollView - MoveScaled(1,24,52,28) - } - { hrSep Separator - MoveScaled(34,7,20,1) + { scrlInstallOpts GridView + MoveScaled(1,27,56,23) + Expand = True } } Modified: branches/iVL/MdlInstallCustom.module ============================================================================== --- branches/iVL/MdlInstallCustom.module (original) +++ branches/iVL/MdlInstallCustom.module Thu Nov 6 11:08:02 2008 @@ -497,18 +497,33 @@ DIM i, ii AS Integer DIM iRet AS Integer - FOR i = 0 TO ClsPkgSel.arrBulks.Count - 1 - sPkg = ClsPkgSel.arrBulks[i] - 'install the packages now - PRINT " + Install " & sPkgPath &/ sPkg - 'iRet = ME.INSTALL_THIS_PACKAGE(sPkgPath &/ sPkg) - iret = ME.INSTALL_THIS_BULK(sPkgPath &/ sPkg) - IF iRet <> 0 THEN - RETURN 1 - END IF - PRINT " ! " & sPkgPath &/ sPkg & " is installed" - NEXT -END + REPEAT + IF FrmPkgSel.scrlInstallOpts[ii, 0].Picture = FrmPkgSel.pyes THEN + sPkg = FrmPkgSel.scrlInstallOpts[ii, 1].text & ".tlz" + iret = ME.INSTALL_THIS_BULK(sPkgPath &/ "optional" &/ sPkg) + IF iret <> 0 THEN + RETURN 1 + END IF + INC ii + END IF + UNTIL ii = FrmPkgSel.scrlInstallOpts.Rows.Count + + + +' ' ' ' +' ' ' ' +' ' ' ' FOR i = 0 TO ClsPkgSel.arrBulks.Count - 1 +' ' ' ' sPkg = ClsPkgSel.arrBulks[i] +' ' ' ' 'install the packages now +' ' ' ' PRINT " + Install " & sPkgPath &/ sPkg +' ' ' ' 'iRet = ME.INSTALL_THIS_PACKAGE(sPkgPath &/ sPkg) +' ' ' ' iret = ME.INSTALL_THIS_BULK(sPkgPath &/ sPkg) +' ' ' ' IF iRet <> 0 THEN +' ' ' ' RETURN 1 +' ' ' ' END IF +' ' ' ' PRINT " ! " & sPkgPath &/ sPkg & " is installed" +' ' ' ' NEXT + END PUBLIC SUB CALCULATE_TOTAL_PACKAGES() @@ -551,14 +566,22 @@ i = i + 1 END IF 'Count user-selected stuff in - 'we will need to cycle through the arrays for th is for accuracy... - irs = 0 - FOR EACH cb IN MdlPkgSel.Bulks - IF cb.value = TRUE THEN INC irs + + REPEAT + IF FrmPkgSel.scrlInstallOpts[ii, 0].Picture = FrmPkgSel.pyes THEN INC irs + INC ii + UNTIL ii = FrmPkgSel.scrlInstallOpts.Rows.Count + i = i + irs - - NEXT - i = i + irs + + ' ' ' ' 'we will need to cycle through the arrays for th is for accuracy... + ' ' ' ' irs = 0 + ' ' ' ' FOR EACH cb IN MdlPkgSel.Bulks + ' ' ' ' IF cb.value = TRUE THEN INC irs + ' ' ' ' + ' ' ' ' + ' ' ' ' NEXT + ' ' ' ' i = i + irs ' now do the optional packages irs = 0 ' reset the count |