feat: sync notebooks between devices via a synced folder (Issue #49, stage 1)
- Storage location setting: the notebooks can be moved into a folder kept in sync by Nextcloud, Google Drive, Syncthing etc. (subfolder `ink-notes`); existing notebooks are copied there if it is still empty, the originals stay. - Changes from other devices are taken over while everything local is saved: changed pages are reloaded, new/removed/reordered pages and titles come in through the manifest. A page file still being synced is retried later instead of being set aside as damaged. - Conflict copies made by sync clients become pages of their own. - `.opened_by.json` marks the device that has a notebook open; opening a notebook open elsewhere shows a warning. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
41ee32e1f7
commit
9b34e30475
13 files changed
+976
-9
No files matched your search
@@ -229,6 +229,9 @@ pub struct UiSettings {
|
||||
pub language: Option<Language>,
|
||||
/// Eraser radius in mm (Issue #38)
|
||||
pub eraser_radius_mm: f32,
|
||||
/// Folder of the notebooks, e.g. inside a Nextcloud folder; default location if unset
|
||||
/// (Issue #49)
|
||||
pub storage_dir: Option<PathBuf>,
|
||||
}
|
||||
|
||||
impl Default for UiSettings {
|
||||
@@ -249,6 +252,7 @@ impl Default for UiSettings {
|
||||
stylus_buttons: Vec::new(),
|
||||
language: None,
|
||||
eraser_radius_mm: 3.0,
|
||||
storage_dir: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -349,6 +353,7 @@ mod tests {
|
||||
],
|
||||
language: Some(Language::English),
|
||||
eraser_radius_mm: 6.0,
|
||||
storage_dir: Some(PathBuf::from("/home/pia/Nextcloud/ink-notes")),
|
||||
};
|
||||
settings.save_to(&path).unwrap();
|
||||
assert_eq!(UiSettings::load_from(&path), settings);
|
||||
|
||||
Reference in new issue
Block a user