GNOME Bugzilla – Bug 764137
Keep items visible and selected after renaming or creation
Last modified: 2016-04-27 21:30:05 UTC
If you create a folder or rename a file, it can move position in the view. This can be confusing if it moves out of sight - it looks like the item has disappeared. The current behaviour isn't very helpful, either - you often want to perform actions on items after renaming or creating them, and having to hunt for their new location is extra work. This is also an argument for keeping items selected after one of these operations - you should be able to press return to open them. After creating a folder, the hamburger menu gets focus rather than the folder - not useful.
*** Bug 760623 has been marked as a duplicate of this bug. ***
Created attachment 326863 [details] [review] files-view: reveal file after renaming We want to reveal the file that was just renamed. In order to do that, we have to make sure the view has the icon and all changes were acknowledge, and only then, reveal the file. In this patch, we implement this connecting to the view signal and revealing the file if the operation was done.
Created attachment 326873 [details] [review] files-view: reveal file after renaming or creating We want to reveal the file that was just renamed. In order to do that, we have to make sure the view has the icon and all changes were acknowledge, and only then, reveal the file. In this patch, we implement this creating a hash table that will hold any file that needs to be revealed when the view acknowledges it. Functions using this will be the renaming of files, the creation of folders, and the creation of folders with selection.
I like more this second approach, that holds private data on what files should be revealed. So the view has the pending to reveal files as part of the state.
Review of attachment 326873 [details] [review]: ::: src/nautilus-files-view.c @@ +3535,3 @@ + + /* Reveal files that were pending to be revealed, only if all of them + * were aknowledge by the view Acknowledged should be used here. @@ +3540,3 @@ + GList *keys; + GList *l; + gboolean all_files_aknowledge = TRUE; Use acknowledged. @@ +3542,3 @@ + gboolean all_files_aknowledge = TRUE; + + keys = g_hash_table_get_keys (view->details->pending_reveal); The list of keys should be freed. @@ +3594,1 @@ + /* Aknowledge the files that were pending to be revealed */ You forgot the C in acknowledge.
Created attachment 326897 [details] [review] files-view: reveal file after renaming or creating We want to reveal the file that was just renamed. In order to do that, we have to make sure the view has the icon and all changes were acknowledge, and only then, reveal the file. In this patch, we implement this creating a hash table that will hold any file that needs to be revealed when the view acknowledges it. Functions using this will be the renaming of files, the creation of folders, and the creation of folders with selection.
Created attachment 326898 [details] [review] files-view: reveal file after renaming or creating We want to reveal the file that was just renamed. In order to do that, we have to make sure the view has the icon and all changes were acknowledge, and only then, reveal the file. In this patch, we implement this creating a hash table that will hold any file that needs to be revealed when the view acknowledges it. Functions using this will be the renaming of files, the creation of folders, and the creation of folders with selection.
Review of attachment 326898 [details] [review]: LGTM!
Thanks for review Razvan! Attachment 326898 [details] pushed as 0a00871 - files-view: reveal file after renaming or creating