FileUndoManager Class Reference
from PyKDE4.kio import *
Inherits: QObject
Namespace: KIO
Detailed Description
FileUndoManager: makes it possible to undo kio jobs.
This class is a singleton, use self() to access its only instance.
Enumerations |
CommandType | { Copy, Move, Rename, Link, Mkdir, Trash } |
Signals |
| jobRecordingFinished (KIO.FileUndoManager.CommandType op) |
| jobRecordingStarted (KIO.FileUndoManager.CommandType op) |
| undoAvailable (bool avail) |
| undoJobFinished () |
| undoTextChanged (QString text) |
Methods |
| __init__ (self) |
quint64 | currentCommandSerialNumber (self) |
| jobRecordingFinished (self, KIO.FileUndoManager.CommandType op) |
| jobRecordingStarted (self, KIO.FileUndoManager.CommandType op) |
quint64 | newCommandSerialNumber (self) |
| recordCopyJob (self, KIO.CopyJob copyJob) |
| recordJob (self, KIO.FileUndoManager.CommandType op, KUrl.List src, KUrl dst, KIO.Job job) |
| setUiInterface (self, KIO.FileUndoManager.UiInterface ui) |
KIO.FileUndoManager.UiInterface | uiInterface (self) |
| undo (self) |
bool | undoAvailable (self) |
| undoAvailable (self, bool avail) |
| undoJobFinished (self) |
QString | undoText (self) |
| undoTextChanged (self, QString text) |
Static Methods |
KIO.FileUndoManager | self () |
Method Documentation
quint64 currentCommandSerialNumber |
( |
|
self ) |
|
jobRecordingFinished |
( |
self, |
|
|
|
KIO.FileUndoManager.CommandType |
op |
|
) |
|
|
|
Emitted when a job that has been recorded by FileUndoManager.recordJob()
or FileUndoManager.recordCopyJob has been finished. The command
is now available for an undo-operation.
- Since:
- 4.2
- Signal syntax:
QObject.connect(source, SIGNAL("jobRecordingFinished(CommandType)"), target_slot)
jobRecordingStarted |
( |
self, |
|
|
|
KIO.FileUndoManager.CommandType |
op |
|
) |
|
|
|
Emitted when a job recording has been started by FileUndoManager.recordJob()
or FileUndoManager.recordCopyJob(). After the job recording has been finished,
the signal jobRecordingFinished() will be emitted.
- Since:
- 4.2
- Signal syntax:
QObject.connect(source, SIGNAL("jobRecordingStarted(CommandType)"), target_slot)
quint64 newCommandSerialNumber |
( |
|
self ) |
|
These two functions are useful when wrapping FileUndoManager and adding custom commands.
Each command has a unique ID. You can get a new serial number for a custom command
with newCommandSerialNumber(), and then when you want to undo, check if the command
FileUndoManager would undo is newer or older than your custom command.
Record this CopyJob while it's happening and add a command for it so that the user can undo it.
The signal jobRecordingStarted() is emitted.
Record this job while it's happening and add a command for it so that the user can undo it.
The signal jobRecordingStarted() is emitted.
- Parameters:
-
| op | the type of job - which is also the type of command that will be created for it
|
| src | list of source urls
|
| dst | destination url
|
| job | the job to record
|
- Returns:
- the FileUndoManager instance
setUiInterface |
( |
self, |
|
|
|
KIO.FileUndoManager.UiInterface |
ui |
|
) |
|
|
|
KIO.FileUndoManager.UiInterface uiInterface |
( |
|
self ) |
|
- Returns:
- the UiInterface instance passed to setUiInterface.
This is useful for calling setParentWidget on it. Never delete it!
Undoes the last command
Remember to call uiInterface()->setParentWidget(parentWidget) first,
if you have multiple mainwindows.
bool undoAvailable |
( |
|
self ) |
|
- Returns:
- true if undo is possible. Usually used for enabling/disabling the undo action.
undoAvailable |
( |
self, |
|
|
|
bool |
avail |
|
) |
|
|
|
Emitted when the value of undoAvailable() changes
- Signal syntax:
QObject.connect(source, SIGNAL("undoAvailable(bool)"), target_slot)
Emitted when an undo job finishes. Used for unit testing.
- Signal syntax:
QObject.connect(source, SIGNAL("undoJobFinished()"), target_slot)
- Returns:
- the current text for the undo action.
undoTextChanged |
( |
self, |
|
|
|
QString |
text |
|
) |
|
|
|
Emitted when the value of undoText() changes
- Signal syntax:
QObject.connect(source, SIGNAL("undoTextChanged(const QString&)"), target_slot)
Enumeration Documentation
- Enumerator:
-
Copy | |
Move | |
Rename | |
Link | |
Mkdir | |
Trash | |