WIP: Add dest disk warnings
This commit is contained in:
parent
2abd6c6582
commit
843e46fc86
1 changed files with 24 additions and 1 deletions
|
|
@ -41,6 +41,7 @@ use crate::{
|
||||||
system::{
|
system::{
|
||||||
boot,
|
boot,
|
||||||
cpu::get_cpu_name,
|
cpu::get_cpu_name,
|
||||||
|
disk::PartitionTableType,
|
||||||
diskpart::build_dest_format_script,
|
diskpart::build_dest_format_script,
|
||||||
drivers::{self},
|
drivers::{self},
|
||||||
},
|
},
|
||||||
|
|
@ -572,7 +573,29 @@ fn get_right_selections(app: &App, prev_mode: Mode, cur_mode: Mode) -> Vec<Vec<D
|
||||||
if let Some(index) = app.get_dest_index() {
|
if let Some(index) = app.get_dest_index() {
|
||||||
let disk_list = app.clone.disk_list.lock().unwrap();
|
let disk_list = app.clone.disk_list.lock().unwrap();
|
||||||
if let Some(disk) = disk_list.get(index) {
|
if let Some(disk) = disk_list.get(index) {
|
||||||
selections.push(get_disk_description_right(&disk, "Dest"));
|
let mut disk_description = get_disk_description_right(&disk, "Dest");
|
||||||
|
|
||||||
|
// Add warning(s)
|
||||||
|
if app.clone.disk_index_dest.is_some() {
|
||||||
|
disk_description[0] // i.e. "Dest:"
|
||||||
|
.line_parts
|
||||||
|
.push(format!(" (WARNING: ALL DATA WILL BE DELETED!)"));
|
||||||
|
disk_description[0].line_colors.push(Color::Red);
|
||||||
|
};
|
||||||
|
if let Some(table_type) = &app.clone.table_type {
|
||||||
|
let type_str = match table_type {
|
||||||
|
PartitionTableType::Guid => "GPT",
|
||||||
|
PartitionTableType::Legacy => "MBR",
|
||||||
|
};
|
||||||
|
disk_description.insert(
|
||||||
|
1,
|
||||||
|
DVLine {
|
||||||
|
line_parts: vec![format!(" (Will be formatted {type_str}")],
|
||||||
|
line_colors: vec![Color::Yellow],
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
selections.push(disk_description)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue