|
|
The command history stores a (user) configurable amount of Commands. It keeps track of its size and deletes commands if it gets too large. The user can set a maximum undo and a maximum redo limit (e.g. max. 50 undo / 30 redo commands). The KCommandHistory keeps track of the "borders" and deletes commands, if appropriate. It also activates/deactivates the undo/redo actions in the menu and changes the text according to the name of the command.
| |
Create a command history, to store commands. This constructor doesn't create actions, so you need to call undo and redo yourself.
| |
Create a command history, to store commands.
This also creates an undo and a redo action, in the actionCollection,
using the standard names ("edit_undo" and "edit_redo").
Parameters:
| withMenus | if true, the actions will display a menu when plugged into a toolbar. |
| void |
Erase all the undo/redo history. Use this when reloading the data, for instance, since this invalidates all the commands.
| void |
Adds a command to the history. Call this for each command you create.
Unless you set execute to false, this will also execute the command.
This means, most of the application's code will look like
MyCommand * cmd = new MyCommand(i18n("The name"), parameters);
m_historyCommand.addCommand( cmd );
| const int & |
Returns: the maximum number of items in the undo history
| void |
Set the maximum number of items in the undo history
| const int & |
Returns: the maximum number of items in the redo history
| void |
Set the maximum number of items in the redo history
| void |
[virtual slot]
Undo the last action. Call this if you don't use the builtin KActions.
| void |
[virtual slot]
Redo the last undone action. Call this if you don't use the builtin KActions.
| void |
[slot]
Remember when you saved the document. Call this right after saving the document. As soon as the history reaches the current index again (via some undo/redo operations) it will emit documentRestored If you implemented undo/redo properly the document is the same you saved before.
| void |
[signal]
This is called every time a command is executed (whether by addCommand, undo or redo). You can use this to update the GUI, for instance.
| void |
[signal]
This is emitted everytime we reach the index where you saved the document for the last time. See documentSaved
| Generated by: ssk@tauon.ph.unimelb.EDU.AU on Wed May 23 04:29:58 2001, using kdoc 2.0a35. |