Add preferences struct to main state

This commit is contained in:
Emilia Allison 2023-12-29 18:10:00 -05:00
parent ec37887c2f
commit 0101846b52
Signed by: emilia
GPG Key ID: 7A3F8997BFE894E0
1 changed files with 14 additions and 0 deletions

View File

@ -13,6 +13,17 @@ pub struct CurrentTransfer {
pub transfer: Transfer, pub transfer: Transfer,
} }
#[derive(PartialEq, Clone, Copy, Serialize, Deserialize)]
pub struct Preferences {
pub in_transfer_hashes: bool,
}
impl Default for Preferences {
fn default() -> Self {
Self { in_transfer_hashes: true }
}
}
#[derive(Default, PartialEq, Clone, Serialize, Deserialize)] #[derive(Default, PartialEq, Clone, Serialize, Deserialize)]
#[non_exhaustive] #[non_exhaustive]
pub struct MainState { pub struct MainState {
@ -22,6 +33,9 @@ pub struct MainState {
pub selected_source_plate: Uuid, pub selected_source_plate: Uuid,
pub selected_dest_plate: Uuid, pub selected_dest_plate: Uuid,
pub selected_transfer: Uuid, pub selected_transfer: Uuid,
#[serde(default)]
pub preferences: Preferences,
} }
impl Store for MainState { impl Store for MainState {