Skip to content

Commit

Permalink
Changes:
Browse files Browse the repository at this point in the history
	
	- cPackageInfo.class: created the cPackageInfo class. Contains the
		following variables:
		PkgName, PkgComment, PkgCategory, PkgPath, PkgSize, TotalSize

	- Global.module: added the PackageInfo[] object.

	- Utils.GetPkgInfo: created this sub to parse the SETUP.CONF
		and the makeslapt generated PACKAGES.TXT files in order to
		gather all the package data available in one go

	- Main.module: Gather package data at startup, as well as hard
		drive data.


Misc:
	
	With the package parser working, it will be trivial to install
	all the packages available in the auto-install mode.

	Almost time to start using a VM for testing ;)
  • Loading branch information
easuter committed Dec 26, 2007
1 parent f983ed0 commit 30f7bc3
Show file tree
Hide file tree
Showing 23 changed files with 295 additions and 169 deletions.
Binary file modified .icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 15 additions & 11 deletions .lang/.pot
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@ msgstr ""
msgid "Enter a value:"
msgstr ""

#: InputBox.class:205 frmDriveSelect.class:129 frmPartSelect.class:378
#: InputBox.class:205 frmDriveSelect.class:134 frmPartSelect.class:378
msgid "OK"
msgstr ""

#: InputBox.class:212 frmChooseFB.class:91 frmDriveSelect.class:136
#: InputBox.class:212 frmChooseFB.class:91 frmDriveSelect.class:141
#: frmPartSelect.class:385
msgid "Cancel"
msgstr ""

#: frmChoice.class:94
#: frmChoice.class:96
msgid ""
"<center><h3><b>You have 3 choices:</b></h3></center>\n"
"\n"
Expand All @@ -48,23 +48,23 @@ msgid ""
"</ul>\n"
msgstr ""

#: frmChoice.class:105
#: frmChoice.class:107
msgid "Choose install type"
msgstr ""

#: frmChoice.class:120
#: frmChoice.class:122
msgid "Install types"
msgstr ""

#: frmChoice.class:125
#: frmChoice.class:127
msgid "Full-automatic"
msgstr ""

#: frmChoice.class:131
#: frmChoice.class:133
msgid "Semi-automatic"
msgstr ""

#: frmChoice.class:137
#: frmChoice.class:139
msgid "Advanced"
msgstr ""

Expand Down Expand Up @@ -206,18 +206,22 @@ msgstr ""
msgid "Config 2"
msgstr ""

#: frmDriveSelect.class:110 frmPartSelect.class:353
#: frmDriveSelect.class:115 frmPartSelect.class:353
msgid "Drives"
msgstr ""

#: frmDriveSelect.class:118
#: frmDriveSelect.class:123
msgid "Click on a row to select..."
msgstr ""

#: frmGO.class:85
#: frmGO.class:120
msgid "Ready to install!"
msgstr ""

#: frmGO.class:135
msgid "Begin installation"
msgstr ""

#: frmMain.class:207
msgid "Welcome!"
msgstr ""
Expand Down
12 changes: 6 additions & 6 deletions .lang/frmChoice.pot
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,27 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"

#: frmChoice.class:94
#: frmChoice.class:96
msgid "<center><h3><b>You have 3 choices:</b></h3></center>\n\n<ul>\n<li><b><u>Full-automatic install:</u></b> Our easiest install yet; choose this option if you want to use your entire hard disk for VL. Your system will be automatically set up, partitions and all. <font color=\"#FF0000\">WARNING: this option will DELETE everything on your hard disk, or offer a choice if there are multiple disks.</font> There will of course be a confirmation dialog in case you selected this option by mistake.</li>\n<li><b><u>Semi-automatic install:</u></b> With this option, you manually partition your drives with gparted, but the rest of the setup will be pretty automatic.</li>\n<li><b><u>Advanced install:</u></b> For the technically savvy user that must do everything by hand. You can control most aspects of the install. However, there will be assisted options available all the way through, so this is a very flexible install.</li>\n</ul>\n"
msgstr ""

#: frmChoice.class:105
#: frmChoice.class:107
msgid "Choose install type"
msgstr ""

#: frmChoice.class:120
#: frmChoice.class:122
msgid "Install types"
msgstr ""

#: frmChoice.class:125
#: frmChoice.class:127
msgid "Full-automatic"
msgstr ""

#: frmChoice.class:131
#: frmChoice.class:133
msgid "Semi-automatic"
msgstr ""

#: frmChoice.class:137
#: frmChoice.class:139
msgid "Advanced"
msgstr ""

8 changes: 4 additions & 4 deletions .lang/frmDriveSelect.pot
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"

#: frmDriveSelect.class:110
#: frmDriveSelect.class:115
msgid "Drives"
msgstr ""

#: frmDriveSelect.class:118
#: frmDriveSelect.class:123
msgid "Click on a row to select..."
msgstr ""

#: frmDriveSelect.class:129
#: frmDriveSelect.class:134
msgid "OK"
msgstr ""

#: frmDriveSelect.class:136
#: frmDriveSelect.class:141
msgid "Cancel"
msgstr ""

6 changes: 5 additions & 1 deletion .lang/frmGO.pot
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"

#: frmGO.class:85
#: frmGO.class:120
msgid "Ready to install!"
msgstr ""

#: frmGO.class:135
msgid "Begin installation"
msgstr ""

3 changes: 2 additions & 1 deletion .project
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
Title=VL-gui-installer
Startup=Main
Icon=vl_logo_icon2.png
Version=0.0.260
Version=0.0.314
Library=gb.qt
Library=gb.qt.ext
TabSize=3
Translate=1
Language=en_US
ControlPublic=1
ExecPath=/home/easuter/vinstall-ng.gambas
2 changes: 1 addition & 1 deletion .settings
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Count=0

[FFind]
SearchIn="Project"
CaseSensitive=False
CaseSensitive=True
SearchWord=False
SearchComment=False
SearchString=True
Expand Down
87 changes: 33 additions & 54 deletions Functions.module
Original file line number Diff line number Diff line change
Expand Up @@ -329,48 +329,26 @@ ENDIF

END

PUBLIC FUNCTION CalcPaksSize(selected_paks AS String) AS Long
'Calculate the space required by the user's package selection
DIM arsPackages AS string[]
DIM hPackageConfig AS file
DIM sLine AS String
DIM sPackageRef AS String
DIM iSize AS Long

iSize = 0


'The config file must have the following layout for easy parsing
'(Package sizes must be in bytes!)
'
'Group: Base
' Package_0:veclinux/required/veclinux.tlz|185597952|Base System
' Package_1:veclinux/required/vlconfig.tlz|337945|Config Files
'Group: Dev

OPEN "/tmp/mnt/SOURCE/veclinux/vinstall-ng_packages.conf" FOR READ AS #hPackageConfig
WHILE NOT Eof(hPackageConfig)
LINE INPUT #hPackageConfig, sLine

'Parse the package configuration file based on whether a bulk or individual package selection was made
IF InStr(selected_paks, "all") > 0 THEN
IF InStr(sLine, "Package_") > 0 THEN
iSize = iSize + Val(Trim$(Mid$(Left$(sLine, RInStr(sLine, "|") - 1), InStr(sLine, "|") + 1)))
ENDIF
ELSE 'Parse individual package selection
arsPackages = Split(selected_paks, ";") 'selected_packs is semi-colon delimited when specific packages are selected
FOR EACH sPackageRef IN arsPackages
IF InStr(sLine, "Package_" & sPackageRef & ":") > 0 THEN
iSize = iSize + Val(Trim$(Mid$(Left$(sLine, RInStr(sLine, "|") - 1), InStr(sLine, "|") + 1)))
ENDIF
NEXT
ENDIF
WEND
CLOSE #hPackageConfig

RETURN iSize

END
' PUBLIC FUNCTION CalcPaksSize(selected_paks AS String) AS Long
' 'Calculate the space required by the user's package selection
' DIM arsPackages AS string[]
' DIM hPackageConfig AS file
' DIM sLine AS String
' DIM sPackageRef AS String
' DIM iSize AS Long
'
' iSize = 0
'
' OPEN Global.SOURCE & "veclinux/SETUP.CONF" FOR READ AS #hPackageConfig
' WHILE NOT Eof(hPackageConfig)
' LINE INPUT #hPackageConfig, sLine
'
'
' CLOSE #hPackageConfig
'
' RETURN iSize
'
' END

PUBLIC FUNCTION AutoRootSize(partmode AS Integer) AS Long
'Calculate the size of the theoretical root partition, for the automatic or free-space partitioning modes
Expand All @@ -391,29 +369,30 @@ RETURN iRootSize

END

PUBLIC FUNCTION EnoughSpace() AS Boolean
PUBLIC FUNCTION EnoughSpace(partmode AS Integer) AS Boolean
'Check whether the space destined to the package installation is enough (with a 150MB "safety" margin)
DIM iAvailableSpace AS Long

IF Global.enumPARTMODE = 0 THEN
IF partmode = 0 THEN
iAvailableSpace = AutoRootSize - CalcSwap(Global.SysMemory) - 157286400
IF iAvailableSpace > CalcPaksSize("all") THEN
RETURN TRUE
ELSE
RETURN FALSE
ENDIF
' IF iAvailableSpace > CalcPaksSize("all") THEN
' RETURN TRUE
' ELSE
' RETURN FALSE
' ENDIF
'Do the same for other partition modes
ELSE IF Global.enumPARTMODE = 1 THEN
ELSE IF Global.enumPARTMODE = 2 THEN
ELSE IF Global.enumPARTMODE = 3 THEN
ELSE IF Global.enumPARTMODE = 4 THEN
ELSE IF Global.enumPARTMODE = 5 THEN
ELSE IF partmode = 1 THEN
ELSE IF partmode = 2 THEN
ELSE IF partmode = 3 THEN
ELSE IF partmode = 4 THEN
ELSE IF partmode = 5 THEN
ELSE
Message.Error("Invalid partition mode: " & Global.enumPARTMODE)
ENDIF

END


' PUBLIC SUB BootMngrSet()
' ' This must determine:
' ' * Where the root partition is
Expand Down
17 changes: 13 additions & 4 deletions Global.class
Original file line number Diff line number Diff line change
Expand Up @@ -59,18 +59,27 @@ STATIC PUBLIC PARTboot AS String
STATIC PUBLIC PARTusr AS String
STATIC PUBLIC PARTshare AS String

STATIC PUBLIC PackageInfo AS NEW Object[]

' Process declarations:
STATIC PUBLIC tproc AS Process

'temp stuff 2 check out:
STATIC PUBLIC installDrive AS String
STATIC PUBLIC instDriveIndex AS Long

'select window exit status (set to "ok" or "canceled")
STATIC PUBLIC frmExitStatus AS String = ""

' Boot Manager variables
STATIC PUBLIC MBRSel AS String ' MBR to use in case there is more than 1
STATIC PUBLIC RootPart AS String ' Root Partition
STATIC PUBLIC KernelLoc AS String ' Kernel location in root partition
STATIC PUBLIC CONSOLENUM AS String ' The boot fb console #
' STATIC PUBLIC MBRSel AS String ' MBR to use in case there is more than 1
' STATIC PUBLIC RootPart AS String ' Root Partition
' STATIC PUBLIC KernelLoc AS String ' Kernel location in root partition
' STATIC PUBLIC CONSOLENUM AS String ' The boot fb console #

'Paths for the installer to find packages and related info files
STATIC PUBLIC SOURCE AS String = "/tmp/vinstall-source/" '4 debugging and testing
'STATIC PUBLIC SOURCE AS String = "/mnt/SOURCE/" 'the real thing



9 changes: 4 additions & 5 deletions Main.module
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,13 @@ Utils.GetSysMemory
' Initially no buttons being executed:
Global.flagBUTTExec = FALSE

'Gather hard-drive data and package information before showing the main window:
Utils.DrivePartInfo()
Utils.GetPkgInfo()

' Load the Main window:
frmMain.Load



' Make always on top:
'frmMain.TopOnly = TRUE

Expand Down Expand Up @@ -68,9 +70,6 @@ frmWelcome.Reparent(frmMain.pnlContainer, 0, 0)
' Start off with button 1 on Main window:
Global.prevForm = 1

'Gather hard-drive data before showing the interface
Utils.DrivePartInfo()

' And get the show on the road....:
frmMain.Show

Expand Down
Loading

0 comments on commit 30f7bc3

Please sign in to comment.