From: <cod...@go...> - 2008-11-14 16:56:38
|
Author: M0...@gm... Date: Fri Nov 14 08:56:14 2008 New Revision: 294 Modified: branches/iVL/.lang/#project.pot branches/iVL/.lang/ClsGlobal.pot branches/iVL/.lang/MdlSetup.pot branches/iVL/.project branches/iVL/FrmLiloSetup.class branches/iVL/FrmLiloSetup.form branches/iVL/MdlLilo.module Log: Successfully generates lilo.conf Modified: branches/iVL/.lang/#project.pot ============================================================================== --- branches/iVL/.lang/#project.pot (original) +++ branches/iVL/.lang/#project.pot Fri Nov 14 08:56:14 2008 @@ -1,4 +1,4 @@ -# /root/gui-installer2/.project +# /home/vluser/devel/installer/.project # Generated by Gambas compiler # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. Modified: branches/iVL/.lang/ClsGlobal.pot ============================================================================== --- branches/iVL/.lang/ClsGlobal.pot (original) +++ branches/iVL/.lang/ClsGlobal.pot Fri Nov 14 08:56:14 2008 @@ -1,4 +1,4 @@ -# /root/gui-installer2/ClsGlobal.class +# /home/vluser/devel/installer/ClsGlobal.class # Generated by Gambas compiler # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. Modified: branches/iVL/.lang/MdlSetup.pot ============================================================================== --- branches/iVL/.lang/MdlSetup.pot (original) +++ branches/iVL/.lang/MdlSetup.pot Fri Nov 14 08:56:14 2008 @@ -1,4 +1,4 @@ -# /root/gui-installer2/MdlSetup.module +# /home/vluser/devel/installer/MdlSetup.module # Generated by Gambas compiler # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. Modified: branches/iVL/.project ============================================================================== --- branches/iVL/.project (original) +++ branches/iVL/.project Fri Nov 14 08:56:14 2008 @@ -1,7 +1,7 @@ # Gambas Project File 2.0 # Compiled with Gambas 2.9.0 Title=VectorLinux Installer -Startup=MdlCore +Startup=FrmLiloSetup Version=0.0.162 Library=gb.gtk Library=gb.form Modified: branches/iVL/FrmLiloSetup.class ============================================================================== --- branches/iVL/FrmLiloSetup.class (original) +++ branches/iVL/FrmLiloSetup.class Fri Nov 14 08:56:14 2008 @@ -76,3 +76,18 @@ END + + +PUBLIC SUB cbYNLilo_Click() + DIM bVal AS Boolean + IF LAST.value = TRUE THEN bval = FALSE + IF LAST.value = FALSE THEN bval = TRUE + WITH ME + .tsLIloTabs.Enabled = bval + .cbBootDefault.Enabled = bval + .cbLIloTarget.Enabled = bval + .cbVideoRes.Enabled = bval + .SpinBox1.Enabled = bval +END WITH +END + Modified: branches/iVL/FrmLiloSetup.form ============================================================================== --- branches/iVL/FrmLiloSetup.form (original) +++ branches/iVL/FrmLiloSetup.form Fri Nov 14 08:56:14 2008 @@ -19,7 +19,7 @@ { Panel1 Panel MoveScaled(2,8,84,4) Arrangement = Arrange.Horizontal - { CheckBox1 CheckBox + { cbYNLilo CheckBox MoveScaled(0,0,20,3) Expand = True Text = ("Do not install LILO") @@ -79,6 +79,7 @@ } { SpinBox1 SpinBox MoveScaled(15,0,7,3) + Value = 10 } { cbTimeOutSec TextLabel MoveScaled(24,0,8,3) Modified: branches/iVL/MdlLilo.module ============================================================================== --- branches/iVL/MdlLilo.module (original) +++ branches/iVL/MdlLilo.module Fri Nov 14 08:56:14 2008 @@ -28,15 +28,66 @@ +PUBLIC FUNCTION generate_lilo_dot_conf_header() AS String + DIM sHeader AS String + DIM sTarget, sVidMode, sDefOS AS String + DIM iTimeOut AS Integer + + sTarget = Trim(FrmLiloSetup.cbLIloTarget.Text) + IF InStr(sTarget, "MBR of") THEN + sTarget = Right(sTarget, Len(sTarget) - InStr(sTarget, "/") + 1) + ELSE IF sTarget = "Sector" THEN + sTarget = ClsPartSel.sRoot + ELSE IF sTarget = "Floppy" THEN + sTarget = "/dev/df0" + END IF + + 'iTimeOut = FrmLiloSetup.cbTimeOutSec.value * 10 + iTimeOut = FrmLiloSetup.SpinBox1.Value * 10 + + + sHeader = "# LILO Configuration file \n" & + "# Generated by the VectorLinux installer \n" & + "# \n" & + "# Begin lilo global configuration \n" & + "# \n" & + "boot = " & sTarget & "\n" & + "default = " & Trim(FrmLiloSetup.cbBootDefault.Text) & "\n" & + "prompt \n" & + "compact \n" & + "timeout = " & iTimeOut & "\n" & + "# \n" & + "# \n" & + "# Override dangerous defaults that require the partition table: \n" & + "change-rules \n" & + "reset \n" + IF Exist(ClsGlobal.sTargetMnt &/ "boot" &/ "bitmap" &/ "boot.bmp") THEN + sHeader = sHeader & "\n" & + "bitmap = /boot/bitmap/boot.bmp \n" + END IF + sHeader = sHeader & "\n" & + "vga = 791 \n" & + "# Begin listing OS Choices \n" + + + RETURN sHeader + +END + + + + PUBLIC SUB GENERATE_LILO_DOT_CONF() DIM tb AS TextBox DIM cb, chbox AS CheckBox - - DIM sSection, sClisection AS String +DIM sOsEntries AS String + DIM sSection, sClisection, sWinSection AS String DIM cbox AS ComboBox - DIM sLabel, sKernel, sInitrd, sAppend AS String - DIM sBootPath AS String + DIM sLabel, sKernel, sInitrd, sAppend, sTag AS String + DIM sBootPath, sHeader, sFile AS String + + FOR EACH cb IN arrLinuxIncCheckboxes @@ -65,13 +116,13 @@ "label = " & sLabel & "<br>" & "append = " & sAppend & "<br>" & "initrd = " & sBootPath &/ sInitrd & "<br>" & - "read only" + "read only" & "<br>" FOR EACH chbox IN ME.arrLinuxTextBoots IF chbox.Value = TRUE THEN IF chbox.tag = cb.Tag THEN sClisection = sSection sClisection = Replace(sClisection, "append = " & sAppend, "append = 2 splash=verbose vga=791") - sClisection = Replace(sClisection, "label = " & sLabel, "label = " & sLabel & "-cli") + sClisection = Replace(sClisection, "label = " & sLabel, "label = " & sLabel & "-cli") & "<br>" ELSE sClisection = "" END IF @@ -79,16 +130,39 @@ END IF NEXT + FOR EACH chbox IN ME.arrWinBootChecks + IF chbox.Value = TRUE THEN + FOR EACH tb IN ME.arrWinNameTxtBoxes + IF tb.Tag = chbox.tag THEN + sTag = Right(tb.Tag, Len(tb.Tag) - InStr(tb.Tag, "/") + 1) + + sWinSection = "other = " & sTag & "<br>" & 'Right(tb.tag, Len(tb.Tag) - InStr(tb.Tag, "/")) & "<br>" & + "label = " & tb.Text & "<br>" & + "table = " & Left(sTag, 8) & "<br>" + ELSE + sWinSection = "" + END IF + NEXT + END IF + NEXT + + - Message(sSection) - IF sClisection THEN Message(sClisection) + 'Message(sSection) + sOsEntries = sOsEntries & "<br>" & sSection & "<br>" & sClisection & "<br>" & sWinSection + + ' IF sClisection THEN Message(sClisection) 'sSection = "image=" & "boot" &/ tb.Text 'Message(sSection) END IF NEXT 'END IF 'NEXT + sHeader = ME.generate_lilo_dot_conf_header() + sFile = sHeader & "<br>" & sOsEntries + + ' write the file to the target END @@ -455,6 +529,9 @@ END + + + PUBLIC SUB OsNameTxtBox_KeyPress() DIM sOld AS String @@ -464,6 +541,8 @@ IF iKey <> -1 THEN FrmLiloSetup.cbBootDefault.Remove(iKey) + 'FrmLiloSetup.tsLIloTabs.Text = LAST.text + 'FrmLiloSetup.cbBootDefault.Add(LAST.text) 'IF FrmLiloSetup.cbBootDefault.Find(sOld) <> -1 THEN FrmLiloSetup.cbBootDefault.Remove @@ -479,7 +558,7 @@ IF ikey <> -1 THEN FrmLiloSetup.cbBootDefault.Remove(iKey) FrmLiloSetup.cbBootDefault.Add(LAST.text) - + FrmLiloSetup.tsLIloTabs.Text = LAST.text 'FrmLiloSetup.cbBootDefault.Add(LAST.text) |