Ejemplo n.º 1
0
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")));
}
Ejemplo n.º 2
0
void EnfuseStackList::setOnItem(const QUrl& url, bool on)
{
    EnfuseStackItem* const item = findItemByUrl(url);

    if (item)
        item->setOn(on);
}
Ejemplo n.º 3
0
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)));
}
Ejemplo n.º 4
0
void ScanGallery::slotSelectImage(const KUrl &url)
{
    FileTreeViewItem *found = findItemByUrl(url);
    if (found==NULL) found = m_defaultBranch->root();

    scrollToItem(found);
    setCurrentItem(found);
    slotItemActivated(found);
}
Ejemplo n.º 5
0
void ScanGallery::slotActivateItem(const KUrl &url)
{
    kDebug() << url;

    FileTreeViewItem *found = findItemByUrl(url);
    if (found==NULL) return;

    slotItemActivated(found);
}
Ejemplo n.º 6
0
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
    }
}
Ejemplo n.º 7
0
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);
}
Ejemplo n.º 8
0
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;
        }
    }
}
Ejemplo n.º 9
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);
    }
}
Ejemplo n.º 10
0
void EnfuseStackList::processedItem(const KUrl& url, bool success)
{
    EnfuseStackItem* item = findItemByUrl(url);
    if (item)
        item->setProcessedIcon(SmallIcon(success ? "dialog-ok" : "dialog-cancel"));
}
Ejemplo n.º 11
0
void EnfuseStackList::removeItem(const KUrl& url)
{
    EnfuseStackItem* item = findItemByUrl(url);
    delete item;
}