#2892 closed enhancement (fixed)
Undo/Redo feature in the Diagram view editing
Reported by: | Francesco Casella | Owned by: | Adeel Asghar |
---|---|---|---|
Priority: | high | Milestone: | 1.9.4 |
Component: | OMEdit | Version: | trunk |
Keywords: | Cc: | jan.kokert@… |
Description
When editing a model in the Text view, it is possible to Undo/Redo changes. However, this is not possible in the Diagram view. If one delets or moves some models by accident, restoring the previous situation is pretty inconvenient. It should be possible to do it by just hitting Ctrl-Z.
Change History (11)
comment:1 by , 10 years ago
Cc: | added |
---|
follow-up: 3 comment:2 by , 10 years ago
comment:3 by , 10 years ago
Replying to janK:
After the implementation of snap to grid, manhattanize connection lines and resimulate control, the missing UNDO/REDO feature is the only remaining blocker of modelling in OMEdit in my eyes (see also #2478).
One possible data structure for a multi-level UNDO is a stack of course. In order to support REDO, a second stack keeps all the commands you've undone. So when you pop the undo stack to undo a command, you push the same command onto the redo stack. Further it's important to always clear the redo stack if you push a different command. The standard design pattern for this functionality seems to be Memento.
We don't need to implement anything by our own. Qt has its own way of doing it. Qt's Undo Framework. Of course the implementation is stack based!
In two weeks I will present OpenModelica at our chair with a live demo. So it would be awesome if a rudimentary undo feature for component movement and connection lines would be available. =D
I am sorry but its not possible. There are some other projects on which I should work now otherwise I will miss deadlines. I will come back to GUI work next year and then I will implement it.
comment:4 by , 10 years ago
Hi Adeas! "Qt's Undo Framework" -> This is great!
Sure, no hurry! Thanks for the willingness of implemeting it!
comment:5 by , 10 years ago
Milestone: | 1.9.2 → 1.9.3 |
---|
Milestone changed to 1.9.3 since 1.9.2 was released.
comment:6 by , 9 years ago
Are any news about this ticket?
We've been waiting for undo for many months (it was discussed in other tickets even earlier than 2892).
Hope some activity on this is planned for the coming weeks or months!
Thank you.
comment:8 by , 9 years ago
Status: | new → accepted |
---|
This issue has now been fixed in a development branch https://github.com/adeas31/OMEdit/tree/indentation for OpenModelica 1.9.4 final release.
comment:9 by , 9 years ago
Resolution: | → fixed |
---|---|
Status: | accepted → closed |
The fix is now available via the nightly build.
After the implementation of snap to grid, manhattanize connection lines and resimulate control, the missing UNDO/REDO feature is the only remaining blocker of modelling in OMEdit in my eyes (see also #2478).
One possible data structure for a multi-level UNDO is a stack of course. In order to support REDO, a second stack keeps all the commands you've undone. So when you pop the undo stack to undo a command, you push the same command onto the redo stack. Further it's important to always clear the redo stack if you push a different command. The standard design pattern for this functionality seems to be Memento.
In two weeks I will present OpenModelica at our chair with a live demo. So it would be awesome if a rudimentary undo feature for component movement and connection lines would be available. =D