![]() |
digiKam Developer Documentation
Professional Photo Management with the Power of Open Source
|
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. More...
Public Slots | |
void | slotAbortAll () |
Aborts all running jobs. | |
void | slotStandardCancelHandler (ProgressItem *item) |
Calls setCompleted() on the item, to make sure it goes away. | |
Signals | |
void | completeTransactionDeferred (ProgressItem *item) |
void | progressItemAdded (ProgressItem *) |
void | progressItemCanceled (ProgressItem *) |
void | progressItemCompleted (ProgressItem *) |
void | progressItemLabel (ProgressItem *, const QString &) |
void | progressItemProgress (ProgressItem *, unsigned int) |
void | progressItemStatus (ProgressItem *, const QString &) |
void | progressItemThumbnail (ProgressItem *, const QPixmap &) |
void | progressItemUsesBusyIndicator (ProgressItem *, bool) |
void | showProgressView () |
Emitted when an operation requests the listeners to be shown. | |
Public Member Functions | |
ProgressItem * | findItembyId (const QString &id) const |
QString | getUniqueID () |
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. | |
bool | isEmpty () const |
ProgressItem * | singleItem () const |
Static Public Member Functions | |
static bool | addProgressItem (ProgressItem *const t, ProgressItem *const parent=nullptr) |
Add a created progressItem outside manager with the given parent. | |
static ProgressItem * | createProgressItem (const QString &id, const QString &label, const QString &status=QString(), bool canBeCanceled=true, bool hasThumb=false) |
Use this version if you have the id string of the parent but without the parent instance. | |
static ProgressItem * | createProgressItem (const QString &label, const QString &status=QString(), bool canBeCanceled=true, bool hasThumb=false) |
Creates a ProgressItem with a unique id and the given label. | |
static ProgressItem * | createProgressItem (const QString &parent, const QString &id, const QString &label, const QString &status=QString(), bool canBeCanceled=true, bool hasThumb=false) |
Use this version if you have the id string of the parent and want to add a subjob to it. | |
static ProgressItem * | createProgressItem (ProgressItem *const parent, const QString &id, const QString &label, const QString &status=QString(), bool canBeCanceled=true, bool hasThumb=false) |
Creates a new progressItem with the given parent, id, label and initial status. | |
static void | emitShowProgressView () |
Ask all listeners to show the progress dialog, because there is something that wants to be shown. | |
static ProgressManager * | instance () |
Friends | |
class | ProgressManagerCreator |
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.
|
static |
t | The process to add on manager. |
parent | Specify an already existing item as the parent of this one (can be null). |
|
static |
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? Cancelling the parent will cancel the children as well (if they can be canceled) and ongoing children prevent parents from finishing. |
hasThumb | flag to indicate if progress item has a thumbnail. |
|
static |
This is the simplest way to acquire a progress item. It will not have a parent.
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? Cancelling the parent will cancel the children as well (if they can be canceled) and ongoing children prevent parents from finishing. |
hasThumb | flag to indicate if progress item has a thumbnail. |
|
static |
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? Cancelling the parent will cancel the children as well (if they can be canceled) and ongoing children prevent parents from finishing. |
hasThumb | flag to indicate if progress item has a thumbnail. |
|
static |
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? Cancelling the parent will cancel the children as well (if they can be canceled) and ongoing children prevent parents from finishing. |
hasThumb | flag to indicate if progress item has a thumbnail. |
ProgressItem * Digikam::ProgressManager::findItembyId | ( | const QString & | id | ) | const |
id | if it exist, else null. |
QString Digikam::ProgressManager::getUniqueID | ( | ) |
Use that number as the id string for your progressItem to ensure it is unique.
|
static |
bool Digikam::ProgressManager::isEmpty | ( | ) | const |
|
signal |
|
signal |
|
signal |
|
signal |
|
signal |
|
signal |
|
signal |
|
signal |
|
signal |
Use emitShowProgressView() to trigger it.
ProgressItem * Digikam::ProgressManager::singleItem | ( | ) | const |
|
slot |
Bound to "Esc"
|
slot |
Provided for convenience.
item | the canceled item. |