void EnfuseStackList::processedItem(const QUrl& url, bool success) { EnfuseStackItem* const item = findItemByUrl(url); if (item) item->setProcessedIcon(QIcon::fromTheme(success ? QStringLiteral("dialog-ok") : QStringLiteral("dialog-cancel"))); }
void EnfuseStackList::setOnItem(const QUrl& url, bool on) { EnfuseStackItem* const item = findItemByUrl(url); if (item) item->setOn(on); }
void EnfuseStackList::setThumbnail(const KUrl& url, const QImage& img) { if (img.isNull()) return; EnfuseStackItem* item = findItemByUrl(url); if (item && (!item->asValidThumb())) item->setThumbnail(QPixmap::fromImage(img.scaled(iconSize().width(), iconSize().height(), Qt::KeepAspectRatio))); }
void ScanGallery::slotSelectImage(const KUrl &url) { FileTreeViewItem *found = findItemByUrl(url); if (found==NULL) found = m_defaultBranch->root(); scrollToItem(found); setCurrentItem(found); slotItemActivated(found); }
void ScanGallery::slotActivateItem(const KUrl &url) { kDebug() << url; FileTreeViewItem *found = findItemByUrl(url); if (found==NULL) return; slotItemActivated(found); }
void ScanGallery::slotUpdatedItem(const KUrl &url) { FileTreeViewItem *found = findItemByUrl(url); if (found==NULL) return; if (found->isSelected()) // only if still selected { slotUnloadItem(found); // ensure unloaded for updating slotItemActivated(found); // load the new image } }
void ScanGallery::slotHighlightItem(const KUrl &url) { kDebug() << url; FileTreeViewItem *found = findItemByUrl(url); if (found==NULL) return; bool b = blockSignals(true); scrollToItem(found); setCurrentItem(found); blockSignals(b); // Need to do this to update/clear the displayed image. Causes a signal // to be sent back to the thumbnail view, but this is benign and fortunately // does not cause not a loop. slotItemHighlighted(found); }
void EnfuseStackList::processingItem(const KUrl& url, bool run) { d->processItem = findItemByUrl(url); if (d->processItem) { if (run) { setCurrentItem(d->processItem, true); scrollToItem(d->processItem); d->progressTimer->start(300); } else { d->progressTimer->stop(); d->processItem = 0; } } }
void EnfuseStackList::addItem(const KUrl& url, const EnfuseSettings& settings) { if (!url.isValid()) return; // Check if the new item already exist in the list. if (!findItemByUrl(url)) { EnfuseSettings enfusePrms = settings; QString ext = SaveSettingsWidget::extensionForFormat(enfusePrms.outputFormat); enfusePrms.previewUrl = url; EnfuseStackItem* item = new EnfuseStackItem(this); item->setEnfuseSettings(enfusePrms); item->setOn(true); setCurrentItem(item); setTemplateFileName(d->outputFormat, d->templateFileName); emit signalItemClicked(url); } }
void EnfuseStackList::processedItem(const KUrl& url, bool success) { EnfuseStackItem* item = findItemByUrl(url); if (item) item->setProcessedIcon(SmallIcon(success ? "dialog-ok" : "dialog-cancel")); }
void EnfuseStackList::removeItem(const KUrl& url) { EnfuseStackItem* item = findItemByUrl(url); delete item; }