modularize date, database, and model code
- Add reusable date parsing, formatting, and recurrence modules - Split database import helpers and model types into focused modules - Expose the application as a library for the binary
This commit is contained in:
36
src/model/settings.rs
Normal file
36
src/model/settings.rs
Normal file
@@ -0,0 +1,36 @@
|
||||
use super::{DateOrder, DonePolicy, TrashPolicy, WeekStart};
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
pub struct DocumentSettings {
|
||||
pub description: String,
|
||||
pub backup_on_open: bool,
|
||||
pub trash_policy: TrashPolicy,
|
||||
pub done_policy: DonePolicy,
|
||||
pub automatic_filing: bool,
|
||||
pub date_order: DateOrder,
|
||||
pub week_start: WeekStart,
|
||||
pub default_time: String,
|
||||
pub morning_time: String,
|
||||
pub afternoon_time: String,
|
||||
pub evening_time: String,
|
||||
pub note_tab_width: u8,
|
||||
}
|
||||
|
||||
impl Default for DocumentSettings {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
description: String::new(),
|
||||
backup_on_open: false,
|
||||
trash_policy: TrashPolicy::OnDemand,
|
||||
done_policy: DonePolicy::Keep,
|
||||
automatic_filing: true,
|
||||
date_order: DateOrder::YearMonthDay,
|
||||
week_start: WeekStart::Monday,
|
||||
default_time: "09:00".into(),
|
||||
morning_time: "09:00".into(),
|
||||
afternoon_time: "13:00".into(),
|
||||
evening_time: "18:00".into(),
|
||||
note_tab_width: 4,
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user