After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 167501 - Nautilus should have a universal Undo command
Nautilus should have a universal Undo command
Status: RESOLVED FIXED
Product: nautilus
Classification: Core
Component: File and Folder Operations
2.24.x
Other All
: Normal enhancement
: ---
Assigned To: Nautilus Maintainers
Nautilus Maintainers
: 309941 324111 362718 514000 553147 554261 562286 618380 627379 (view as bug list)
Depends on: 322194
Blocks: 620598 621013 resa
 
 
Reported: 2005-02-15 18:07 UTC by TuringTest
Modified: 2012-04-04 12:28 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement


Attachments
01_nautilus-undo-initial.patch (against 2.20.0) (84.88 KB, patch)
2007-10-23 13:42 UTC, Amos Brocco
none Details | Review
01_nautilus-undo-initial-v2.patch (against 2.20.0) (92.29 KB, patch)
2007-10-24 16:01 UTC, Amos Brocco
none Details | Review
Patch to add undo-redo support to Nautilus (against 2.28.1) (86.07 KB, patch)
2009-12-16 17:42 UTC, Amos Brocco
none Details | Review
Undo Redo Patch (fixed diff format) (87.26 KB, patch)
2009-12-16 19:44 UTC, Amos Brocco
none Details | Review
Updated Patch (79.31 KB, patch)
2009-12-21 13:59 UTC, Amos Brocco
none Details | Review
Patch against current git master (78.67 KB, patch)
2010-01-07 15:47 UTC, Amos Brocco
none Details | Review
Undo/redo patch (2010-01-12) (93.74 KB, patch)
2010-01-12 12:58 UTC, Amos Brocco
none Details | Review
Updated patch agains git (97.92 KB, patch)
2010-01-14 13:13 UTC, Amos Brocco
none Details | Review
Updated patch against git master (97.63 KB, patch)
2010-01-26 11:45 UTC, Amos Brocco
none Details | Review
updated version of current patch (97.58 KB, patch)
2010-03-12 11:22 UTC, A. Walton
none Details | Review
Updated patch (93.63 KB, patch)
2011-01-30 15:11 UTC, Amos Brocco
none Details | Review
Updated patch against current git (93.84 KB, patch)
2012-01-12 21:09 UTC, Amos Brocco
none Details | Review

Description TuringTest 2005-02-15 18:07:14 UTC
This is a superset of Bug 41850.

Everything in a usable environment should be easily undoable to allow user
exploration of the system. Ideally every command in the desktop should be
undoable, but enabling Undo in Nautilus would be a good place to start.

Having a universally available Undo command allows to get ridden of confirmation
"Are you sure?" dialogs. This speeds workflow up, increases the user confidence
in the interface, and is really useful when the user makes a mistake (no more "I
removed the whole Documents folder with just a click on OK").

Nautilus would be great if it had Undo for at least the commands Move, Copy,
Rename, Delete & Move to Trash.
Comment 1 Michaël Arnauts 2005-03-18 10:51:46 UTC
This is indeed something that i've missed in nautilus for quite some time.
Since there is an option in the "File Manager Preferences" that allows the user
to disable the dialog when moving files to trash, it shoudn't be removed as the
reported says imo...
Comment 2 Christian Neumair 2005-07-10 20:29:15 UTC
*** Bug 309941 has been marked as a duplicate of this bug. ***
Comment 3 Christian Neumair 2005-07-10 20:30:14 UTC
Bug 309941 also demands for rename widget undo capabilities.
Comment 4 Matthew Paul Thomas (mpt) 2005-11-29 18:33:46 UTC
This is not a superset of bug 41850. An undo function lets you undo the last 
action, then maybe the previous action, then maybe the one before that (e.g. 
moving something to the Trash), etc. But a proper Trash restore function 
lets you restore any item at any time, provided its container still exists.

Perhaps this bug should cover Nautilus having (a) a history of actions it 
has performed, each with human-readable summary for use in the Edit menu 
(e.g. "Move of 3 items"), and (b) infrastructure for calling a command's 
undo function if it exists, and making the "Undo"/ "Redo" menu items 
insensitive otherwise (e.g. "Can't Undo Erase Disk"). Then making individual 
operations undoable/redoable can be reported as separate bugs.
Comment 5 Christian Neumair 2005-11-29 22:11:20 UTC
I agree with you Matthew. However, what's more important than having a clean
bugzilla is to have people working on a real undo framework.

I haven't taken a close look at NautilusUndo yet, but since it is a legacy from
our IPC complexity days, it might be appropriate as a starting point but
overengineered.
I think some architectural decisions are quiet obvious, as long as we don't want
folder-specific revision control, which is what a Google bounty was aiming at.
A rough list should IMHO include rename, move, copy and trash operations, all on
one stack, and accessible through a menu.
Comment 6 Christian Neumair 2005-11-29 22:25:22 UTC
Oh, and we have to decide whether things should be undone globally, or per window.

It might be useful to work in window a, then b, and afterwards undoing in a
without undoing in b. At least for spatial windows, this seems to be a cruicial
aspect of undo.

For the browser window, a global undo list could be more desirable, but I don't
know really. Usability crew, any ideas?
Comment 7 Calum Benson 2005-12-01 00:35:30 UTC
For completeness, here's a link to a comment I made about this on the usability list recently: http://
mail.gnome.org/archives/usability/2005-October/msg00095.html

One problem with having per-window undo in any app is that the changes might have 
interdependencies... e.g. in a file manager, I might create a file in window A, create a symlink to it in 
window B, and then hit Undo in window A.  (Ok, not the most destructive example I can think of, but you 
get the idea...)
Comment 8 Sebastien Bacher 2005-12-14 23:58:43 UTC
*** Bug 324111 has been marked as a duplicate of this bug. ***
Comment 9 Alexander “weej” Jones 2005-12-15 00:04:39 UTC
Look at Konqueror, look at Finder, look at Explorer.
Comment 10 Vidar Braut Haarr 2005-12-15 00:09:35 UTC
alex@weej.com: Why?

And in any case, some people can't. Please elaborate.
Comment 11 CoudCoud 2007-09-06 13:47:49 UTC
We are in september 2007 and the bug is still there.
And the users who want this feature (it's not a bug, it's a feature :-) ) to be changed by adding an "undo" option are still there too.
Comment 12 Amos Brocco 2007-10-20 23:30:30 UTC
This is just a copy a message I've posted on nautilus-list (see [A]):

(...)I'm implementing an undo mechanism for Nautilus (see [1]).

I've already implemented some code [2] to manage a global operation history (nautilus-undostack-manager), menu entries and callbacks.

As there is work being done to move from gnome-vfs to gvfs I've not yet added the code to actually undo-redo file operations;
at this moment, selecting Undo or Redo does not perform real file operations but just prints a message on the console.
I've put some placeholders in nautilus-file-operations.c where the code to construct "undo data" will be put.

I've considered that every file operation (including undo/redo) is performed asynchronously, so the history is protected
using a mutex. Updates for the UI (menu items sensitivity, labels and tooltips) are pushed, when necessary, by mean of signals
(the UI being FMDirectoryView).

Some additional info on how the undo history works is found in nautilus-undostack-manager.c . (...)

references:
[A] http://mail.gnome.org/archives/nautilus-list/2007-October/msg00018.html
[1] http://bugzilla.gnome.org/show_bug.cgi?id=167501
[2] http://diuf.unifr.ch/pai/people/broccoa/dev/01_nautilus-undo-initial.patch
Comment 13 Amos Brocco 2007-10-23 13:42:34 UTC
Created attachment 97727 [details] [review]
01_nautilus-undo-initial.patch (against 2.20.0)

patch (against 2.20.0) to add initial support for undo to nautilus (uses gnome-vfs, so it will need to be ported to gvfs in the future).

operations that can be undone/redone are:
 - copy / move file
 - rename file
 - move to trash
 - create folder
 - make link

everything is done asynchronously

Note: Undo/Redo for "new empty file"/"new file from template" are not yet supported
Comment 14 Amos Brocco 2007-10-23 14:49:42 UTC
I've put a demonstration video at
http://www.youtube.com/watch?v=G--PBDz3hEs
Comment 15 Amos Brocco 2007-10-24 16:01:19 UTC
Created attachment 97785 [details] [review]
01_nautilus-undo-initial-v2.patch (against 2.20.0)

patch (against 2.20.0) also supporting undo/redo of "new empty file"/"new file from template"
Comment 16 CoudCoud 2007-10-24 22:38:13 UTC
Your work seems to be great.
I'm not a programmer, just a simple user, so how can I beta-test your patch ?
Comment 17 Michael Monreal 2007-10-26 15:01:27 UTC
This is one of my top-10 must-have features for GNOME... please get this into nautilus 2.22!
Comment 18 Björn Martensen 2008-01-31 18:00:09 UTC
i'd really love to see this in 2.22 aswell, but i fear it's a bit late.
but this should definately hit nautilus soon, imho.
it is very high on my wish-list aswell.
Comment 19 Amos Brocco 2008-01-31 23:39:02 UTC
I'm a bit busy now, and I'm also waiting for nautilus 2.22 with stable gio/gvfs before porting the undo thing to it (I don't want to hack on something that is still being heavily worked on). 
Comment 20 André Klapper 2008-02-03 13:50:22 UTC
*** Bug 362718 has been marked as a duplicate of this bug. ***
Comment 21 André Klapper 2008-02-03 13:50:47 UTC
*** Bug 514000 has been marked as a duplicate of this bug. ***
Comment 22 antistress 2008-03-10 10:09:33 UTC
for information, the idea is also developped here :
Never Use a Warning When you Mean Undo
http://www.alistapart.com/articles/neveruseawarning

Bugs #487643, #480975 and #319785 are related (but not duplicate)
They have been reported from Launchpad/Ubuntu Feature request : "Evince/EOG/Epiphany lack an option to reset toolbars" and EoG has a Fix Released in version 2.22

See also Bug 521533 "the Recent Documents menu should not have a confirmation dialog box when the user ask for deleting entries"
The Recent Documents menu (since GNOME 2.20 thanks to GtkRecentAction) shows a
confirmation dialog box when the user ask for deleting entries, 
whereas there should be an Undo functionnality or maybe nothing (since no files
are deleted, only shortcuts. Warnings should be reserved to important actions.
User will not read warnings anymore if there is too much of them in the
Desktop).

Comment 23 Björn Martensen 2008-07-10 13:24:04 UTC
Any chance getting undo capabilities in nautilus in 2.24 since gio/gvfs are pretty stable now?
Comment 24 Cosimo Cecchi 2008-09-29 19:58:37 UTC
*** Bug 554261 has been marked as a duplicate of this bug. ***
Comment 25 Alejandro 2008-11-02 20:24:06 UTC
Any Chance of getting this into 2.26? This is really one of the most important features I think!
Thanks!
Comment 26 Denis Kasak 2008-11-25 19:17:44 UTC
Is anyone paying attention to this bug? Since this is probably the single most important feature that Nautilus lacks (from a POV of Windows users who are so accustomed to it that they're shocked when they notice there is no such feature in Nautilus), I think this should be paid much more attention. To bump the question: will this be included in 2.26?
Comment 27 CoudCoud 2008-11-25 21:53:22 UTC
Yes, will this feature be included in 2.26?
Comment 28 palfrey 2008-11-26 18:26:03 UTC
*** Bug 562286 has been marked as a duplicate of this bug. ***
Comment 29 André Klapper 2008-12-21 17:55:37 UTC
Obviously it will not be included until somebody comes up here and attaches a patch. "Me too" comments do not help.
Comment 30 CoudCoud 2008-12-21 23:48:36 UTC
Errr, Amos Brocco already proposed a patch (see v1 and v2 above), hasn't he ?
I tested it on Ubuntu Gustsy Gibbon and it seemed to work : it was one year ago.
I suppose many changes have been done to nautilus since 2.20 (I'm not a developer), but can't the work that has already been done be used ?
Comment 31 Tom 2009-01-07 20:37:44 UTC
Sigh, it's not in 2.24 - someone said it's trivial coding (obviously waaay beyond my skill-set) and there's a patch for it so its perverse to hold it back from general release - especially since it makes Linux less attractive to Windows users.  

Are we trying to discourage people from adopting Linux, do we want people to avoid Linux and stick with Windows or was it a mistake?  My money is on it being a mistake.  lol, good luck getting it included in the next Nautilus upgrade - is it possible to have it as just one of the occasional updates or is it going to have to wait for the next big upgrade?  Is there anything less negative that i could do to help expedite matters?  Please let me know if i can help.

Windows has had this UnDo feature in right-click and Edit menus for donkeys years (or is that ears?)
Comment 32 André Klapper 2009-01-07 20:50:19 UTC
(In reply to comment #30)
> Errr, Amos Brocco already proposed a patch (see v1 and v2 above), hasn't he ?
> I suppose many changes have been done to nautilus since 2.20

yes. hence it needs porting and *a lot* of testing...
Comment 33 Tom 2009-01-07 21:28:07 UTC
Sorry my last posting was rude and unhelpful.  It's good that we have a patch and i'd help test it if i knew how but i don't have enough ability that way.
Comment 34 Amos Brocco 2009-12-16 17:42:15 UTC
Created attachment 149859 [details] [review]
Patch to add undo-redo support to Nautilus (against 2.28.1)

Hello,
I've finished the porting of the patch to GIO. I've developed it against Nautilus 2.28.1 (Ubuntu 9.10).

It supports Undo-Redo for the following operations:
   - copy / duplicate
   - move
   - trash
   - rename
   - make link
   - create new folder
   - create new file
   - create file from template

I've tried to touch the existing code (mainly nautilus-file-operations.c) as little as possible. 

...and it surely needs some heavy testing:) 

a little demo video is available online at 
http://www.youtube.com/watch?v=YCf94_p2SyA
Comment 35 Tom 2009-12-16 18:39:49 UTC
WOW !! That does look awesome :)) Good work all :) Now just to alpha?/beta test it? I'm going to try randomly clicking on a few things to see if that helps me beta test it. Sorry to ask for clues, i really shouldn't be such a noob at this by now but i have enjoyed using linux and it's all been soo easy that i haven't been forced into learning much :)

While it is good to have it in the Edit menu it would be great if this new functionality could be added to the normal right-click menu?

Thanks all for working at this
Congrats, regards and respect to you for fixing this :)
from
Tom :)
Comment 36 Baptiste Mille-Mathias 2009-12-16 19:13:49 UTC
(In reply to comment #34)
> Created an attachment (id=149859) [details] [review]
> Patch to add undo-redo support to Nautilus (against 2.28.1)

Hi Amos,

I'm not able to review your patch, but I rather wanted to tell you this is always better to work against the latest development version.
Nautilus 2.28.1 is few weeks now and the unstable has moved since, and your patch does apply to master.

I suggest to use git (as all GNOME projets do) to ease your work (which seems to be an hard job) and the maintainer's job too.

Cheers
Comment 37 Baptiste Mille-Mathias 2009-12-16 19:20:57 UTC
(In reply to comment #36)

> and your patch does apply to master.
                     ^^^
                     not
Comment 38 Amos Brocco 2009-12-16 19:44:39 UTC
Created attachment 149868 [details] [review]
Undo Redo Patch (fixed diff format)

(the same patch... just fixed the diff format...)
Comment 39 Ralf Ebert 2009-12-17 14:46:45 UTC
Amos, thanks, works great so far!

(In reply to comment #35)
> Now just to alpha?/beta test it?
I successfully applied the patch to the nautilus-2.28.1 source package following the instructions here http://www.moosechips.com/2008/09/ubuntu-rebuild-a-source-package/ and here http://www.debian.org/doc/maint-guide/ch-build.en.html#s-dpatch
Comment 40 Amos Brocco 2009-12-21 13:59:16 UTC
Created attachment 150170 [details] [review]
Updated Patch

Updated patch (against 2.28.1):
  - cleaned up signals
  - added undo/redo for "restore from trash"
  - various bug fixes


Note:
this patch applies cleanly also to the current development version on git (as of 19 dec), but I have not yet tried to compile it.
Comment 41 Tom 2009-12-21 14:35:31 UTC
Ok, the current version of Nautilus that i am using from the repositories is 2.26.2 so i guess it will be quite a long while before i can try this out. I am a point&click user & was hoping to beta test this patch against my current version but i am happy to wait. Thanks for writing this Amos :))
Happy Samhain/Christmas whatever
Regards from
Tom :)
Comment 42 Amos Brocco 2010-01-07 15:47:52 UTC
Created attachment 150975 [details] [review]
Patch against current git master

New patch against current git master (as of Thu Jan 7, 4:45PM)

I've fixed some compilation warnings about unused variables, fixed problems with the "new file" operation, and changed some strings.
Comment 43 Amos Brocco 2010-01-12 12:58:36 UTC
Created attachment 151248 [details] [review]
Undo/redo patch (2010-01-12)

New patch against git master (as of Tue Jan 12, 1:51 PM)

Changes:
  - added undo/redo support for permission change, owner change, and group change
Comment 44 Tom 2010-01-12 20:05:10 UTC
Cooking on gas!! Good to see more progress with this :)
Thanks Amos :))
Regards from
Tom :)
Comment 45 Amos Brocco 2010-01-14 13:13:08 UTC
Created attachment 151396 [details] [review]
Updated patch agains git

changes:
  - use more meaningful descriptions for status messages (both undo and redo)
Comment 46 Tom 2010-01-14 13:20:47 UTC
Main thing that bothers me now is whether this functionality could be added to the mouse's right-click menu in a sensible way? It does feel like a fantastic step forwards being able to use the edit menu to undo but Window (sorry to swear) already has this in the right-click. I am not sure but i have a feeling that would be another major problem in trying to finesse this?
Regards from
Tom :)
Comment 47 Tom 2010-01-14 13:37:44 UTC
Hi again :)

As a point&click user i found Synaptic allowed me to add a "proposed updates" repository. Does this allow me to upgrade to the development version of nautilus?

I am not hugely worried about breaking one of my ubuntu installs as both my installs share a separate /home partition. Also i have found a sneaky method of reinstalling Ubuntu to get it "back to factory settings" without losing all the installed programs, actually i have 2 simple methods for this. Which reminds me, i should back up my bookmarks and stuff fairly soon lol

Thanks to all that are working at this, especially Amos. Please nudge me in the direction of being able to alpha/beta test this for you a bit
Many regards from
Tom :)
Comment 48 John Stowers 2010-01-14 14:13:06 UTC
> As a point&click user i found Synaptic allowed me to add a "proposed updates"
> repository. Does this allow me to upgrade to the development version of
> nautilus?

Almost certainly not. Ubuntu almost never backports new major versions of software into older distributions. However, I did see this

http://www.webupd8.org/2010/01/download-undo-redo-patched-nautilus.html

> Thanks to all that are working at this, especially Amos. Please nudge me in the
> direction of being able to alpha/beta test this for you a bit

While this is not really a forum, I expect the developers would like to hear your experiences using the modified nautilus.
Comment 49 Tom 2010-01-14 15:58:34 UTC
Thanks John :)

So i need to update to Kosmic Koala (lol) before i can try this? But when i do upgrade i just need to run these commands?

sudo apt-get install wget
wget http://diuf.unifr.ch/pai/people/broccoa/nautilus/nautilus_2.28.1-81attila1_i386.deb
wget http://diuf.unifr.ch/pai/people/broccoa/nautilus/nautilus-data_2.28.1-81attila1_all.deb
wget http://diuf.unifr.ch/pai/people/broccoa/nautilus/libnautilus-extension1_2.28.1-81attila1_i386.deb
sudo dpkg -i *.deb

Either from the root shell in Recovery Mode before/during bootup or perhaps just reboot to start a new X session?  Hmm, i think i have found a forum thread where i can ask these questions more easily

Thanks and regards from
Tom :)
Comment 50 Amos Brocco 2010-01-15 19:44:36 UTC
(In reply to comment #49)

For ubuntu users I've set up a PPA, https://launchpad.net/~mriya3/+archive/ppa

If you have further comments on installing these packages please ask directly on the ubuntu forums (http://ubuntuforums.org/showthread.php?p=8536329#post8536329).
Comment 51 Amos Brocco 2010-01-26 11:45:56 UTC
Created attachment 152302 [details] [review]
Updated patch against git master

Updated patch changes:
  - bug fixes
Comment 52 A. Walton 2010-03-12 11:22:31 UTC
Created attachment 155955 [details] [review]
updated version of current patch

Spent some time off and on during my spring break to bring you this (mostly untested) large update to the patch. Really happy that it worked going into the changes, since that'll make it easier to track what I broke during this update.

The major changes include:
* Moves to Nautilus' coding style (indention, variables defined at the top of the block, avoids assignment at variable creation, etc.) Largest portion of the work was spent here.
* Reduces the number of roundtrips through GFile.
* Stubs out the gtk-doc for some of the new API
* Some bug fixes (using glib, making sure not to mismatch malloc()/g_free()).

While I still don't think this is ready to go in, it gets us significantly closer.
* I'd like to break down the huge NautilusUndoStackActionData struct. I'm not sure if this should end up like the Job structs in the file operations, or more like GdkEvent, but I'm leaning towards the former just to try to avoid unions and break down some of those enormous switch blocks.
* The whole thing still seems wordy. Considering nixing the word "stack" just to shorten the whole namespace, information->info.
* Need to reconcile the differences between the existing undo support and the new undo stack code. There is some noticeable overlap, but for the most part it seems the new code replaces the old code (which seems to barely have any function now that Nautilus is Bonobo-less).
* Still need to get rid of some GFile roundtripping.
* Still a few style issues I left untouched since the file state of that code is still unknown.

Input welcome.
Comment 53 Cosimo Cecchi 2010-05-02 15:07:01 UTC
*** Bug 553147 has been marked as a duplicate of this bug. ***
Comment 54 Cosimo Cecchi 2010-05-12 00:05:36 UTC
*** Bug 618380 has been marked as a duplicate of this bug. ***
Comment 55 antistress 2010-06-24 22:46:38 UTC
it seems that Nautilus Elementary has a Undo command
http://blog.sckyzo.com/wp-content/uploads/2010/06/Espace-de-travail-1_002.png
Comment 56 Tom 2010-06-25 07:00:10 UTC
@ AntiStress
A lot of the developers in Elementary also work (even lead) in other projects such as Ubuntu, Mint & Debian main. Elementary is a good place to test ideas in the wild before bringing them into Debian family distros (such as Ubuntu and Mint) in much the same way as Fedora is a good testing-ground for the RedHat family.  At least that is my impression from the excellent article by Chris Smart
Good luck and regards from
Tom :)
Comment 57 Cosimo Cecchi 2010-08-20 10:25:42 UTC
*** Bug 627379 has been marked as a duplicate of this bug. ***
Comment 58 Amos Brocco 2011-01-30 15:11:52 UTC
Created attachment 179634 [details] [review]
Updated patch

Here's an update patch that cleans up a little bit the undo mechanism (based on the work done by Cosimo in the undo-manager branch). It applies to current git master. 

The main differences are:
 - better code organization
 - separate undo data structures
 - fixes to let the patch apply to git master (mainly changes from FMDirectoryView to NautilusView)
Comment 59 Amos Brocco 2012-01-12 21:09:33 UTC
Created attachment 205141 [details] [review]
Updated patch against current git

Updated to apply against current git.
Fixed deprecated methods for dealing with GMutex.
Comment 60 André Klapper 2012-04-04 11:40:57 UTC
Hasn't this been fixed for 3.4? Wondering why this report is still open...
Comment 61 Cosimo Cecchi 2012-04-04 12:28:46 UTC
Yes, just because I forgot about it :)