use super::*;
use mkutil::text::*;
#[derive(Debug, Clone, Default)]
#[cfg_attr(feature = "persistence", derive(Serialize, Deserialize))]
pub struct Offline {
pub pp_members_input: String,
pub pp_members: Vec<Project>,
}
impl Offline {
pub fn parse(&mut self, draft: &str) {
self.pp_members = ascii_from_comma_sep_singleline(draft, MAX_PROJECT_NAME_LENGTH)
.into_iter()
.map(|s| Project::Manual(s))
.collect::<Vec<Project>>();
self.pp_members_input = draft.to_owned();
}
#[cfg(feature = "gui")]
pub fn projects_ui(&mut self, ui: &mut egui::Ui) -> egui::Response {
ui.add(
egui::TextEdit::singleline(&mut self.pp_members_input)
.hint_text("Enter project codes, separated by commas"),
)
}
}