Akonadi.AgentInstanceCreateJob

KDE 4.7 PyKDE API Reference

- KDE's Python API

# AgentInstanceCreateJob Class Reference

`from PyKDE4.akonadi import *`

Inherits: KJob → QObject
Namespace: Akonadi

## Detailed Description

Job for creating new agent instances.

This class encapsulates the procedure of creating a new agent instance and optionally configuring it immediately.

     MyClass.MyClass( QWidget *parent )
       : QWidget( parent )
     {
       // Get agent type object
       Akonadi.AgentType type = Akonadi.AgentManager.self()->type( "akonadi_vcard_resource" );

       Akonadi.AgentInstanceCreateJob *job = new Akonadi.AgentInstanceCreateJob( type );
       connect( job, SIGNAL( result( KJob * ) ),
                this, SLOT( slotCreated( KJob * ) ) );

       // use this widget as parent for the config dialog
       job->configure( this );

       job->start();
     }

     ...

     void MyClass.slotCreated( KJob *job )
     {
       Akonadi.AgentInstanceCreateJob *createJob = static_cast<Akonadi.AgentInstanceCreateJob*>( job );

       qDebug() << "Created agent instance:" << createJob->instance().identifier();
     }

Author:
  Volker Krause <vkrause@kde.org>

## Methods
| __init__ (self, Akonadi.AgentType type, QObject parent=0)
| __init__ (self, QString typeId, QObject parent=0)
| configure (self, QWidget parent=0)
Akonadi.AgentInstance | instance (self)
| start (self)

## Method Documentation

__init__ | ( | self, |
|  | Akonadi.AgentType | type,
|  | QObject | parent=0
| ) |  |  |

Creates a new agent instance create job.

Parameters:

  | type | The type of the agent to create.
  | parent | The parent object.

__init__ | ( | self, |
|  | QString | typeId,
|  | QObject | parent=0
| ) |  |  |

Creates a new agent instance create job.

Parameters:

  | typeId | The identifier of type of the agent to create.
  | parent | The parent object.

Since:
  4.5

configure | ( | self, |
|  | QWidget | parent=0
| ) |  |  |

Setup the job to show agent configuration dialog once the agent instance has been successfully started.

Parameters:

  | parent | The parent window for the configuration dialog.

Akonadi.AgentInstance instance | ( |  | self ) |

Returns the AgentInstance object of the newly created agent instance.

start | ( |  | self ) |

Starts the instance creation.