// This file is part of Deja-Vu. // // Deja-Vu 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 3 of the License, or // (at your option) any later version. // // Deja-Vu 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 Deja-Vu. If not, see . // use std::sync::{Arc, Mutex}; use serde::{Deserialize, Serialize}; use crate::system::{ disk::{Disk, PartitionTableType}, drivers, }; #[derive(Default, Debug, Copy, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)] pub enum Mode { // Core #[default] Home, Done, Failed, // Boot Diags DiagMenu, BootDiags, BootScan, BootSetup, InjectDrivers, SetBootMode, // Clone ScanDisks, InstallDrivers, SelectDisks, SelectTableType, Confirm, PreClone, Clone, SelectParts, PostClone, // WinPE PEMenu, } #[derive(Debug, Default)] pub struct CloneSettings { pub disk_index_dest: Option, pub disk_index_source: Option, pub disk_list: Arc>>, pub driver_list: Vec, pub part_index_boot: Option, pub part_index_os: Option, pub driver: Option, pub table_type: Option, } impl CloneSettings { pub fn new(disk_list: Arc>>) -> Self { CloneSettings { disk_list, ..Default::default() } } pub fn scan_drivers(&mut self) { self.driver_list = drivers::scan(); } }