digiKam
Digikam::ProgressItem Class Reference
+ Inheritance diagram for Digikam::ProgressItem:

Signals

void progressItemAdded (ProgressItem *)
 
void progressItemCanceled (ProgressItem *)
 
void progressItemCanceledById (const QString &id)
 
void progressItemCompleted (ProgressItem *)
 
void progressItemLabel (ProgressItem *, const QString &)
 
void progressItemProgress (ProgressItem *, unsigned int)
 
void progressItemStatus (ProgressItem *, const QString &)
 
void progressItemThumbnail (ProgressItem *item, const QPixmap &thumb)
 
void progressItemUsesBusyIndicator (ProgressItem *item, bool value)
 

Public Member Functions

void addChild (ProgressItem *const kiddo)
 
bool advance (unsigned int v)
 
bool canBeCanceled () const
 
void cancel ()
 
bool canceled () const
 
unsigned int completedItems () const
 
bool hasThumbnail () const
 
const QString & id () const
 
bool incCompletedItems (unsigned int v=1)
 
void incTotalItems (unsigned int v=1)
 
const QString & label () const
 
ProgressItemparent () const
 
unsigned int progress () const
 
 ProgressItem (ProgressItem *const parent, const QString &id, const QString &label, const QString &status, bool canBeCanceled, bool hasThumb)
 
void removeChild (ProgressItem *const kiddo)
 
void reset ()
 
void setComplete ()
 
bool setCompletedItems (unsigned int v)
 
void setLabel (const QString &v)
 
void setProgress (unsigned int v)
 
void setShowAtStart (bool showAtStart)
 
void setStatus (const QString &v)
 
void setThumbnail (const QIcon &icon)
 
void setTotalItems (unsigned int v)
 
void setUsesBusyIndicator (bool useBusyIndicator)
 
bool showAtStart () const
 
const QString & status () const
 
bool totalCompleted () const
 
unsigned int totalItems () const
 
void updateProgress ()
 
bool usesBusyIndicator () const
 
 ~ProgressItem () override
 

Constructor & Destructor Documentation

◆ ProgressItem()

Digikam::ProgressItem::ProgressItem ( ProgressItem *const  parent,
const QString &  id,
const QString &  label,
const QString &  status,
bool  canBeCanceled,
bool  hasThumb 
)

◆ ~ProgressItem()

Digikam::ProgressItem::~ProgressItem ( )
override

Member Function Documentation

◆ addChild()

void Digikam::ProgressItem::addChild ( ProgressItem *const  kiddo)

◆ advance()

bool Digikam::ProgressItem::advance ( unsigned int  v)

Advance total items processed by n values and update percentage in progressbar.

Parameters
vThe value to advance.
Returns
true if totalCompleted()

References incCompletedItems(), and updateProgress().

Referenced by Digikam::DFileOperations::copyFolderRecursively().

◆ canBeCanceled()

bool Digikam::ProgressItem::canBeCanceled ( ) const
Returns
Whether this item can be canceled.

Referenced by cancel(), ProgressItem(), and Digikam::TransactionItem::TransactionItem().

◆ cancel()

void Digikam::ProgressItem::cancel ( )

◆ canceled()

bool Digikam::ProgressItem::canceled ( ) const

◆ completedItems()

unsigned int Digikam::ProgressItem::completedItems ( ) const

◆ hasThumbnail()

bool Digikam::ProgressItem::hasThumbnail ( ) const
Returns
whether this item has a thumbnail.

Referenced by setThumbnail(), and Digikam::TransactionItem::TransactionItem().

◆ id()

const QString & Digikam::ProgressItem::id ( ) const
Returns
The id string which uniquely identifies the operation represented by this item.

Referenced by Digikam::ProgressManager::addProgressItem(), ProgressItem(), Digikam::DProgressWdg::progressScheduled(), and Digikam::StatusProgressBar::setProgressBarMode().

◆ incCompletedItems()

bool Digikam::ProgressItem::incCompletedItems ( unsigned int  v = 1)

Referenced by advance().

◆ incTotalItems()

void Digikam::ProgressItem::incTotalItems ( unsigned int  v = 1)

◆ label()

const QString & Digikam::ProgressItem::label ( ) const
Returns
The user visible string to be used to represent this item.

Referenced by ProgressItem(), Digikam::MaintenanceTool::slotDone(), and Digikam::TransactionItem::TransactionItem().

◆ parent()

◆ progress()

unsigned int Digikam::ProgressItem::progress ( ) const
Returns
The current progress value of this item in percent.

Referenced by Digikam::TransactionItem::TransactionItem().

◆ progressItemAdded

void Digikam::ProgressItem::progressItemAdded ( ProgressItem )
signal

Emitted when a new ProgressItem is added.

Parameters
TheProgressItem that was added.

◆ progressItemCanceled

void Digikam::ProgressItem::progressItemCanceled ( ProgressItem )
signal

Emitted when an item was canceled. It will not go away immediately, only when the owner sets it complete, which will usually happen. Can be used to visually indicate the canceled status of an item. Should be used by the owner of the item to make sure it is set completed even if it is canceled. There is a ProgressManager::slotStandardCancelHandler which simply sets the item completed and can be used if no other work needs to be done on cancel.

Parameters
Thecanceled item;

Referenced by cancel(), Digikam::FacesDetector::FacesDetector(), and Digikam::FileActionProgress::FileActionProgress().

◆ progressItemCanceledById

void Digikam::ProgressItem::progressItemCanceledById ( const QString &  id)
signal

◆ progressItemCompleted

void Digikam::ProgressItem::progressItemCompleted ( ProgressItem )
signal

Emitted when a progress item was completed. The item will be deleted afterwards, so slots connected to this are the last chance to work with this item.

Parameters
Thecompleted item.

Referenced by removeChild(), and setComplete().

◆ progressItemLabel

void Digikam::ProgressItem::progressItemLabel ( ProgressItem ,
const QString &   
)
signal

Emitted when the label of an item changed. Should be used by progress dialogs to update the label of an item.

Parameters
Theupdated item.
Thenew label.

Referenced by setLabel().

◆ progressItemProgress

void Digikam::ProgressItem::progressItemProgress ( ProgressItem ,
unsigned int   
)
signal

Emitted when the progress value of an item changes.

Parameters
Theitem which got a new value.
Thevalue, for convenience.

Referenced by setProgress().

◆ progressItemStatus

void Digikam::ProgressItem::progressItemStatus ( ProgressItem ,
const QString &   
)
signal

Emitted when the status message of an item changed. Should be used by progress dialogs to update the status message for an item.

Parameters
Theupdated item.
Thenew message.

Referenced by setStatus().

◆ progressItemThumbnail

void Digikam::ProgressItem::progressItemThumbnail ( ProgressItem item,
const QPixmap &  thumb 
)
signal

Emitted when the thumbnail data must be set in item.

Parameters
itemThe updated item
thumbthumbnail data

Referenced by setThumbnail().

◆ progressItemUsesBusyIndicator

void Digikam::ProgressItem::progressItemUsesBusyIndicator ( ProgressItem item,
bool  value 
)
signal

Emitted when the busy indicator state of an item changes. Should be used by progress dialogs so that they can adjust the display of the progress bar to the new mode.

Parameters
itemThe updated item
valueTrue if the item uses a busy indicator now, false otherwise

Referenced by setUsesBusyIndicator().

◆ removeChild()

void Digikam::ProgressItem::removeChild ( ProgressItem *const  kiddo)

◆ reset()

void Digikam::ProgressItem::reset ( )

Reset the progress value of this item to 0 and the status string to the empty string.

References setProgress(), and setStatus().

◆ setComplete()

void Digikam::ProgressItem::setComplete ( )

Tell the item it has finished. This will emit progressItemCompleted() result in the destruction of the item after all slots connected to this signal have executed. This is the only way to get rid of an item and needs to be called even if the item is canceled. Don't use the item after this has been called on it.

References progressItemCompleted(), and setProgress().

Referenced by Digikam::ProgressManager::addProgressItem(), Digikam::TwoProgressItemsContainer::advance(), Digikam::DProgressWdg::progressCompleted(), Digikam::StatusProgressBar::setProgressBarMode(), Digikam::MaintenanceTool::slotCancel(), Digikam::MaintenanceTool::slotDone(), Digikam::PrivateProgressItemCreator::slotProgressItemCanceled(), and Digikam::ProgressManager::slotStandardCancelHandler().

◆ setCompletedItems()

bool Digikam::ProgressItem::setCompletedItems ( unsigned int  v)

◆ setLabel()

◆ setProgress()

void Digikam::ProgressItem::setProgress ( unsigned int  v)

Set the progress (percentage of completion) value of this item.

Parameters
vThe percentage value.

References progressItemProgress().

Referenced by reset(), setComplete(), and updateProgress().

◆ setShowAtStart()

void Digikam::ProgressItem::setShowAtStart ( bool  showAtStart)

Set the property to pop-up item when it's added in progress manager. Use this method if you consider that item is important to be notified to end-user.

References showAtStart().

Referenced by Digikam::NewItemsFinder::NewItemsFinder().

◆ setStatus()

void Digikam::ProgressItem::setStatus ( const QString &  v)

Set the string to be used for showing this item's current status.

Parameters
vThe status string.

References progressItemStatus().

Referenced by cancel(), Digikam::DProgressWdg::progressStatusChanged(), reset(), and Digikam::StatusProgressBar::setProgressText().

◆ setThumbnail()

void Digikam::ProgressItem::setThumbnail ( const QIcon &  icon)

◆ setTotalItems()

void Digikam::ProgressItem::setTotalItems ( unsigned int  v)

◆ setUsesBusyIndicator()

void Digikam::ProgressItem::setUsesBusyIndicator ( bool  useBusyIndicator)

Sets whether this item uses a busy indicator instead of real progress for its progress bar. If it uses a busy indicator, you are still responsible for calling setProgress() from time to time to update the busy indicator.

References progressItemUsesBusyIndicator().

◆ showAtStart()

bool Digikam::ProgressItem::showAtStart ( ) const
Returns
true if item must be pop-up when it's added in progress manager.

Referenced by setShowAtStart(), and Digikam::ProgressView::slotTransactionAdded().

◆ status()

const QString & Digikam::ProgressItem::status ( ) const
Returns
The string to be used for showing this item's current status.

Referenced by ProgressItem(), and Digikam::TransactionItem::TransactionItem().

◆ totalCompleted()

bool Digikam::ProgressItem::totalCompleted ( ) const

◆ totalItems()

unsigned int Digikam::ProgressItem::totalItems ( ) const

◆ updateProgress()

void Digikam::ProgressItem::updateProgress ( )

Recalculate progress according to total/completed items and update.

References setProgress().

Referenced by advance(), and Digikam::StatusProgressBar::setProgressValue().

◆ usesBusyIndicator()

bool Digikam::ProgressItem::usesBusyIndicator ( ) const
Returns
whether this item uses a busy indicator instead of real progress display

The documentation for this class was generated from the following files: