|
From: <cod...@go...> - 2008-07-15 21:28:34
|
Author: M0E.lnx
Date: Tue Jul 15 14:26:59 2008
New Revision: 42
Added:
branches/iVL/FrmWinDrives.class
branches/iVL/FrmWinDrives.form
branches/iVL/MdlWinDrives.module
Modified:
branches/iVL/.lang/FMain.pot
branches/iVL/.lang/FrmDiskPart.pot
branches/iVL/.lang/FrmLicense.pot
branches/iVL/.lang/FrmPartScheme.pot
branches/iVL/.lang/FrmPartSel.pot
branches/iVL/.lang/FrmSelISO.pot
branches/iVL/.lang/MdlPartSel.pot
branches/iVL/.lang/MdlSetup.pot
branches/iVL/.project
branches/iVL/ClsPartSel.class
branches/iVL/FMain.class
branches/iVL/FrmDiskPart.class
branches/iVL/FrmLicense.class
branches/iVL/FrmPartScheme.class
branches/iVL/FrmPartScheme.form
branches/iVL/FrmPartSel.class
branches/iVL/FrmPartSel.form
branches/iVL/FrmSelISO.class
branches/iVL/MdlCore.module
branches/iVL/MdlPartSel.module
Log:
Reworked navigation algorithm. This eliminates the need for
separate "Next" buttons on child forms during the install.
Modified: branches/iVL/.lang/FMain.pot
==============================================================================
--- branches/iVL/.lang/FMain.pot (original)
+++ branches/iVL/.lang/FMain.pot Tue Jul 15 14:26:59 2008
@@ -14,23 +14,23 @@
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-#: FMain.class:176
+#: FMain.class:154
msgid "Process Overview"
msgstr ""
-#: FMain.class:189
+#: FMain.class:167
msgid "Vector Linux Install"
msgstr ""
-#: FMain.class:199
+#: FMain.class:177
msgid "Next"
msgstr ""
-#: FMain.class:205
+#: FMain.class:183
msgid "Back"
msgstr ""
-#: FMain.class:211
+#: FMain.class:189
msgid "Exit"
msgstr ""
Modified: branches/iVL/.lang/FrmDiskPart.pot
==============================================================================
--- branches/iVL/.lang/FrmDiskPart.pot (original)
+++ branches/iVL/.lang/FrmDiskPart.pot Tue Jul 15 14:26:59 2008
@@ -14,7 +14,7 @@
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-#: FrmDiskPart.class:96
+#: FrmDiskPart.class:100
msgid "Disk Partitioning:"
msgstr ""
Modified: branches/iVL/.lang/FrmLicense.pot
==============================================================================
--- branches/iVL/.lang/FrmLicense.pot (original)
+++ branches/iVL/.lang/FrmLicense.pot Tue Jul 15 14:26:59 2008
@@ -14,19 +14,19 @@
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-#: FrmLicense.class:100
+#: FrmLicense.class:99
msgid "LICENSE AGREEMENT"
msgstr ""
-#: FrmLicense.class:105
+#: FrmLicense.class:104
msgid "TextArea1"
msgstr ""
-#: FrmLicense.class:111
+#: FrmLicense.class:110
msgid "Yes, I Agree to the License Agreement"
msgstr ""
-#: FrmLicense.class:116
+#: FrmLicense.class:115
msgid "No, I Do Not Agree"
msgstr ""
Modified: branches/iVL/.lang/FrmPartScheme.pot
==============================================================================
--- branches/iVL/.lang/FrmPartScheme.pot (original)
+++ branches/iVL/.lang/FrmPartScheme.pot Tue Jul 15 14:26:59 2008
@@ -14,23 +14,19 @@
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-#: FrmPartScheme.class:103
+#: FrmPartScheme.class:97
msgid "Select your disk partition option"
msgstr ""
-#: FrmPartScheme.class:108
+#: FrmPartScheme.class:102
msgid "Use existing disk partitions"
msgstr ""
-#: FrmPartScheme.class:113
+#: FrmPartScheme.class:107
msgid "Modify my disk partitions to make room for new installation"
msgstr ""
-#: FrmPartScheme.class:118
+#: FrmPartScheme.class:112
msgid "TextLabel1"
-msgstr ""
-
-#: FrmPartScheme.class:123
-msgid "Next"
msgstr ""
Modified: branches/iVL/.lang/FrmPartSel.pot
==============================================================================
--- branches/iVL/.lang/FrmPartSel.pot (original)
+++ branches/iVL/.lang/FrmPartSel.pot Tue Jul 15 14:26:59 2008
@@ -1,4 +1,4 @@
-# /home/vluser/area-51/projects/new-inst/FrmPartSel.class
+# /home/moises/area-51/projects/installer/FrmPartSel.class
# Generated by Gambas compiler
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
@@ -14,19 +14,27 @@
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-#: FrmPartSel.class:120
+#: FrmPartSel.class:139
msgid "Define where the operating system will be
installed\n<br>\nLinux is a modular operating system. This means that
it has the ability to keep system and user data separately.<br> A
recommended setup would included a / (root), a /home, and a swap
partitions.\n<br>\nPlease select which partitions you would like to use
for your install"
msgstr ""
-#: FrmPartSel.class:128
+#: FrmPartSel.class:147
msgid "<b>Partition</b>"
msgstr ""
-#: FrmPartSel.class:134
+#: FrmPartSel.class:153
msgid "<b>Mount Point</b>"
msgstr ""
-#: FrmPartSel.class:140
+#: FrmPartSel.class:159
msgid "<b>File System</b>"
+msgstr ""
+
+#: FrmPartSel.class:166
+msgid "Check this box if you have a Windows installation on your
system or any other windows partition (FAT, FAT32, NTFS) that you want
auto-mounted as soon as your computer starts"
+msgstr ""
+
+#: FrmPartSel.class:167
+msgid "Detect and Setup Windows partitions for auto-mounting at boot"
msgstr ""
Modified: branches/iVL/.lang/FrmSelISO.pot
==============================================================================
--- branches/iVL/.lang/FrmSelISO.pot (original)
+++ branches/iVL/.lang/FrmSelISO.pot Tue Jul 15 14:26:59 2008
@@ -14,19 +14,19 @@
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-#: FrmSelISO.class:188
+#: FrmSelISO.class:189
msgid "No installable images found."
msgstr ""
-#: FrmSelISO.class:194
+#: FrmSelISO.class:195
msgid "Select which distribution to install from the list below"
msgstr ""
-#: FrmSelISO.class:199
+#: FrmSelISO.class:200
msgid "TextLabel1"
msgstr ""
-#: FrmSelISO.class:204
+#: FrmSelISO.class:205
msgid "Search Again"
msgstr ""
Modified: branches/iVL/.lang/MdlPartSel.pot
==============================================================================
--- branches/iVL/.lang/MdlPartSel.pot (original)
+++ branches/iVL/.lang/MdlPartSel.pot Tue Jul 15 14:26:59 2008
@@ -1,4 +1,4 @@
-# /home/vluser/area-51/projects/new-inst/MdlPartSel.module
+# /home/moises/area-51/projects/installer/MdlPartSel.module
# 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 Tue Jul 15 14:26:59 2008
@@ -1,4 +1,4 @@
-# /home/vluser/area-51/projects/new-inst/MdlSetup.module
+# /home/moises/area-51/projects/installer/MdlSetup.module
# Generated by Gambas compiler
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
Modified: branches/iVL/.project
==============================================================================
--- branches/iVL/.project (original)
+++ branches/iVL/.project Tue Jul 15 14:26:59 2008
@@ -1,6 +1,6 @@
# Gambas Project File 2.0
Title=VectorLinux Installer
-Startup=FrmPartSel
+Startup=MdlCore
Version=0.0.1
Library=gb.gtk
Library=gb.form
Modified: branches/iVL/ClsPartSel.class
==============================================================================
--- branches/iVL/ClsPartSel.class (original)
+++ branches/iVL/ClsPartSel.class Tue Jul 15 14:26:59 2008
@@ -31,3 +31,5 @@
STATIC PUBLIC fTmp AS String
STATIC PUBLIC sSwap AS String
+
+STATIC PUBLIC bDoWin AS Boolean
Modified: branches/iVL/FMain.class
==============================================================================
--- branches/iVL/FMain.class (original)
+++ branches/iVL/FMain.class Tue Jul 15 14:26:59 2008
@@ -20,6 +20,7 @@
PUBLIC sNextKey AS String
PUBLIC FrmCurr AS Form ' assigned when a form is opened
PUBLIC frmLast AS Form ' assigned when a form is hidden
+PUBLIC frmNext AS Form ' assined next form for the "next" button in fmain"
PUBLIC SUB _new()
@@ -82,23 +83,6 @@
PUBLIC SUB tvPlan_Select()
-
-'tvPlan[sLast].Picture = MdlCore.sDonePic
-'
-'
-'
-' IF tvPlan.Current.Picture <> MdlCore.sCatPic THEN
-'
-' IF sLast THEN
-' tvPlan[sLast].Picture = MdlCore.sDonePic
-' END IF
-'
-' tvPlan.Current.Picture = MdlCore.sNowPic
-
-
-
-'END IF
-
END
PUBLIC SUB tvPlan_MouseUp()
@@ -118,37 +102,31 @@
PUBLIC SUB btnext_Click()
- DIM FrmNext AS Form
- DIM sDev AS String
DIM sISONAME AS String
+ DIM sDev AS String
- 'DIM FrmCurr AS Form
-
- SELECT CASE ME.sNextKey
- CASE "Prep0"
- ' We'll need to mount the ISO or image and then display the form
+ SELECT CASE FrmCurr.Name ' very nice navigation algoritm
+ CASE "FrmSelISO"
sDev = Right(FrmSelISO.lstInstallableImg.Text,
Len(FrmSelISO.lstInstallableImg.Text) -
InStr(FrmSelISO.lstInstallableImg.text, "/") + 1)
IF InStr(FrmSelISO.lstInstallableImg.text, ".iso") OR
InStr(FrmSelISO.lstInstallableImg.text, ".ISO") THEN
- sISONAME = Left(FrmSelISO.lstInstallableImg.text,
InStr(FrmSelISO.lstInstallableImg.text, " ") - 1)
- MdlSetup.GO_WITH_SELECTED(sDev, sISONAME)
+ sISONAME = Left(FrmSelISO.lstInstallableImg.text,
InStr(FrmSelISO.lstInstallableImg.text, " ") - 1)
+ MdlSetup.GO_WITH_SELECTED(sDev, sISONAME)
ELSE
-
- MdlSetup.GO_WITH_SELECTED(sDev, "")
+ MdlSetup.GO_WITH_SELECTED(sDev, "")
+ END IF
+ CASE "FrmPartSel"
+ IF NOT ClsPartSel.sRoot OR ClsPartSel.sRoot = "" THEN
+ Message.Error("You must select a \"/\" partition. This is the
target where the system will install to")
+ STOP EVENT
END IF
- FrmNext = FrmPartScheme
- ME.tvPlan.Current.Picture = MdlCore.sDonePic
- ME.tvPlan["Prep1"].Selected = TRUE
- ME.tvPlan["Prep1"].Picture = MdlCore.sNowPic
-
- CASE "Prep1"
- FrmNext = FrmDiskPart
- ME.tvPlan.Current.Picture = MdlCore.sDonePic
- ME.tvPlan["Prep2"].Picture = MdlCore.sNowPic
- ME.tvPlan["Prep2"].Selected = TRUE
END SELECT
+
+
- FrmNext.Reparent(FrmCurr.Parent)
+ frmNext.Reparent(ME.pnlWinHost)
FrmCurr.Hide
- FrmNext.Show
+ frmLast = FrmCurr
+ frmNext.Show
+
END
Modified: branches/iVL/FrmDiskPart.class
==============================================================================
--- branches/iVL/FrmDiskPart.class (original)
+++ branches/iVL/FrmDiskPart.class Tue Jul 15 14:26:59 2008
@@ -20,6 +20,10 @@
PUBLIC SUB Form_Open()
+
+ FMain.FrmCurr = ME
+
+
MdlDiskPart.EMBED_GPARTED()
WITH ME
Modified: branches/iVL/FrmLicense.class
==============================================================================
--- branches/iVL/FrmLicense.class (original)
+++ branches/iVL/FrmLicense.class Tue Jul 15 14:26:59 2008
@@ -53,7 +53,6 @@
.Reparent(.parent)
.Resize(.Parent.Width, .Parent.Height)
.taLicense.Move(.tlbanner.Left, .tlbanner.top + .tlbanner.Height +
4, .ClientWidth - 20, .ClientHeight - .tlbanner.Height - (.rbNo.Height
* 4))
- '.taLicense.Resize(.ClientWidth - (.ClientWidth /
20), .ClientHeight - .tlbanner.Height - (.rbNo.Height * 4))
.rbNo.Move(.taLicense.Left, .taLicense.Top + (.taLicense.Height +
4), MdlObjSizer.get_object_width(.rbNo.Text) + 24)
.rbYes.Move(.rbNo.Left, .rbNo.Top + (.rbNo.Height + 4),
MdlObjSizer.get_object_width(.rbYes.Text) + 24)
END WITH
Modified: branches/iVL/FrmPartScheme.class
==============================================================================
--- branches/iVL/FrmPartScheme.class (original)
+++ branches/iVL/FrmPartScheme.class Tue Jul 15 14:26:59 2008
@@ -24,22 +24,25 @@
.rbUseExisting.Move(.tlBanner.Left, .tlBanner.Top
+ .tlBanner.Height + 8)
.rbEditPartitions.Move(.rbUseExisting.Left, .rbUseExisting.Top
+ .rbUseExisting.Height + 4)
.tlChoiceExp.Move(.rbEditPartitions.Left, .rbEditPartitions.top
+ .rbEditPartitions.Height + 16, .tlBanner.Width - 10)
- .btNext.Move(.tlBanner.Left + .tlBanner.Width - .btNext.Width -
8, .ClientHeight - (.btNext.Height * 2))
+
END WITH
END
PUBLIC SUB Form_Open()
-
+
+FMain.FrmCurr = ME
+FMain.tvPlan["Prep1"].Selected = TRUE
+FMain.tvPlan["Prep1"].Picture = MdlCore.sNowPic
+FMain.tvPlan["Prep0"].Picture = MdlCore.sDonePic
+'FMain.frmNext = FrmPartSel
WITH ME
.rbEditPartitions.Width =
MdlObjSizer.get_object_width(.rbEditPartitions.Text) + 24
.rbUseExisting.Width =
MdlObjSizer.get_object_width(.rbUseExisting.Text) + 24
- .btNext.Width = MdlObjSizer.get_object_width(.btNext.Text) + 36
END WITH
ME.rbEditPartitions.Value = TRUE
-FMain.btnext.Enabled = FALSE
-FMain.btnext.ForeColor = Color.Gray
+
END
PUBLIC SUB rbUseExisting_Click()
@@ -48,6 +51,7 @@
"Select this option if you already have a linux installation that
you wish to overwrite or if a linux partition scheme exists in your " &
"Hard disk. <b>This option will overwrite whatever is in those
partitions</b><br><br>" &
"<i>Use this option if you already prepared your partitions using
the VectorLinux installer</i>"
+ FMain.frmNext = FrmPartSel
END
@@ -56,6 +60,7 @@
ME.tlChoiceExp.Text = "<b>" & rbEditPartitions.Text & "</b><br><br>" &
"Select this option is you wish to create, more or resize partitions
in order to make room for your new VectorLinux " &
"installation. This option is the safest choice if you have other
existing installations that you wish to keep."
+ FMain.frmNext = FrmDiskPart
END
@@ -65,19 +70,9 @@
END
-PUBLIC SUB btNext_Click()
- IF ME.rbEditPartitions.Value = TRUE THEN
- ' fire up the gparted window
- FrmDiskPart.Reparent(ME.Parent)
- ME.Hide
- FrmDiskPart.Show
- ELSE IF ME.rbUseExisting.Value THEN
- ' Fire wizard to set partitions
- ' This will also be used after the user has already partitioned
the disk
- FrmPartSel.Reparent(ME.Parent)
- ME.Hide
- FrmPartSel.Show
- END IF
+PUBLIC SUB Form_Hide()
+
+
END
Modified: branches/iVL/FrmPartScheme.form
==============================================================================
--- branches/iVL/FrmPartScheme.form (original)
+++ branches/iVL/FrmPartScheme.form Tue Jul 15 14:26:59 2008
@@ -19,9 +19,4 @@
MoveScaled(1,17,76,23)
Text = ("TextLabel1")
}
- { btNext Button
- MoveScaled(70,44,9,3)
- Text = ("Next")
- Picture = Picture["icon:/16/right"]
- }
}
Modified: branches/iVL/FrmPartSel.class
==============================================================================
--- branches/iVL/FrmPartSel.class (original)
+++ branches/iVL/FrmPartSel.class Tue Jul 15 14:26:59 2008
@@ -36,8 +36,10 @@
WITH ME
.tlBanner.Width = .ClientWidth - 16
-
-
+ .scrollPartitions.Width = .tlBanner.Width
+ .scrollPartitions.Height = .ClientHeight - (.tlBanner.Height
+ .cbDoWin.Height + 32)
+ .cbDoWin.Move(.scrollPartitions.Left, .ClientHeight
- .cbDoWin.Height - 8)
+
END WITH
@@ -45,31 +47,34 @@
PUBLIC SUB Form_Open()
+
+ FMain.FrmCurr = ME
+
ME.tlBanner.Adjust
-
+ ME.cbDoWin.Width = MdlObjSizer.get_object_width(cbDoWin.text) + 24
MdlPartSel.DISPLAY_PARTITION_OPTIONS
-
+ ME.cbDoWin.Value = FALSE
END
PUBLIC SUB Form_Hide()
-
- ME.ANALYZE_PARTITION_SETUP()
+
END
-PUBLIC SUB ANALYZE_PARTITION_SETUP()
+PUBLIC FUNCTION ANALYZE_PARTITION_SETUP() AS Integer
IF NOT sRootAddr THEN
Message.Error("You must select at least one partition for \"/\"
This is there the system will be installed to")
- STOP EVENT
+ RETURN 1
ELSE IF NOT sRootFrmt THEN
Message.Error("You must select which file system type to use with
your \"/\" partition.")
- STOP EVENT
+ RETURN 1
ELSE
ClsPartSel.sRoot = sRootAddr
ClsPartSel.fRoot = sRootFrmt
+ RETURN 0
END IF
IF sHomeAddr THEN
@@ -97,4 +102,17 @@
END
+
+
+PUBLIC SUB cbDoWin_Click()
+
+ ClsPartSel.bDoWin = cbDoWin.Value
+ IF ClsPartSel.bDoWin = TRUE THEN
+ FMain.frmNext = FrmWinDrives
+ ELSE
+ ' Move towards installing packages
+ END IF
+
+
+END
Modified: branches/iVL/FrmPartSel.form
==============================================================================
--- branches/iVL/FrmPartSel.form (original)
+++ branches/iVL/FrmPartSel.form Tue Jul 15 14:26:59 2008
@@ -8,7 +8,7 @@
Text = ("Define where the operating system will be
installed\n<br>\nLinux is a modular operating system. This means that
it has the ability to keep system and user data separately.<br> A
recommended setup would included a / (root), a /home, and a swap
partitions.\n<br>\nPlease select which partitions you would like to use
for your install")
}
{ scrollPartitions ScrollView
- MoveScaled(1,16,69,36)
+ MoveScaled(1,16,69,33)
{ tlPartRow TextLabel
MoveScaled(1,1,14,3)
Text = ("<b>Partition</b>")
@@ -24,5 +24,10 @@
Text = ("<b>File System</b>")
Alignment = Align.Left
}
+ }
+ { cbDoWin CheckBox
+ MoveScaled(1,50,57,3)
+ ToolTip = ("Check this box if you have a Windows installation on
your system or any other windows partition (FAT, FAT32, NTFS) that you
want auto-mounted as soon as your computer starts")
+ Text = ("Detect and Setup Windows partitions for auto-mounting at boot")
}
}
Modified: branches/iVL/FrmSelISO.class
==============================================================================
--- branches/iVL/FrmSelISO.class (original)
+++ branches/iVL/FrmSelISO.class Tue Jul 15 14:26:59 2008
@@ -52,6 +52,7 @@
ME.Height = ME.Parent.Height
FMain.sNextKey = "Prep0"
FMain.FrmCurr = ME
+ FMain.frmNext = FrmPartScheme
Added: branches/iVL/FrmWinDrives.class
==============================================================================
--- (empty file)
+++ branches/iVL/FrmWinDrives.class Tue Jul 15 14:26:59 2008
@@ -0,0 +1,23 @@
+' Gambas class file
+
+' This file is part of vinstall-ng
+
+' vinstall-ng 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.
+
+' vinstall-ng 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 vinstall-ng. If not, see <http://www.gnu.org/licenses/>.
+
+
+PUBLIC SUB Form_Open()
+
+ MdlWinDrives.LIST_WIN_PARTITIONS
+
+END
Added: branches/iVL/FrmWinDrives.form
==============================================================================
--- (empty file)
+++ branches/iVL/FrmWinDrives.form Tue Jul 15 14:26:59 2008
@@ -0,0 +1,13 @@
+# Gambas Form File 2.0
+
+{ Form Form
+ MoveScaled(0,0,67,56)
+ Text = ("")
+ { tlBanner TextLabel
+ MoveScaled(1,2,65,5)
+ Text = ("Select the windows partitions you would like to mount
during boot")
+ }
+ { svWinDrives ScrollView
+ MoveScaled(1,8,64,39)
+ }
+}
Modified: branches/iVL/MdlCore.module
==============================================================================
--- branches/iVL/MdlCore.module (original)
+++ branches/iVL/MdlCore.module Tue Jul 15 14:26:59 2008
@@ -329,14 +329,7 @@
"/home " & iMinHome & "<br>" &
"swap " & iMinSwap
END WITH
- ' PRINT sDistro
- ' PRINT sVer
- ' PRINT sBuildDate
- ' PRINT iMinHome
- ' PRINT iMinRoot
- ' PRINT iMinSwap
- ' PRINT ClsGlobal.sBulkList
- ' PRINT ClsGlobal.sConfPkg
+
ELSE
'File not found
Message.Error("Setup is unable to find SETUP.CONF in your install
media. This could be symptoms of a bad burn or a bad ISO")
Modified: branches/iVL/MdlPartSel.module
==============================================================================
--- branches/iVL/MdlPartSel.module (original)
+++ branches/iVL/MdlPartSel.module Tue Jul 15 14:26:59 2008
@@ -184,76 +184,7 @@
'Message.Info("Swap total = " & iswapsize)
END IF
-
- ' now, do the WIN partitions
- ' MOVE THESE PARTITIONS TO A DIFFERENT WINDOW.
- ' THESE ARE ONLY NEEDED FOR FSTAB
- sDump1 = ""
- 'FIX THIS COMMAND.... MAY NOT WORK OR NEED MORE ACCURATE DETECTION
- SHELL "export PATH=$PATH:/sbin && sudo probepart | grep -i \" FAT\" |
cut -f 1 -d \' \'" TO sDump1
- IF sDump1 THEN
- sDump1 = Trim(sDump1)
- y = y + tl.Height * 2 + 4
- ' create a new text label just to label the separation between
windows and linux partitions
- tl = NEW TextLabel(FrmPartSel.scrollPartitions) AS "Separator"
- WITH tl
- .Text = "<b>Windows Partitions</b>"
- .Height = 27
- .Width = MdlObjSizer.get_object_width(.Text)
- .x = FrmPartSel.tlPartRow2.Left
- .y = y
- END WITH
- END IF
- IF InStr(sDump1, gb.NewLine) THEN ' more than one partition found
- sPartList = Split(sDump1, gb.NewLine)
- FOR i = 0 TO sPartList.Count - 1
- sPart = Right(sPartList[i], Len(sPartList[i]) - RInStr(sPartList[i], "/"))
-
- SHELL "sudo mkdir /mnt" &/ spart & " && sudo mount " &
Trim(sPartList[i]) & Space(1) & "/mnt" &/ sPart WAIT
- ' get the size using df -h | grep sPart and some sed
- ' will embed some bash, but should probabbly be fixed
- SHELL "export " & sPart & "=$(df -h | grep " & sPart
& ") && echo $" & sPart & " | cut -f 2 -d \' \'" TO sSize
- SHELL "sudo umount /mnt" &/ spart
- SHELL "sudo rm -rf /mnt" &/ spart
-
- tl = NEW TextLabel(FrmPartSel.scrollPartitions) AS "WinPartitions"
- WITH tl
- .Width = tl.Width
- .Text = sPart & " ( " & sSize & " )"
- .Tag = sPartList[i]
- .Height = 27
- .x = FrmPartSel.tlPartRow.Left
- .y = y
- END WITH
- y = y + tl.Height + 4
-
- NEXT
- ELSE ' only one win partition found
-
- sPart = Right(sDump1, Len(sDump1) - RInStr(sDump1, "/"))
- SHELL "sudo mkdir /mnt" &/ spart & " && sudo mount " &
Trim(sDump1) & Space(1) & "/mnt" &/ sPart WAIT
- SHELL "export " & sPart & "=$(df -h | grep " & sPart & ") &&
echo $" & sPart & " | cut -f 2 -d \' \'" TO sSize
-
-
-
- y = y + tl.Height + 4
- tl = NEW TextLabel(FrmPartSel.scrollPartitions) AS "WinPartitions"
- WITH tl
- .Width = lbwidth
- .Text = sDump1 & " ( " & sSize & " )"
- .tag = sDump1
- .Height = 27
- .x = FrmPartSel.tlPartRow.Left
- .y = y
-
- END WITH
- SHELL "sudo umount /mnt" &/ spart WAIT
- SHELL "sudo rm -rf /mnt" &/ spart WAIT
- END IF
-
-
-
-
+
END
@@ -323,7 +254,7 @@
NEXT
END IF
- PRINT "format " & LAST.tag & " as " & LAST.text
+ 'PRINT "format " & LAST.tag & " as " & LAST.text
ME.SET_PARTITION_FORMAT(LAST.tag, LAST.text)
Added: branches/iVL/MdlWinDrives.module
==============================================================================
--- (empty file)
+++ branches/iVL/MdlWinDrives.module Tue Jul 15 14:26:59 2008
@@ -0,0 +1,155 @@
+' Gambas module file
+
+
+' This file is part of vinstall-ng
+
+' vinstall-ng 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.
+
+' vinstall-ng 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 vinstall-ng. If not, see <http://www.gnu.org/licenses/>.
+
+
+PUBLIC vObj AS Object[]
+PUBLIC SUB LIST_WIN_PARTITIONS()
+DIM tl AS TextLabel
+DIM cb AS ComboBox
+DIM y AS Integer
+DIM x AS Integer
+DIM i AS Integer
+DIM sDump1 AS String
+DIM sPartList AS String[]
+DIM sPart AS String
+DIM sSize AS String
+DIM lbwidth AS Integer
+
+x = FrmWinDrives.svWinDrives.Left + 4
+y = FrmWinDrives.svWinDrives.Top + 8
+
+
+ ' now, do the WIN partitions
+ ' MOVE THESE PARTITIONS TO A DIFFERENT WINDOW.
+ ' THESE ARE ONLY NEEDED FOR FSTAB
+ sDump1 = ""
+ 'FIX THIS COMMAND.... MAY NOT WORK OR NEED MORE ACCURATE DETECTION
+ SHELL "export PATH=$PATH:/sbin && sudo probepart | grep -e \"
*FAT32$\" | cut -f 1 -d \' \'" TO sDump1
+ File.Save(Temp("fat32"), Trim(sDump1))
+ sDump1 = ""
+ SHELL "export PATH=$PATH:/sbin && sudo probepart | grep -e \"
*FAT$\" | cut -f 1 -d \' \'" TO sDump1
+ File.Save(Temp("fat"), Trim(sDump1))
+ sDump1 = ""
+ SHELL "export PATH=$PATH:/sbin && sudo probepart | grep -e \"
*NTFS$\" | cut -f 1 -d \' \'" TO sDump1
+ File.Save(Temp("ntfs"), Trim(sDump1))
+ sDump1 = ""
+ sDump1 = File.Load(Temp("fat32")) & gb.NewLine &
+ File.Load(Temp("fat")) & gb.NewLine &
+ File.Load(Temp("ntfs")) & gb.NewLine
+ sDump1 = Trim(sDump1)
+
+
+ IF sDump1 <> "" THEN
+ sDump1 = Trim(sDump1)
+ 'y = y + tl.Height * 2 + 4
+ ' create a new text label just to label the separation between
windows and linux partitions
+ tl = NEW TextLabel(FrmWinDrives.svWinDrives) AS "Separator"
+ WITH tl
+ .Text = "<b>Windows Partitions</b>"
+ .Height = 27
+ .Width = MdlObjSizer.get_object_width(.Text)
+ .x = x
+ .y = y
+ END WITH
+
+ 'END IF
+ IF InStr(sDump1, gb.NewLine) THEN ' more than one partition found
+ sPartList = Split(sDump1, gb.NewLine)
+ FOR i = 0 TO sPartList.Count - 1
+ sPart = Right(sPartList[i], Len(sPartList[i]) - RInStr(sPartList[i], "/"))
+
+ SHELL "sudo mkdir /mnt" &/ spart & " && sudo mount " &
Trim(sPartList[i]) & Space(1) & "/mnt" &/ sPart WAIT
+ ' get the size using df -h | grep sPart and some sed
+ ' will embed some bash, but should probabbly be fixed
+ SHELL "export " & sPart & "=$(df -h | grep " & sPart
& ") && echo $" & sPart & " | cut -f 2 -d \' \'" TO sSize
+ SHELL "sudo umount /mnt" &/ spart
+ SHELL "sudo rm -rf /mnt" &/ spart
+
+ tl = NEW TextLabel(FrmWinDrives.svWinDrives) AS "WinPartitions"
+ WITH tl
+ .Width = tl.Width
+ .Text = sPart & " ( " & sSize & " )"
+ .Tag = sPartList[i]
+ .Height = 27
+ .x = FrmPartSel.tlPartRow.Left
+ .y = y
+ IF .Width > lbwidth THEN
+ lbwidth = .Width
+ END IF
+ .Width = lbwidth
+ END WITH
+ ME.vObj.Add(tl)
+
+ ' now create the combobox to select the mount point
+ cb = NEW ComboBox
+ WITH cb
+ .Width = tl.Width
+ .Tag = sPartList[i]
+ .Height = 27
+ .x = tl.Left + tl.Width + 8
+ .y = tl.Top
+ .Width = lbwidth
+ .Add("/mnt" &/ sPart)
+ END WITH
+
+ y = y + tl.Height + 4
+
+
+
+ NEXT
+
+
+
+
+ ELSE ' only one win partition found
+
+ sPart = Right(sDump1, Len(sDump1) - RInStr(sDump1, "/"))
+ SHELL "sudo mkdir /mnt" &/ spart & " && sudo mount " &
Trim(sDump1) & Space(1) & "/mnt" &/ sPart WAIT
+ SHELL "export " & sPart & "=$(df -h | grep " & sPart & ") &&
echo $" & sPart & " | cut -f 2 -d \' \'" TO sSize
+
+
+
+ 'y = y + tl.Height + 4
+ tl = NEW TextLabel(FrmWinDrives.svWinDrives) AS "WinPartitions"
+ WITH tl
+ .Width = lbwidth
+ .Text = sDump1 & " ( " & sSize & " )"
+ .tag = sDump1
+ .Height = 27
+ .x = FrmPartSel.tlPartRow.Left
+ .y = y
+
+ END WITH
+ SHELL "sudo umount /mnt" &/ spart WAIT
+ SHELL "sudo rm -rf /mnt" &/ spart WAIT
+ END IF
+ ELSE
+ ' no widnows partitions found
+ tl = NEW TextLabel(FrmWinDrives.svWinDrives)
+ WITH tl
+ .Text = "<b>No Windows partitions detected</b>"
+ .Width = MdlObjSizer.get_object_width(.Text)
+ .Height = 27
+ .x = y
+ .y = y
+ END WITH
+ END IF
+END
+
+
+
|