// 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 serde::{Deserialize, Serialize};
use strum::Display;
use crate::{components::popup::Type, line::DVLine, state::Mode, system::disk::Disk};
#[derive(Debug, Clone, PartialEq, Eq, Display, Serialize, Deserialize)]
pub enum Action {
// App (Clone)
Highlight(usize),
InstallDriver,
Process,
ScanDisks,
Select(Option, Option), // indicies for (source, dest) etc
SelectRight(Option, Option), // indicies for right info pane
UpdateDiskList(Vec),
UpdateFooter(String),
UpdateLeft(String, Vec, Vec, usize), // (title, labels, items, select_num)
// NOTE: select_num should be set to 0, 1, or 2.
// 0: For repeating selections
// 1: For a single choice
// 2: For two selections (obviously)
UpdateRight(Vec>, usize, Vec>), // (labels, start_index, items) - items before start are always shown
// App (PEMenu)
OpenTerminal,
// Screens
DismissPopup,
DisplayPopup(Type, String),
NextScreen,
PrevScreen,
SetMode(Mode),
// TUI
ClearScreen,
Error(String),
Help,
KeyDown,
KeyUp,
Quit,
Render,
Resize(u16, u16),
Resume,
Suspend,
Tick,
}