it (should) work

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

Binary file not shown.

@ -1,3 +1,2 @@
Disks:widget /dev/sda
/dev/nvme0n1
[LOG]

@ -17,6 +17,8 @@ class InstallPrefs {
final String hostname;
final bool ipv6;
final bool enableTimeshift;
final bool manualPartitioning;
final List<String> partitions;
InstallPrefs({
this.locale = const Location(),
@ -34,13 +36,16 @@ class InstallPrefs {
this.hostname = "",
this.ipv6 = false,
this.enableTimeshift = false,
this.manualPartitioning = false,
this.partitions = const [],
});
Map toJson() => {
"partition": {
"device": disk,
"mode": "auto",
"mode": manualPartitioning ? "manual" : "auto",
"efi": isEfi,
"partitions": partitions,
},
"bootloader": {
"type": bootloader,

@ -6,6 +6,6 @@ class Partition {
Partition({
this.partition = "",
this.mountpoint = "none",
this.filesystem = "",
this.filesystem = "don't format",
});
}

@ -11,34 +11,44 @@ test(setOutput, running, setRunning, config, writeToLog) async {
await File(filename).writeAsString(config);
writeToLog("Json config: $config");
var process =
await Process.start('pkexec', ['/opt/jade_gui/scripts/jadewrapper.sh']);
//await Process.start('/opt/jade_gui/scripts/jadeemu.sh', []);
//await Process.start('pkexec', ['/opt/jade_gui/scripts/jadewrapper.sh']);
await Process.start('/opt/jade_gui/scripts/jadeemu.sh', []);
process.stdout.transform(utf8.decoder).forEach(setOutput);
setRunning(true);
}
}
Widget install(
Location locale,
String keymap,
String layout,
String username,
String password,
bool enableSudo,
String rootPass,
Desktop desktop,
String disk,
bool isEfi,
String bootloader,
String hostname,
bool ipv6,
bool enableTimeshift,
setOutput,
output,
running,
setRunning,
writeToLog,
) {
Location locale,
String keymap,
String layout,
String username,
String password,
bool enableSudo,
String rootPass,
Desktop desktop,
String disk,
bool isEfi,
String bootloader,
String hostname,
bool ipv6,
bool enableTimeshift,
setOutput,
output,
running,
setRunning,
writeToLog,
partitions,
manual) {
List<String> partsParsed = <String>[];
for (var part in partitions) {
if (part.mountpoint != "none" && part.filesystem != "none") {
partsParsed
.add("${part.mountpoint}:${part.partition}:${part.filesystem}");
}
}
InstallPrefs prefs = InstallPrefs(
locale: locale,
keymap: keymap,
@ -49,6 +59,8 @@ Widget install(
rootPass: rootPass,
desktop: desktop,
disk: disk.replaceAll("/dev/", ""),
manualPartitioning: manual,
partitions: partsParsed,
isEfi: isEfi,
bootloader: bootloader,
bootloaderLocation: isEfi ? "/boot/efi" : disk,

@ -23,6 +23,7 @@ Widget partitioning(
setPartitions,
partitions,
setPartitionMountPoint,
setFilesystem,
) {
if (doManualPartitioning) {
setRunningInfoMan(false);
@ -36,6 +37,7 @@ Widget partitioning(
setPartitionMountPoint,
setManual,
next,
setFilesystem,
);
} else {
setRunningInfo(false);

@ -4,8 +4,7 @@ import 'package:flutter/material.dart';
import 'package:jade_gui/classes/partition.dart';
Widget partitionTemplate(partition, runningInfo, setRunningInfo, mountpoints,
setPartitionMountpoint) {
String mount = "none";
setPartitionMountpoint, filesystems, setFilesystem) {
if (partition().partition != "") {
return Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
@ -33,6 +32,7 @@ Widget partitionTemplate(partition, runningInfo, setRunningInfo, mountpoints,
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,
@ -40,14 +40,39 @@ Widget partitionTemplate(partition, runningInfo, setRunningInfo, mountpoints,
onChanged: (String? newValue) {
setPartitionMountpoint(
partition(), newValue == "" ? "none" : newValue);
mount = newValue == "" ? "none" : newValue!;
print(partition().mountpoint);
},
items:
mountpoints.map<DropdownMenuItem<String>>((String value) {
return DropdownMenuItem<String>(
value: value,
child: Text(value),
child: Text(value,
style: const TextStyle(color: Colors.white)),
);
}).toList(),
),
const SizedBox(width: 10),
DropdownButton<String>(
value: partition().filesystem,
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) {
setFilesystem(
partition(), newValue == "" ? "none" : newValue);
print(partition().filesystem);
},
items:
filesystems.map<DropdownMenuItem<String>>((String value) {
return DropdownMenuItem<String>(
value: value,
child: Text(value,
style: const TextStyle(color: Colors.white)),
);
}).toList(),
),
@ -61,8 +86,20 @@ Widget partitionTemplate(partition, runningInfo, setRunningInfo, mountpoints,
}
}
Widget manualPartitioning(partitions, setState, runningPart, setRunningPart,
runningInfo, setRunningInfo, setPartitionMountpoint, setManual, next) {
/*mkfs.bfs mkfs.cramfs mkfs.ext3 mkfs.fat mkfs.msdos mkfs.xfs
mkfs.btrfs mkfs.ext2 mkfs.ext4 mkfs.minix mkfs.vfat */
Widget manualPartitioning(
partitions,
setState,
runningPart,
setRunningPart,
runningInfo,
setRunningInfo,
setPartitionMountpoint,
setManual,
next,
setFilesystem) {
var mountpoints = <String>[
"none",
"/",
@ -74,6 +111,20 @@ Widget manualPartitioning(partitions, setState, runningPart, setRunningPart,
"/usr",
"/var"
];
var filesystems = <String>[
"don't format",
"bfs",
"cramfs",
"ext3",
"fat",
"msdos",
"xfs",
"btrfs",
"ext2",
"ext4",
"minix",
"vfat"
];
return Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
@ -118,6 +169,8 @@ Widget manualPartitioning(partitions, setState, runningPart, setRunningPart,
setRunningInfo,
mountpoints,
setPartitionMountpoint,
filesystems,
setFilesystem,
),
)
.toList(),
@ -146,25 +199,23 @@ Widget manualPartitioning(partitions, setState, runningPart, setRunningPart,
child: Column(
children: [
const Text(
'Currently chosen Disk: ',
'Select partitions',
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.bold,
color: Color.fromARGB(255, 169, 0, 255),
),
),
const SizedBox(height: 10),
const Text(
"selectedPartition",
'to format',
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.bold,
color: Color.fromARGB(255, 169, 0, 255),
),
),
const SizedBox(height: 5),
const Text(
'Size: diskInfo',
'and mount',
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.bold,

@ -62,6 +62,7 @@ Widget summary(
nextPage,
running,
setRunning,
partitions,
) {
getDiskType(setDiskType, disk, running, setRunning);
return Column(

@ -644,18 +644,18 @@ class _JadeguiState extends State<Jadegui> {
partitions,
(partition, value) {
setState(() {
/*for (int i = 0; i < partitions.length; i++) {
if (partitions[i].partition == partition.partition) {
partitions[i].mountpoint = value;
print("moutnpoint: ${partitions[i].mountpoint}");
print("partition: ${partitions[i].partition}");
}
}*/
partition.mountpoint = value;
print("moutnpoint: ${partition.mountpoint}");
print("partition: ${partition.partition}");
});
},
(partition, value) {
setState(() {
partition.filesystem = value;
print("filesystem: ${partition.filesystem}");
print("partition: ${partition.partition}");
});
},
),
),
),
@ -714,6 +714,7 @@ class _JadeguiState extends State<Jadegui> {
runningSum = true;
});
},
partitions,
),
),
),
@ -758,6 +759,8 @@ class _JadeguiState extends State<Jadegui> {
});
},
writeToLog,
partitions,
manualPartitioning,
),
),
),

Loading…
Cancel
Save