86 lines
2.3 KiB
Rust
86 lines
2.3 KiB
Rust
// 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 <https://www.gnu.org/licenses/>.
|
|
//
|
|
use serde::{Deserialize, Serialize};
|
|
use strum::Display;
|
|
|
|
use crate::{
|
|
components::{left::SelectionType, popup::Type as PopupType},
|
|
line::DVLine,
|
|
state::Mode,
|
|
system::disk::Disk,
|
|
};
|
|
|
|
#[derive(Debug, Clone, PartialEq, Eq, Display, Serialize, Deserialize)]
|
|
pub enum DiagResult {
|
|
Pass,
|
|
Fail,
|
|
Warn,
|
|
}
|
|
|
|
#[derive(Debug, Clone, PartialEq, Eq, Display, Serialize, Deserialize)]
|
|
pub enum Action {
|
|
// App (Boot-Diags)
|
|
BootScan,
|
|
DiagLineStart { text: String },
|
|
DiagLineUpdate { result: DiagResult, text: String },
|
|
DiagLineEnd { text: String },
|
|
DiagMainMenu,
|
|
// App (Clone)
|
|
Highlight(usize),
|
|
InstallDriver,
|
|
Process,
|
|
ScanDisks,
|
|
Select(Option<usize>, Option<usize>), // indicies for (source, dest) etc
|
|
SelectRight(Option<usize>, Option<usize>), // indicies for right info pane
|
|
TaskGroupStart(String),
|
|
TasksComplete,
|
|
UpdateDiskList(Vec<Disk>),
|
|
UpdateFooter(String),
|
|
UpdateLeft(String, Vec<String>, Vec<String>, SelectionType), // (title, labels, items, select_type)
|
|
UpdateRight(Vec<Vec<DVLine>>, usize, Vec<Vec<DVLine>>), // (labels, start_index, items) - items before start are always shown
|
|
// App (PE-Menu)
|
|
OpenTerminal,
|
|
Restart,
|
|
Shutdown,
|
|
// App (Win-Installer)
|
|
FindWimBackups,
|
|
FindWimNetwork,
|
|
SetUserName(String),
|
|
// Screens
|
|
DismissPopup,
|
|
DisplayPopup(PopupType, String),
|
|
NextScreen,
|
|
PrevScreen,
|
|
SetMode(Mode),
|
|
// TUI
|
|
ClearScreen,
|
|
Error(String),
|
|
Help,
|
|
KeyDown,
|
|
KeyUp,
|
|
KeyLeft,
|
|
KeyRight,
|
|
KeyPageUp,
|
|
KeyPageDown,
|
|
KeyHome,
|
|
KeyEnd,
|
|
Quit,
|
|
Render,
|
|
Resize(u16, u16),
|
|
Resume,
|
|
Suspend,
|
|
Tick,
|
|
}
|