Beispiel #1
0
void ImageWindow::slotLoadImageInfosStage2()
{
    // if window is minimized, show it
    if (isMinimized())
    {
        KWindowSystem::unminimizeWindow(winId());
    }

    slotLoadCurrent();
}
Beispiel #2
0
void ImageWindow::openImage(const ItemInfo& info)
{
    if (d->currentItemInfo == info)
    {
        return;
    }

    d->currentItemInfo = info;
    d->ensureModelContains(d->currentItemInfo);

    slotLoadCurrent();
}
Beispiel #3
0
void ImageWindow::loadIndex(const QModelIndex& index)
{
    if (!promptUserSave(d->currentUrl(), AskIfNeeded))
    {
        return;
    }

    if (!index.isValid())
        return;
    d->currentImageInfo = d->imageFilterModel->imageInfo(index);
    slotLoadCurrent();
}
Beispiel #4
0
void ImageWindow::setupConnections()
{
    setupStandardConnections();

    connect(this, SIGNAL(loadCurrentLater()),
            this, SLOT(slotLoadCurrent()), Qt::QueuedConnection);

    // To toggle properly keyboards shortcuts from comments & tags side bar tab.

    connect(d->rightSideBar, SIGNAL(signalNextItem()),
            this, SLOT(slotForward()));

    connect(d->rightSideBar, SIGNAL(signalPrevItem()),
            this, SLOT(slotBackward()));

    connect(d->rightSideBar->getFiltersHistoryTab(), SIGNAL(actionTriggered(const ImageInfo&)),
            this, SLOT(openImage(const ImageInfo&)));

    connect(this, SIGNAL(signalSelectionChanged( const QRect&)),
            d->rightSideBar, SLOT(slotImageSelectionChanged( const QRect&)));

    connect(this, SIGNAL(signalNoCurrentItem()),
            d->rightSideBar, SLOT(slotNoCurrentItem()));

    ImageAttributesWatch* watch = ImageAttributesWatch::instance();

    connect(watch, SIGNAL(signalFileMetadataChanged(const KUrl&)),
            this, SLOT(slotFileMetadataChanged(const KUrl&)));

    /*connect(DatabaseAccess::databaseWatch(), SIGNAL(collectionImageChange(const CollectionImageChangeset&)),
            this, SLOT(slotCollectionImageChange(const CollectionImageChangeset&)),
            Qt::QueuedConnection);*/

    connect(ThemeEngine::instance(), SIGNAL(signalThemeChanged()),
            this, SLOT(slotThemeChanged()));

    /*connect(d->imageFilterModel, SIGNAL(rowsAboutToBeRemoved(const QModelIndex&, int, int)),
            this, SLOT(slotRowsAboutToBeRemoved(const QModelIndex&, int, int)));*/

    connect(d->thumbBar, SIGNAL(currentChanged(const ImageInfo&)),
            this, SLOT(slotThumbBarImageSelected(const ImageInfo&)));

    connect(d->dragDropHandler, SIGNAL(imageInfosDropped(const QList<ImageInfo>&)),
            this, SLOT(slotDroppedOnThumbbar(const QList<ImageInfo>&)));

    connect(d->thumbBarDock, SIGNAL(dockLocationChanged(Qt::DockWidgetArea)),
            d->thumbBar, SLOT(slotDockLocationChanged(Qt::DockWidgetArea)));

    connect(AlbumSettings::instance(), SIGNAL(setupChanged()),
            this, SLOT(slotSetupChanged()));
}
Beispiel #5
0
void ImageWindow::slotThumbBarImageSelected(const ItemInfo& info)
{
    if (d->currentItemInfo == info || !d->thumbBar->isEnabled())
    {
        return;
    }

    if (!promptUserSave(d->currentUrl(), AskIfNeeded, false))
    {
        return;
    }

    d->currentItemInfo = info;
    slotLoadCurrent();
}
Beispiel #6
0
void ImageWindow::openImage(const ImageInfo& info)
{
    if (d->currentImageInfo == info)
    {
        return;
    }

    d->currentImageInfo = info;
    if (!d->imageInfoModel->hasImage(d->currentImageInfo))
    {
        d->imageInfoModel->addImageInfoSynchronously(d->currentImageInfo);
    }

    slotLoadCurrent();
}