Source

vlocity-vinstall-gambas / src / Step3.class

Full commit
' 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 rbGroup_Click()
  
    ' FMain.btNext.Enabled = TRUE
    ' FMain0.btNext.Enabled = TRUE
  
END


PUBLIC SUB Form_Open()

  ME.tlbanner.Text = "<h2>" & ("Disc Partitioning Options") & "</h2>"
  ME.tlbanner.Alignment = Align.Center
  ME.tlbanner.Alignment = Align.Normal
  ME.tlPartHelp.Text = ("Select the partitioning method you would like to use")
  ME.tlautopart.Text = ("Automatically resize your partitions and / or create the correct disk space for") & Space(1) & ClsGlobal.sDistroName
  ME.TextLabel1.Text = ("Install") & Space(1) & Main.SelectedSrc.Name & Space(1) & ("to existing partitions on my hard drive")
  FMain.btNext.Enabled = TRUE
  FMain0.btNext.Enabled = TRUE
  ME.rbCustomPart.Enabled = Exist("/usr/bin/gparted") OR Exist("/usr/sbin/gparted") OR Exist("/sbin/gparted")
  IF ME.rbCustomPart.Enabled = FALSE THEN ME.tlGparted.ForeColor = Color.Gray
  'ME.rbPrePartitioned.Value = TRUE
  ME.rbPrePartitioned.Enabled = Main.Partitions_In_Host.Count > 0
    IF ME.rbPrePartitioned.Enabled = TRUE THEN
      ME.rbPrePartitioned.Value = TRUE
    ELSE 
      ME.rbCustomPart.Value = TRUE
    END IF

END

PUBLIC FUNCTION GetNext() AS String

  MdlMain.ADVANCE_STATUS_TREE("Step1", "Step2")
  ' ClsGlobal.fRunningMainForm.listview1["Step1"].picture = MdlStartUp.pDone
  ' ClsGlobal.fRunningMainForm.listview1["Step2"].picture = MdlStartUp.pNow
  IF ME.rbAutoPart.Value = TRUE THEN 
    
    RETURN "Step3a"
  END IF
  IF ME.rbCustomPart.Value = TRUE THEN 
    
    RETURN "Step5"
  END IF
  IF ME.rbPrePartitioned.Value = TRUE THEN   
    
    RETURN "Step6"
  END IF
  
END

PUBLIC SUB SET_PARTITIONING_METHOD()
  
    IF ME.rbAutoPart.Value = TRUE THEN 
    ClsGlobal.bAutoPartition = TRUE
      PRINT " ---> Use built-in auto partition tools for partitioning"
    'RETURN "Step3a"
  END IF
  IF ME.rbCustomPart.Value = TRUE THEN 
    'embed gparted
      PRINT " ---> Embed GParted for partitioning"
    ClsGlobal.bAutoPartition = FALSE
    'RETURN "Step5"
  END IF
  IF ME.rbPrePartitioned.Value = TRUE THEN   
    ' Use existing partitions
    PRINT " ---> Install to pre-partitioned hard drive"
    ClsGlobal.bAutoPartition = FALSE
    'RETURN "Step6"
  END IF
  
END



PUBLIC SUB StartUp()
  
  ME.Resize(ClsGlobal.fRunningMainForm.Pnlstack.Width, ClsGlobal.fRunningMainForm.PnlStack.Height)
  ClsGlobal.fRunningMainForm.btNext.enabled = TRUE
  
  
END
PUBLIC SUB OnExit()
  
  
  ME.SET_PARTITIONING_METHOD()
  ClsGlobal.fRunningMainForm.btNext.enabled = FALSE
  
  
END