libkdepim
#include <progressmanager.h>
Public Slots | |
void | slotAbortAll () |
void | slotStandardCancelHandler (KPIM::ProgressItem *item) |
Signals | |
void | progressItemAdded (KPIM::ProgressItem *) |
void | progressItemCanceled (KPIM::ProgressItem *) |
void | progressItemCompleted (KPIM::ProgressItem *) |
void | progressItemCryptoStatus (KPIM::ProgressItem *, KPIM::ProgressItem::CryptoStatus) |
void | progressItemLabel (KPIM::ProgressItem *, const QString &) |
void | progressItemProgress (KPIM::ProgressItem *, unsigned int) |
void | progressItemStatus (KPIM::ProgressItem *, const QString &) |
void | progressItemUsesBusyIndicator (KPIM::ProgressItem *, bool) |
void | showProgressDialog () |
Public Member Functions | |
virtual | ~ProgressManager () |
bool | isEmpty () const |
ProgressItem * | singleItem () const |
Public Member Functions inherited from QObject | |
QObject (QObject *parent) | |
QObject (QObject *parent, const char *name) | |
virtual | ~QObject () |
bool | blockSignals (bool block) |
QObject * | child (const char *objName, const char *inheritsClass, bool recursiveSearch) const |
const QObjectList & | children () const |
const char * | className () const |
bool | connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const |
void | deleteLater () |
void | destroyed (QObject *obj) |
bool | disconnect (const QObject *receiver, const char *method) |
bool | disconnect (const char *signal, const QObject *receiver, const char *method) |
void | dumpObjectInfo () |
void | dumpObjectTree () |
QList< QByteArray > | dynamicPropertyNames () const |
virtual bool | event (QEvent *e) |
virtual bool | eventFilter (QObject *watched, QEvent *event) |
T | findChild (const QString &name) const |
QList< T > | findChildren (const QRegExp ®Exp) const |
QList< T > | findChildren (const QString &name) const |
bool | inherits (const char *className) const |
void | insertChild (QObject *object) |
void | installEventFilter (QObject *filterObj) |
bool | isA (const char *className) const |
bool | isWidgetType () const |
void | killTimer (int id) |
virtual const QMetaObject * | metaObject () const |
void | moveToThread (QThread *targetThread) |
const char * | name () const |
const char * | name (const char *defaultName) const |
QString | objectName () const |
QObject * | parent () const |
QVariant | property (const char *name) const |
void | removeChild (QObject *object) |
void | removeEventFilter (QObject *obj) |
void | setName (const char *name) |
void | setObjectName (const QString &name) |
void | setParent (QObject *parent) |
bool | setProperty (const char *name, const QVariant &value) |
bool | signalsBlocked () const |
int | startTimer (int interval) |
QThread * | thread () const |
Static Public Member Functions | |
static ProgressItem * | createProgressItem (unsigned int progressType, const QString &label) |
static ProgressItem * | createProgressItem (const QString &label) |
static ProgressItem * | createProgressItem (ProgressItem *parent, const QString &id, const QString &label, const QString &status=QString(), bool canBeCanceled=true, KPIM::ProgressItem::CryptoStatus cryptoStatus=KPIM::ProgressItem::Unencrypted) |
static ProgressItem * | createProgressItem (const QString &parent, const QString &id, const QString &label, const QString &status=QString(), bool canBeCanceled=true, KPIM::ProgressItem::CryptoStatus cryptoStatus=KPIM::ProgressItem::Unencrypted) |
static ProgressItem * | createProgressItem (const QString &id, const QString &label, const QString &status=QString(), bool canBeCanceled=true, KPIM::ProgressItem::CryptoStatus cryptoStatus=KPIM::ProgressItem::Unencrypted) |
static ProgressItem * | createProgressItem (ProgressItem *parent, const Akonadi::AgentInstance &agent, const QString &id, const QString &label, const QString &status=QString(), bool canBeCanceled=true, KPIM::ProgressItem::CryptoStatus cryptoStatus=KPIM::ProgressItem::Unencrypted) |
static void | emitShowProgressDialog () |
static QString | getUniqueID () |
static ProgressManager * | instance () |
Static Public Member Functions inherited from QObject | |
bool | connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type) |
bool | connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type) |
bool | disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method) |
bool | disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method) |
QString | tr (const char *sourceText, const char *disambiguation, int n) |
QString | trUtf8 (const char *sourceText, const char *disambiguation, int n) |
Additional Inherited Members | |
Protected Member Functions inherited from QObject | |
bool | checkConnectArgs (const char *signal, const QObject *object, const char *method) |
virtual void | childEvent (QChildEvent *event) |
virtual void | connectNotify (const char *signal) |
virtual void | customEvent (QEvent *event) |
virtual void | disconnectNotify (const char *signal) |
int | receivers (const char *signal) const |
QObject * | sender () const |
int | senderSignalIndex () const |
virtual void | timerEvent (QTimerEvent *event) |
Static Protected Member Functions inherited from QObject | |
QByteArray | normalizeSignalSlot (const char *signalSlot) |
Properties inherited from QObject | |
objectName | |
Detailed Description
The ProgressManager singleton keeps track of all ongoing transactions and notifies observers (progress dialogs) when their progress percent value changes, when they are completed (by their owner), and when they are canceled.
Each ProgressItem emits those signals individually and the singleton broadcasts them. Use the ::createProgressItem() statics to acquire an item and then call ->setProgress( int percent ) on it every time you want to update the item and ->setComplete() when the operation is done. This will delete the item. Connect to the item's progressItemCanceled() signal to be notified when the user cancels the transaction using one of the observing progress dialogs or by calling item->cancel() in some other way. The owner is responsible for calling setComplete() on the item, even if it is canceled. Use the standardCancelHandler() slot if that is all you want to do on cancel.
Note that if you request an item with a certain id and there is already one with that id, there will not be a new one created but the existing one will be returned. This is convenient for accessing items that are needed regularly without the to store a pointer to them or to add child items to parents by id.
Definition at line 285 of file progressmanager.h.
Constructor & Destructor Documentation
|
virtual |
Definition at line 194 of file progressmanager.cpp.
Member Function Documentation
|
static |
Creates a ProgressItem with a unique id and the given label.
This is the simplest way to acquire a progress item. It will not have a parent and will be set to be cancellable and not using crypto.
Definition at line 238 of file progressmanager.cpp.
|
static |
Creates a ProgressItem with a unique id and the given label.
This is the simplest way to acquire a progress item. It will not have a parent and will be set to be cancellable and not using crypto.
Definition at line 232 of file progressmanager.cpp.
|
static |
Creates a new progressItem with the given parent, id, label and initial status.
- Parameters
-
parent Specify an already existing item as the parent of this one. id Used to identify this operation for cancel and progress info. label The text to be displayed by progress handlers status Additional text to be displayed for the item. canBeCanceled can the user cancel this operation? usesCrypto does the operation use secure transports (SSL) Cancelling the parent will cancel the children as well (if they can be canceled) and ongoing children prevent parents from finishing.
- Returns
- The ProgressItem representing the operation.
Definition at line 226 of file progressmanager.cpp.
|
static |
Use this version if you have the id string of the parent and want to add a subjob to it.
Definition at line 220 of file progressmanager.cpp.
|
static |
Version without a parent.
Definition at line 214 of file progressmanager.cpp.
|
static |
Version for Akonadi agents.
This connects all the proper signals so that you do not have to worry about updating the progress or reacting to progressItemCanceled().
Definition at line 58 of file progressmanager_akonadiagent.cpp.
|
static |
Ask all listeners to show the progress dialog, because there is something that wants to be shown.
Definition at line 342 of file progressmanager.cpp.
|
static |
Use this to acquire a unique id number which can be used to discern an operation from all others going on at the same time.
Use that number as the id string for your progressItem to ensure it is unique.
- Returns
Definition at line 204 of file progressmanager.cpp.
|
static |
- Returns
- The singleton instance of this class.
Definition at line 199 of file progressmanager.cpp.
bool KPIM::ProgressManager::isEmpty | ( | ) | const |
- Returns
- true when there are no more progress items.
Definition at line 209 of file progressmanager.cpp.
|
signal |
|
signal |
|
signal |
|
signal |
|
signal |
|
signal |
|
signal |
|
signal |
|
signal |
Emitted when an operation requests the listeners to be shown.
Use emitShowProgressDialog() to trigger it.
ProgressItem * KPIM::ProgressManager::singleItem | ( | ) | const |
- Returns
- the only top level progressitem when there's only one. Returns 0 if there is no item, or more than one top level item. Since this is used to calculate the overall progress, it will also return 0 if there is an item which uses a busy indicator, since that will invalidate the overall progress.
Definition at line 319 of file progressmanager.cpp.
|
slot |
|
slot |
Calls setCompleted() on the item, to make sure it goes away.
Provided for convenience.
- Parameters
-
item the canceled item.
Definition at line 314 of file progressmanager.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:33:51 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.