KDE 4.1 PyKDE API Reference
  • KDE's Python API
  • Overview
  • PyKDE Home
  • Sitemap
  • Contact Us
 

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

 undoAvailable (bool avail)
 undoJobFinished ()
 undoTextChanged (QString text)

Methods

 __init__ (self)
quint64 currentCommandSerialNumber (self)
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

__init__ (   self )
quint64 currentCommandSerialNumber (   self )
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.

recordCopyJob (  self,
KIO.CopyJob  copyJob
)

Record this CopyJob while it's happening and add a command for it so that the user can undo it.

recordJob (  self,
KIO.FileUndoManager.CommandType  op,
KUrl.List  src,
KUrl  dst,
KIO.Job  job
)

Record this job while it's happening and add a command for it so that the user can undo it.

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

KIO.FileUndoManager self (   )

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!

undo (   self )

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)
undoJobFinished (   self )

Emitted when an undo job finishes. Used for unit testing.

Signal syntax:
QObject.connect(source, SIGNAL("undoJobFinished()"), target_slot)
QString undoText (   self )

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

CommandType
Enumerator:
Copy 
Move 
Rename 
Link 
Mkdir 
Trash 

  • Full Index

Modules

  • akonadi
  • dnssd
  • kdecore
  • kdeui
  • khtml
  • kio
  • knewstuff
  • kparts
  • kutils
  • nepomuk
  • phonon
  • solid
  • soprano
This documentation is maintained by Simon Edwards.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal