[GSoC 22] [undo] Add 'undo' for file operations
This is an issue to keep track of general discussion on the addition of 'undo' for file operations (requested in #191 (closed)). It is a part of my proposal for GSoC 22.
Implementation brief
The implementation relies on the addition of a new type, ThunarJobOperation
to keep track of the latest operation(s) performed and allow for undoing them by calculating the inverse operation and executing it. Later additions would introduce a GList
of such operations, and performing an undo should undo the latest operation, move the HEAD (pointer to the current state) backwards in history after undoing that operation. This would allow for 'redo' as well to be easily implemented by simply moving the head forward in history and executing the operation at the HEAD.
TODO
The following MRs for each partial feature have to be added:
-
Undo for the single latest copy operation (!266 (merged)) -
Undo for single latest operation out of each of the following: move, rename, trash, link, create -
Move (!281 (merged)) -
Rename (!288 (merged)) -
Trash (!289 (merged)) -
File creation (928e59c4) -
Link (ff927e81)
-
-
Undo and redo for the single latest operation (98bc16cc) -
Multi level undo/redo (98bc16cc) -
Limit job_operation_list
to e.g. 5 elements, so it does not grow indefinitely (configurable via xfconf prop) (!299 (merged)) -
Introduce mutex to protect job_operation_list
and undo/redo pointers, since the variables can be accessed from within multiple threads (!305 (merged)) -
Add toolbar icons for undo/redo (!298 (merged)) -
Open separate issues for things mentioned in #819 (comment 51642) -
small popup informing the user what operation they just undid (#903 (closed)) -
Allow users to access and view the recorded operation history in some way.
-