digiKam
|
Public Slots | |
void | slotAbortAll () |
void | slotStandardCancelHandler (ProgressItem *item) |
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 () |
Public Member Functions | |
ProgressItem * | findItembyId (const QString &id) const |
QString | getUniqueID () |
bool | isEmpty () const |
ProgressItem * | singleItem () const |
Static Public Member Functions | |
static bool | addProgressItem (ProgressItem *const t, ProgressItem *const parent=nullptr) |
static ProgressItem * | createProgressItem (const QString &id, const QString &label, const QString &status=QString(), bool canBeCanceled=true, bool hasThumb=false) |
static ProgressItem * | createProgressItem (const QString &label, const QString &status=QString(), bool canBeCanceled=true, bool hasThumb=false) |
static ProgressItem * | createProgressItem (const QString &parent, const QString &id, const QString &label, const QString &status=QString(), bool canBeCanceled=true, bool hasThumb=false) |
static ProgressItem * | createProgressItem (ProgressItem *const parent, const QString &id, const QString &label, const QString &status=QString(), bool canBeCanceled=true, bool hasThumb=false) |
static void | emitShowProgressView () |
static ProgressManager * | instance () |
Friends | |
class | ProgressManagerCreator |
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.
|
static |
Add a created progressItem outside manager with the given parent.
t | The process to add on manager. |
parent | Specify an already existing item as the parent of this one (can be null). |
References findItembyId(), Digikam::ProgressItem::id(), instance(), and Digikam::ProgressItem::setComplete().
Referenced by Digikam::PrivateProgressItemCreator::addProgressItem(), Digikam::AlbumParser::AlbumParser(), Digikam::FacesDetector::FacesDetector(), Digikam::FileActionProgress::FileActionProgress(), Digikam::FingerPrintsGenerator::FingerPrintsGenerator(), Digikam::ImageQualitySorter::ImageQualitySorter(), and Digikam::NewItemsFinder::NewItemsFinder().
|
signal |
|
static |
Version without a parent.
References instance().
|
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.
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. |
References getUniqueID(), and instance().
Referenced by Digikam::DProgressWdg::progressScheduled(), and Digikam::StatusProgressBar::setProgressBarMode().
|
static |
Use this version if you have the id string of the parent and want to add a subjob to it.
References instance().
|
static |
Creates a new progressItem with the given parent, id, label and initial status.
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. |
References instance().
|
static |
Ask all listeners to show the progress dialog, because there is something that wants to be shown.
References instance().
ProgressItem * Digikam::ProgressManager::findItembyId | ( | const QString & | id | ) | const |
References isEmpty().
Referenced by addProgressItem(), and Digikam::DFileOperations::copyFolderRecursively().
QString Digikam::ProgressManager::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. Use that number as the id string for your progressItem to ensure it is unique.
Referenced by createProgressItem().
|
static |
Referenced by addProgressItem(), Digikam::StatusbarProgressWidget::connectSingleItem(), Digikam::DFileOperations::copyFolderRecursively(), Digikam::PrivateProgressItemCreator::createProgressItem(), createProgressItem(), Digikam::DigikamApp::DigikamApp(), emitShowProgressView(), Digikam::MaintenanceMngr::MaintenanceMngr(), Digikam::AlbumManager::mergeTAlbum(), Digikam::AlbumManager::moveTAlbum(), Digikam::ProgressView::ProgressView(), Digikam::StatusbarProgressWidget::slotClean(), Digikam::StatusbarProgressWidget::slotProgressItemCompleted(), Digikam::StatusbarProgressWidget::slotShowItemDelayed(), Digikam::StatusbarProgressWidget::StatusbarProgressWidget(), and Digikam::DigikamApp::~DigikamApp().
bool Digikam::ProgressManager::isEmpty | ( | ) | const |
Referenced by findItembyId(), and Digikam::StatusbarProgressWidget::slotShowItemDelayed().
|
signal |
|
signal |
|
signal |
|
signal |
|
signal |
|
signal |
|
signal |
|
signal |
|
signal |
Emitted when an operation requests the listeners to be shown. Use emitShowProgressView() to trigger it.
ProgressItem * Digikam::ProgressManager::singleItem | ( | ) | const |
Referenced by Digikam::StatusbarProgressWidget::connectSingleItem().
|
slot |
Aborts all running jobs. Bound to "Esc"
Referenced by Digikam::DigikamApp::~DigikamApp().
|
slot |
Calls setCompleted() on the item, to make sure it goes away. Provided for convenience.
item | the canceled item. |
References Digikam::ProgressItem::setComplete().
|
friend |