Shared groundwork: - paths.rs: folders for data, settings and downloads per system (Linux XDG unchanged, Windows %APPDATA%/%LOCALAPPDATA%, Android app folder) - Linux-only parts behind cfg: Wayland on-screen keyboard (osk/wayland.rs), display backend and app id, the vendored winit touch extensions - run_with(event_loop) so that other entry points can start the app Windows (#48): - cross-compiled with MinGW into a portable ink-notes_<version>_x86_64.exe (system DLLs only), no console window in release builds - file picker: user folders and drives; held notebook locks are detected (ERROR_LOCK_VIOLATION) - updater: replaces the running .exe via rename, active at the next start - octotablet panicking without the Tablet PC components no longer crashes the app - release: .exe built in CI and part of the signed checksums - all library tests pass under wine Android (#42): - android_main entry point, winit with android-native-activity, android_logger; octotablet and arboard left out there - cargo check and the cdylib build for aarch64-linux-android pass; the window surface does not follow the activity lifecycle yet Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
beb780b420
commit
e5a8601f87
26 files changed
+762
-270
No files matched your search
+26
-1
@@ -140,7 +140,7 @@ pub fn list_dir(dir: &Path, kind: PickerKind) -> std::io::Result<Vec<PickerEntry
|
||||
/// mit den Ordnern aus `~/.config/user-dirs.dirs` (z. B. „Bilder“ statt „Pictures“). Die
|
||||
/// Bezeichnungen sind deutsch, angezeigt werden sie mit `i18n::tr`.
|
||||
pub fn shortcuts() -> Vec<(&'static str, PathBuf)> {
|
||||
let Some(home) = std::env::var_os("HOME").map(PathBuf::from) else {
|
||||
let Some(home) = crate::paths::home_dir() else {
|
||||
return Vec::new();
|
||||
};
|
||||
let user_dirs =
|
||||
@@ -162,6 +162,30 @@ pub fn shortcuts() -> Vec<(&'static str, PathBuf)> {
|
||||
list.push((tn!("🖥 Schreibtisch"), p));
|
||||
}
|
||||
list.push((tn!("🏠 Persönlicher Ordner"), home));
|
||||
// Drives (Windows has no single root)
|
||||
#[cfg(windows)]
|
||||
{
|
||||
const DRIVES: [&str; 24] = [
|
||||
"💽 C:", "💽 D:", "💽 E:", "💽 F:", "💽 G:", "💽 H:", "💽 I:", "💽 J:", "💽 K:",
|
||||
"💽 L:", "💽 M:", "💽 N:", "💽 O:", "💽 P:", "💽 Q:", "💽 R:", "💽 S:", "💽 T:",
|
||||
"💽 U:", "💽 V:", "💽 W:", "💽 X:", "💽 Y:", "💽 Z:",
|
||||
];
|
||||
// Looked up once: a disconnected network drive can take seconds to answer
|
||||
static FOUND: std::sync::OnceLock<Vec<(&str, PathBuf)>> = std::sync::OnceLock::new();
|
||||
let found = FOUND.get_or_init(|| {
|
||||
DRIVES
|
||||
.iter()
|
||||
.map(|label| {
|
||||
(
|
||||
*label,
|
||||
PathBuf::from(format!("{}\\", &label[label.len() - 2..])),
|
||||
)
|
||||
})
|
||||
.filter(|(_, root)| root.is_dir())
|
||||
.collect()
|
||||
});
|
||||
list.extend(found.iter().cloned());
|
||||
}
|
||||
list
|
||||
}
|
||||
|
||||
@@ -254,6 +278,7 @@ mod tests {
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(unix)]
|
||||
fn test_parse_user_dirs() {
|
||||
let home = Path::new("/home/anna");
|
||||
let content = "# Kommentar\nXDG_DESKTOP_DIR=\"$HOME/Schreibtisch\"\nXDG_PICTURES_DIR=\"$HOME/Bilder\"\nXDG_MUSIC_DIR=\"/daten/Musik\"\n";
|
||||
|
||||
Reference in new issue
Block a user