diff --git a/crates/app/src/app.rs b/crates/app/src/app.rs index 3539888..4908914 100644 --- a/crates/app/src/app.rs +++ b/crates/app/src/app.rs @@ -38,6 +38,7 @@ use crate::sync_view::{SyncRequest, SyncView}; use crate::theme::{self, pal, radius, space, text}; use crate::toasts::{ToastKind, Toasts}; use crate::transfers::{self, TransfersView}; +use crate::undo::Op; use crate::util::{self, same_fs}; use crate::widgets; use crate::worker::{self, ConnectRequest, WorkResult, Worker}; @@ -164,6 +165,9 @@ pub enum Action { TrashExternal(Vec), /// "Empty Trash…" (asks first). EmptyTrash, + /// ⌘Z / ⇧⌘Z: the next step of the file operation history. + Undo, + Redo, /// Show the Trash in Finder (explicitly Finder: Manta may be the /// default file viewer). ShowTrashInFinder, @@ -451,6 +455,8 @@ pub struct MantaApp { pub(crate) trasher: crate::trash::SharedTrasher, /// The sidebar's Trash: its folder and full / empty state. pub(crate) trash: trash_place::TrashPlace, + /// Undo and Redo (⌘Z, ⇧⌘Z) of Manta's own file operations. + pub(crate) history: crate::undo::History, /// Where the Trash row was drawn in the last frame. pub(crate) trash_rect: Option, /// Secrets of favorites: the login Keychain (tests: memory). @@ -608,7 +614,10 @@ pub(crate) fn can_trash(fs: &SharedVfs) -> bool { /// "New File": an empty file at `path`. `open_write` truncates, so a file /// that appeared since the folder was listed is left alone. -fn create_empty_file(fs: &dyn manta_core::Vfs, path: &VfsPath) -> manta_core::VfsResult<()> { +pub(crate) fn create_empty_file( + fs: &dyn manta_core::Vfs, + path: &VfsPath, +) -> manta_core::VfsResult<()> { if fs.stat(path).is_ok() { return Err(manta_core::VfsError::AlreadyExists(path.to_string())); } @@ -977,6 +986,7 @@ impl MantaApp { folder_views_path: None, trasher: init.trasher.clone().unwrap_or_else(crate::trash::system), trash: trash_place::TrashPlace::default(), + history: Default::default(), trash_rect: None, secrets, live: crate::live_refresh::LiveRefresh::new( @@ -1819,6 +1829,11 @@ impl MantaApp { refresh, outcome, } => self.on_trashed(action, refresh, outcome), + WorkResult::Undone { + redo, + refresh, + outcome, + } => self.on_undone(redo, refresh, outcome), WorkResult::TrashMeasured(summary) => self.on_trash_measured(summary), WorkResult::TrashEmptied(result) => self.on_trash_emptied(result), WorkResult::Ejected { path, name, result } => self.on_ejected(path, name, result), @@ -1850,11 +1865,15 @@ impl MantaApp { select, action, result, + undo, } => { if let Some(id) = action { let outcome = result.clone().map(|()| 0); self.finish_action(id, outcome); } + if let (Ok(()), Some(op)) = (&result, undo) { + self.history.record(op); + } match result { Ok(()) => self.set_success(description), Err(e) => self.set_error_detail(failure, e), @@ -1914,6 +1933,9 @@ impl MantaApp { outcome: crate::trash::TrashOutcome, ) { self.trash.stale(); + if !outcome.put_back.is_empty() { + self.history.record(Op::PutBack(outcome.put_back.clone())); + } let name_of = |p: &std::path::Path| { p.file_name() .map(|n| n.to_string_lossy().into_owned()) @@ -1944,6 +1966,54 @@ impl MantaApp { } } + /// ⌘Z (⇧⌘Z: `redo`): run the next step of the history in the + /// background. Nothing happens while a step still runs. + fn undo_redo(&mut self, redo: bool) { + if self.history.busy { + return; + } + let Some(op) = self.history.take(redo) else { + self.set_info(if redo { + t!("status.nothing_to_redo") + } else { + t!("status.nothing_to_undo") + }); + return; + }; + let refresh = op.refresh(&self.local); + let trasher = self.trasher.clone(); + self.worker.spawn( + if redo { "redo" } else { "undo" }, + move || Ok(op.run(trasher.as_ref())), + move |result: Result| WorkResult::Undone { + redo, + refresh, + outcome: result.unwrap_or_else(|e| crate::undo::Outcome { + error: Some((t!("error.undo_failed").to_string(), e)), + ..Default::default() + }), + }, + ); + } + + fn on_undone( + &mut self, + redo: bool, + refresh: Vec<(SharedVfs, VfsPath)>, + mut outcome: crate::undo::Outcome, + ) { + self.history.finish(redo, &mut outcome); + self.trash.stale(); + match (outcome.error, outcome.done) { + (Some((title, detail)), _) => self.set_error_detail(title, detail), + (None, Some(done)) => self.set_success(done), + (None, None) => {} + } + for (fs, dir) in refresh { + self.refresh_matching(&fs, &dir); + } + } + /// Show the one-time "what's new" notice after an update, or mark it /// seen right away on a new install. fn check_whats_new(&mut self, existing_install: bool) { @@ -2762,6 +2832,8 @@ impl MantaApp { Action::DropOnTrash { from, fs, paths } => self.drop_on_trash(from, fs, paths), Action::TrashExternal(paths) => self.trash_external(paths), Action::EmptyTrash => self.ask_empty_trash(), + Action::Undo => self.undo_redo(false), + Action::Redo => self.undo_redo(true), Action::ShowTrashInFinder => self.show_trash_in_finder(), Action::OpenFullDiskAccess => self.open_full_disk_access(), Action::ToggleHidden(side) => { @@ -3437,6 +3509,8 @@ impl MantaApp { Cmd::MoveToTrash => Action::Delete(side), Cmd::DeletePermanently => Action::DeletePermanently(side), Cmd::EmptyTrash => Action::EmptyTrash, + Cmd::Undo => Action::Undo, + Cmd::Redo => Action::Redo, Cmd::SelectAll => Action::SelectAll(side), Cmd::ToggleHidden => Action::ToggleHidden(side), Cmd::NewTab => Action::NewTab(side), @@ -3528,6 +3602,8 @@ impl MantaApp { Cmd::Open | Cmd::CopyToOther | Cmd::OpenWithApp | Cmd::GetInfo => has_sel, Cmd::MoveToOther | Cmd::MoveToTrash | Cmd::DeletePermanently => has_sel && !ro, Cmd::EmptyTrash => self.trash.dir.is_some() && self.trash.status.full() != Some(false), + Cmd::Undo => self.history.can_undo(), + Cmd::Redo => self.history.can_redo(), Cmd::NewFolder | Cmd::NewFile => !ro, Cmd::Compress => has_sel && !ro, // Asked for every menu item every frame: no copies of the @@ -4109,6 +4185,7 @@ impl MantaApp { select: None, action, result, + undo: None, }, ); } @@ -4622,6 +4699,7 @@ impl MantaApp { None, ); let action = Some(self.start_action(a)); + let undo = Some(Op::remove_new(fs.clone(), target.clone(), false)); self.worker.spawn( "touch", move || create_empty_file(&*fs, &target).map_err(|e| e.to_string()), @@ -4632,6 +4710,7 @@ impl MantaApp { select, action, result, + undo, }, ); } @@ -4644,6 +4723,7 @@ impl MantaApp { None, ); let action = Some(self.start_action(a)); + let undo = Some(Op::remove_new(fs.clone(), target.clone(), true)); self.worker.spawn( "mkdir", move || fs.create_dir(&target).map_err(|e| e.to_string()), @@ -4654,6 +4734,7 @@ impl MantaApp { select, action, result, + undo, }, ); } @@ -4669,6 +4750,11 @@ impl MantaApp { ); a.destination = Some(target.clone()); let action = Some(self.start_action(a)); + let undo = Some(Op::Rename { + fs: fs.clone(), + from: target.clone(), + to: from.clone(), + }); self.worker.spawn( "rename", move || fs.rename(&from, &target).map_err(|e| e.to_string()), @@ -4679,6 +4765,7 @@ impl MantaApp { select, action, result, + undo, }, ); } @@ -6153,6 +6240,14 @@ impl MantaApp { if !panel_focus && key(Modifiers::COMMAND, Key::Backspace) { actions.push(Action::Delete(side)); } + // ⇧⌘Z before ⌘Z (a pattern without ⇧ also matches with it). A + // focused text field keeps both for its text (see `text_focus`). + if !panel_focus && key(cmd_shift, Key::Z) { + actions.push(Action::Redo); + } + if !panel_focus && key(Modifiers::COMMAND, Key::Z) { + actions.push(Action::Undo); + } if !panel_focus && key(Modifiers::COMMAND, Key::A) { self.pane_mut(side).tab_mut().select_all(); } diff --git a/crates/app/src/app/finder_ops.rs b/crates/app/src/app/finder_ops.rs index 06de760..7d3a69e 100644 --- a/crates/app/src/app/finder_ops.rs +++ b/crates/app/src/app/finder_ops.rs @@ -334,6 +334,11 @@ impl MantaApp { a.destination = Some(target.clone()); let action = Some(self.start_action(a)); let refresh = vec![(fs.clone(), dir)]; + let undo = Some(crate::undo::Op::Rename { + fs: fs.clone(), + from: target.clone(), + to: from.clone(), + }); self.worker.spawn( "rename", move || { @@ -350,6 +355,7 @@ impl MantaApp { select: None, action, result, + undo, }, ); } diff --git a/crates/app/src/app_menu.rs b/crates/app/src/app_menu.rs index b7e1d4a..c73aa96 100644 --- a/crates/app/src/app_menu.rs +++ b/crates/app/src/app_menu.rs @@ -212,7 +212,15 @@ pub fn command_menus() -> Vec { ), m( t!("menu.edit"), - &[c(SelectAll), None, c(Filter), c(EditPath)], + &[ + c(Undo), + c(Redo), + None, + c(SelectAll), + None, + c(Filter), + c(EditPath), + ], ), m( t!("menu.view"), @@ -1029,6 +1037,8 @@ mod tests { ("\u{8}".into(), OPTION | COMMAND) ); assert_eq!(k(Cmd::EmptyTrash), ("\u{8}".into(), SHIFT | COMMAND)); + assert_eq!(k(Cmd::Undo), ("z".into(), COMMAND)); + assert_eq!(k(Cmd::Redo), ("z".into(), SHIFT | COMMAND)); assert_eq!(k(Cmd::AddToFavorites), ("t".into(), CONTROL | COMMAND)); assert_eq!(k(Cmd::ToggleHidden), (".".into(), SHIFT | COMMAND)); assert_eq!(k(Cmd::Rename), ("\u{F705}".into(), 0), "F2"); diff --git a/crates/app/src/commands.rs b/crates/app/src/commands.rs index 48b3c91..ca438c5 100644 --- a/crates/app/src/commands.rs +++ b/crates/app/src/commands.rs @@ -27,6 +27,10 @@ pub enum Cmd { DeletePermanently, /// ⇧⌘⌫: delete everything in the Trash after asking (Finder). EmptyTrash, + /// ⌘Z: revert the last file operation (Trash, rename, new item). + Undo, + /// ⇧⌘Z: do the last undone operation again. + Redo, SelectAll, ToggleHidden, NewTab, @@ -96,6 +100,8 @@ pub const ALL: &[Cmd] = &[ Cmd::MoveToTrash, Cmd::DeletePermanently, Cmd::EmptyTrash, + Cmd::Undo, + Cmd::Redo, Cmd::SelectAll, Cmd::ToggleHidden, Cmd::NewTab, @@ -166,6 +172,8 @@ impl Cmd { Cmd::MoveToTrash => t!("cmd.move_to_trash"), Cmd::DeletePermanently => t!("cmd.delete_permanently"), Cmd::EmptyTrash => t!("cmd.empty_trash"), + Cmd::Undo => t!("cmd.undo"), + Cmd::Redo => t!("cmd.redo"), Cmd::SelectAll => t!("cmd.select_all"), Cmd::ToggleHidden => t!("cmd.toggle_hidden"), Cmd::NewTab => t!("cmd.new_tab"), @@ -224,6 +232,8 @@ impl Cmd { Cmd::MoveToTrash => "⌘⌫", Cmd::DeletePermanently => "⌥⌘⌫", Cmd::EmptyTrash => "⇧⌘⌫", + Cmd::Undo => "⌘Z", + Cmd::Redo => "⇧⌘Z", Cmd::SelectAll => "⌘A", Cmd::ToggleHidden => "⇧⌘.", Cmd::NewTab => "⌘T", @@ -279,6 +289,8 @@ impl Cmd { Cmd::MoveToTrash => i::TRASH, Cmd::DeletePermanently => i::TRASH, Cmd::EmptyTrash => i::TRASH, + Cmd::Undo => i::ARROW_COUNTER_CLOCKWISE, + Cmd::Redo => i::ARROW_CLOCKWISE, Cmd::SelectAll => i::CHECK_CIRCLE, Cmd::ToggleHidden => i::FILE_DASHED, Cmd::NewTab => i::PLUS, @@ -338,6 +350,8 @@ impl Cmd { | Cmd::MoveToTrash | Cmd::DeletePermanently | Cmd::EmptyTrash + | Cmd::Undo + | Cmd::Redo | Cmd::Compress | Cmd::GetInfo | Cmd::ExtractHere => t!("cmd.cat.file"), @@ -392,6 +406,8 @@ impl Cmd { Cmd::MoveToTrash => t!("cmd.kw.move_to_trash"), Cmd::DeletePermanently => t!("cmd.kw.delete_permanently"), Cmd::EmptyTrash => t!("cmd.kw.empty_trash"), + Cmd::Undo => t!("cmd.kw.undo"), + Cmd::Redo => t!("cmd.kw.redo"), Cmd::SelectAll => t!("cmd.kw.select_all"), Cmd::ToggleHidden => t!("cmd.kw.toggle_hidden"), Cmd::NewTab => t!("cmd.kw.new_tab"), diff --git a/crates/app/src/i18n/catalog/app.rs b/crates/app/src/i18n/catalog/app.rs index 1cb2208..2d67a8f 100644 --- a/crates/app/src/i18n/catalog/app.rs +++ b/crates/app/src/i18n/catalog/app.rs @@ -91,6 +91,12 @@ pub const ENTRIES: Entries = &[ ("status.created_folder", "Created folder “{name}”", "Ordner „{name}“ erstellt"), ("status.created_file", "Created file “{name}”", "Datei „{name}“ erstellt"), ("status.renamed", "Renamed “{old}” to “{name}”", "„{old}“ in „{name}“ umbenannt"), + ("status.put_back.single", "Put back “{name}”", "„{name}“ zurückgelegt"), + ("status.put_back.one", "Put back {count} item", "{count} Objekt zurückgelegt"), + ("status.put_back.other", "Put back {count} items", "{count} Objekte zurückgelegt"), + ("status.removed", "Deleted “{name}”", "„{name}“ gelöscht"), + ("status.nothing_to_undo", "Nothing to undo", "Nichts zu widerrufen"), + ("status.nothing_to_redo", "Nothing to redo", "Nichts zu wiederholen"), // Error toasts ("error.load_favorites", "Could not load favorites: {error}", "Die Favoriten konnten nicht geladen werden: {error}"), ("error.save_favorites", "Couldn't save favorites", "Die Favoriten konnten nicht gesichert werden"), @@ -108,6 +114,13 @@ pub const ENTRIES: Entries = &[ ("error.create_folder", "Couldn't create folder “{name}”", "Der Ordner „{name}“ konnte nicht erstellt werden"), ("error.create_file", "Couldn't create file “{name}”", "Die Datei „{name}“ konnte nicht erstellt werden"), ("error.rename", "Couldn't rename “{name}”", "„{name}“ konnte nicht umbenannt werden"), + ("error.put_back.single", "Couldn't put back “{name}”", "„{name}“ konnte nicht zurückgelegt werden"), + ("error.put_back.one", "Couldn't put back {count} item", "{count} Objekt konnte nicht zurückgelegt werden"), + ("error.put_back.other", "Couldn't put back {count} items", "{count} Objekte konnten nicht zurückgelegt werden"), + ("error.remove", "Couldn't delete “{name}”", "„{name}“ konnte nicht gelöscht werden"), + ("error.undo_failed", "Couldn't undo", "Widerrufen nicht möglich"), + ("error.undo_exists", "An item named “{name}” already exists there.", "Dort gibt es bereits ein Objekt mit dem Namen „{name}“."), + ("error.undo_not_empty", "It isn't empty anymore. Delete it yourself if you no longer need it.", "Es ist nicht mehr leer. Lösche es selbst, wenn du es nicht mehr brauchst."), ("error.is_folder", "“{name}” is a folder", "„{name}“ ist ein Ordner"), ("error.internal", "internal error: {detail}", "Interner Fehler: {detail}"), ("toast.finished_with_issues", "Finished with issues: {title}", "Mit Problemen abgeschlossen: {title}"), diff --git a/crates/app/src/i18n/catalog/commands.rs b/crates/app/src/i18n/catalog/commands.rs index 45bab5a..d8a86cd 100644 --- a/crates/app/src/i18n/catalog/commands.rs +++ b/crates/app/src/i18n/catalog/commands.rs @@ -39,6 +39,8 @@ pub const ENTRIES: Entries = &[ "Sofort löschen …", ), ("cmd.empty_trash", "Empty Trash…", "Papierkorb entleeren …"), + ("cmd.undo", "Undo", "Widerrufen"), + ("cmd.redo", "Redo", "Wiederholen"), ("cmd.select_all", "Select All", "Alles auswählen"), ( "cmd.toggle_hidden", @@ -196,6 +198,12 @@ pub const ENTRIES: Entries = &[ "remove erase rm permanent forever", "remove erase rm permanent forever entfernen endgültig dauerhaft", ), + ( + "cmd.kw.undo", + "revert restore put back trash rename", + "revert restore put back undo rückgängig zurücklegen wiederherstellen", + ), + ("cmd.kw.redo", "again repeat", "again repeat redo erneut"), ("cmd.kw.select_all", "all", "all alle"), ( "cmd.kw.toggle_hidden", diff --git a/crates/app/src/i18n/catalog/es/app.rs b/crates/app/src/i18n/catalog/es/app.rs index f231ca0..e9b9e39 100644 --- a/crates/app/src/i18n/catalog/es/app.rs +++ b/crates/app/src/i18n/catalog/es/app.rs @@ -85,6 +85,12 @@ pub const ENTRIES: Translations = &[ ("status.created_folder", "Se ha creado la carpeta “{name}”"), ("status.created_file", "Se ha creado el archivo “{name}”"), ("status.renamed", "Se ha renombrado “{old}” como “{name}”"), + ("status.put_back.single", "Se ha devuelto “{name}”"), + ("status.put_back.one", "Se ha devuelto {count} ítem"), + ("status.put_back.other", "Se han devuelto {count} ítems"), + ("status.removed", "Se ha eliminado “{name}”"), + ("status.nothing_to_undo", "No hay nada que deshacer"), + ("status.nothing_to_redo", "No hay nada que rehacer"), ("error.load_favorites", "No se han podido cargar los favoritos: {error}"), ("error.save_favorites", "No se han podido guardar los favoritos"), ("error.couldnt_finish", "No se ha podido terminar: {title}"), @@ -101,6 +107,13 @@ pub const ENTRIES: Translations = &[ ("error.create_folder", "No se ha podido crear la carpeta “{name}”"), ("error.create_file", "No se ha podido crear el archivo “{name}”"), ("error.rename", "No se ha podido renombrar “{name}”"), + ("error.put_back.single", "No se ha podido devolver “{name}”"), + ("error.put_back.one", "No se ha podido devolver {count} ítem"), + ("error.put_back.other", "No se han podido devolver {count} ítems"), + ("error.remove", "No se ha podido eliminar “{name}”"), + ("error.undo_failed", "No se ha podido deshacer"), + ("error.undo_exists", "Ya existe un ítem llamado “{name}” en esa ubicación."), + ("error.undo_not_empty", "Ya no está vacío. Elimínalo tú mismo si ya no lo necesitas."), ("error.is_folder", "“{name}” es una carpeta"), ("error.internal", "error interno: {detail}"), ("toast.finished_with_issues", "Terminado con problemas: {title}"), diff --git a/crates/app/src/i18n/catalog/es/commands.rs b/crates/app/src/i18n/catalog/es/commands.rs index f5f026a..cf0e816 100644 --- a/crates/app/src/i18n/catalog/es/commands.rs +++ b/crates/app/src/i18n/catalog/es/commands.rs @@ -19,6 +19,8 @@ pub const ENTRIES: Translations = &[ ("cmd.move_to_trash", "Trasladar a la papelera"), ("cmd.delete_permanently", "Eliminar inmediatamente…"), ("cmd.empty_trash", "Vaciar papelera…"), + ("cmd.undo", "Deshacer"), + ("cmd.redo", "Rehacer"), ("cmd.select_all", "Seleccionar todo"), ("cmd.toggle_hidden", "Mostrar archivos ocultos"), ("cmd.new_tab", "Nueva pestaña"), @@ -70,6 +72,8 @@ pub const ENTRIES: Translations = &[ ("cmd.kw.move_to_trash", "delete remove trash bin rm eliminar borrar quitar papelera"), ("cmd.kw.empty_trash", "trash bin clear erase empty papelera vaciar borrar"), ("cmd.kw.delete_permanently", "remove erase rm permanent forever eliminar borrar permanente definitivo"), + ("cmd.kw.undo", "revert restore put back undo deshacer devolver restaurar"), + ("cmd.kw.redo", "again repeat redo rehacer repetir"), ("cmd.kw.select_all", "all todo todos seleccionar"), ("cmd.kw.toggle_hidden", "dotfiles invisible ocultos invisibles mostrar"), ("cmd.kw.new_tab", "tab pestaña nueva"), diff --git a/crates/app/src/i18n/catalog/fr/app.rs b/crates/app/src/i18n/catalog/fr/app.rs index 7a317c0..8cd86d7 100644 --- a/crates/app/src/i18n/catalog/fr/app.rs +++ b/crates/app/src/i18n/catalog/fr/app.rs @@ -85,6 +85,12 @@ pub const ENTRIES: Translations = &[ ("status.created_folder", "Dossier «\u{a0}{name}\u{a0}» créé"), ("status.created_file", "Fichier «\u{a0}{name}\u{a0}» créé"), ("status.renamed", "«\u{a0}{old}\u{a0}» renommé en «\u{a0}{name}\u{a0}»"), + ("status.put_back.single", "«\u{a0}{name}\u{a0}» a été remis à sa place"), + ("status.put_back.one", "{count} élément remis à sa place"), + ("status.put_back.other", "{count} éléments remis à leur place"), + ("status.removed", "«\u{a0}{name}\u{a0}» a été supprimé"), + ("status.nothing_to_undo", "Rien à annuler"), + ("status.nothing_to_redo", "Rien à rétablir"), ("error.load_favorites", "Impossible de charger les Favoris\u{a0}: {error}"), ("error.save_favorites", "Impossible d’enregistrer les Favoris"), ("error.couldnt_finish", "Impossible de terminer\u{a0}: {title}"), @@ -101,6 +107,13 @@ pub const ENTRIES: Translations = &[ ("error.create_folder", "Impossible de créer le dossier «\u{a0}{name}\u{a0}»"), ("error.create_file", "Impossible de créer le fichier «\u{a0}{name}\u{a0}»"), ("error.rename", "Impossible de renommer «\u{a0}{name}\u{a0}»"), + ("error.put_back.single", "Impossible de remettre «\u{a0}{name}\u{a0}» à sa place"), + ("error.put_back.one", "Impossible de remettre {count} élément à sa place"), + ("error.put_back.other", "Impossible de remettre {count} éléments à leur place"), + ("error.remove", "Impossible de supprimer «\u{a0}{name}\u{a0}»"), + ("error.undo_failed", "Impossible d’annuler"), + ("error.undo_exists", "Un élément nommé «\u{a0}{name}\u{a0}» existe déjà à cet emplacement."), + ("error.undo_not_empty", "Il n’est plus vide. Supprimez-le vous-même si vous n’en avez plus besoin."), ("error.is_folder", "«\u{a0}{name}\u{a0}» est un dossier"), ("error.internal", "erreur interne\u{a0}: {detail}"), ("toast.finished_with_issues", "Terminé avec des problèmes\u{a0}: {title}"), diff --git a/crates/app/src/i18n/catalog/fr/commands.rs b/crates/app/src/i18n/catalog/fr/commands.rs index 3561c93..c34d3d9 100644 --- a/crates/app/src/i18n/catalog/fr/commands.rs +++ b/crates/app/src/i18n/catalog/fr/commands.rs @@ -19,6 +19,8 @@ pub const ENTRIES: Translations = &[ ("cmd.move_to_trash", "Placer dans la corbeille"), ("cmd.delete_permanently", "Supprimer immédiatement…"), ("cmd.empty_trash", "Vider la corbeille…"), + ("cmd.undo", "Annuler"), + ("cmd.redo", "Rétablir"), ("cmd.select_all", "Tout sélectionner"), ("cmd.toggle_hidden", "Afficher les fichiers masqués"), ("cmd.new_tab", "Nouvel onglet"), @@ -70,6 +72,8 @@ pub const ENTRIES: Translations = &[ ("cmd.kw.move_to_trash", "delete remove trash bin rm supprimer effacer corbeille"), ("cmd.kw.empty_trash", "trash bin clear erase empty corbeille vider effacer"), ("cmd.kw.delete_permanently", "remove erase rm permanent forever supprimer effacer définitivement immédiatement"), + ("cmd.kw.undo", "revert restore put back undo annuler remettre restaurer"), + ("cmd.kw.redo", "again repeat redo rétablir refaire"), ("cmd.kw.select_all", "all tout sélectionner"), ("cmd.kw.toggle_hidden", "dotfiles invisible masqués cachés invisibles"), ("cmd.kw.new_tab", "tab onglet"), diff --git a/crates/app/src/i18n/catalog/it/app.rs b/crates/app/src/i18n/catalog/it/app.rs index 33731fb..5c6bbee 100644 --- a/crates/app/src/i18n/catalog/it/app.rs +++ b/crates/app/src/i18n/catalog/it/app.rs @@ -85,6 +85,12 @@ pub const ENTRIES: Translations = &[ ("status.created_folder", "Cartella “{name}” creata"), ("status.created_file", "File “{name}” creato"), ("status.renamed", "“{old}” rinominato in “{name}”"), + ("status.put_back.single", "“{name}” ripristinato"), + ("status.put_back.one", "{count} elemento ripristinato"), + ("status.put_back.other", "{count} elementi ripristinati"), + ("status.removed", "“{name}” eliminato"), + ("status.nothing_to_undo", "Niente da annullare"), + ("status.nothing_to_redo", "Niente da ripetere"), ("error.load_favorites", "Impossibile caricare i Preferiti: {error}"), ("error.save_favorites", "Impossibile salvare i Preferiti"), ("error.couldnt_finish", "Impossibile completare: {title}"), @@ -101,6 +107,13 @@ pub const ENTRIES: Translations = &[ ("error.create_folder", "Impossibile creare la cartella “{name}”"), ("error.create_file", "Impossibile creare il file “{name}”"), ("error.rename", "Impossibile rinominare “{name}”"), + ("error.put_back.single", "Impossibile ripristinare “{name}”"), + ("error.put_back.one", "Impossibile ripristinare {count} elemento"), + ("error.put_back.other", "Impossibile ripristinare {count} elementi"), + ("error.remove", "Impossibile eliminare “{name}”"), + ("error.undo_failed", "Impossibile annullare"), + ("error.undo_exists", "In questa posizione esiste già un elemento chiamato “{name}”."), + ("error.undo_not_empty", "Non è più vuoto. Eliminalo tu se non ti serve più."), ("error.is_folder", "“{name}” è una cartella"), ("error.internal", "errore interno: {detail}"), ("toast.finished_with_issues", "Completato con problemi: {title}"), diff --git a/crates/app/src/i18n/catalog/it/commands.rs b/crates/app/src/i18n/catalog/it/commands.rs index 801fd58..f08b28e 100644 --- a/crates/app/src/i18n/catalog/it/commands.rs +++ b/crates/app/src/i18n/catalog/it/commands.rs @@ -19,6 +19,8 @@ pub const ENTRIES: Translations = &[ ("cmd.move_to_trash", "Sposta nel Cestino"), ("cmd.delete_permanently", "Elimina immediatamente…"), ("cmd.empty_trash", "Svuota il Cestino…"), + ("cmd.undo", "Annulla"), + ("cmd.redo", "Ripeti"), ("cmd.select_all", "Seleziona tutto"), ("cmd.toggle_hidden", "Mostra file nascosti"), ("cmd.new_tab", "Nuova scheda"), @@ -70,6 +72,8 @@ pub const ENTRIES: Translations = &[ ("cmd.kw.move_to_trash", "delete remove trash bin rm elimina rimuovi cestino"), ("cmd.kw.empty_trash", "trash bin clear erase empty cestino svuota cancella"), ("cmd.kw.delete_permanently", "remove erase rm permanent forever rimuovi elimina definitivamente sempre"), + ("cmd.kw.undo", "revert restore put back undo annulla ripristina"), + ("cmd.kw.redo", "again repeat redo ripeti di nuovo"), ("cmd.kw.select_all", "all tutto tutti seleziona"), ("cmd.kw.toggle_hidden", "dotfiles invisible nascosti invisibili mostra nascondi"), ("cmd.kw.new_tab", "tab scheda pannello"), diff --git a/crates/app/src/i18n/catalog/ru/app.rs b/crates/app/src/i18n/catalog/ru/app.rs index 26c61c6..5822eaf 100644 --- a/crates/app/src/i18n/catalog/ru/app.rs +++ b/crates/app/src/i18n/catalog/ru/app.rs @@ -101,6 +101,14 @@ pub const ENTRIES: Translations = &[ ("status.created_folder", "Создана папка «{name}»"), ("status.created_file", "Создан файл «{name}»"), ("status.renamed", "Переименовано: «{old}» → «{name}»"), + ("status.put_back.single", "Объект «{name}» возвращен на место"), + ("status.put_back.one", "{count} объект возвращен на место"), + ("status.put_back.few", "{count} объекта возвращено на место"), + ("status.put_back.many", "{count} объектов возвращено на место"), + ("status.put_back.other", "{count} объекта возвращено на место"), + ("status.removed", "Объект «{name}» удален"), + ("status.nothing_to_undo", "Нечего отменять"), + ("status.nothing_to_redo", "Нечего повторять"), ("error.load_favorites", "Не удалось загрузить Избранное: {error}"), ("error.save_favorites", "Не удалось сохранить Избранное"), ("error.couldnt_finish", "Не удалось завершить: {title}"), @@ -117,6 +125,15 @@ pub const ENTRIES: Translations = &[ ("error.create_folder", "Не удалось создать папку «{name}»"), ("error.create_file", "Не удалось создать файл «{name}»"), ("error.rename", "Не удалось переименовать «{name}»"), + ("error.put_back.single", "Не удалось вернуть «{name}» на место"), + ("error.put_back.one", "Не удалось вернуть на место {count} объект"), + ("error.put_back.few", "Не удалось вернуть на место {count} объекта"), + ("error.put_back.many", "Не удалось вернуть на место {count} объектов"), + ("error.put_back.other", "Не удалось вернуть на место {count} объекта"), + ("error.remove", "Не удалось удалить «{name}»"), + ("error.undo_failed", "Не удалось отменить"), + ("error.undo_exists", "Там уже есть объект с именем «{name}»."), + ("error.undo_not_empty", "Объект больше не пуст. Удалите его сами, если он больше не нужен."), ("error.is_folder", "«{name}» — это папка"), ("error.internal", "внутренняя ошибка: {detail}"), ("toast.finished_with_issues", "Завершено с проблемами: {title}"), diff --git a/crates/app/src/i18n/catalog/ru/commands.rs b/crates/app/src/i18n/catalog/ru/commands.rs index 81c9670..b171045 100644 --- a/crates/app/src/i18n/catalog/ru/commands.rs +++ b/crates/app/src/i18n/catalog/ru/commands.rs @@ -19,6 +19,8 @@ pub const ENTRIES: Translations = &[ ("cmd.move_to_trash", "Переместить в Корзину"), ("cmd.delete_permanently", "Удалить немедленно…"), ("cmd.empty_trash", "Очистить Корзину…"), + ("cmd.undo", "Отменить"), + ("cmd.redo", "Повторить"), ("cmd.select_all", "Выбрать все"), ("cmd.toggle_hidden", "Показать скрытые файлы"), ("cmd.new_tab", "Новая вкладка"), @@ -70,6 +72,8 @@ pub const ENTRIES: Translations = &[ ("cmd.kw.move_to_trash", "delete remove trash bin rm удалить убрать корзина"), ("cmd.kw.empty_trash", "trash bin clear erase empty корзина очистить стереть"), ("cmd.kw.delete_permanently", "remove erase rm permanent forever удалить стереть навсегда немедленно"), + ("cmd.kw.undo", "revert restore put back undo отменить вернуть восстановить"), + ("cmd.kw.redo", "again repeat redo повторить снова"), ("cmd.kw.select_all", "all все выбрать"), ("cmd.kw.toggle_hidden", "dotfiles invisible скрытые невидимые"), ("cmd.kw.new_tab", "tab вкладка"), diff --git a/crates/app/src/i18n/catalog/zh/app.rs b/crates/app/src/i18n/catalog/zh/app.rs index 73c3494..1e3f6bb 100644 --- a/crates/app/src/i18n/catalog/zh/app.rs +++ b/crates/app/src/i18n/catalog/zh/app.rs @@ -85,6 +85,12 @@ pub const ENTRIES: Translations = &[ ("status.created_folder", "已创建文件夹“{name}”"), ("status.created_file", "已创建文件“{name}”"), ("status.renamed", "已将“{old}”重新命名为“{name}”"), + ("status.put_back.single", "已将“{name}”放回原处"), + ("status.put_back.one", "已将 {count} 项放回原处"), + ("status.put_back.other", "已将 {count} 项放回原处"), + ("status.removed", "已删除“{name}”"), + ("status.nothing_to_undo", "没有可撤销的操作"), + ("status.nothing_to_redo", "没有可重做的操作"), ("error.load_favorites", "无法载入个人收藏:{error}"), ("error.save_favorites", "无法存储个人收藏"), ("error.couldnt_finish", "无法完成:{title}"), @@ -101,6 +107,13 @@ pub const ENTRIES: Translations = &[ ("error.create_folder", "无法创建文件夹“{name}”"), ("error.create_file", "无法创建文件“{name}”"), ("error.rename", "无法重新命名“{name}”"), + ("error.put_back.single", "无法将“{name}”放回原处"), + ("error.put_back.one", "无法将 {count} 项放回原处"), + ("error.put_back.other", "无法将 {count} 项放回原处"), + ("error.remove", "无法删除“{name}”"), + ("error.undo_failed", "无法撤销"), + ("error.undo_exists", "该位置已有名为“{name}”的项目。"), + ("error.undo_not_empty", "它已不再为空。如果不再需要,请自行删除。"), ("error.is_folder", "“{name}”是文件夹"), ("error.internal", "内部错误:{detail}"), ("toast.finished_with_issues", "已完成,但有问题:{title}"), diff --git a/crates/app/src/i18n/catalog/zh/commands.rs b/crates/app/src/i18n/catalog/zh/commands.rs index 76b05a9..eb49b21 100644 --- a/crates/app/src/i18n/catalog/zh/commands.rs +++ b/crates/app/src/i18n/catalog/zh/commands.rs @@ -19,6 +19,8 @@ pub const ENTRIES: Translations = &[ ("cmd.move_to_trash", "移到废纸篓"), ("cmd.delete_permanently", "立即删除…"), ("cmd.empty_trash", "清倒废纸篓…"), + ("cmd.undo", "撤销"), + ("cmd.redo", "重做"), ("cmd.select_all", "全选"), ("cmd.toggle_hidden", "显示隐藏文件"), ("cmd.new_tab", "新建标签页"), @@ -70,6 +72,8 @@ pub const ENTRIES: Translations = &[ ("cmd.kw.move_to_trash", "delete remove trash bin rm 删除 移除 废纸篓"), ("cmd.kw.empty_trash", "trash bin clear erase empty 废纸篓 清倒 清空"), ("cmd.kw.delete_permanently", "remove erase rm permanent forever 移除 抹掉 永久 删除"), + ("cmd.kw.undo", "revert restore put back undo 撤销 放回原处 恢复"), + ("cmd.kw.redo", "again repeat redo 重做 再次"), ("cmd.kw.select_all", "all 全部 全选"), ("cmd.kw.toggle_hidden", "dotfiles invisible 隐藏 不可见"), ("cmd.kw.new_tab", "tab 标签页"), diff --git a/crates/app/src/main.rs b/crates/app/src/main.rs index 5cd4355..a2ad579 100644 --- a/crates/app/src/main.rs +++ b/crates/app/src/main.rs @@ -52,6 +52,7 @@ mod toasts; mod transfer_pill; mod transfers; mod trash; +mod undo; mod update_window; mod updates; mod util; diff --git a/crates/app/src/trash.rs b/crates/app/src/trash.rs index 7bdc018..860a7f4 100644 --- a/crates/app/src/trash.rs +++ b/crates/app/src/trash.rs @@ -30,6 +30,12 @@ pub trait Trasher: Send + Sync { /// Empty the Trash through Finder: used when Manta can't list the /// Trash folder itself (no Full Disk Access). fn empty_with_finder(&self) -> Result<(), String>; + + /// Move `from` (an item in the Trash) back to `to`, where it was + /// before (Undo of Move to Trash). `to` must not exist. + fn put_back(&self, from: &Path, to: &Path) -> Result<(), String> { + std::fs::rename(from, to).map_err(|e| e.to_string()) + } } pub type SharedTrasher = Arc; @@ -88,6 +94,55 @@ impl Trasher for SystemTrash { Err("Emptying the Trash isn't supported on this system".into()) } } + + fn put_back(&self, from: &Path, to: &Path) -> Result<(), String> { + let err = match std::fs::rename(from, to) { + Ok(()) => return Ok(()), + Err(e) => e.to_string(), + }; + if !is_permission_error(&err) { + return Err(err); + } + #[cfg(target_os = "macos")] + { + // Without Full Disk Access macOS keeps Manta out of `~/.Trash`; + // Finder may move the item (Apple Events, as for emptying). The + // paths go in as arguments, never into the script text. Finder + // keeps the name the item has in the Trash, so it is set again. + let (Some(dir), Some(name)) = (to.parent(), to.file_name()) else { + return Err(err); + }; + let out = std::process::Command::new("/usr/bin/osascript") + .args([ + "-e", + "on run argv", + "-e", + "tell application \"Finder\"", + "-e", + "set m to move (POSIX file (item 1 of argv)) to (POSIX file (item 2 of argv))", + "-e", + "set name of m to (item 3 of argv)", + "-e", + "end tell", + "-e", + "end run", + ]) + .arg(from) + .arg(dir) + .arg(name) + .output() + .map_err(|e| e.to_string())?; + if out.status.success() { + Ok(()) + } else { + Err(String::from_utf8_lossy(&out.stderr).trim().to_string()) + } + } + #[cfg(not(target_os = "macos"))] + { + Err(err) + } + } } pub fn system() -> SharedTrasher { @@ -101,6 +156,9 @@ pub struct TrashOutcome { pub moved: Vec, /// Where they ended up (when the system said so), for cleanup in tests. pub locations: Vec, + /// `(where it is in the Trash, where it was)` for the items whose new + /// location is known: what Undo puts back. + pub put_back: Vec<(PathBuf, PathBuf)>, /// `(path, error)` for items that stayed. pub failed: Vec<(PathBuf, String)>, } @@ -112,6 +170,9 @@ pub fn trash_all(trasher: &dyn Trasher, paths: &[PathBuf]) -> TrashOutcome { match trasher.trash(p) { Ok(loc) => { out.moved.push(p.clone()); + if let Some(l) = &loc { + out.put_back.push((l.clone(), p.clone())); + } out.locations.extend(loc); } Err(e) => out.failed.push((p.clone(), e)), diff --git a/crates/app/src/trash_ux_tests.rs b/crates/app/src/trash_ux_tests.rs index 165ba83..02617b8 100644 --- a/crates/app/src/trash_ux_tests.rs +++ b/crates/app/src/trash_ux_tests.rs @@ -84,7 +84,7 @@ fn wait_for(h: &mut H, what: &str, mut f: impl FnMut(&mut H) -> bool) { } /// Show the left pane on the fake server, with a file and a folder. -fn open_server(h: &mut H) -> MemFs { +pub(super) fn open_server(h: &mut H) -> MemFs { let mem = MemFs::new(); mem.mkdir_p("/srv/www"); mem.put("/srv/old.log", b"x", chrono::Utc::now()); diff --git a/crates/app/src/undo.rs b/crates/app/src/undo.rs new file mode 100644 index 0000000..b4a1e3d --- /dev/null +++ b/crates/app/src/undo.rs @@ -0,0 +1,389 @@ +//! Undo and Redo (⌘Z, ⇧⌘Z) of Manta's own file operations, like Finder: +//! moving to the Trash, renaming, new folders and files. Copies and moves +//! aren't recorded. +//! +//! Each history entry is the [`Op`] that reverts one step. Running it gives +//! the op that reverts *that* ([`Outcome::inverse`]), which goes on the +//! other stack, so Undo and Redo are the same mechanism. The history lives +//! as long as the window; a new operation clears Redo. + +use std::path::{Path, PathBuf}; + +use manta_core::{SharedVfs, VfsPath}; + +use crate::trash::Trasher; + +/// Steps kept per stack; the oldest go first. +const LIMIT: usize = 100; + +#[derive(Clone)] +pub enum Op { + /// Move items out of the Trash: `(where it is in the Trash, where it was)`. + PutBack(Vec<(PathBuf, PathBuf)>), + /// Move local items to the Trash. + Trash(Vec), + Rename { + fs: SharedVfs, + from: VfsPath, + to: VfsPath, + }, + /// Make an empty folder (`dir`) or file again. + Create { + fs: SharedVfs, + path: VfsPath, + dir: bool, + }, + /// Delete what [`Op::Create`] made, only while it is still empty + /// (servers have no Trash). + Remove { + fs: SharedVfs, + path: VfsPath, + dir: bool, + }, +} + +/// What running an [`Op`] did. +#[derive(Default)] +pub struct Outcome { + /// Reverts what ran: goes on the other stack. + pub inverse: Option, + /// What didn't run: stays on this stack, to try again. + pub rest: Option, + /// Status line text when something ran. + pub done: Option, + /// `(title, detail)` of the first failure. + pub error: Option<(String, String)>, +} + +impl Op { + /// Reverts making `path` (a new folder or file): local items go to the + /// Trash, as in Finder; elsewhere they are deleted while still empty. + pub fn remove_new(fs: SharedVfs, path: VfsPath, dir: bool) -> Op { + match fs.local_path(&path).filter(|_| crate::app::can_trash(&fs)) { + Some(local) => Op::Trash(vec![local]), + None => Op::Remove { fs, path, dir }, + } + } + + /// Folders whose listings change; local ops are on `local`. + pub fn refresh(&self, local: &SharedVfs) -> Vec<(SharedVfs, VfsPath)> { + let mut out: Vec<(SharedVfs, VfsPath)> = Vec::new(); + let mut add = |fs: &SharedVfs, p: &VfsPath| { + let dir = p.parent().unwrap_or_else(VfsPath::root); + if !out + .iter() + .any(|(f, d)| manta_ops::same_fs(f, fs) && *d == dir) + { + out.push((fs.clone(), dir)); + } + }; + match self { + Op::PutBack(items) => { + for (_, to) in items { + add(local, &local_vfs_path(to)); + } + } + Op::Trash(paths) => { + for p in paths { + add(local, &local_vfs_path(p)); + } + } + Op::Rename { fs, from, to } => { + add(fs, from); + add(fs, to); + } + Op::Create { fs, path, .. } | Op::Remove { fs, path, .. } => add(fs, path), + } + out + } + + /// Run the op (on a worker thread: it touches the disk or a server). + pub fn run(self, trasher: &dyn Trasher) -> Outcome { + match self { + Op::PutBack(items) => put_back(trasher, items), + Op::Trash(paths) => trash(trasher, &paths), + Op::Rename { fs, from, to } => { + let old = from.file_name().to_string(); + let name = to.file_name().to_string(); + // Never replace another item. A change of case only + // ("readme" → "README") finds the item itself on + // case-insensitive disks. + let case_only = + from != to && from.to_string().to_lowercase() == to.to_string().to_lowercase(); + let result = if !case_only && fs.stat(&to).is_ok() { + Err(t!("error.undo_exists", name = name)) + } else { + fs.rename(&from, &to).map_err(|e| e.to_string()) + }; + match result { + Ok(()) => Outcome { + done: Some(t!("status.renamed", old = old, name = name)), + inverse: Some(Op::Rename { + fs, + from: to, + to: from, + }), + ..Default::default() + }, + Err(e) => Outcome { + error: Some((t!("error.rename", name = old), e)), + rest: Some(Op::Rename { fs, from, to }), + ..Default::default() + }, + } + } + Op::Create { fs, path, dir } => { + let name = path.file_name().to_string(); + let result = if dir { + fs.create_dir(&path) + } else { + crate::app::create_empty_file(&*fs, &path) + }; + match result { + Ok(()) => Outcome { + done: Some(if dir { + t!("status.created_folder", name = name) + } else { + t!("status.created_file", name = name) + }), + inverse: Some(Op::remove_new(fs, path, dir)), + ..Default::default() + }, + Err(e) => Outcome { + error: Some(( + if dir { + t!("error.create_folder", name = name) + } else { + t!("error.create_file", name = name) + }, + e.to_string(), + )), + rest: Some(Op::Create { fs, path, dir }), + ..Default::default() + }, + } + } + Op::Remove { fs, path, dir } => { + let name = path.file_name().to_string(); + let empty = if dir { + fs.list(&path).map(|l| l.is_empty()) + } else { + fs.stat(&path).map(|e| e.size == 0) + }; + let result = match empty { + Ok(true) if dir => fs.remove_dir(&path).map_err(|e| e.to_string()), + Ok(true) => fs.remove_file(&path).map_err(|e| e.to_string()), + Ok(false) => Err(t!("error.undo_not_empty").to_string()), + Err(e) => Err(e.to_string()), + }; + match result { + Ok(()) => Outcome { + done: Some(t!("status.removed", name = name)), + inverse: Some(Op::Create { fs, path, dir }), + ..Default::default() + }, + Err(e) => Outcome { + error: Some((t!("error.remove", name = name), e)), + rest: Some(Op::Remove { fs, path, dir }), + ..Default::default() + }, + } + } + } + } +} + +fn put_back(trasher: &dyn Trasher, items: Vec<(PathBuf, PathBuf)>) -> Outcome { + let mut back = Vec::new(); + let mut left = Vec::new(); + let mut error = None; + for (from, to) in items { + let result = if to.symlink_metadata().is_ok() { + Err(t!("error.undo_exists", name = name_of(&to))) + } else { + trasher.put_back(&from, &to) + }; + match result { + Ok(()) => back.push(to), + Err(e) => { + error.get_or_insert((name_of(&to), e)); + left.push((from, to)); + } + } + } + let n = back.len(); + Outcome { + done: match back.first() { + None => None, + Some(p) if n == 1 => Some(t!("status.put_back.single", name = name_of(p))), + Some(_) => Some(t!("status.put_back", count = n)), + }, + error: error.map(|(name, e)| { + let title = if left.len() == 1 { + t!("error.put_back.single", name = name) + } else { + t!("error.put_back", count = left.len()) + }; + (title, e) + }), + inverse: (!back.is_empty()).then_some(Op::Trash(back)), + rest: (!left.is_empty()).then_some(Op::PutBack(left)), + } +} + +fn trash(trasher: &dyn Trasher, paths: &[PathBuf]) -> Outcome { + let out = crate::trash::trash_all(trasher, paths); + let n = out.moved.len(); + let failed = out.failed.len(); + Outcome { + done: match out.moved.first() { + None => None, + Some(p) if n == 1 => Some(t!("status.trashed.single", name = name_of(p))), + Some(_) => Some(t!("status.trashed", count = n)), + }, + error: out.failed.first().map(|(p, e)| { + let title = if failed == 1 { + t!("error.trash.single", name = name_of(p)) + } else { + t!("error.trash", count = failed) + }; + (title, e.clone()) + }), + inverse: (!out.put_back.is_empty()).then_some(Op::PutBack(out.put_back)), + rest: (failed > 0).then(|| Op::Trash(out.failed.into_iter().map(|(p, _)| p).collect())), + } +} + +fn name_of(p: &Path) -> String { + p.file_name() + .map(|n| n.to_string_lossy().into_owned()) + .unwrap_or_default() +} + +fn local_vfs_path(p: &Path) -> VfsPath { + VfsPath::new(&p.to_string_lossy()) +} + +/// The Undo and Redo stacks. +#[derive(Default)] +pub struct History { + undo: Vec, + redo: Vec, + /// An Undo or Redo is running: the next one waits for it (steps + /// depend on each other). + pub busy: bool, +} + +impl History { + /// The user did something: `op` reverts it. + pub fn record(&mut self, op: Op) { + push(&mut self.undo, op); + self.redo.clear(); + } + + pub fn can_undo(&self) -> bool { + !self.busy && !self.undo.is_empty() + } + + pub fn can_redo(&self) -> bool { + !self.busy && !self.redo.is_empty() + } + + /// The next step to run (`redo`: from Redo), marking the history busy. + pub fn take(&mut self, redo: bool) -> Option { + if self.busy { + return None; + } + let op = if redo { &mut self.redo } else { &mut self.undo }.pop(); + self.busy = op.is_some(); + op + } + + /// The step taken with [`History::take`] finished. + pub fn finish(&mut self, redo: bool, outcome: &mut Outcome) { + self.busy = false; + let (this, other) = if redo { + (&mut self.redo, &mut self.undo) + } else { + (&mut self.undo, &mut self.redo) + }; + if let Some(rest) = outcome.rest.take() { + push(this, rest); + } + if let Some(inverse) = outcome.inverse.take() { + push(other, inverse); + } + } +} + +fn push(stack: &mut Vec, op: Op) { + stack.push(op); + if stack.len() > LIMIT { + stack.remove(0); + } +} + +#[cfg(test)] +mod tests { + use super::*; + + fn op(name: &str) -> Op { + Op::Trash(vec![PathBuf::from(name)]) + } + + fn name(op: &Op) -> String { + match op { + Op::Trash(p) => p[0].to_string_lossy().into_owned(), + _ => unreachable!(), + } + } + + /// Undo hands the inverse to Redo and back; a new operation clears Redo. + #[test] + fn steps_move_between_the_stacks() { + let mut h = History::default(); + h.record(op("a")); + h.record(op("b")); + let step = h.take(false).unwrap(); + assert_eq!(name(&step), "b", "last in, first undone"); + assert!(h.busy && !h.can_undo() && h.take(false).is_none()); + h.finish( + false, + &mut Outcome { + inverse: Some(op("b again")), + ..Default::default() + }, + ); + assert!(h.can_undo() && h.can_redo()); + assert_eq!(name(&h.take(true).unwrap()), "b again"); + h.finish(true, &mut Outcome::default()); + h.record(op("c")); + assert!(!h.can_redo(), "a new operation clears Redo"); + } + + /// What failed stays on its stack, to try again. + #[test] + fn the_rest_stays() { + let mut h = History::default(); + h.record(op("a")); + let _ = h.take(false); + h.finish( + false, + &mut Outcome { + rest: Some(op("a")), + ..Default::default() + }, + ); + assert!(h.can_undo() && !h.can_redo()); + } + + #[test] + fn keeps_the_last_steps() { + let mut h = History::default(); + for i in 0..LIMIT + 5 { + h.record(op(&i.to_string())); + } + assert_eq!(h.undo.len(), LIMIT); + assert_eq!(name(&h.undo[0]), "5", "the oldest went first"); + } +} diff --git a/crates/app/src/undo_ux_tests.rs b/crates/app/src/undo_ux_tests.rs new file mode 100644 index 0000000..5ab6d97 --- /dev/null +++ b/crates/app/src/undo_ux_tests.rs @@ -0,0 +1,250 @@ +//! Undo and Redo like Finder: ⌘Z puts items moved to the Trash back, +//! restores the old name after a rename and removes a new folder or file; +//! ⇧⌘Z does it again. A focused text field keeps ⌘Z for its text. + +use std::time::{Duration, Instant}; + +use eframe::egui::{self, Key, Modifiers, Theme}; +use manta_core::{Vfs, VfsPath}; + +use super::trash_ux_tests::open_server; +use super::{app, fixture, harness, select, Fixture, H, WIDE}; +use crate::app::Side; +use crate::dialogs::Dialog; + +fn fake_trash(fx: &Fixture) -> std::path::PathBuf { + fx.root.parent().unwrap().join("Trash") +} + +fn press(h: &mut H, mods: Modifiers, k: Key) { + h.key_press_modifiers(mods, k); + h.run_steps(2); +} + +fn undo(h: &mut H) { + press(h, Modifiers::COMMAND, Key::Z); +} + +fn redo(h: &mut H) { + press(h, Modifiers::COMMAND | Modifiers::SHIFT, Key::Z); +} + +/// Step until `f` holds (worker threads finish in the background). +fn wait_for(h: &mut H, what: &str, mut f: impl FnMut(&mut H) -> bool) { + let start = Instant::now(); + while !f(h) { + assert!( + start.elapsed() < crate::test_support::wait(), + "timed out waiting for {what}" + ); + h.step(); + std::thread::sleep(Duration::from_millis(5)); + } +} + +/// Wait until no Undo or Redo step runs any more. +fn wait_idle(h: &mut H) { + wait_for(h, "the undo step", |h| !app(h).history.busy); +} + +fn toast(h: &mut H, text: &str) -> bool { + app(h).toasts.titles().iter().any(|t| t == text) +} + +/// Name the item in the open name dialog and confirm. +fn enter_name(h: &mut H, name: &str) { + let Some(Dialog::Name(f)) = &mut app(h).dialog else { + panic!("the name dialog is open"); + }; + f.name = name.into(); + h.key_press(Key::Enter); + h.run_steps(2); +} + +#[test] +fn cmd_z_puts_trashed_items_back_and_shift_cmd_z_trashes_them_again() { + let fx = fixture(); + let mut h = harness(&fx, WIDE, Theme::Light); + let trash = fake_trash(&fx); + select(&mut h, Side::Left, &["README.md", "src"]); + press(&mut h, Modifiers::COMMAND, Key::Backspace); + wait_for(&mut h, "items in the Trash", |_| { + trash.join("README.md").exists() && trash.join("src").exists() + }); + wait_for(&mut h, "Undo enabled", |h| app(h).history.can_undo()); + + undo(&mut h); + wait_idle(&mut h); + assert!(fx.root.join("README.md").is_file() && fx.root.join("src/main.rs").is_file()); + assert!(!trash.join("README.md").exists() && !trash.join("src").exists()); + assert!(toast(&mut h, "Put back 2 items")); + + redo(&mut h); + wait_idle(&mut h); + assert!(trash.join("README.md").exists() && trash.join("src").exists()); + assert!(!fx.root.join("README.md").exists()); + + undo(&mut h); + wait_idle(&mut h); + assert!(fx.root.join("README.md").is_file() && fx.root.join("src").is_dir()); + // Nothing left: says so instead of doing anything. + undo(&mut h); + wait_idle(&mut h); + assert!(toast(&mut h, "Nothing to undo")); +} + +/// The original place is taken again: nothing is replaced, the step stays +/// and works once the place is free. +#[test] +fn put_back_never_replaces_an_item_and_can_be_tried_again() { + let fx = fixture(); + let mut h = harness(&fx, WIDE, Theme::Light); + let trash = fake_trash(&fx); + select(&mut h, Side::Left, &["README.md"]); + press(&mut h, Modifiers::COMMAND, Key::Backspace); + wait_for(&mut h, "README.md in the Trash", |h| { + trash.join("README.md").exists() && app(h).history.can_undo() + }); + std::fs::write(fx.root.join("README.md"), "new").unwrap(); + + undo(&mut h); + wait_idle(&mut h); + assert!(toast(&mut h, "Couldn't put back “README.md”")); + assert_eq!( + std::fs::read_to_string(fx.root.join("README.md")).unwrap(), + "new" + ); + assert!(trash.join("README.md").exists()); + assert!(app(&mut h).history.can_undo(), "the step stays"); + + std::fs::remove_file(fx.root.join("README.md")).unwrap(); + undo(&mut h); + wait_idle(&mut h); + assert!(fx.root.join("README.md").is_file() && !trash.join("README.md").exists()); +} + +#[test] +fn cmd_z_restores_the_old_name() { + let fx = fixture(); + let mut h = harness(&fx, WIDE, Theme::Light); + select(&mut h, Side::Left, &["README.md"]); + h.key_press(Key::F2); + h.run_steps(2); + enter_name(&mut h, "LIESMICH.md"); + wait_for(&mut h, "the rename", |h| { + fx.root.join("LIESMICH.md").exists() && app(h).history.can_undo() + }); + + undo(&mut h); + wait_idle(&mut h); + assert!(fx.root.join("README.md").exists() && !fx.root.join("LIESMICH.md").exists()); + assert!(toast(&mut h, "Renamed “LIESMICH.md” to “README.md”")); + + redo(&mut h); + wait_idle(&mut h); + assert!(fx.root.join("LIESMICH.md").exists() && !fx.root.join("README.md").exists()); +} + +/// A new local folder goes to the Trash on Undo (Finder), and comes back +/// with Redo, with whatever was put into it. +#[test] +fn cmd_z_moves_a_new_folder_to_the_trash() { + let fx = fixture(); + let mut h = harness(&fx, WIDE, Theme::Light); + let trash = fake_trash(&fx); + press(&mut h, Modifiers::COMMAND | Modifiers::SHIFT, Key::N); + enter_name(&mut h, "Drafts"); + wait_for(&mut h, "the new folder", |h| { + fx.root.join("Drafts").is_dir() && app(h).history.can_undo() + }); + std::fs::write(fx.root.join("Drafts/note.txt"), "keep me").unwrap(); + + undo(&mut h); + wait_idle(&mut h); + assert!(!fx.root.join("Drafts").exists()); + assert!( + trash.join("Drafts/note.txt").exists(), + "trashed, not deleted" + ); + + redo(&mut h); + wait_idle(&mut h); + assert!(fx.root.join("Drafts/note.txt").exists()); +} + +/// Servers have no Trash: Undo deletes a new folder only while it is +/// still empty. +#[test] +fn on_a_server_undo_deletes_a_new_folder_only_while_empty() { + let fx = fixture(); + let mut h = harness(&fx, WIDE, Theme::Light); + let mem = open_server(&mut h); + press(&mut h, Modifiers::COMMAND | Modifiers::SHIFT, Key::N); + enter_name(&mut h, "build"); + let build = VfsPath::new("/srv/build"); + wait_for(&mut h, "the new folder", |h| { + mem.stat(&build).is_ok() && app(h).history.can_undo() + }); + + undo(&mut h); + wait_idle(&mut h); + assert!(mem.stat(&build).is_err(), "deleted"); + redo(&mut h); + wait_idle(&mut h); + assert!(mem.stat(&build).is_ok(), "made again"); + + mem.put("/srv/build/app.js", b"x", chrono::Utc::now()); + undo(&mut h); + wait_idle(&mut h); + assert!(toast(&mut h, "Couldn't delete “build”")); + assert!(mem.stat(&VfsPath::new("/srv/build/app.js")).is_ok(), "kept"); + assert!(app(&mut h).history.can_undo()); +} + +/// In the filter field ⌘Z edits the text; files stay where they are. +#[test] +fn cmd_z_in_a_text_field_is_left_to_the_field() { + let fx = fixture(); + let mut h = harness(&fx, WIDE, Theme::Light); + let trash = fake_trash(&fx); + select(&mut h, Side::Left, &["README.md"]); + press(&mut h, Modifiers::COMMAND, Key::Backspace); + wait_for(&mut h, "README.md in the Trash", |h| { + trash.join("README.md").exists() && app(h).history.can_undo() + }); + press(&mut h, Modifiers::COMMAND, Key::F); + h.event(egui::Event::Text("src".into())); + h.run_steps(2); + + undo(&mut h); + h.run_steps(5); + assert!(!app(&mut h).history.busy); + assert!(trash.join("README.md").exists(), "not put back"); + assert!(app(&mut h).history.can_undo()); +} + +/// A change of case only ("README.md" → "readme.md") is undone too, although +/// the Mac's disk finds the old name for the new one. +#[test] +fn cmd_z_undoes_a_change_of_case() { + let fx = fixture(); + let mut h = harness(&fx, WIDE, Theme::Light); + let names = |fx: &Fixture| -> Vec { + std::fs::read_dir(&fx.root) + .unwrap() + .map(|e| e.unwrap().file_name().to_string_lossy().into_owned()) + .filter(|n| n.eq_ignore_ascii_case("readme.md")) + .collect() + }; + select(&mut h, Side::Left, &["README.md"]); + h.key_press(Key::F2); + h.run_steps(2); + enter_name(&mut h, "readme.md"); + wait_for(&mut h, "the rename", |h| { + names(&fx) == ["readme.md"] && app(h).history.can_undo() + }); + + undo(&mut h); + wait_idle(&mut h); + assert_eq!(names(&fx), ["README.md"]); +} diff --git a/crates/app/src/ux_tests.rs b/crates/app/src/ux_tests.rs index abd4324..8fccba1 100644 --- a/crates/app/src/ux_tests.rs +++ b/crates/app/src/ux_tests.rs @@ -3570,6 +3570,9 @@ mod native_dnd_ux_tests; #[path = "trash_ux_tests.rs"] mod trash_ux_tests; +#[path = "undo_ux_tests.rs"] +mod undo_ux_tests; + #[path = "host_key_ux_tests.rs"] mod host_key_ux_tests; diff --git a/crates/app/src/worker.rs b/crates/app/src/worker.rs index 6d250a1..b8e71aa 100644 --- a/crates/app/src/worker.rs +++ b/crates/app/src/worker.rs @@ -155,6 +155,15 @@ pub enum WorkResult { /// The `FileAction` to finish with the result. action: Option, result: Result<(), String>, + /// Reverts the operation: recorded for Undo when it succeeded. + undo: Option, + }, + /// An Undo or Redo step ran (`redo`: from Redo). + Undone { + redo: bool, + /// Directories whose listings should be refreshed afterwards. + refresh: Vec<(SharedVfs, VfsPath)>, + outcome: crate::undo::Outcome, }, } diff --git a/docs/i18n/glossary.md b/docs/i18n/glossary.md index 0cc543a..9490e33 100644 --- a/docs/i18n/glossary.md +++ b/docs/i18n/glossary.md @@ -45,6 +45,8 @@ Short UI terms only (menus, commands, buttons, settings labels, dialog titles, s | `cmd.move_to_trash` | Move to Trash | In den Papierkorb legen | 移到废纸篓 | Trasladar a la papelera | Placer dans la corbeille | Sposta nel Cestino | Переместить в Корзину | | `cmd.delete_permanently` | Delete Immediately… | Sofort löschen … | 立即删除… | Eliminar inmediatamente… | Supprimer immédiatement… | Elimina immediatamente… | Удалить немедленно… | | `cmd.empty_trash` | Empty Trash… | Papierkorb entleeren … | 清倒废纸篓… | Vaciar papelera… | Vider la corbeille… | Svuota il Cestino… | Очистить Корзину… | +| `cmd.undo` | Undo | Widerrufen | 撤销 | Deshacer | Annuler | Annulla | Отменить | +| `cmd.redo` | Redo | Wiederholen | 重做 | Rehacer | Rétablir | Ripeti | Повторить | | `cmd.select_all` | Select All | Alles auswählen | 全选 | Seleccionar todo | Tout sélectionner | Seleziona tutto | Выбрать все | | `cmd.toggle_hidden` | Show Hidden Files | Unsichtbare Dateien einblenden | 显示隐藏文件 | Mostrar archivos ocultos | Afficher les fichiers masqués | Mostra file nascosti | Показать скрытые файлы | | `cmd.new_tab` | New Tab | Neuer Tab | 新建标签页 | Nueva pestaña | Nouvel onglet | Nuova scheda | Новая вкладка | diff --git a/docs/manual/de/05-dateien.md b/docs/manual/de/05-dateien.md index 8a779c9..169b6cf 100644 --- a/docs/manual/de/05-dateien.md +++ b/docs/manual/de/05-dateien.md @@ -227,7 +227,7 @@ Manta löscht wie der Finder: | Wo | ⌘⌫ (**In den Papierkorb legen**) | ⌥⌘⌫ (**Sofort löschen …**) | |---|---|---| -| Dein Mac (auch externe Laufwerke und Cloud-Ordner) | Legt die Objekte ohne Rückfrage in den **Papierkorb**. **Zurücklegen** im Finder holt sie zurück. | Löscht nach Rückfrage endgültig. | +| Dein Mac (auch externe Laufwerke und Cloud-Ordner) | Legt die Objekte ohne Rückfrage in den **Papierkorb**. **⌘Z** (**Widerrufen**) oder **Zurücklegen** im Finder holt sie zurück. | Löscht nach Rückfrage endgültig. | | Server (SFTP, FTP, FTPS), S3, Container | Es gibt keinen Papierkorb: löscht nach Rückfrage endgültig. | Löscht nach Rückfrage endgültig. | | Archive | Schreibgeschützt: Es lässt sich nichts löschen. | Schreibgeschützt. | @@ -236,7 +236,7 @@ So legst du Objekte in den Papierkorb: 1. Wähle die Objekte aus. 2. Drücke **⌘⌫** oder die Entfernen-Taste **⌦**, oder wähle **In den Papierkorb legen** im Kontextmenü oder in der Symbolleiste – oder zieh sie auf **Papierkorb** in der Seitenleiste. -Eine Meldung bestätigt es („3 Objekte in den Papierkorb gelegt“). Um Objekte zurückzuholen, öffne den Papierkorb im Finder, wähle sie aus und wähle **Zurücklegen**. Ein eigenes Widerrufen hat Manta dafür nicht. +Eine Meldung bestätigt es („3 Objekte in den Papierkorb gelegt“). Um die Objekte zurückzuholen, drücke **⌘Z** (**Widerrufen**): Manta legt sie dorthin zurück, wo sie waren, siehe [Widerrufen](#widerrufen). Ältere Objekte oder solche, die du in einer anderen App gelöscht hast, holst du im Finder zurück: Öffne dort den Papierkorb, wähle sie aus und wähle **Zurücklegen**. So löschst du endgültig: @@ -252,6 +252,24 @@ Den Papierkorb selbst öffnest du über **Papierkorb** in der Seitenleiste. Dari > [!CAUTION] > In **Cloud-Ordnern** (iCloud Drive, Google Drive, OneDrive, Dropbox) verschwindet ein Objekt, das du in den Papierkorb legst, auch aus der Cloud, sobald dein Mac synchronisiert. **Zurücklegen** holt es meist zurück; manche Anbieter haben zusätzlich einen Papierkorb auf ihrer Website. Siehe [Cloud-Speicher](09-cloud.md). +## Widerrufen {#widerrufen} + +**⌘Z** (**Widerrufen**) macht deinen letzten Dateivorgang rückgängig, wie im Finder, und **⇧⌘Z** (**Wiederholen**) führt ihn erneut aus. Beide findest du im Menü **Bearbeiten** und in der Befehlspalette. Manta merkt sich bis zu 100 Schritte, bis du es beendest. + +| Was du getan hast | Was **⌘Z** macht | +|---|---| +| **In den Papierkorb legen** (**⌘⌫** oder Ziehen auf **Papierkorb** in der Seitenleiste) | Legt die Objekte dorthin zurück, wo sie waren. | +| Umbenennen (**Umbenennen …**, per Klick umbenennen, Informationsfenster) | Stellt den alten Namen wieder her, auch auf Servern. | +| **Neuer Ordner …** oder **Neue Datei …** auf deinem Mac | Legt das neue Objekt in den Papierkorb, wie der Finder, samt allem, was du inzwischen hineingelegt hast. **⇧⌘Z** holt es zurück. | +| **Neuer Ordner …** oder **Neue Datei …** auf einem Server, in S3 oder in einem Container | Es gibt keinen Papierkorb: Manta löscht das neue Objekt, aber nur, solange es noch leer ist. Sonst meldet Manta, dass es sich nicht löschen ließ, und lässt es stehen. | + +Nicht widerrufen lassen sich Kopieren und Bewegen (**F5**, **F6**, Drag & Drop) und alles Endgültige: **Sofort löschen …**, Löschen auf Servern und **Papierkorb entleeren …**. **Stapelweise umbenennen …** hat ein eigenes **Widerrufen**, siehe [Stapelweise umbenennen](14-plugins.md#umbenennen). + +Ist der ursprüngliche Ort inzwischen wieder belegt (dort liegt ein Objekt mit demselben Namen), ersetzt Manta nichts. Es meldet „‚Name‘ konnte nicht zurückgelegt werden“ und behält den Schritt: Sobald der Platz frei ist, funktioniert **⌘Z** wieder. + +- In einem **Textfeld** (Filter, Pfad, Name beim Umbenennen) widerrufen **⌘Z** und **⇧⌘Z** deine Eingabe, nicht Dateivorgänge. Solange das **Terminal** den Fokus hat, gehört **⌘Z** dem Terminal. +- Ohne [Festplattenvollzugriff](07-favoriten-seitenleiste.md#papierkorb-zugriff) legt Manta Objekte über den Finder aus dem Papierkorb zurück, wie bei **Papierkorb entleeren …**: macOS fragt beim ersten Mal, ob Manta den Finder steuern darf. + ## Tags {#tags} Manta liest und setzt dieselben Tags wie der Finder (sie gehören zur Datei, Finder, Spotlight und andere Apps sehen sie also auch). Objekte mit Tags zeigen farbige Punkte bei ihrem Namen, in jeder Darstellung – in der Liste und in den Spalten hinter dem Namen, in Symbolen und Galerie davor. Tags gibt es für Objekte auf diesem Mac, auch in iCloud Drive und anderen Cloud-Ordnern; Server und Archive haben keine. diff --git a/docs/manual/de/07-favoriten-seitenleiste.md b/docs/manual/de/07-favoriten-seitenleiste.md index 807a6d7..a9aa0aa 100644 --- a/docs/manual/de/07-favoriten-seitenleiste.md +++ b/docs/manual/de/07-favoriten-seitenleiste.md @@ -55,7 +55,7 @@ Der **Papierkorb** steht als letzter Eintrag unter **Orte**, wie im Finder. Sein - **Öffnen**: Klicke auf **Papierkorb**. Er öffnet sich im aktiven Bereich wie ein normaler Ordner. Mit **Sofort löschen …** (oder **⌘⌫**) löschst du darin einzelne Objekte endgültig – Manta fragt vorher nach. - **Entleeren**: Rechtsklick auf **Papierkorb** → **Papierkorb entleeren …**, oder **⇧⌘⌫**, oder **Papierkorb entleeren …** in der Befehlspalette. Manta fragt nach („Möchtest du die Objekte im Papierkorb wirklich endgültig löschen?“) und nennt Anzahl und Größe. Du kannst das nicht widerrufen. Objekte, die sich nicht löschen lassen (z. B. geschützte), überspringt Manta und meldet sie. - **Hineinziehen**: Zieh Objekte aus einem Bereich auf **Papierkorb**. Der Eintrag wird hervorgehoben, am Mauszeiger steht z. B. „3 Objekte in den Papierkorb legen“. Lokale Objekte landen ohne Rückfrage im Papierkorb (wie mit **⌘⌫**). Objekte von einem **Server**, aus **S3** oder einem **Container** können nicht in den Papierkorb: Manta fragt, ob sie endgültig gelöscht werden sollen. Objekte aus einem **Archiv** lassen sich nicht löschen – der Mauszeiger zeigt das. Auch Dateien aus anderen Apps (z. B. aus dem Finder) kannst du auf den Papierkorb ziehen. -- **Zurücklegen**: Das geht nur im Finder (Rechtsklick → **Im Finder öffnen**, dann **Zurücklegen**). Der Finder speichert den ursprünglichen Ort in eigenen Daten, die Manta nicht lesen kann. +- **Zurücklegen**: Was du gerade in Manta in den Papierkorb gelegt hast, holt **⌘Z** (**Widerrufen**) zurück, siehe [Widerrufen](05-dateien.md#widerrufen). Ältere Objekte legst du im Finder zurück (Rechtsklick → **Im Finder öffnen**, dann **Zurücklegen**): Der Finder speichert den ursprünglichen Ort in eigenen Daten, die Manta nicht lesen kann. ### Festplattenvollzugriff {#papierkorb-zugriff} diff --git a/docs/manual/de/11-terminal.md b/docs/manual/de/11-terminal.md index 90f3e5d..3a3bde0 100644 --- a/docs/manual/de/11-terminal.md +++ b/docs/manual/de/11-terminal.md @@ -74,7 +74,7 @@ Ausschalten: **Dateiaktionen im Terminal zeigen** in den Einstellungen. ## Tastatur im Terminal {#tastatur} -Solange das Terminal den Fokus hat, gehören diese Kürzel dem Terminal statt Manta: **⌘C**, **⌘V**, **⌘A**, **⌘K**, **⌘←**, **⌘→** und **⌘⌫**. Andere Manta-Kürzel wie **⇧⌘P** funktionieren weiter. Klicke in die Dateiliste, um Manta wieder die Tastatur zu geben. +Solange das Terminal den Fokus hat, gehören diese Kürzel dem Terminal statt Manta: **⌘C**, **⌘V**, **⌘A**, **⌘K**, **⌘←**, **⌘→**, **⌘⌫** und **⌘Z**. Andere Manta-Kürzel wie **⇧⌘P** funktionieren weiter. Klicke in die Dateiliste, um Manta wieder die Tastatur zu geben. ## Grenzen {#grenzen} diff --git a/docs/manual/de/18-tastenkuerzel.md b/docs/manual/de/18-tastenkuerzel.md index 936e75f..3130211 100644 --- a/docs/manual/de/18-tastenkuerzel.md +++ b/docs/manual/de/18-tastenkuerzel.md @@ -86,6 +86,8 @@ Die Kürzel wirken auf den aktiven Bereich. Siehe [Ansichten](03-ansichten.md). | ⌘⌫ oder ⌦ | In den Papierkorb legen (auf Servern: nach Rückfrage endgültig löschen, siehe [Löschen](05-dateien.md#loeschen)) | | ⌥⌘⌫ | Sofort löschen … (endgültig, nach Rückfrage) | | ⇧⌘⌫ | Papierkorb entleeren … (nach Rückfrage, siehe [Papierkorb](07-favoriten-seitenleiste.md#papierkorb)) | +| ⌘Z | Widerrufen (In den Papierkorb legen, Umbenennen, Neuer Ordner, Neue Datei; siehe [Widerrufen](05-dateien.md#widerrufen)) | +| ⇧⌘Z | Wiederholen | | ⌥⌘C | Komprimieren … | | ⌥⌘E | Hier entpacken | | ⌘ beim Ziehen | Bewegen statt Kopieren vorwählen (ohne Taste ist Kopieren vorausgewählt; ⌥ wählt ausdrücklich Kopieren) | @@ -121,7 +123,7 @@ Eigene Schnellaktionen können ein eigenes Kürzel bekommen (Feld `shortcut` in ## Wann Kürzel nicht wirken {#fokus} - In einem **Textfeld** (Filter, Pfad, Dialogfelder) funktionieren nur **⇧⌘P**, **⇧⌘G**, **⌘,** und **⌘?**; alle anderen Tasten gehören dem Textfeld. -- Im **Terminal** gehören **⌘C**, **⌘V**, **⌘A**, **⌘K**, **⌘←**, **⌘→** und **⌘⌫** dem Terminal. Klicke in die Dateiliste, um Manta die Tastatur zurückzugeben. +- Im **Terminal** gehören **⌘C**, **⌘V**, **⌘A**, **⌘K**, **⌘←**, **⌘→**, **⌘⌫** und **⌘Z** dem Terminal. Klicke in die Dateiliste, um Manta die Tastatur zurückzugeben. - In den Fenstern **Einstellungen**, **Vergleichen und synchronisieren** und **Vorschau** wirken nur deren eigene Kürzel. ## Bedienung ohne Maus {#tastatur} diff --git a/docs/manual/de/20-faq.md b/docs/manual/de/20-faq.md index ed07fa2..bc06891 100644 --- a/docs/manual/de/20-faq.md +++ b/docs/manual/de/20-faq.md @@ -32,7 +32,7 @@ So viele, wie in dein Fenster passen – jeder braucht etwa 280 Punkte Breite. M ### Wo ist der Papierkorb? Kann ich Gelöschtes wiederherstellen? {#papierkorb} -Ja, für Objekte auf deinem Mac: **⌘⌫** legt sie wie im Finder in den Papierkorb von macOS, und **Zurücklegen** im Finder holt sie zurück. **⌥⌘⌫** (**Sofort löschen …**) löscht nach Rückfrage endgültig. Server, S3 und Container haben keinen Papierkorb: Dort ist Löschen immer endgültig, und Manta fragt vorher nach. Siehe [Löschen](05-dateien.md#loeschen). +Ja, für Objekte auf deinem Mac: **⌘⌫** legt sie wie im Finder in den Papierkorb von macOS. Direkt danach legt **⌘Z** (**Widerrufen**) sie wieder zurück; später geht es mit **Zurücklegen** im Finder. **⌥⌘⌫** (**Sofort löschen …**) löscht nach Rückfrage endgültig. Server, S3 und Container haben keinen Papierkorb: Dort ist Löschen immer endgültig, und Manta fragt vorher nach. Siehe [Löschen](05-dateien.md#loeschen). ### Wird beim Ziehen kopiert oder bewegt? {#ziehen} diff --git a/docs/manual/en/05-dateien.md b/docs/manual/en/05-dateien.md index b88d68b..6421e9d 100644 --- a/docs/manual/en/05-dateien.md +++ b/docs/manual/en/05-dateien.md @@ -227,7 +227,7 @@ Manta deletes like Finder: | Where | ⌘⌫ (**Move to Trash**) | ⌥⌘⌫ (**Delete Immediately…**) | |---|---|---| -| Your Mac (also external drives and cloud folders) | Moves the items to the **Trash**, without asking. Finder's **Put Back** restores them. | Deletes permanently after asking. | +| Your Mac (also external drives and cloud folders) | Moves the items to the **Trash**, without asking. **⌘Z** (**Undo**) or Finder's **Put Back** restores them. | Deletes permanently after asking. | | Servers (SFTP, FTP, FTPS), S3, containers | There is no Trash: deletes permanently after asking. | Deletes permanently after asking. | | Archives | Read-only: nothing can be deleted. | Read-only. | @@ -236,7 +236,7 @@ To move items to the Trash: 1. Select them. 2. Press **⌘⌫** or the forward-delete key **⌦**, or choose **Move to Trash** in the context menu or the toolbar – or drag them onto **Trash** in the sidebar. -A message confirms it ("Moved 3 items to the Trash"). To get items back, open the Trash in Finder, select them and choose **Put Back**. Manta has no Undo of its own for this. +A message confirms it ("Moved 3 items to the Trash"). To get the items back, press **⌘Z** (**Undo**): Manta puts them back where they were, see [Undo](#widerrufen). For older items, or ones deleted in another app, open the Trash in Finder, select them and choose **Put Back**. To delete permanently: @@ -252,6 +252,24 @@ To open the Trash itself, click **Trash** in the sidebar. In it, **⌘⌫** (the > [!CAUTION] > In **cloud folders** (iCloud Drive, Google Drive, OneDrive, Dropbox) an item you move to the Trash also disappears from the cloud as soon as your Mac syncs. **Put Back** usually brings it back; some providers also keep a trash on their website. See [Cloud Storage](09-cloud.md). +## Undo {#widerrufen} + +**⌘Z** (**Undo**) reverts your last file operation, like in Finder, and **⇧⌘Z** (**Redo**) does it again. Both are in the **Edit** menu and the command palette. Manta remembers up to 100 steps until you quit it. + +| What you did | What **⌘Z** does | +|---|---| +| **Move to Trash** (**⌘⌫**, or dragging onto **Trash** in the sidebar) | Puts the items back where they were. | +| Rename (**Rename…**, click to rename, the Info window) | Brings back the old name, on servers too. | +| **New Folder…** or **New File…** on your Mac | Moves the new item to the Trash, like Finder, along with anything you have put into it. **⇧⌘Z** brings it back. | +| **New Folder…** or **New File…** on a server, in S3 or in a container | There is no Trash: Manta deletes the new item, but only while it is still empty. Otherwise it says it couldn't delete it and leaves it where it is. | + +Not undoable: copying and moving (**F5**, **F6**, drag and drop) and everything permanent: **Delete Immediately…**, deleting on servers and **Empty Trash…**. **Batch Rename…** has its own **Undo**, see [Batch Rename](14-plugins.md#umbenennen). + +If the original place has been taken in the meantime (an item with the same name is there), Manta replaces nothing. It reports "Couldn't put back “name”" and keeps the step, so **⌘Z** works again once the place is free. + +- In a **text field** (filter, path, a name you are renaming) **⌘Z** and **⇧⌘Z** undo your typing, not file operations. While the **terminal** has focus, **⌘Z** belongs to the terminal. +- Without [Full Disk Access](07-favoriten-seitenleiste.md#papierkorb-zugriff), Manta puts items back from the Trash through Finder, as it does for **Empty Trash…**: macOS asks once whether Manta may control Finder. + ## Tags {#tags} Manta reads and sets the same tags as Finder (they live with the file, so Finder, Spotlight and other apps see them). Tagged items show coloured dots after their name in every view – in the list and the columns after the name, in Icons and Gallery before it. Tags work for items on this Mac, including iCloud Drive and other cloud folders; servers and archives have none. diff --git a/docs/manual/en/07-favoriten-seitenleiste.md b/docs/manual/en/07-favoriten-seitenleiste.md index 11bd396..b7c37c2 100644 --- a/docs/manual/en/07-favoriten-seitenleiste.md +++ b/docs/manual/en/07-favoriten-seitenleiste.md @@ -55,7 +55,7 @@ The **Trash** is the last row under **Locations**, as in Finder. Its icon shows - **Open**: click **Trash**. It opens in the active pane like any folder. **Delete Immediately…** (or **⌘⌫**) deletes single items in it for good – Manta asks first. - **Empty**: right-click **Trash** → **Empty Trash…**, or press **⇧⌘⌫**, or choose **Empty Trash…** in the command palette. Manta asks (“Are you sure you want to permanently erase the items in the Trash?”) and shows the number of items and their size. You can't undo this. Items that can't be deleted (locked ones, for example) are skipped and reported. - **Drag onto it**: drag items from a pane onto **Trash**. The row is highlighted and the pointer says e.g. “Move 3 items to the Trash”. Local items go to the Trash without asking (like **⌘⌫**). Items on a **server**, in **S3** or in a **container** can't go to a Trash: Manta asks whether to delete them permanently. Items in an **archive** can't be deleted – the pointer shows it. You can also drag files from other apps (Finder, for example) onto the Trash. -- **Put Back**: only in Finder (right-click → **Open in Finder**, then **Put Back**). Finder keeps the original location in its own data, which Manta can't read. +- **Put Back**: what you just moved to the Trash in Manta comes back with **⌘Z** (**Undo**), see [Undo](05-dateien.md#widerrufen). For older items use Finder (right-click → **Open in Finder**, then **Put Back**): Finder keeps the original location in its own data, which Manta can't read. ### Full Disk Access {#papierkorb-zugriff} diff --git a/docs/manual/en/11-terminal.md b/docs/manual/en/11-terminal.md index 431b304..03837b7 100644 --- a/docs/manual/en/11-terminal.md +++ b/docs/manual/en/11-terminal.md @@ -74,7 +74,7 @@ Open **Settings** (**⌘,**) → **Plugins** → **Terminal** → **Settings**. ## Keyboard in the terminal {#tastatur} -While the terminal has focus, these shortcuts belong to the terminal instead of Manta: **⌘C**, **⌘V**, **⌘A**, **⌘K**, **⌘←**, **⌘→** and **⌘⌫**. Other Manta shortcuts such as **⇧⌘P** keep working. Click into the file list to give the keyboard back to Manta. +While the terminal has focus, these shortcuts belong to the terminal instead of Manta: **⌘C**, **⌘V**, **⌘A**, **⌘K**, **⌘←**, **⌘→**, **⌘⌫** and **⌘Z**. Other Manta shortcuts such as **⇧⌘P** keep working. Click into the file list to give the keyboard back to Manta. ## Limitations {#grenzen} diff --git a/docs/manual/en/18-tastenkuerzel.md b/docs/manual/en/18-tastenkuerzel.md index 0cbcc1b..8f4fb74 100644 --- a/docs/manual/en/18-tastenkuerzel.md +++ b/docs/manual/en/18-tastenkuerzel.md @@ -86,6 +86,8 @@ The shortcuts act on the active pane. See [Views](03-ansichten.md). | ⌘⌫ or ⌦ | Move to Trash (on servers: delete permanently after asking, see [Delete](05-dateien.md#loeschen)) | | ⌥⌘⌫ | Delete Immediately… (permanent, after asking) | | ⇧⌘⌫ | Empty Trash… (after asking, see [Trash](07-favoriten-seitenleiste.md#papierkorb)) | +| ⌘Z | Undo (Move to Trash, Rename, New Folder, New File; see [Undo](05-dateien.md#widerrufen)) | +| ⇧⌘Z | Redo | | ⌥⌘C | Compress… | | ⌥⌘E | Extract Here | | ⌘ while dragging | Preselect Move instead of Copy (without a key Copy is preselected; ⌥ preselects Copy explicitly) | @@ -121,7 +123,7 @@ Your own Quick Actions can have a shortcut of their own (the `shortcut` field in ## When shortcuts don't work {#fokus} - In a **text field** (filter, path, dialog fields) only **⇧⌘P**, **⇧⌘G**, **⌘,** and **⌘?** work; all other keys belong to the field. -- In the **terminal**, **⌘C**, **⌘V**, **⌘A**, **⌘K**, **⌘←**, **⌘→** and **⌘⌫** belong to the terminal. Click into the file list to give the keyboard back to Manta. +- In the **terminal**, **⌘C**, **⌘V**, **⌘A**, **⌘K**, **⌘←**, **⌘→**, **⌘⌫** and **⌘Z** belong to the terminal. Click into the file list to give the keyboard back to Manta. - In the **Settings**, **Compare & Sync** and **preview** windows only their own shortcuts work. ## Keyboard-only use {#tastatur} diff --git a/docs/manual/en/20-faq.md b/docs/manual/en/20-faq.md index 0c75dfb..b452092 100644 --- a/docs/manual/en/20-faq.md +++ b/docs/manual/en/20-faq.md @@ -32,7 +32,7 @@ As many as fit in your window – each needs about 280 points of width. At least ### Where's the Trash? Can I get deleted files back? {#papierkorb} -Yes, for items on your Mac: **⌘⌫** moves them to the macOS Trash, like Finder, and Finder's **Put Back** restores them. **⌥⌘⌫** (**Delete Immediately…**) deletes permanently after asking. Servers, S3 and containers have no Trash: deleting there is always permanent, and Manta asks first. See [Delete](05-dateien.md#loeschen). +Yes, for items on your Mac: **⌘⌫** moves them to the macOS Trash, like Finder. Right afterwards, **⌘Z** (**Undo**) puts them back where they were; later on, Finder's **Put Back** restores them. **⌥⌘⌫** (**Delete Immediately…**) deletes permanently after asking. Servers, S3 and containers have no Trash: deleting there is always permanent, and Manta asks first. See [Delete](05-dateien.md#loeschen). ### Does dragging copy or move? {#ziehen} diff --git a/docs/manual/es/05-dateien.md b/docs/manual/es/05-dateien.md index 20429fe..60aa0b1 100644 --- a/docs/manual/es/05-dateien.md +++ b/docs/manual/es/05-dateien.md @@ -227,7 +227,7 @@ Manta elimina como Finder: | Dónde | ⌘⌫ (**Trasladar a la papelera**) | ⌥⌘⌫ (**Eliminar inmediatamente…**) | |---|---|---| -| Tu Mac (también unidades externas y carpetas en la nube) | Traslada los ítems a la **Papelera**, sin preguntar. La opción **Devolver** de Finder los restaura. | Elimina definitivamente tras preguntar. | +| Tu Mac (también unidades externas y carpetas en la nube) | Traslada los ítems a la **Papelera**, sin preguntar. **⌘Z** (**Deshacer**) o la opción **Devolver** de Finder los restauran. | Elimina definitivamente tras preguntar. | | Servidores (SFTP, FTP, FTPS), S3, contenedores | No hay papelera: elimina definitivamente tras preguntar. | Elimina definitivamente tras preguntar. | | Archivos comprimidos | Solo lectura: no se puede eliminar nada. | Solo lectura. | @@ -236,7 +236,7 @@ Para trasladar ítems a la papelera: 1. Selecciónalos. 2. Pulsa **⌘⌫** o la tecla de borrar hacia delante **⌦**, o elige **Trasladar a la papelera** en el menú contextual o en la barra de herramientas, o arrástralos a **Papelera** en la barra lateral. -Un mensaje lo confirma (“Se han trasladado 3 ítems a la papelera”). Para recuperar ítems, abre la papelera en Finder, selecciónalos y elige **Devolver**. Manta no tiene una función Deshacer propia para esto. +Un mensaje lo confirma (“Se han trasladado 3 ítems a la papelera”). Para recuperar los ítems, pulsa **⌘Z** (**Deshacer**): Manta los devuelve a donde estaban; consulta [Deshacer](#widerrufen). Para ítems más antiguos o eliminados desde otra app, abre la papelera en Finder, selecciónalos y elige **Devolver**. Para eliminar definitivamente: @@ -252,6 +252,24 @@ Para abrir la propia papelera, haz clic en **Papelera** en la barra lateral. Den > [!CAUTION] > En las **carpetas en la nube** (iCloud Drive, Google Drive, OneDrive, Dropbox), un ítem que trasladas a la papelera desaparece también de la nube en cuanto tu Mac se sincroniza. **Devolver** suele recuperarlo; algunos proveedores también tienen una papelera en su sitio web. Consulta [Almacenamiento en la nube](09-cloud.md). +## Deshacer {#widerrufen} + +**⌘Z** (**Deshacer**) revierte tu última operación con archivos, como en Finder, y **⇧⌘Z** (**Rehacer**) la vuelve a hacer. Ambos están en el menú **Edición** y en la paleta de comandos. Manta recuerda hasta 100 pasos mientras no lo cierres. + +| Lo que hiciste | Lo que hace **⌘Z** | +|---|---| +| **Trasladar a la papelera** (**⌘⌫**, o arrastrar a **Papelera** en la barra lateral) | Devuelve los ítems a donde estaban. | +| Renombrar (**Renombrar…**, renombrar con un clic, la ventana de información) | Recupera el nombre anterior, también en servidores. | +| **Nueva carpeta…** o **Nuevo archivo…** en tu Mac | Traslada el ítem nuevo a la papelera, como Finder, junto con todo lo que hayas puesto dentro. **⇧⌘Z** lo recupera. | +| **Nueva carpeta…** o **Nuevo archivo…** en un servidor, en S3 o en un contenedor | No hay papelera: Manta elimina el ítem nuevo, pero solo mientras siga vacío. Si no, avisa de que no ha podido eliminarlo y lo deja donde está. | + +No se puede deshacer copiar y mover (**F5**, **F6**, arrastrar y soltar) ni nada definitivo: **Eliminar inmediatamente…**, eliminar en servidores y **Vaciar papelera…**. **Renombrar en lote…** tiene su propio **Deshacer**; consulta [Renombrar en lote](14-plugins.md#umbenennen). + +Si mientras tanto el lugar original vuelve a estar ocupado (hay un ítem con el mismo nombre), Manta no reemplaza nada. Avisa con “No se ha podido devolver ‘nombre’” y conserva el paso, así que **⌘Z** vuelve a funcionar en cuanto el lugar quede libre. + +- En un **campo de texto** (filtro, ruta, el nombre que estás cambiando), **⌘Z** y **⇧⌘Z** deshacen lo que escribes, no las operaciones con archivos. Mientras el **terminal** tiene el foco, **⌘Z** pertenece al terminal. +- Sin [Acceso total al disco](07-favoriten-seitenleiste.md#papierkorb-zugriff), Manta devuelve los ítems de la papelera a través de Finder, igual que con **Vaciar papelera…**: macOS pregunta una vez si Manta puede controlar Finder. + ## Etiquetas {#tags} Manta lee y asigna las mismas etiquetas que el Finder (se guardan con el archivo, así que el Finder, Spotlight y otras apps las ven). Los ítems etiquetados muestran puntos de color junto a su nombre en todas las visualizaciones: en Lista y Columnas detrás del nombre, en Iconos y Galería delante. Las etiquetas funcionan con los ítems de este Mac, incluidos iCloud Drive y otras carpetas en la nube; los servidores y los archivos comprimidos no tienen. diff --git a/docs/manual/es/07-favoriten-seitenleiste.md b/docs/manual/es/07-favoriten-seitenleiste.md index a8d03df..fcb8173 100644 --- a/docs/manual/es/07-favoriten-seitenleiste.md +++ b/docs/manual/es/07-favoriten-seitenleiste.md @@ -55,7 +55,7 @@ La **Papelera** es la última fila de **Ubicaciones**, como en Finder. Su icono - **Abrir**: haz clic en **Papelera**. Se abre en el panel activo como cualquier carpeta. **Eliminar inmediatamente…** (o **⌘⌫**) elimina definitivamente ítems sueltos de su interior; Manta pregunta antes. - **Vaciar**: haz clic derecho en **Papelera** → **Vaciar papelera…**, pulsa **⇧⌘⌫** o elige **Vaciar papelera…** en la paleta de comandos. Manta pregunta (“¿Seguro que quieres eliminar permanentemente los ítems de la papelera?”) y muestra el número de ítems y su tamaño. Esta acción no se puede deshacer. Los ítems que no se pueden eliminar (los bloqueados, por ejemplo) se omiten y se notifican. - **Arrastrar a ella**: arrastra ítems de un panel a **Papelera**. La fila se resalta y el puntero indica, por ejemplo, “Trasladar 3 ítems a la papelera”. Los ítems locales van a la papelera sin preguntar (como con **⌘⌫**). Los ítems de un **servidor**, de **S3** o de un **contenedor** no pueden ir a una papelera: Manta pregunta si quieres eliminarlos definitivamente. Los ítems de un **archivo comprimido** no se pueden eliminar; el puntero lo indica. También puedes arrastrar archivos de otras apps (de Finder, por ejemplo) a la papelera. -- **Devolver**: solo en Finder (clic derecho → **Abrir en Finder** y después **Devolver**). Finder guarda la ubicación original en sus propios datos, que Manta no puede leer. +- **Devolver**: lo que acabas de trasladar a la papelera en Manta vuelve con **⌘Z** (**Deshacer**); consulta [Deshacer](05-dateien.md#widerrufen). Para ítems más antiguos, usa Finder (clic derecho → **Abrir en Finder** y después **Devolver**): Finder guarda la ubicación original en sus propios datos, que Manta no puede leer. ### Acceso total al disco {#papierkorb-zugriff} diff --git a/docs/manual/es/11-terminal.md b/docs/manual/es/11-terminal.md index ac5d560..0f8d1ca 100644 --- a/docs/manual/es/11-terminal.md +++ b/docs/manual/es/11-terminal.md @@ -74,7 +74,7 @@ Abre **Ajustes** (**⌘,**) → **Plugins** → **Terminal** → **Ajustes**. ## El teclado en el terminal {#tastatur} -Mientras el terminal tiene el foco, estos atajos pertenecen al terminal en lugar de a Manta: **⌘C**, **⌘V**, **⌘A**, **⌘K**, **⌘←**, **⌘→** y **⌘⌫**. Otros atajos de Manta, como **⇧⌘P**, siguen funcionando. Haz clic en la lista de archivos para devolver el teclado a Manta. +Mientras el terminal tiene el foco, estos atajos pertenecen al terminal en lugar de a Manta: **⌘C**, **⌘V**, **⌘A**, **⌘K**, **⌘←**, **⌘→**, **⌘⌫** y **⌘Z**. Otros atajos de Manta, como **⇧⌘P**, siguen funcionando. Haz clic en la lista de archivos para devolver el teclado a Manta. ## Limitaciones {#grenzen} diff --git a/docs/manual/es/18-tastenkuerzel.md b/docs/manual/es/18-tastenkuerzel.md index b301177..64a3a67 100644 --- a/docs/manual/es/18-tastenkuerzel.md +++ b/docs/manual/es/18-tastenkuerzel.md @@ -86,6 +86,8 @@ Los atajos actúan sobre el panel activo. Consulta [Visualizaciones](03-ansichte | ⌘⌫ o ⌦ | Trasladar a la papelera (en servidores: eliminar definitivamente tras preguntar; consulta [Eliminar](05-dateien.md#loeschen)) | | ⌥⌘⌫ | Eliminar inmediatamente… (definitivo, tras preguntar) | | ⇧⌘⌫ | Vaciar papelera… (tras preguntar; consulta [Papelera](07-favoriten-seitenleiste.md#papierkorb)) | +| ⌘Z | Deshacer (trasladar a la papelera, renombrar, nueva carpeta, nuevo archivo; consulta [Deshacer](05-dateien.md#widerrufen)) | +| ⇧⌘Z | Rehacer | | ⌥⌘C | Comprimir… | | ⌥⌘E | Extraer aquí | | ⌘ al arrastrar | Preseleccionar Mover en lugar de Copiar (sin tecla se preselecciona Copiar; ⌥ preselecciona Copiar de forma explícita) | @@ -121,7 +123,7 @@ Tus propias acciones rápidas pueden tener un atajo propio (el campo `shortcut` ## Cuando los atajos no funcionan {#fokus} - En un **campo de texto** (filtro, ruta, campos de diálogo) solo funcionan **⇧⌘P**, **⇧⌘G**, **⌘,** y **⌘?**; todas las demás teclas pertenecen al campo. -- En el **terminal**, **⌘C**, **⌘V**, **⌘A**, **⌘K**, **⌘←**, **⌘→** y **⌘⌫** pertenecen al terminal. Haz clic en la lista de archivos para devolver el teclado a Manta. +- En el **terminal**, **⌘C**, **⌘V**, **⌘A**, **⌘K**, **⌘←**, **⌘→**, **⌘⌫** y **⌘Z** pertenecen al terminal. Haz clic en la lista de archivos para devolver el teclado a Manta. - En las ventanas **Ajustes**, **Comparar y sincronizar** y **vista previa** solo funcionan sus propios atajos. ## Uso solo con teclado {#tastatur} diff --git a/docs/manual/es/20-faq.md b/docs/manual/es/20-faq.md index dcd6226..436efd6 100644 --- a/docs/manual/es/20-faq.md +++ b/docs/manual/es/20-faq.md @@ -32,7 +32,7 @@ Tantos como quepan en tu ventana: cada uno necesita unos 280 puntos de anchura. ### ¿Dónde está la papelera? ¿Puedo recuperar archivos eliminados? {#papierkorb} -Sí, en el caso de los ítems de tu Mac: **⌘⌫** los traslada a la papelera de macOS, como Finder, y la opción **Devolver** de Finder los restaura. **⌥⌘⌫** (**Eliminar inmediatamente…**) elimina definitivamente tras preguntar. Los servidores, S3 y los contenedores no tienen papelera: allí eliminar es siempre definitivo, y Manta pregunta antes. Consulta [Eliminar](05-dateien.md#loeschen). +Sí, en el caso de los ítems de tu Mac: **⌘⌫** los traslada a la papelera de macOS, como Finder. Justo después, **⌘Z** (**Deshacer**) los devuelve a su sitio; más adelante, la opción **Devolver** de Finder los restaura. **⌥⌘⌫** (**Eliminar inmediatamente…**) elimina definitivamente tras preguntar. Los servidores, S3 y los contenedores no tienen papelera: allí eliminar es siempre definitivo, y Manta pregunta antes. Consulta [Eliminar](05-dateien.md#loeschen). ### ¿Arrastrar copia o mueve? {#ziehen} diff --git a/docs/manual/fr/05-dateien.md b/docs/manual/fr/05-dateien.md index 3d59085..4e15f1c 100644 --- a/docs/manual/fr/05-dateien.md +++ b/docs/manual/fr/05-dateien.md @@ -227,7 +227,7 @@ Manta supprime comme le Finder : | Où | ⌘⌫ (**Placer dans la corbeille**) | ⌥⌘⌫ (**Supprimer immédiatement…**) | |---|---|---| -| Votre Mac (y compris les disques externes et les dossiers cloud) | Place les éléments dans la **corbeille**, sans confirmation. La commande **Remettre** du Finder les restaure. | Supprime définitivement après confirmation. | +| Votre Mac (y compris les disques externes et les dossiers cloud) | Place les éléments dans la **corbeille**, sans confirmation. **⌘Z** (**Annuler**) ou la commande **Remettre** du Finder les restaure. | Supprime définitivement après confirmation. | | Serveurs (SFTP, FTP, FTPS), S3, conteneurs | Il n’y a pas de corbeille : supprime définitivement après confirmation. | Supprime définitivement après confirmation. | | Archives | Lecture seule : rien ne peut être supprimé. | Lecture seule. | @@ -236,7 +236,7 @@ Pour placer des éléments dans la corbeille : 1. Sélectionnez-les. 2. Appuyez sur **⌘⌫** ou sur la touche de suppression vers l’avant **⌦**, ou choisissez **Placer dans la corbeille** dans le menu contextuel ou la barre d’outils – ou faites-les glisser sur **Corbeille** dans la barre latérale. -Un message le confirme (« 3 éléments placés dans la corbeille »). Pour récupérer des éléments, ouvrez la corbeille dans le Finder, sélectionnez-les et choisissez **Remettre**. Manta n’a pas sa propre fonction d’annulation pour cette opération. +Un message le confirme (« 3 éléments placés dans la corbeille »). Pour récupérer les éléments, appuyez sur **⌘Z** (**Annuler**) : Manta les remet à leur place, voir [Annuler](#widerrufen). Pour des éléments plus anciens ou supprimés dans une autre app, ouvrez la corbeille dans le Finder, sélectionnez-les et choisissez **Remettre**. Pour supprimer définitivement : @@ -252,6 +252,24 @@ Pour ouvrir la corbeille elle-même, cliquez sur **Corbeille** dans la barre lat > [!CAUTION] > Dans les **dossiers cloud** (iCloud Drive, Google Drive, OneDrive, Dropbox), un élément placé dans la corbeille disparaît aussi du cloud dès que votre Mac se synchronise. **Remettre** le restaure généralement ; certains fournisseurs conservent aussi une corbeille sur leur site web. Voir [Stockage cloud](09-cloud.md). +## Annuler {#widerrufen} + +**⌘Z** (**Annuler**) annule votre dernière opération sur les fichiers, comme dans le Finder, et **⇧⌘Z** (**Rétablir**) la refait. Les deux commandes se trouvent dans le menu **Édition** et dans la palette de commandes. Manta mémorise jusqu’à 100 étapes, jusqu’à ce que vous le quittiez. + +| Ce que vous avez fait | Ce que fait **⌘Z** | +|---|---| +| **Placer dans la corbeille** (**⌘⌫**, ou glisser sur **Corbeille** dans la barre latérale) | Remet les éléments à leur emplacement d’origine. | +| Renommer (**Renommer…**, renommer d’un clic, fenêtre d’informations) | Rétablit l’ancien nom, y compris sur les serveurs. | +| **Nouveau dossier…** ou **Nouveau fichier…** sur votre Mac | Place le nouvel élément dans la corbeille, comme le Finder, avec tout ce que vous y avez mis. **⇧⌘Z** le récupère. | +| **Nouveau dossier…** ou **Nouveau fichier…** sur un serveur, dans S3 ou dans un conteneur | Il n’y a pas de corbeille : Manta supprime le nouvel élément, mais seulement tant qu’il est vide. Sinon, Manta indique qu’il n’a pas pu le supprimer et le laisse en place. | + +Ne peuvent pas être annulés : la copie et le déplacement (**F5**, **F6**, glisser-déposer) et tout ce qui est définitif : **Supprimer immédiatement…**, la suppression sur les serveurs et **Vider la corbeille…**. **Renommer par lot…** a sa propre fonction d’annulation, voir [Renommage par lot](14-plugins.md#umbenennen). + +Si l’emplacement d’origine est de nouveau occupé entre-temps (un élément du même nom s’y trouve), Manta ne remplace rien. Il affiche « Impossible de remettre « nom » à sa place » et conserve l’étape : dès que la place est libre, **⌘Z** fonctionne de nouveau. + +- Dans un **champ de texte** (filtre, chemin, nom en cours de modification), **⌘Z** et **⇧⌘Z** annulent la saisie, pas les opérations sur les fichiers. Tant que le **terminal** est actif, **⌘Z** s’adresse au terminal. +- Sans [Accès complet au disque](07-favoriten-seitenleiste.md#papierkorb-zugriff), Manta remet les éléments de la corbeille à leur place via le Finder, comme pour **Vider la corbeille…** : macOS demande une fois si Manta peut contrôler le Finder. + ## Tags {#tags} Manta lit et attribue les mêmes tags que le Finder (ils sont enregistrés avec le fichier : le Finder, Spotlight et les autres apps les voient donc). Les éléments dotés de tags affichent des pastilles de couleur à côté de leur nom dans toutes les présentations – après le nom en Liste et en Colonnes, avant le nom en Icônes et en Galerie. Les tags fonctionnent pour les éléments de ce Mac, y compris iCloud Drive et les autres dossiers cloud ; les serveurs et les archives n’en ont pas. diff --git a/docs/manual/fr/07-favoriten-seitenleiste.md b/docs/manual/fr/07-favoriten-seitenleiste.md index b6bcc5e..6f36e34 100644 --- a/docs/manual/fr/07-favoriten-seitenleiste.md +++ b/docs/manual/fr/07-favoriten-seitenleiste.md @@ -55,7 +55,7 @@ La **Corbeille** est la dernière ligne sous **Emplacements**, comme dans le Fin - **Ouvrir** : cliquez sur **Corbeille**. Elle s’ouvre dans la sous-fenêtre active comme n’importe quel dossier. **Supprimer immédiatement…** (ou **⌘⌫**) y supprime définitivement des éléments individuels – Manta demande d’abord confirmation. - **Vider** : clic droit sur **Corbeille** → **Vider la corbeille…**, ou appuyez sur **⇧⌘⌫**, ou choisissez **Vider la corbeille…** dans la palette de commandes. Manta demande (« Voulez-vous vraiment supprimer définitivement les éléments de la corbeille ? ») et affiche le nombre d’éléments et leur taille. Cette opération est irréversible. Les éléments qui ne peuvent pas être supprimés (les éléments verrouillés, par exemple) sont ignorés et signalés. - **Faire glisser dessus** : faites glisser des éléments d’une sous-fenêtre sur **Corbeille**. La ligne est mise en évidence et le pointeur affiche par exemple « Placer 3 éléments dans la corbeille ». Les éléments locaux sont placés dans la corbeille sans confirmation (comme avec **⌘⌫**). Les éléments situés sur un **serveur**, dans **S3** ou dans un **conteneur** ne peuvent pas aller dans une corbeille : Manta vous demande s’il faut les supprimer définitivement. Les éléments d’une **archive** ne peuvent pas être supprimés – le pointeur l’indique. Vous pouvez aussi faire glisser sur la corbeille des fichiers provenant d’autres apps (le Finder, par exemple). -- **Remettre** : uniquement dans le Finder (clic droit → **Ouvrir dans le Finder**, puis **Remettre**). Le Finder conserve l’emplacement d’origine dans ses propres données, que Manta ne peut pas lire. +- **Remettre** : ce que vous venez de placer dans la corbeille dans Manta revient avec **⌘Z** (**Annuler**), voir [Annuler](05-dateien.md#widerrufen). Pour les éléments plus anciens, passez par le Finder (clic droit → **Ouvrir dans le Finder**, puis **Remettre**) : le Finder conserve l’emplacement d’origine dans ses propres données, que Manta ne peut pas lire. ### Accès complet au disque {#papierkorb-zugriff} diff --git a/docs/manual/fr/11-terminal.md b/docs/manual/fr/11-terminal.md index 2d3ce82..4710ece 100644 --- a/docs/manual/fr/11-terminal.md +++ b/docs/manual/fr/11-terminal.md @@ -74,7 +74,7 @@ Ouvrez **Réglages** (**⌘,**) → **Plug-ins** → **Terminal** → **Réglage ## Clavier dans le terminal {#tastatur} -Tant que le terminal est actif, ces raccourcis s’adressent au terminal et non à Manta : **⌘C**, **⌘V**, **⌘A**, **⌘K**, **⌘←**, **⌘→** et **⌘⌫**. Les autres raccourcis de Manta, comme **⇧⌘P**, continuent de fonctionner. Cliquez dans la liste des fichiers pour rendre le clavier à Manta. +Tant que le terminal est actif, ces raccourcis s’adressent au terminal et non à Manta : **⌘C**, **⌘V**, **⌘A**, **⌘K**, **⌘←**, **⌘→**, **⌘⌫** et **⌘Z**. Les autres raccourcis de Manta, comme **⇧⌘P**, continuent de fonctionner. Cliquez dans la liste des fichiers pour rendre le clavier à Manta. ## Limites {#grenzen} diff --git a/docs/manual/fr/18-tastenkuerzel.md b/docs/manual/fr/18-tastenkuerzel.md index 2caccd2..1f42461 100644 --- a/docs/manual/fr/18-tastenkuerzel.md +++ b/docs/manual/fr/18-tastenkuerzel.md @@ -86,6 +86,8 @@ Les raccourcis agissent sur la sous-fenêtre active. Voir [Présentations](03-an | ⌘⌫ ou ⌦ | Placer dans la corbeille (sur les serveurs : suppression définitive après confirmation, voir [Supprimer](05-dateien.md#loeschen)) | | ⌥⌘⌫ | Supprimer immédiatement… (définitivement, après confirmation) | | ⇧⌘⌫ | Vider la corbeille… (après confirmation, voir [Corbeille](07-favoriten-seitenleiste.md#papierkorb)) | +| ⌘Z | Annuler (placer dans la corbeille, renommer, nouveau dossier, nouveau fichier ; voir [Annuler](05-dateien.md#widerrufen)) | +| ⇧⌘Z | Rétablir | | ⌥⌘C | Compresser… | | ⌥⌘E | Extraire ici | | ⌘ pendant le glissement | Présélectionner Déplacer au lieu de Copier (sans touche, Copier est présélectionné ; ⌥ présélectionne explicitement Copier) | @@ -121,7 +123,7 @@ Vos propres actions rapides peuvent avoir leur propre raccourci (le champ `short ## Quand les raccourcis ne fonctionnent pas {#fokus} - Dans un **champ de texte** (filtre, chemin, champs de zone de dialogue), seuls **⇧⌘P**, **⇧⌘G**, **⌘,** et **⌘?** fonctionnent ; toutes les autres touches s’adressent au champ. -- Dans le **terminal**, **⌘C**, **⌘V**, **⌘A**, **⌘K**, **⌘←**, **⌘→** et **⌘⌫** s’adressent au terminal. Cliquez dans la liste des fichiers pour rendre le clavier à Manta. +- Dans le **terminal**, **⌘C**, **⌘V**, **⌘A**, **⌘K**, **⌘←**, **⌘→**, **⌘⌫** et **⌘Z** s’adressent au terminal. Cliquez dans la liste des fichiers pour rendre le clavier à Manta. - Dans les fenêtres **Réglages**, **Comparer et synchroniser** et **aperçu**, seuls leurs propres raccourcis fonctionnent. ## Utilisation au clavier seul {#tastatur} diff --git a/docs/manual/fr/20-faq.md b/docs/manual/fr/20-faq.md index f3c45d0..813868f 100644 --- a/docs/manual/fr/20-faq.md +++ b/docs/manual/fr/20-faq.md @@ -32,7 +32,7 @@ Autant que votre fenêtre peut en contenir – chacune a besoin d’environ 280 ### Où est la corbeille ? Puis-je récupérer des fichiers supprimés ? {#papierkorb} -Oui, pour les éléments de votre Mac : **⌘⌫** les place dans la corbeille de macOS, comme le Finder, et la commande **Remettre** du Finder les restaure. **⌥⌘⌫** (**Supprimer immédiatement…**) supprime définitivement après confirmation. Les serveurs, S3 et les conteneurs n’ont pas de corbeille : la suppression y est toujours définitive, et Manta demande d’abord confirmation. Voir [Supprimer](05-dateien.md#loeschen). +Oui, pour les éléments de votre Mac : **⌘⌫** les place dans la corbeille de macOS, comme le Finder. Juste après, **⌘Z** (**Annuler**) les remet à leur place ; plus tard, la commande **Remettre** du Finder les restaure. **⌥⌘⌫** (**Supprimer immédiatement…**) supprime définitivement après confirmation. Les serveurs, S3 et les conteneurs n’ont pas de corbeille : la suppression y est toujours définitive, et Manta demande d’abord confirmation. Voir [Supprimer](05-dateien.md#loeschen). ### Le glisser-déposer copie-t-il ou déplace-t-il ? {#ziehen} diff --git a/docs/manual/i18n/es.json b/docs/manual/i18n/es.json index 419d46a..a4e00d3 100644 --- a/docs/manual/i18n/es.json +++ b/docs/manual/i18n/es.json @@ -92,7 +92,11 @@ "reconectar", "devolver", "eliminar inmediatamente", - "vaciar papelera" + "vaciar papelera", + "deshacer", + "rehacer", + "restaurar", + "⌘z" ] }, "schnellansicht": { @@ -125,7 +129,9 @@ "nube", "papelera", "vaciar papelera", - "acceso total al disco" + "acceso total al disco", + "devolver", + "deshacer" ] }, "verbindungen": { @@ -334,7 +340,10 @@ "solo teclado", "navegación con el teclado", "foco", - "voiceover" + "voiceover", + "deshacer", + "rehacer", + "⌘z" ] }, "fehlerbehebung": { diff --git a/docs/manual/i18n/fr.json b/docs/manual/i18n/fr.json index 8522bc5..ad3a601 100644 --- a/docs/manual/i18n/fr.json +++ b/docs/manual/i18n/fr.json @@ -97,7 +97,11 @@ "manta-part", "fichier partiel", "remettre", - "vider la corbeille" + "vider la corbeille", + "annuler", + "rétablir", + "restaurer", + "⌘z" ] }, "schnellansicht": { @@ -131,7 +135,9 @@ "cloud", "corbeille", "vider la corbeille", - "accès complet au disque" + "accès complet au disque", + "remettre", + "annuler" ] }, "verbindungen": { @@ -330,7 +336,10 @@ "clavier seul", "navigation au clavier", "focus", - "voiceover" + "voiceover", + "annuler", + "rétablir", + "⌘z" ] }, "fehlerbehebung": { diff --git a/docs/manual/i18n/it.json b/docs/manual/i18n/it.json index 138fc0e..63bfef9 100644 --- a/docs/manual/i18n/it.json +++ b/docs/manual/i18n/it.json @@ -87,7 +87,12 @@ "file parziale", "manta-part", "sostituisci", - "mantieni entrambi" + "mantieni entrambi", + "annulla", + "ripeti", + "ripristina", + "recuperare", + "⌘z" ] }, "schnellansicht": { @@ -118,7 +123,9 @@ "aggiungi ai preferiti", "accesso completo al disco", "unità", - "espellere" + "espellere", + "ripristina", + "annulla" ] }, "verbindungen": { @@ -323,7 +330,10 @@ "solo tastiera", "navigazione da tastiera", "focus", - "voiceover" + "voiceover", + "annulla", + "ripeti", + "⌘z" ] }, "fehlerbehebung": { diff --git a/docs/manual/i18n/ru.json b/docs/manual/i18n/ru.json index e95dcf5..d200d6a 100644 --- a/docs/manual/i18n/ru.json +++ b/docs/manual/i18n/ru.json @@ -89,7 +89,12 @@ "прерванные передачи", "manta-part", "вернуть", - "удалить немедленно" + "удалить немедленно", + "отменить", + "отмена", + "повторить", + "восстановить", + "⌘z" ] }, "schnellansicht": { @@ -121,7 +126,8 @@ "очистить корзину", "вернуть", "полный доступ к диску", - "облако" + "облако", + "отменить" ] }, "verbindungen": { @@ -322,7 +328,10 @@ "только клавиатура", "навигация с клавиатуры", "фокус", - "voiceover" + "voiceover", + "отменить", + "повторить", + "⌘z" ] }, "fehlerbehebung": { diff --git a/docs/manual/i18n/zh-Hans.json b/docs/manual/i18n/zh-Hans.json index b2fb1b7..af03324 100644 --- a/docs/manual/i18n/zh-Hans.json +++ b/docs/manual/i18n/zh-Hans.json @@ -91,7 +91,12 @@ "传输", "暂停", "继续", - "清倒废纸篓" + "清倒废纸篓", + "撤销", + "重做", + "放回原处", + "恢复", + "⌘z" ] }, "schnellansicht": { @@ -122,7 +127,9 @@ "Google Drive", "OneDrive", "Dropbox", - "废纸篓" + "废纸篓", + "放回原处", + "撤销" ] }, "verbindungen": { @@ -325,7 +332,10 @@ "仅用键盘", "键盘导航", "焦点", - "旁白" + "旁白", + "撤销", + "重做", + "⌘z" ] }, "fehlerbehebung": { diff --git a/docs/manual/index.json b/docs/manual/index.json index bb1fdf7..5d11fbd 100644 --- a/docs/manual/index.json +++ b/docs/manual/index.json @@ -583,7 +583,14 @@ "sofort löschen", "in den papierkorb legen", "in den papierkorb ziehen", - "papierkorb entleeren" + "papierkorb entleeren", + "widerrufen", + "wiederholen", + "rückgängig", + "undo", + "redo", + "wiederherstellen", + "⌘z" ], "en": [ "copy", @@ -622,7 +629,12 @@ "delete immediately", "move to trash", "drag to trash", - "empty trash" + "empty trash", + "undo", + "redo", + "restore", + "revert", + "⌘z" ], "zh-Hans": [ "拷贝", @@ -639,7 +651,12 @@ "传输", "暂停", "继续", - "清倒废纸篓" + "清倒废纸篓", + "撤销", + "重做", + "放回原处", + "恢复", + "⌘z" ], "es": [ "copiar", @@ -656,7 +673,11 @@ "reconectar", "devolver", "eliminar inmediatamente", - "vaciar papelera" + "vaciar papelera", + "deshacer", + "rehacer", + "restaurar", + "⌘z" ], "fr": [ "copier", @@ -677,7 +698,11 @@ "manta-part", "fichier partiel", "remettre", - "vider la corbeille" + "vider la corbeille", + "annuler", + "rétablir", + "restaurer", + "⌘z" ], "it": [ "copiare", @@ -694,7 +719,12 @@ "file parziale", "manta-part", "sostituisci", - "mantieni entrambi" + "mantieni entrambi", + "annulla", + "ripeti", + "ripristina", + "recuperare", + "⌘z" ], "ru": [ "копировать", @@ -711,7 +741,12 @@ "прерванные передачи", "manta-part", "вернуть", - "удалить немедленно" + "удалить немедленно", + "отменить", + "отмена", + "повторить", + "восстановить", + "⌘z" ] } }, @@ -837,7 +872,8 @@ "papierkorb", "papierkorb entleeren", "zurücklegen", - "festplattenvollzugriff" + "festplattenvollzugriff", + "widerrufen" ], "en": [ "favorites", @@ -866,7 +902,8 @@ "trash", "empty trash", "put back", - "full disk access" + "full disk access", + "undo" ], "zh-Hans": [ "个人收藏", @@ -883,7 +920,9 @@ "Google Drive", "OneDrive", "Dropbox", - "废纸篓" + "废纸篓", + "放回原处", + "撤销" ], "es": [ "favoritos", @@ -900,7 +939,9 @@ "nube", "papelera", "vaciar papelera", - "acceso total al disco" + "acceso total al disco", + "devolver", + "deshacer" ], "fr": [ "favoris", @@ -918,7 +959,9 @@ "cloud", "corbeille", "vider la corbeille", - "accès complet au disque" + "accès complet au disque", + "remettre", + "annuler" ], "it": [ "preferiti", @@ -932,7 +975,9 @@ "aggiungi ai preferiti", "accesso completo al disco", "unità", - "espellere" + "espellere", + "ripristina", + "annulla" ], "ru": [ "избранное", @@ -949,7 +994,8 @@ "очистить корзину", "вернуть", "полный доступ к диску", - "облако" + "облако", + "отменить" ] } }, @@ -2245,7 +2291,10 @@ "ohne maus", "tastaturnavigation", "fokus", - "voiceover" + "voiceover", + "widerrufen", + "wiederholen", + "⌘z" ], "en": [ "keyboard shortcuts", @@ -2266,7 +2315,10 @@ "keyboard only", "keyboard navigation", "focus", - "voiceover" + "voiceover", + "undo", + "redo", + "⌘z" ], "zh-Hans": [ "键盘快捷键", @@ -2280,7 +2332,10 @@ "新建标签页", "传输", "新功能", - "清倒废纸篓" + "清倒废纸篓", + "撤销", + "重做", + "⌘z" ], "es": [ "atajos de teclado", @@ -2294,7 +2349,10 @@ "nueva pestaña", "transferencias", "vaciar papelera", - "⇧⌘⌫" + "⇧⌘⌫", + "deshacer", + "rehacer", + "⌘z" ], "fr": [ "raccourcis clavier", @@ -2309,7 +2367,10 @@ "nouvel onglet", "transferts", "vider la corbeille", - "⇧⌘⌫" + "⇧⌘⌫", + "annuler", + "rétablir", + "⌘z" ], "it": [ "scorciatoie", @@ -2321,7 +2382,10 @@ "f6", "finder", "tasti funzione", - "fn" + "fn", + "annulla", + "ripeti", + "⌘z" ], "ru": [ "сочетания клавиш", @@ -2333,7 +2397,10 @@ "новая вкладка", "передачи", "очистить корзину", - "⇧⌘⌫" + "⇧⌘⌫", + "отменить", + "повторить", + "⌘z" ] } }, diff --git a/docs/manual/it/05-dateien.md b/docs/manual/it/05-dateien.md index 97000f0..2df3b8f 100644 --- a/docs/manual/it/05-dateien.md +++ b/docs/manual/it/05-dateien.md @@ -227,7 +227,7 @@ Manta elimina come il Finder: | Dove | ⌘⌫ (**Sposta nel Cestino**) | ⌥⌘⌫ (**Elimina immediatamente…**) | |---|---|---| -| Il tuo Mac (anche unità esterne e cartelle cloud) | Sposta gli elementi nel **Cestino**, senza chiedere. **Ripristina** del Finder li recupera. | Elimina definitivamente dopo una conferma. | +| Il tuo Mac (anche unità esterne e cartelle cloud) | Sposta gli elementi nel **Cestino**, senza chiedere. **⌘Z** (**Annulla**) o **Ripristina** del Finder li recuperano. | Elimina definitivamente dopo una conferma. | | Server (SFTP, FTP, FTPS), S3, container | Non c’è un Cestino: elimina definitivamente dopo una conferma. | Elimina definitivamente dopo una conferma. | | Archivi | Sola lettura: non si può eliminare nulla. | Sola lettura. | @@ -236,7 +236,7 @@ Per spostare elementi nel Cestino: 1. Selezionali. 2. Premi **⌘⌫** o il tasto di cancellazione in avanti **⌦**, oppure scegli **Sposta nel Cestino** nel menu contestuale o nella barra degli strumenti, oppure trascinali su **Cestino** nella barra laterale. -Un messaggio lo conferma (“3 elementi spostati nel Cestino”). Per recuperare gli elementi, apri il Cestino nel Finder, selezionali e scegli **Ripristina**. Manta non ha un proprio comando Annulla per questo. +Un messaggio lo conferma (“3 elementi spostati nel Cestino”). Per recuperare gli elementi, premi **⌘Z** (**Annulla**): Manta li rimette dov’erano, vedi [Annulla](#widerrufen). Per elementi più vecchi o eliminati da un’altra app, apri il Cestino nel Finder, selezionali e scegli **Ripristina**. Per eliminare definitivamente: @@ -252,6 +252,24 @@ Per aprire il Cestino stesso, fai clic su **Cestino** nella barra laterale. Lì > [!CAUTION] > Nelle **cartelle cloud** (iCloud Drive, Google Drive, OneDrive, Dropbox) un elemento che sposti nel Cestino sparisce anche dal cloud non appena il tuo Mac si sincronizza. Di solito **Ripristina** lo recupera; alcuni fornitori hanno anche un cestino sul loro sito web. Vedi [Archiviazione cloud](09-cloud.md). +## Annulla {#widerrufen} + +**⌘Z** (**Annulla**) annulla la tua ultima operazione sui file, come nel Finder, e **⇧⌘Z** (**Ripeti**) la esegue di nuovo. Entrambi i comandi sono nel menu **Modifica** e nella palette dei comandi. Manta ricorda fino a 100 passaggi, finché non lo chiudi. + +| Cosa hai fatto | Cosa fa **⌘Z** | +|---|---| +| **Sposta nel Cestino** (**⌘⌫**, o trascinare su **Cestino** nella barra laterale) | Rimette gli elementi dov’erano. | +| Rinominare (**Rinomina…**, rinominare con un clic, finestra Informazioni) | Ripristina il nome precedente, anche sui server. | +| **Nuova cartella…** o **Nuovo file…** sul tuo Mac | Sposta il nuovo elemento nel Cestino, come il Finder, insieme a tutto ciò che ci hai messo dentro. **⇧⌘Z** lo recupera. | +| **Nuova cartella…** o **Nuovo file…** su un server, in S3 o in un container | Non c’è un Cestino: Manta elimina il nuovo elemento, ma solo finché è ancora vuoto. Altrimenti segnala che non è riuscito a eliminarlo e lo lascia dov’è. | + +Non si possono annullare la copia e lo spostamento (**F5**, **F6**, trascinamento) né le operazioni definitive: **Elimina immediatamente…**, l’eliminazione sui server e **Svuota il Cestino…**. **Rinomina in blocco…** ha un proprio comando **Annulla**, vedi [Rinomina in blocco](14-plugins.md#umbenennen). + +Se nel frattempo la posizione originale è di nuovo occupata (c’è un elemento con lo stesso nome), Manta non sostituisce nulla. Segnala “Impossibile ripristinare ‘nome’” e conserva il passaggio: appena la posizione è libera, **⌘Z** funziona di nuovo. + +- In un **campo di testo** (filtro, percorso, nome che stai rinominando) **⌘Z** e **⇧⌘Z** annullano ciò che hai digitato, non le operazioni sui file. Quando il **terminale** è attivo, **⌘Z** appartiene al terminale. +- Senza [Accesso completo al disco](07-favoriten-seitenleiste.md#papierkorb-zugriff), Manta ripristina gli elementi dal Cestino tramite il Finder, come per **Svuota il Cestino…**: macOS chiede una volta se Manta può controllare il Finder. + ## Tag {#tags} Manta legge e assegna gli stessi tag del Finder (sono memorizzati insieme al file, quindi il Finder, Spotlight e le altre app li vedono). Gli elementi con tag mostrano dei pallini colorati accanto al nome in tutte le viste: nell’elenco e nelle colonne dopo il nome, in Icone e Galleria prima del nome. I tag funzionano per gli elementi su questo Mac, compresi iCloud Drive e le altre cartelle cloud; server e archivi non ne hanno. diff --git a/docs/manual/it/07-favoriten-seitenleiste.md b/docs/manual/it/07-favoriten-seitenleiste.md index 7ba928e..ec9c01a 100644 --- a/docs/manual/it/07-favoriten-seitenleiste.md +++ b/docs/manual/it/07-favoriten-seitenleiste.md @@ -55,7 +55,7 @@ Il **Cestino** è l’ultima riga sotto **Posizioni**, come nel Finder. La sua i - **Aprire**: fai clic su **Cestino**. Si apre nel pannello attivo come qualsiasi cartella. **Elimina immediatamente…** (o **⌘⌫**) elimina per sempre singoli elementi al suo interno; Manta chiede prima conferma. - **Svuotare**: clic destro su **Cestino** → **Svuota il Cestino…**, oppure premi **⇧⌘⌫**, oppure scegli **Svuota il Cestino…** nella palette dei comandi. Manta chiede conferma (“Vuoi davvero eliminare definitivamente gli elementi nel Cestino?”) e mostra il numero di elementi e la loro dimensione. L’operazione non si può annullare. Gli elementi che non possono essere eliminati (ad esempio quelli bloccati) vengono saltati e segnalati. - **Trascinarci sopra**: trascina elementi da un pannello su **Cestino**. La riga viene evidenziata e accanto al puntatore compare ad esempio “Sposta 3 elementi nel Cestino”. Gli elementi locali vanno nel Cestino senza domande (come con **⌘⌫**). Gli elementi su un **server**, in **S3** o in un **container** non possono finire in un Cestino: Manta chiede se eliminarli definitivamente. Gli elementi di un **archivio** non possono essere eliminati, e il puntatore lo indica. Puoi anche trascinare sul Cestino file da altre app (ad esempio dal Finder). -- **Ripristina**: solo nel Finder (clic destro → **Apri nel Finder**, poi **Ripristina**). Il Finder conserva la posizione originale nei propri dati, che Manta non può leggere. +- **Ripristina**: ciò che hai appena spostato nel Cestino in Manta torna al suo posto con **⌘Z** (**Annulla**), vedi [Annulla](05-dateien.md#widerrufen). Per gli elementi più vecchi usa il Finder (clic destro → **Apri nel Finder**, poi **Ripristina**): il Finder conserva la posizione originale nei propri dati, che Manta non può leggere. ### Accesso completo al disco {#papierkorb-zugriff} diff --git a/docs/manual/it/11-terminal.md b/docs/manual/it/11-terminal.md index 50c3482..843f90a 100644 --- a/docs/manual/it/11-terminal.md +++ b/docs/manual/it/11-terminal.md @@ -74,7 +74,7 @@ Apri **Impostazioni** (**⌘,**) → **Plug-in** → **Terminale** → **Imposta ## Tastiera nel terminale {#tastatur} -Quando il terminale è attivo, queste scorciatoie appartengono al terminale invece che a Manta: **⌘C**, **⌘V**, **⌘A**, **⌘K**, **⌘←**, **⌘→** e **⌘⌫**. Le altre scorciatoie di Manta, come **⇧⌘P**, continuano a funzionare. Fai clic nell’elenco dei file per restituire la tastiera a Manta. +Quando il terminale è attivo, queste scorciatoie appartengono al terminale invece che a Manta: **⌘C**, **⌘V**, **⌘A**, **⌘K**, **⌘←**, **⌘→**, **⌘⌫** e **⌘Z**. Le altre scorciatoie di Manta, come **⇧⌘P**, continuano a funzionare. Fai clic nell’elenco dei file per restituire la tastiera a Manta. ## Limiti {#grenzen} diff --git a/docs/manual/it/18-tastenkuerzel.md b/docs/manual/it/18-tastenkuerzel.md index 581a1fd..81c0d3e 100644 --- a/docs/manual/it/18-tastenkuerzel.md +++ b/docs/manual/it/18-tastenkuerzel.md @@ -86,6 +86,8 @@ Le scorciatoie agiscono sul pannello attivo. Vedi [Viste](03-ansichten.md). | ⌘⌫ o ⌦ | Sposta nel Cestino (sui server: elimina definitivamente dopo una conferma, vedi [Eliminare](05-dateien.md#loeschen)) | | ⌥⌘⌫ | Elimina immediatamente… (definitivo, dopo una conferma) | | ⇧⌘⌫ | Svuota il Cestino… (dopo una conferma, vedi [Cestino](07-favoriten-seitenleiste.md#papierkorb)) | +| ⌘Z | Annulla (sposta nel Cestino, rinomina, nuova cartella, nuovo file; vedi [Annulla](05-dateien.md#widerrufen)) | +| ⇧⌘Z | Ripeti | | ⌥⌘C | Comprimi… | | ⌥⌘E | Estrai qui | | ⌘ durante il trascinamento | Preseleziona Sposta invece di Copia (senza tasti è preselezionato Copia; ⌥ preseleziona esplicitamente Copia) | @@ -121,7 +123,7 @@ Le tue azioni rapide possono avere una scorciatoia propria (il campo `shortcut` ## Quando le scorciatoie non funzionano {#fokus} - In un **campo di testo** (filtro, percorso, campi delle finestre di dialogo) funzionano solo **⇧⌘P**, **⇧⌘G**, **⌘,** e **⌘?**; tutti gli altri tasti appartengono al campo. -- Nel **terminale**, **⌘C**, **⌘V**, **⌘A**, **⌘K**, **⌘←**, **⌘→** e **⌘⌫** appartengono al terminale. Fai clic nell’elenco dei file per restituire la tastiera a Manta. +- Nel **terminale**, **⌘C**, **⌘V**, **⌘A**, **⌘K**, **⌘←**, **⌘→**, **⌘⌫** e **⌘Z** appartengono al terminale. Fai clic nell’elenco dei file per restituire la tastiera a Manta. - Nelle finestre **Impostazioni**, **Confronta e sincronizza** e **anteprima** funzionano solo le loro scorciatoie. ## Uso solo da tastiera {#tastatur} diff --git a/docs/manual/it/20-faq.md b/docs/manual/it/20-faq.md index f957de5..c6d519c 100644 --- a/docs/manual/it/20-faq.md +++ b/docs/manual/it/20-faq.md @@ -32,7 +32,7 @@ Quanti ne entrano nella finestra: ognuno ha bisogno di circa 280 punti di larghe ### Dov’è il Cestino? Posso recuperare i file eliminati? {#papierkorb} -Sì, per gli elementi sul tuo Mac: **⌘⌫** li sposta nel Cestino di macOS, come il Finder, e **Ripristina** del Finder li recupera. **⌥⌘⌫** (**Elimina immediatamente…**) elimina definitivamente dopo una conferma. Server, S3 e container non hanno un Cestino: lì l’eliminazione è sempre definitiva e Manta chiede prima conferma. Vedi [Eliminare](05-dateien.md#loeschen). +Sì, per gli elementi sul tuo Mac: **⌘⌫** li sposta nel Cestino di macOS, come il Finder. Subito dopo, **⌘Z** (**Annulla**) li rimette dov’erano; più tardi li recuperi con **Ripristina** del Finder. **⌥⌘⌫** (**Elimina immediatamente…**) elimina definitivamente dopo una conferma. Server, S3 e container non hanno un Cestino: lì l’eliminazione è sempre definitiva e Manta chiede prima conferma. Vedi [Eliminare](05-dateien.md#loeschen). ### Trascinando si copia o si sposta? {#ziehen} diff --git a/docs/manual/ru/05-dateien.md b/docs/manual/ru/05-dateien.md index 80f0c5d..2fbc90e 100644 --- a/docs/manual/ru/05-dateien.md +++ b/docs/manual/ru/05-dateien.md @@ -227,7 +227,7 @@ Manta удаляет так же, как Finder: | Где | ⌘⌫ (**Переместить в Корзину**) | ⌥⌘⌫ (**Удалить немедленно…**) | |---|---|---| -| Ваш Mac (в том числе внешние диски и облачные папки) | Перемещает объекты в **Корзину** без вопросов. Команда Finder **Вернуть** восстанавливает их. | Удаляет навсегда после вопроса. | +| Ваш Mac (в том числе внешние диски и облачные папки) | Перемещает объекты в **Корзину** без вопросов. **⌘Z** (**Отменить**) или команда Finder **Вернуть** восстанавливают их. | Удаляет навсегда после вопроса. | | Серверы (SFTP, FTP, FTPS), S3, контейнеры | Корзины нет: удаляет навсегда после вопроса. | Удаляет навсегда после вопроса. | | Архивы | Только чтение: ничего удалить нельзя. | Только чтение. | @@ -236,7 +236,7 @@ Manta удаляет так же, как Finder: 1. Выберите их. 2. Нажмите **⌘⌫** или клавишу удаления вперед **⌦** либо выберите **Переместить в Корзину** в контекстном меню или на панели инструментов — или перетащите их на **Корзину** в боковом меню. -Сообщение подтвердит это («3 объекта перемещено в Корзину»). Чтобы вернуть объекты, откройте Корзину в Finder, выберите их и выберите **Вернуть**. Собственной отмены для этого в Manta нет. +Сообщение подтвердит это («3 объекта перемещено в Корзину»). Чтобы вернуть объекты, нажмите **⌘Z** (**Отменить**): Manta вернёт их на прежнее место, см. [Отмена действий](#widerrufen). Более старые объекты или удалённые в другой программе возвращайте через Finder: откройте там Корзину, выберите их и выберите **Вернуть**. Чтобы удалить навсегда: @@ -252,6 +252,24 @@ Manta удаляет так же, как Finder: > [!CAUTION] > В **облачных папках** (iCloud Drive, Google Drive, OneDrive, Dropbox) объект, перемещенный в Корзину, исчезает и из облака, как только Mac синхронизируется. **Вернуть** обычно восстанавливает его; некоторые поставщики также хранят корзину на своем сайте. См. [Облачные хранилища](09-cloud.md). +## Отмена действий {#widerrufen} + +**⌘Z** (**Отменить**) отменяет вашу последнюю операцию с файлами, как в Finder, а **⇧⌘Z** (**Повторить**) выполняет её снова. Обе команды есть в меню **Правка** и в палитре команд. До выхода из Manta запоминается до 100 шагов. + +| Что вы сделали | Что делает **⌘Z** | +|---|---| +| **Переместить в Корзину** (**⌘⌫** или перетаскивание на **Корзину** в боковом меню) | Возвращает объекты на прежнее место. | +| Переименование (**Переименовать…**, переименование щелчком, окно свойств) | Возвращает старое имя, в том числе на серверах. | +| **Новая папка…** или **Новый файл…** на вашем Mac | Перемещает новый объект в Корзину, как Finder, вместе со всем, что вы в него положили. **⇧⌘Z** возвращает его. | +| **Новая папка…** или **Новый файл…** на сервере, в S3 или в контейнере | Корзины нет: Manta удаляет новый объект, но только пока он пуст. Иначе появляется сообщение, что удалить его не удалось, и объект остаётся на месте. | + +Отменить нельзя копирование и перемещение (**F5**, **F6**, перетаскивание), а также всё необратимое: **Удалить немедленно…**, удаление на серверах и **Очистить Корзину…**. У **Пакетного переименования…** есть собственная **отмена**, см. [Пакетное переименование](14-plugins.md#umbenennen). + +Если исходное место тем временем снова занято (там есть объект с тем же именем), Manta ничего не заменяет. Появляется сообщение «Не удалось вернуть „имя“ на место», а шаг сохраняется: как только место освободится, **⌘Z** снова сработает. + +- В **текстовом поле** (фильтр, путь, имя при переименовании) **⌘Z** и **⇧⌘Z** отменяют ввод, а не операции с файлами. Пока фокус в **Терминале**, **⌘Z** относится к Терминалу. +- Без [Полного доступа к диску](07-favoriten-seitenleiste.md#papierkorb-zugriff) Manta возвращает объекты из Корзины через Finder, как и при **Очистить Корзину…**: macOS один раз спросит, может ли Manta управлять Finder. + ## Теги {#tags} Manta читает и ставит те же теги, что и Finder (они хранятся вместе с файлом, поэтому их видят Finder, Spotlight и другие программы). Помеченные объекты показывают цветные точки рядом с именем во всех видах: в списке и колонках — после имени, в видах «Значки» и «Галерея» — перед ним. Теги работают для объектов на этом Mac, в том числе в iCloud Drive и других облачных папках; у серверов и архивов тегов нет. diff --git a/docs/manual/ru/07-favoriten-seitenleiste.md b/docs/manual/ru/07-favoriten-seitenleiste.md index 8e88db2..ddd8bdd 100644 --- a/docs/manual/ru/07-favoriten-seitenleiste.md +++ b/docs/manual/ru/07-favoriten-seitenleiste.md @@ -55,7 +55,7 @@ - **Открыть**: нажмите **Корзина**. Она открывается в активной панели как обычная папка. **Удалить немедленно…** (или **⌘⌫**) удаляет отдельные объекты в ней навсегда — Manta сначала спрашивает. - **Очистить**: правый клик по **Корзине** → **Очистить Корзину…**, или нажмите **⇧⌘⌫**, или выберите **Очистить Корзину…** в палитре команд. Manta спросит («Вы действительно хотите навсегда стереть объекты из Корзины?») и покажет число объектов и их размер. Это действие нельзя отменить. Объекты, которые нельзя удалить (например, защищенные), пропускаются, и Manta сообщает о них. - **Перетащить на нее**: перетащите объекты из панели на **Корзину**. Строка подсвечивается, а у указателя написано, например, «Переместить 3 объекта в Корзину». Локальные объекты попадают в Корзину без вопросов (как при **⌘⌫**). Объекты на **сервере**, в **S3** или в **контейнере** в Корзину попасть не могут: Manta спросит, удалить ли их навсегда. Объекты в **архиве** удалить нельзя — указатель это покажет. На Корзину можно перетаскивать и файлы из других программ (например, из Finder). -- **Вернуть**: только в Finder (правый клик → **Открыть в Finder**, затем **Вернуть**). Finder хранит исходное место в собственных данных, которые Manta прочитать не может. +- **Вернуть**: то, что вы только что переместили в Корзину в Manta, возвращает **⌘Z** (**Отменить**), см. [Отмена действий](05-dateien.md#widerrufen). Более старые объекты возвращайте в Finder (правый клик → **Открыть в Finder**, затем **Вернуть**): Finder хранит исходное место в собственных данных, которые Manta прочитать не может. ### Полный доступ к диску {#papierkorb-zugriff} diff --git a/docs/manual/ru/11-terminal.md b/docs/manual/ru/11-terminal.md index 7658b3b..0ad255d 100644 --- a/docs/manual/ru/11-terminal.md +++ b/docs/manual/ru/11-terminal.md @@ -74,7 +74,7 @@ ## Клавиатура в Терминале {#tastatur} -Пока фокус в Терминале, эти сочетания клавиш относятся к Терминалу, а не к Manta: **⌘C**, **⌘V**, **⌘A**, **⌘K**, **⌘←**, **⌘→** и **⌘⌫**. Другие сочетания Manta, например **⇧⌘P**, продолжают работать. Нажмите в списке файлов, чтобы вернуть клавиатуру Manta. +Пока фокус в Терминале, эти сочетания клавиш относятся к Терминалу, а не к Manta: **⌘C**, **⌘V**, **⌘A**, **⌘K**, **⌘←**, **⌘→**, **⌘⌫** и **⌘Z**. Другие сочетания Manta, например **⇧⌘P**, продолжают работать. Нажмите в списке файлов, чтобы вернуть клавиатуру Manta. ## Ограничения {#grenzen} diff --git a/docs/manual/ru/18-tastenkuerzel.md b/docs/manual/ru/18-tastenkuerzel.md index 0730d9a..b67e851 100644 --- a/docs/manual/ru/18-tastenkuerzel.md +++ b/docs/manual/ru/18-tastenkuerzel.md @@ -86,6 +86,8 @@ | ⌘⌫ или ⌦ | Переместить в Корзину (на серверах: удалить навсегда после вопроса, см. [Удаление](05-dateien.md#loeschen)) | | ⌥⌘⌫ | Удалить немедленно… (навсегда, после вопроса) | | ⇧⌘⌫ | Очистить Корзину… (после вопроса, см. [Корзина](07-favoriten-seitenleiste.md#papierkorb)) | +| ⌘Z | Отменить (перемещение в Корзину, переименование, новая папка, новый файл; см. [Отмена действий](05-dateien.md#widerrufen)) | +| ⇧⌘Z | Повторить | | ⌥⌘C | Сжать… | | ⌥⌘E | Извлечь сюда | | ⌘ при перетаскивании | Заранее выбрать «Переместить» вместо «Копировать» (без клавиши выбрано «Копировать»; ⌥ явно выбирает «Копировать») | @@ -121,7 +123,7 @@ ## Если сочетания клавиш не работают {#fokus} - В **текстовом поле** (фильтр, путь, поля диалогов) работают только **⇧⌘P**, **⇧⌘G**, **⌘,** и **⌘?**; все остальные клавиши относятся к полю. -- В **Терминале** **⌘C**, **⌘V**, **⌘A**, **⌘K**, **⌘←**, **⌘→** и **⌘⌫** относятся к Терминалу. Нажмите в списке файлов, чтобы вернуть клавиатуру Manta. +- В **Терминале** **⌘C**, **⌘V**, **⌘A**, **⌘K**, **⌘←**, **⌘→**, **⌘⌫** и **⌘Z** относятся к Терминалу. Нажмите в списке файлов, чтобы вернуть клавиатуру Manta. - В окнах **Настройки**, **Сравнение и синхронизация** и **просмотра** работают только их собственные сочетания клавиш. ## Работа только с клавиатуры {#tastatur} diff --git a/docs/manual/ru/20-faq.md b/docs/manual/ru/20-faq.md index 4f72605..62b2f49 100644 --- a/docs/manual/ru/20-faq.md +++ b/docs/manual/ru/20-faq.md @@ -32,7 +32,7 @@ Manta построена на компонентах с открытым исх ### Где Корзина? Можно ли вернуть удаленные файлы? {#papierkorb} -Да, для объектов на вашем Mac: **⌘⌫** перемещает их в Корзину macOS, как Finder, а команда Finder **Вернуть** восстанавливает их. **⌥⌘⌫** (**Удалить немедленно…**) удаляет навсегда после вопроса. На серверах, в S3 и в контейнерах Корзины нет: удаление там всегда необратимо, и Manta сначала спрашивает. См. [Удаление](05-dateien.md#loeschen). +Да, для объектов на вашем Mac: **⌘⌫** перемещает их в Корзину macOS, как Finder. Сразу после этого **⌘Z** (**Отменить**) вернёт их на место; позже их восстанавливает команда Finder **Вернуть**. **⌥⌘⌫** (**Удалить немедленно…**) удаляет навсегда после вопроса. На серверах, в S3 и в контейнерах Корзины нет: удаление там всегда необратимо, и Manta сначала спрашивает. См. [Удаление](05-dateien.md#loeschen). ### Перетаскивание копирует или перемещает? {#ziehen} diff --git a/docs/manual/zh-Hans/05-dateien.md b/docs/manual/zh-Hans/05-dateien.md index af64d37..360949b 100644 --- a/docs/manual/zh-Hans/05-dateien.md +++ b/docs/manual/zh-Hans/05-dateien.md @@ -227,7 +227,7 @@ Manta 的删除方式与访达相同: | 位置 | ⌘⌫(**移到废纸篓**) | ⌥⌘⌫(**立即删除…**) | |---|---|---| -| 你的 Mac(包括外置驱动器和云端文件夹) | 将项目移到**废纸篓**,不会询问。可使用访达的**放回原处**将其恢复。 | 询问后永久删除。 | +| 你的 Mac(包括外置驱动器和云端文件夹) | 将项目移到**废纸篓**,不会询问。按 **⌘Z**(**撤销**)或使用访达的**放回原处**可将其恢复。 | 询问后永久删除。 | | 服务器(SFTP、FTP、FTPS)、S3、容器 | 没有废纸篓:询问后永久删除。 | 询问后永久删除。 | | 归档 | 只读:无法删除任何内容。 | 只读。 | @@ -236,7 +236,7 @@ Manta 的删除方式与访达相同: 1. 选择项目。 2. 按 **⌘⌫** 或向前删除键 **⌦**,或者在快捷菜单或工具栏中选择**移到废纸篓**——也可以将其拖移到边栏中的**废纸篓**。 -随后会有消息确认(“已将 3 项移到废纸篓”)。要取回项目,请在访达中打开废纸篓,选择项目,然后选择**放回原处**。Manta 本身没有针对此操作的撤销功能。 +随后会有消息确认(“已将 3 项移到废纸篓”)。要取回项目,请按 **⌘Z**(**撤销**):Manta 会将它们放回原来的位置,请参阅[撤销](#widerrufen)。对于较早删除的项目或在其他 App 中删除的项目,请在访达中打开废纸篓,选择项目,然后选择**放回原处**。 要永久删除: @@ -252,6 +252,24 @@ Manta 的删除方式与访达相同: > [!CAUTION] > 在**云端文件夹**(iCloud Drive、Google Drive、OneDrive、Dropbox)中,移到废纸篓的项目会在 Mac 同步后从云端消失。通常可以使用**放回原处**将其恢复;有些提供商还会在其网站上保留一个废纸篓。请参阅[云存储](09-cloud.md)。 +## 撤销 {#widerrufen} + +**⌘Z**(**撤销**)会像访达一样撤销你最近的一次文件操作,**⇧⌘Z**(**重做**)则会再次执行它。两者都位于**编辑**菜单和命令面板中。在你退出 Manta 之前,它最多会记住 100 步。 + +| 你做了什么 | **⌘Z** 的作用 | +|---|---| +| **移到废纸篓**(**⌘⌫**,或拖移到边栏中的**废纸篓**) | 将项目放回原来的位置。 | +| 重新命名(**重新命名…**、点按以重新命名、简介窗口) | 恢复旧名称,在服务器上也可以。 | +| 在你的 Mac 上**新建文件夹…**或**新建文件…** | 像访达一样将新项目移到废纸篓,连同你放入其中的所有内容。**⇧⌘Z** 会将其恢复。 | +| 在服务器、S3 或容器中**新建文件夹…**或**新建文件…** | 那里没有废纸篓:Manta 会删除新项目,但仅限它仍为空时。否则 Manta 会提示无法删除,并保留该项目。 | + +无法撤销的操作:拷贝和移动(**F5**、**F6**、拖放),以及所有永久性操作:**立即删除…**、在服务器上删除和**清倒废纸篓…**。**批量重新命名…**有自己的**撤销**功能,请参阅[批量重新命名](14-plugins.md#umbenennen)。 + +如果原来的位置在此期间又被占用(那里已有同名项目),Manta 不会替换任何内容。它会提示“无法将‘名称’放回原处”,并保留这一步:位置空出后,**⌘Z** 即可再次使用。 + +- 在**文本栏**(过滤、路径、正在重新命名的名称)中,**⌘Z** 和 **⇧⌘Z** 撤销的是你的输入,而不是文件操作。当**终端**获得焦点时,**⌘Z** 归终端使用。 +- 没有[完全磁盘访问权限](07-favoriten-seitenleiste.md#papierkorb-zugriff)时,Manta 会通过访达将项目从废纸篓放回原处,与**清倒废纸篓…**相同:macOS 会询问一次是否允许 Manta 控制访达。 + ## 标签 {#tags} Manta 读取和设定的标签与访达相同(标签随文件一起存储,因此访达、聚焦和其他 App 都能看到)。带有标签的项目在每种视图中都会在名称旁显示彩色圆点——在列表和分栏中位于名称之后,在图标和画廊中位于名称之前。标签适用于这台 Mac 上的项目,包括 iCloud Drive 和其他云端文件夹;服务器和归档没有标签。 diff --git a/docs/manual/zh-Hans/07-favoriten-seitenleiste.md b/docs/manual/zh-Hans/07-favoriten-seitenleiste.md index 1b67f60..570b24a 100644 --- a/docs/manual/zh-Hans/07-favoriten-seitenleiste.md +++ b/docs/manual/zh-Hans/07-favoriten-seitenleiste.md @@ -55,7 +55,7 @@ - **打开**:点按**废纸篓**。它会像任何文件夹一样在当前面板中打开。**立即删除…**(或 **⌘⌫**)会彻底删除其中的单个项目——Manta 会先询问。 - **清倒**:右键点按**废纸篓** → **清倒废纸篓…**,或按 **⇧⌘⌫**,或在命令面板中选择**清倒废纸篓…**。Manta 会询问(“确定要永久抹掉废纸篓中的项目吗?”),并显示项目数量及其大小。此操作无法撤销。无法删除的项目(例如已锁定的项目)会被跳过并报告。 - **拖移到废纸篓**:将项目从面板拖移到**废纸篓**。该行会高亮显示,指针旁会显示例如“将 3 项移到废纸篓”。本地项目会直接移到废纸篓,不会询问(与 **⌘⌫** 相同)。**服务器**上、**S3** 中或**容器**中的项目无法移到废纸篓:Manta 会询问是否将其永久删除。**归档**中的项目无法删除——指针会显示这一点。你也可以将其他 App(例如访达)中的文件拖移到废纸篓。 -- **放回原处**:仅能在访达中进行(右键点按 → **在访达中打开**,然后选择**放回原处**)。访达会将原始位置保存在自己的数据中,Manta 无法读取这些数据。 +- **放回原处**:刚刚在 Manta 中移到废纸篓的项目,按 **⌘Z**(**撤销**)即可放回,请参阅[撤销](05-dateien.md#widerrufen)。较早的项目请在访达中放回(右键点按 → **在访达中打开**,然后选择**放回原处**):访达会将原始位置保存在自己的数据中,Manta 无法读取这些数据。 ### 完全磁盘访问权限 {#papierkorb-zugriff} diff --git a/docs/manual/zh-Hans/11-terminal.md b/docs/manual/zh-Hans/11-terminal.md index be6e6bb..32572c3 100644 --- a/docs/manual/zh-Hans/11-terminal.md +++ b/docs/manual/zh-Hans/11-terminal.md @@ -74,7 +74,7 @@ ## 终端中的键盘操作 {#tastatur} -当终端获得焦点时,以下快捷键归终端使用,而不是 Manta:**⌘C**、**⌘V**、**⌘A**、**⌘K**、**⌘←**、**⌘→** 和 **⌘⌫**。其他 Manta 快捷键(例如 **⇧⌘P**)仍然有效。点按文件列表即可将键盘交还给 Manta。 +当终端获得焦点时,以下快捷键归终端使用,而不是 Manta:**⌘C**、**⌘V**、**⌘A**、**⌘K**、**⌘←**、**⌘→**、**⌘⌫** 和 **⌘Z**。其他 Manta 快捷键(例如 **⇧⌘P**)仍然有效。点按文件列表即可将键盘交还给 Manta。 ## 限制 {#grenzen} diff --git a/docs/manual/zh-Hans/18-tastenkuerzel.md b/docs/manual/zh-Hans/18-tastenkuerzel.md index fe6faf0..e6efd7c 100644 --- a/docs/manual/zh-Hans/18-tastenkuerzel.md +++ b/docs/manual/zh-Hans/18-tastenkuerzel.md @@ -86,6 +86,8 @@ Manta 的所有键盘快捷键一览,按主题分组。命令面板(**⇧⌘ | ⌘⌫ 或 ⌦ | 移到废纸篓(在服务器上:询问后永久删除,请参阅[删除](05-dateien.md#loeschen)) | | ⌥⌘⌫ | 立即删除…(询问后永久删除) | | ⇧⌘⌫ | 清倒废纸篓…(询问后执行,请参阅[废纸篓](07-favoriten-seitenleiste.md#papierkorb)) | +| ⌘Z | 撤销(移到废纸篓、重新命名、新建文件夹、新建文件;请参阅[撤销](05-dateien.md#widerrufen)) | +| ⇧⌘Z | 重做 | | ⌥⌘C | 压缩… | | ⌥⌘E | 在此处解压缩 | | 拖移时按住 ⌘ | 预选“移动”而非“拷贝”(不按键时预选“拷贝”;按住 ⌥ 明确预选“拷贝”) | @@ -121,7 +123,7 @@ Manta 的所有键盘快捷键一览,按主题分组。命令面板(**⇧⌘ ## 快捷键不起作用时 {#fokus} - 在 **文本栏**(过滤、路径、对话框中的输入栏)中,只有 **⇧⌘P**、**⇧⌘G**、**⌘,** 和 **⌘?** 有效;其他所有按键都归该输入栏使用。 -- 在 **终端** 中,**⌘C**、**⌘V**、**⌘A**、**⌘K**、**⌘←**、**⌘→** 和 **⌘⌫** 归终端使用。点按文件列表即可将键盘交还给 Manta。 +- 在 **终端** 中,**⌘C**、**⌘V**、**⌘A**、**⌘K**、**⌘←**、**⌘→**、**⌘⌫** 和 **⌘Z** 归终端使用。点按文件列表即可将键盘交还给 Manta。 - 在 **设置**、**比较与同步** 和 **预览** 窗口中,只有它们自己的快捷键有效。 ## 仅用键盘操作 {#tastatur} diff --git a/docs/manual/zh-Hans/20-faq.md b/docs/manual/zh-Hans/20-faq.md index acf524d..3e2dcd2 100644 --- a/docs/manual/zh-Hans/20-faq.md +++ b/docs/manual/zh-Hans/20-faq.md @@ -32,7 +32,7 @@ Manta 基于开源组件构建。它们的许可声明位于 **帮助** → ** ### 废纸篓在哪里?能找回已删除的文件吗? {#papierkorb} -对于 Mac 上的项目可以:**⌘⌫** 会像访达一样将它们移到 macOS 的废纸篓,使用访达的 **放回原处** 即可恢复。**⌥⌘⌫**(**立即删除…**)会在询问后永久删除。服务器、S3 和容器没有废纸篓:在那里删除始终是永久性的,Manta 会先询问你。请参阅[删除](05-dateien.md#loeschen)。 +对于 Mac 上的项目可以:**⌘⌫** 会像访达一样将它们移到 macOS 的废纸篓。删除后立即按 **⌘Z**(**撤销**)即可将其放回原处;之后也可以使用访达的 **放回原处** 恢复。**⌥⌘⌫**(**立即删除…**)会在询问后永久删除。服务器、S3 和容器没有废纸篓:在那里删除始终是永久性的,Manta 会先询问你。请参阅[删除](05-dateien.md#loeschen)。 ### 拖移是拷贝还是移动? {#ziehen}