use crate::core::JustDate;
use super::query::*;
#[derive(Debug, Eq, PartialEq)]
pub enum State {
SearchIdeas(Query),
SearchJournals(Query),
SearchNotes(Query),
SearchTasks(Query),
HelpScreen,
}
#[derive(Debug, Eq, PartialEq)]
pub enum UpdateStatus {
Unchanged,
Changed,
StartIdeaEditor(String),
StartJournalEditor(JustDate),
StartNoteEditor(String, String),
StartTaskEditor(String),
Quit,
}
impl UpdateStatus {
pub fn copy(&self) -> Self {
match self {
UpdateStatus::Unchanged => UpdateStatus::Unchanged,
UpdateStatus::Changed => UpdateStatus::Changed,
UpdateStatus::StartIdeaEditor(name) => UpdateStatus::StartIdeaEditor(name.to_owned()),
UpdateStatus::StartJournalEditor(date) => UpdateStatus::StartJournalEditor(*date),
UpdateStatus::StartNoteEditor(category, name) => UpdateStatus::StartNoteEditor(category.to_owned(), name.to_owned()),
UpdateStatus::StartTaskEditor(project) => UpdateStatus::StartTaskEditor(project.to_owned()),
UpdateStatus::Quit => UpdateStatus::Quit,
}
}
}