Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undo operation - or previous move history ? #651

Closed
luffah opened this issue Mar 20, 2018 · 5 comments
Closed

Undo operation - or previous move history ? #651

luffah opened this issue Mar 20, 2018 · 5 comments

Comments

@luffah
Copy link

luffah commented Mar 20, 2018

[enhancement]
Many human interfaces guidelines like
https://elementary.io/fr/docs/human-interface-guidelines#human-interface-guidelines
recommends to provide an undo (e.g. Dolphin from Kde provide it) to revert accidentals file move (next a touchpad sensitivity problem for example).

I see pcmanfm-qt have a really pragmatic way to proceed by asking user confirmation. But it could be very cool to have a way to navigate an history like we can do in a terminal.

Expected Behavior

After moving a file, have the possibility in a menu to undo the last move or at least have last file move history.

Current Behavior

v0.11.3 - Not supported.

Context

I want to trace which file i moved.

@tsujan
Copy link
Member

tsujan commented Mar 20, 2018

It seems tricky but I agree that it would be a good feature.

@tsujan
Copy link
Member

tsujan commented Mar 21, 2018

For a future investigation:

In libfm-qtutilities.cppparseClipboardData(), we can have paths of cut files. Then, pasteFilesFromClipboard() tries to paste them by calling FileOperation::moveFiles(). At that stage, some errors may occur -- a file with the same name may exist and the user may change the name, or the file may not be pasted at all, or... --- and we can skip such cases when considering undoing.

Now, presumably, we have the last list of "cleanly" moved files (without renaming) and the list of their destinations. Both lists should be updated when something is cut from inside pcmanfm-qt or when cutting is canceled. So, theoretically, we should be able to undo the last "clean" moving with a prompt dialog and assign Ctrl+Z to it.

It sounds very easy when said in English but, probably, not when started to be written in C++ ;)

@tsujan
Copy link
Member

tsujan commented Jan 27, 2019

Second thought: Yesterday, I was working with Dolphin (because I'd patched libfm-qt and pcmanfm-qt didn't run temporarily), wanted to press Ctrl+Z inside FeatherPad and saw a moved file reappeared in Dolphin. I'm not completely sure about it because I was really busy but an undo that can move a heavy file by mistake isn't a good "feature" to add, especially when its implementation takes a lot of code.

I cruelly close this report for the above-mentioned reason. Feel free to reopen it if you see undo as a necessary feature. However, over my dead body ;)

@tsujan tsujan closed this as completed Jan 27, 2019
@luffah
Copy link
Author

luffah commented Jan 28, 2019

As it was said in first comment: the aim was to follow which file has moved in pcmanfm-qt session.
Moreover, the move operation is already secured by dialog.

If someone see the the feature as essential, i suggest to implement it not with Ctrl+z , but in an undo history (which list files and allow to recover from a move or rename operation).

More harder to implement than a Ctrl+z, this feature is an extra that could be in a plugin ( linked to #40 ? ).
Therefore, if not existing, adding a hook (operation, source, target) when doing operation on files seems more essential than the feature.

@tsujan
Copy link
Member

tsujan commented Jan 28, 2019

the aim was to follow which file has moved in pcmanfm-qt session

Moved files cannot be tracked visually because the folder from which they are removed - or the folder to which they are moved -- may have been closed a second/minute/hour ago, in which case an undo can become very confusing.

A file manager is different from a text editor in this regard; undo/redo doesn't make sense for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants