KIO.JobUiDelegate

KDE 4.2 PyKDE API Reference

- KDE's Python API

# JobUiDelegate Class Reference

`from PyKDE4.kio import *`

Inherits: KDialogJobUiDelegate → KJobUiDelegate → QObject
Namespace: KIO

## Detailed Description

A UI delegate tuned to be used with KIO Jobs.

## Enumerations
ConfirmationType | { DefaultConfirmation, ForceConfirmation }
DeletionType | { Delete, Trash }
## Methods
| __init__ (self)
bool | askDeleteConfirmation (self, KUrl.List urls, KIO.JobUiDelegate.DeletionType deletionType, KIO.JobUiDelegate.ConfirmationType confirmationType)
KIO.RenameDialog_Result | askFileRename (self, KJob job, QString caption, QString src, QString dest, KIO.RenameDialog_Mode mode, QString newDest, KIO.filesize_t sizeSrc=-1, KIO.filesize_t sizeDest=-1, time_t ctimeSrc=-1, time_t ctimeDest=-1, time_t mtimeSrc=-1, time_t mtimeDest=-1)
KIO.SkipDialog_Result | askSkip (self, KJob job, bool multi, QString error_text)
| setWindow (self, QWidget window)

## Method Documentation

__init__ | ( |  | self ) |

Constructs a new KIO Job UI delegate.

bool askDeleteConfirmation | ( | self, |
|  | KUrl.List | urls,
|  | KIO.JobUiDelegate.DeletionType | deletionType,
|  | KIO.JobUiDelegate.ConfirmationType | confirmationType
| ) |  |  |

Ask for confirmation before deleting/trashing urls.

Note that this method is not called automatically by KIO jobs. It's the application's responsibility to ask the user for confirmation before calling KIO.del() or KIO.trash().

Parameters:

  | urls | the urls about to be deleted/trashed
  | method | the type of deletion (Delete for real deletion, Trash otherwise)
  | confirmation | see ConfirmationType. Normally set to DefaultConfirmation. Note: the window passed to setWindow is used as the parent for the message box.

Returns:
  true if confirmed

KIO.RenameDialog_Result askFileRename | ( | self, |
|  | KJob | job,
|  | QString | caption,
|  | QString | src,
|  | QString | dest,
|  | KIO.RenameDialog_Mode | mode,
|  | QString | newDest,
|  | KIO.filesize_t | sizeSrc=-1,
|  | KIO.filesize_t | sizeDest=-1,
|  | time_t | ctimeSrc=-1,
|  | time_t | ctimeDest=-1,
|  | time_t | mtimeSrc=-1,
|  | time_t | mtimeDest=-1
| ) |  |  |

Construct a modal, parent-less "rename" dialog, and return a result code, as well as the new dest. Much easier to use than the class RenameDialog directly.

Parameters:

  | caption | the caption for the dialog box
  | src | the URL of the file/dir we're trying to copy, as it's part of the text message
  | dest | the URL of the destination file/dir, i.e. the one that already exists
  | mode | parameters for the dialog (which buttons to show...), see RenameDialog_Mode
  | newDestPath | the new destination path, valid if R_RENAME was returned.
  | sizeSrc | size of source file
  | sizeDest | size of destination file
  | ctimeSrc | creation time of source file
  | ctimeDest | creation time of destination file
  | mtimeSrc | modification time of source file
  | mtimeDest | modification time of destination file

Returns:
  the result

KIO.SkipDialog_Result askSkip | ( | self, |
|  | KJob | job,
|  | bool | multi,
|  | QString | error_text
| ) |  |  |

Internal:
  See skipdialog.h

setWindow | ( | self, |
|  | QWidget | window
| ) |  |  |

Associate this job with a window given by window.

Parameters:

  | window | the window to associate to

See also:
  window()

## Enumeration Documentation

ConfirmationType

ForceConfirmation: always ask the user for confirmation DefaultConfirmation: don't ask the user if he/she said "don't ask again".

Used by askDeleteConfirmation.

Enumerator:

  DefaultConfirmation |
  ForceConfirmation |

DeletionType

The type of deletion: real deletion, or moving the files to the trash Used by askDeleteConfirmation.

Enumerator:

  Delete |
  Trash |