From: <cod...@go...> - 2009-03-04 22:28:39
|
Author: M0...@gm... Date: Wed Mar 4 14:27:37 2009 New Revision: 509 Modified: branches/speedy/.lang/.pot branches/speedy/.lang/Step3a3.pot branches/speedy/MdlAutoPartition.module branches/speedy/Step3a3.class branches/speedy/Step3a3.form Log: Finished autopartition section for resizing existing partitions Modified: branches/speedy/.lang/.pot ============================================================================== --- branches/speedy/.lang/.pot (original) +++ branches/speedy/.lang/.pot Wed Mar 4 14:27:37 2009 @@ -30,16 +30,20 @@ msgid "Quit" msgstr "" -#: MdlAutoPartition.module:114 -msgid "Percentage of free space to use for VectorLinux" +#: MdlAutoPartition.module:112 +msgid "MB of free space" msgstr "" -#: MdlAutoPartition.module:179 -msgid "Select the location to which we will resize" +#: MdlAutoPartition.module:182 +msgid "Existing Data" msgstr "" -#: MdlAutoPartition.module:182 -msgid "Percentage of free space used for VectorLinux" +#: MdlAutoPartition.module:203 +msgid "Total space for VectorLinux" +msgstr "" + +#: MdlAutoPartition.module:294 +msgid "Select the location to which we will resize" msgstr "" #: MdlMain.module:33 @@ -591,6 +595,10 @@ #: Step3a3.class:22 msgid "Claim free space from existing partitions" +msgstr "" + +#: Step3a3.class:144 +msgid "Select which partition to resize in order to make room for VectorLinux" msgstr "" #: Step4.class:23 Modified: branches/speedy/.lang/Step3a3.pot ============================================================================== --- branches/speedy/.lang/Step3a3.pot (original) +++ branches/speedy/.lang/Step3a3.pot Wed Mar 4 14:27:37 2009 @@ -18,3 +18,7 @@ msgid "Claim free space from existing partitions" msgstr "" +#: Step3a3.class:144 +msgid "Select which partition to resize in order to make room for VectorLinux" +msgstr "" + Modified: branches/speedy/MdlAutoPartition.module ============================================================================== --- branches/speedy/MdlAutoPartition.module (original) +++ branches/speedy/MdlAutoPartition.module Wed Mar 4 14:27:37 2009 @@ -15,10 +15,15 @@ ' You should have received a copy of the GNU General Public License ' along with vinstall-ng. If not, see <http://www.gnu.org/licenses/>. PRIVATE sMountedList AS String -PRIVATE objProgs AS Object[] -PRIVATE objSliders AS Object[] -PRIVATE objTls AS Object[] -PRIVATE sResizableList AS String[] +PUBLIC objProgs AS Object[] +PUBLIC objSliders AS Object[] +PUBLIC objTls AS Object[] +PUBLIC sResizableList AS String[] +PUBLIC objContainters AS Object[] +PUBLIC objRbs AS Object[] +PRIVATE picDrive AS Picture +PRIVATE myProgs AS Object[] + PUBLIC SUB DISPLAY_PARTITIONS_WITH_FREE_SPACE(hostContainer AS Container) @@ -30,13 +35,22 @@ DIM rb AS RadioButton DIM pb AS ProgressBar DIM sl AS Slider - DIM hb AS HBox + DIM hb AS hpanel DIM tl AS TextLabel + DIM hr AS Separator + DIM picb AS PictureBox + DIM hobox AS Panel + objProgs = NEW Object[] objSliders = NEW Object[] sResizableList = NEW String[] objTls = NEW Object[] + objRbs = NEW Object[] + objContainters = NEW Object[] + myProgs = NEW Object[] + + picDrive = Picture.Load("images/hdd.png") SHELL "df -Th | grep \"^/dev/\" | cut -f 1 -d \' \'" TO sPreMountList '| tr -s \' \',\"\"" TO sPreMountList 'Message(sPreMountList) @@ -93,33 +107,82 @@ 'Message(sLineArr[0] & Space(1) & "fREE SPACE " & sLineArr[4] & " Mb") IF lFreeMB >= 10240 THEN ' only if free space is equal to or greater than 10GB sResizableList.Add(Trim(sResults[i])) - rb = NEW RadioButton(hostContainer) + rb = NEW RadioButton(hostContainer) AS "PartitionOptions" WITH rb - .Text = Trim(sLineArr[0]) & Space(1) & "-" & Trim(sLineArr[4]) + .Text = Trim(sLineArr[0]) & Space(1) & "-" & Space(1) & Trim(sLineArr[4]) & Space(1) & ("MB of free space") .tag = Trim(sLineArr[0]) .Height = 21 .Expand = TRUE END WITH - pb = NEW ProgressBar(hostContainer) AS "UseageBar" - WITH pb - .Tag = Trim(sLineArr[0]) + objRbs.Add(rb) + + + hb = NEW hpanel(hostContainer) + WITH hb + .Expand = TRUE + .Height = 72 + .Tag = Trim(sLineArr[0]) + .Visible = FALSE + END WITH + objContainters.Add(hb) + + + + hr = NEW Separator(hb) + WITH hr + .Expand = TRUE + .Height = 8 + .tag = Trim(sLineArr[0]) + END WITH + hobox = NEW Panel(hb) + WITH hobox .Height = 21 + '.Width = .Parent.Width / 2 + .Tag = Trim(sLineArr[0]) + .Expand = TRUE + .Arrangement = Arrange.Row + '.Padding = 4 + .BackColor = Color.LightBackground + END WITH + 'panels.Add(hobox) + tl = NEW TextLabel(hobox) + WITH tl + .BackColor = Color.SelectedBackground + .Expand = FALSE + .Text = ("Existing Data") + '.Width = .Parent.Width / 2 + '.Width = .Parent.Width - (((lUsedMB + (4 * 1024)) + (lFreeMB / 2) / lFreeMB) / 100) * 100 + .Height = .Parent.Height + .Alignment = Align.Center + .tag = .Parent.Tag + END WITH + myProgs.Add(tl) + tl = NEW TextLabel(hobox) + WITH tl + .Text = ClsGlobal.sDistroName + .Height = .Parent.Height + .Width = .Parent.Width * 0.5 .Expand = TRUE - .Value = lUsedMB / lTotalMB - .Label = TRUE + .BackColor = Color.LightBackground + .Alignment = Align.Center + .Tag = .Parent.Tag & "R" END WITH - objProgs.Add(pb) - tl = NEW TextLabel(hostContainer) + + tl = NEW TextLabel(hb) WITH tl - .Text = ("Percentage of free space to use for VectorLinux") + .Text = ("Total space for VectorLinux") & ":" & Space(1) .Height = 21 + '.Width = .Parent.Width * 0.5 .Alignment = Align.Left + .BackColor = Color.Transparent .Expand = TRUE .tag = Trim(sLineArr[0]) END WITH objTls.Add(tl) + + - sl = NEW Slider(hostContainer) AS "Slider" + sl = NEW Slider(hb) AS "Slider" WITH sl .Tag = Trim(sLineArr[0]) .Height = 21 @@ -133,6 +196,13 @@ '.Value = 50 END WITH objSliders.Add(sl) + hr = NEW Separator(hb) + WITH hr + .Expand = TRUE + .Height = 4 + .Tag = Trim(sLineArr[0]) + END WITH + ' hb = NEW HBox(hostContainer) ' WITH hb @@ -142,47 +212,77 @@ END IF NEXT - + + IF objContainters.count > 0 THEN objContainters[0].visible = TRUE + IF objSliders.Count > 0 THEN + objSliders[0].setfocus + END IF + + +END + +PUBLIC SUB Slider_click() + + + END PUBLIC SUB Slider_change() DIM pb AS ProgressBar - DIM fMin AS Long + DIM hb AS Panel + DIM fMin AS Float DIM fVal AS Float DIM i AS Integer DIM sMatch AS String DIM sLine AS String[] DIM lFree, lMin, ltotal, lval AS Long - DIM tl AS TextLabel + DIM tl, tlr AS TextLabel + DIM sAllocated AS Long - - FOR EACH pb IN objProgs - - IF pb.tag = LAST.tag THEN fMin = pb.Value * 100 + ' FOR EACH pb IN objProgs + ' + ' IF pb.tag = LAST.tag THEN fMin = pb.Value * 100 FOR i = 0 TO sResizableList.Max IF Left(Trim(sResizableList[i]), Len("/dev/hda1")) = LAST.tag THEN 'Message("fount match") sMatch = Trim(sResizableList[i]) sLine = Split(sMatch, " ") - lFree = Trim(sLine[4]) + lFree = sLine[4] lTotal = Trim(sLine[2]) lMin = lFree + (4 * 1024) lval = (lMin / lTotal) * 10 END IF NEXT - NEXT - + 'NEXT + fmin = (LAST.value / 100) + 'Message(fmin) + sAllocated = ltotal - (lTotal * fMin) LAST.tooltip = ("Select the location to which we will resize") & Space(1) & LAST.tag FOR EACH tl IN objTls IF tl.Tag = LAST.tag THEN - tl.Text = ("Percentage of free space used for VectorLinux") & Space(1) & (LAST.Value) & "%" + tl.Text = ("Total space for VectorLinux") & ":" & Space(1) & (100 - LAST.Value) & "%" & Space(1) & "-" & " ( " & sAllocated & " MB )" + END IF NEXT + FOR EACH tl IN myProgs + IF tl.tag = LAST.tag THEN + tl.Width = tl.Parent.Width * (LAST.value / 100) + + END IF + + NEXT + +IF sAllocated <= (4 * 1024) THEN + Message("We need at least 4GB for vectorlinux") + STOP EVENT + RETURN +END IF + IF LAST.Value < lval THEN LAST.Value = lval Message("This is the minimum we can resize this partition to.") @@ -190,6 +290,18 @@ RETURN END IF +END + +PUBLIC SUB PartitionOptions_Click() + + DIM hb AS HPanel + FOR EACH hb IN objContainters + IF hb.tag = LAST.tag THEN + hb.visible = TRUE + ELSE + hb.visible = FALSE + END IF + NEXT END Modified: branches/speedy/Step3a3.class ============================================================================== --- branches/speedy/Step3a3.class (original) +++ branches/speedy/Step3a3.class Wed Mar 4 14:27:37 2009 @@ -83,11 +83,18 @@ END PUBLIC SUB StartUp() - MdlAutoPartition.DISPLAY_PARTITIONS_WITH_FREE_SPACE(ME.HpnlChoices) + MdlAutoPartition.DISPLAY_PARTITIONS_WITH_FREE_SPACE(ME.ScrollView1) '(ME.ListContainer1) '(ME.ScrollView1) '(ME.HpnlChoices) END PUBLIC SUB OnExit() +END + +PUBLIC SUB Form_Resize() + + 'ME.HpnlChoices.Height = ME.ClientH - (ME.tlExp.top + ME.tlExp.Height + 12) + ME.ScrollView1.Height = ME.ClientH - (ME.tlExp.Top + ME.tlExp.Height + 12) + END Modified: branches/speedy/Step3a3.form ============================================================================== --- branches/speedy/Step3a3.form (original) +++ branches/speedy/Step3a3.form Wed Mar 4 14:27:37 2009 @@ -4,7 +4,6 @@ MoveScaled(0,0,75,51) Text = ("") Arrangement = Arrange.Row - Padding = 4 { HPanel1 HPanel MoveScaled(0,0,60,5) Expand = True @@ -19,11 +18,21 @@ } } { HBox1 HBox - MoveScaled(0,5,10,3) + MoveScaled(0,5,10,2) Expand = True } - { HpnlChoices HPanel - MoveScaled(0,8,72,25) + { tlExp TextLabel + MoveScaled(1,8,67,4) Expand = True + Text = ("Select which partition to resize in order to make room for VectorLinux") + } + { ScrollView1 ScrollView + MoveScaled(1,13,68,33) + Expand = True + Arrangement = Arrange.Row + Spacing = 2 + Padding = 4 + Border = False + ScrollBar = Scroll.Vertical } } |