Add option to select boot device for legacy

pull/2/head
axtlos 3 years ago
parent ffe501c743
commit ee68605e7e
No known key found for this signature in database
GPG Key ID: A468AFD71DD51D4A

@ -1,2 +1,2 @@
[LOG] Selected disk: /dev/nvme0n1

@ -3,28 +3,28 @@ import 'package:jade_gui/functions/partitioning/auto.dart';
import 'package:jade_gui/functions/partitioning/manual.dart'; import 'package:jade_gui/functions/partitioning/manual.dart';
Widget partitioning( Widget partitioning(
disks, disks,
setState, setState,
setPartition, setPartition,
next, next,
setPartitionInfo, setPartitionInfo,
selectedPartition, selectedPartition,
partitionInfo, partitionInfo,
runningPart, runningPart,
setRunningPart, setRunningPart,
runningInfo, runningInfo,
setRunningInfo, setRunningInfo,
doManualPartitioning, doManualPartitioning,
setManual, setManual,
runningPartMan, runningPartMan,
runningInfoMan, runningInfoMan,
setRunningPartMan, setRunningPartMan,
setRunningInfoMan, setRunningInfoMan,
setPartitions, setPartitions,
partitions, partitions,
setPartitionMountPoint, setPartitionMountPoint,
setFilesystem, setFilesystem,
) { efi) {
if (doManualPartitioning) { if (doManualPartitioning) {
setRunningInfoMan(false); setRunningInfoMan(false);
return manualPartitioning( return manualPartitioning(
@ -38,6 +38,13 @@ Widget partitioning(
setManual, setManual,
next, next,
setFilesystem, setFilesystem,
efi,
selectedPartition,
disks,
setState,
runningPart,
setRunningPart,
setPartition,
); );
} else { } else {
setRunningInfo(false); setRunningInfo(false);

@ -2,9 +2,10 @@ import 'dart:async';
import 'dart:io'; import 'dart:io';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:jade_gui/classes/partition.dart'; import 'package:jade_gui/classes/partition.dart';
import 'package:jade_gui/functions/partitioning/auto.dart';
Widget partitionTemplate(partition, runningInfo, setRunningInfo, mountpoints, Widget partitionTemplate(partition, runningInfo, setRunningInfo, mountpoints,
setPartitionMountpoint, filesystems, setFilesystem) { setPartitionMountpoint, filesystems, setFilesystem, efi) {
if (partition().partition != "") { if (partition().partition != "") {
return Column( return Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly, mainAxisAlignment: MainAxisAlignment.spaceEvenly,
@ -99,7 +100,14 @@ Widget manualPartitioning(
setPartitionMountpoint, setPartitionMountpoint,
setManual, setManual,
next, next,
setFilesystem) { setFilesystem,
efi,
disk,
disks,
setDisks,
runningDisk,
setRunningDisk,
setPartition) {
var mountpoints = <String>[ var mountpoints = <String>[
"none", "none",
"/", "/",
@ -125,6 +133,7 @@ Widget manualPartitioning(
"minix", "minix",
"vfat" "vfat"
]; ];
getDisk(setDisks, runningDisk, setRunningDisk);
return Column( return Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
@ -159,21 +168,24 @@ Widget manualPartitioning(
child: SingleChildScrollView( child: SingleChildScrollView(
primary: false, primary: false,
child: Column( child: Column(
children: partitions children: [
.map<Widget>( Column(
(partition) => partitionTemplate( children: partitions
() { .map<Widget>(
return partition; (partition) => partitionTemplate(() {
}, return partition;
runningInfo, },
setRunningInfo, runningInfo,
mountpoints, setRunningInfo,
setPartitionMountpoint, mountpoints,
filesystems, setPartitionMountpoint,
setFilesystem, filesystems,
), setFilesystem,
) efi),
.toList(), )
.toList(),
),
],
), ),
), ),
), ),
@ -206,23 +218,56 @@ Widget manualPartitioning(
color: Color.fromARGB(255, 169, 0, 255), color: Color.fromARGB(255, 169, 0, 255),
), ),
), ),
const Text( Visibility(
'to format', visible: efi,
style: TextStyle( child: const Text(
fontSize: 20, 'Bootloader Device:',
fontWeight: FontWeight.bold, style: TextStyle(
color: Color.fromARGB(255, 169, 0, 255), fontSize: 20,
fontWeight: FontWeight.bold,
color: Color.fromARGB(255, 169, 0, 255),
),
), ),
), ),
const Text( const SizedBox(height: 6),
'and mount', Visibility(
style: TextStyle( visible: efi,
fontSize: 20, child: Container(
fontWeight: FontWeight.bold, padding: const EdgeInsets.fromLTRB(5, 2, 2, 5),
color: Color.fromARGB(255, 169, 0, 255), decoration: BoxDecoration(
borderRadius: BorderRadius.circular(5),
border: Border.all(color: Colors.black45),
color: const Color.fromARGB(255, 30, 30, 30),
),
child: DropdownButton<String>(
value: disk,
icon: const Icon(Icons.arrow_downward),
elevation: 16,
style: const TextStyle(color: Colors.deepPurple),
dropdownColor:
const Color.fromARGB(255, 23, 23, 23),
underline: Container(
height: 2,
color: Colors.deepPurpleAccent,
),
onChanged: (String? newValue) {
setPartition(newValue!);
print(disk);
},
items: disks
.split('\n')
.map<DropdownMenuItem<String>>((String value) {
return DropdownMenuItem<String>(
value: value,
child: Text(value,
style:
const TextStyle(color: Colors.white)),
);
}).toList(),
),
), ),
), ),
const SizedBox(height: 5), const SizedBox(height: 10),
const Image(image: AssetImage('assets/jade_logo.png')), const Image(image: AssetImage('assets/jade_logo.png')),
const SizedBox(height: 10), const SizedBox(height: 10),
Container( Container(

@ -580,83 +580,83 @@ class _JadeguiState extends State<Jadegui> {
width: logicWidth, width: logicWidth,
height: logicHeight, height: logicHeight,
child: partitioning( child: partitioning(
disks, disks,
(value) { (value) {
setState(() { setState(() {
disks = value; disks = value;
writeToLog("Disks:widget $disks"); writeToLog("Disks:widget $disks");
}); });
}, },
(value) { (value) {
setState(() { setState(() {
selectedDisk = value; selectedDisk = value;
writeToLog("Selected disk: $selectedDisk"); writeToLog("Selected disk: $selectedDisk");
}); });
}, },
() { () {
setState(() { setState(() {
_selectedIndex = _selectedIndex + 1; _selectedIndex = _selectedIndex + 1;
}); });
}, },
(value) { (value) {
setState(() { setState(() {
diskInfo = value; diskInfo = value;
writeToLog("Partition info: $diskInfo"); writeToLog("Partition info: $diskInfo");
}); });
}, },
selectedDisk, selectedDisk,
diskInfo, diskInfo,
runningPart, runningPart,
(value) { (value) {
setState(() { setState(() {
runningPart = value; runningPart = value;
}); });
}, },
runningInfo, runningInfo,
(value) { (value) {
setState(() { setState(() {
runningInfo = value; runningInfo = value;
}); });
}, },
manualPartitioning, manualPartitioning,
(value) { (value) {
setState(() { setState(() {
manualPartitioning = value; manualPartitioning = value;
}); });
}, },
runningInfoMan, runningInfoMan,
runningPartMan, runningPartMan,
(value) { (value) {
setState(() { setState(() {
runningPartMan = value; runningPartMan = value;
}); });
}, },
(value) { (value) {
setState(() { setState(() {
runningInfoMan = value; runningInfoMan = value;
}); });
}, },
(value) { (value) {
setState(() { setState(() {
partitions = value; partitions = value;
}); });
}, },
partitions, partitions,
(partition, value) { (partition, value) {
setState(() { setState(() {
partition.mountpoint = value; partition.mountpoint = value;
print("moutnpoint: ${partition.mountpoint}"); print("moutnpoint: ${partition.mountpoint}");
print("partition: ${partition.partition}"); print("partition: ${partition.partition}");
}); });
}, },
(partition, value) { (partition, value) {
setState(() { setState(() {
partition.filesystem = value; partition.filesystem = value;
print("filesystem: ${partition.filesystem}"); print("filesystem: ${partition.filesystem}");
print("partition: ${partition.partition}"); print("partition: ${partition.partition}");
}); });
}, },
), isEfi),
), ),
), ),
); );

Loading…
Cancel
Save