void ImageWindow::loadImageInfos(const ImageInfoList& imageInfoList, const ImageInfo& imageInfoCurrent, const QString& caption) { // Very first thing is to check for changes, user may choose to cancel operation if (!promptUserSave(d->currentUrl(), AskIfNeeded)) { return; } d->currentImageInfo = ImageInfo(); d->currentImageInfo = imageInfoCurrent; // Note: Addition is asynchronous, index not yet available d->imageInfoModel->setImageInfos(imageInfoList); d->setThumbBarToCurrent(); if (!caption.isEmpty()) { setCaption(i18n("Image Editor - %1",caption)); } else { setCaption(i18n("Image Editor")); } // it can slightly improve the responsiveness when inserting an event loop run here QTimer::singleShot(0, this, SLOT(slotLoadImageInfosStage2())); }
void ShowFoto::slotRevert() { if (!promptUserSave(d->thumbBar->currentUrl())) { return; } m_canvas->slotRestore(); }
void ShowFoto::slotOpenFile() { if (!d->thumbBar->currentInfo().isNull() && !promptUserSave(d->thumbBar->currentUrl())) { return; } QList<QUrl> urls = Digikam::ImageDialog::getImageURLs(this, d->lastOpenedDirectory); openUrls(urls); }
void ShowFoto::slotLast() { if (!d->thumbBar->currentInfo().isNull() && !promptUserSave(d->thumbBar->currentUrl())) { return; } d->thumbBar->toLastIndex(); d->thumbBar->setCurrentInfo(d->thumbBar->showfotoItemInfos().last()); slotOpenUrl(d->thumbBar->showfotoItemInfos().last()); }
void ImageWindow::loadIndex(const QModelIndex& index) { if (!promptUserSave(d->currentUrl(), AskIfNeeded)) { return; } if (!index.isValid()) return; d->currentImageInfo = d->imageFilterModel->imageInfo(index); slotLoadCurrent(); }
void ShowFoto::slotShowfotoItemInfoActivated(const ShowfotoItemInfo& info) { d->thumbBar->setCurrentUrl(d->currentLoadedUrl); if (!d->thumbBar->currentInfo().isNull() && !promptUserSave(d->thumbBar->currentUrl())) { return; } slotOpenUrl(info); d->thumbBar->setCurrentUrl(d->currentLoadedUrl); }
void ShowFoto::slotOpenFolder(const QUrl& url) { if (!d->thumbBar->currentInfo().isNull() && !promptUserSave(d->thumbBar->currentUrl())) { return; } m_canvas->load(QString(), m_IOFileSettings); d->thumbBar->showfotoItemInfos().clear(); emit signalNoCurrentItem(); openFolder(url); toggleNavigation(1); }
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(); }
void ShowFoto::slotBackward() { if (!d->thumbBar->currentInfo().isNull() && !promptUserSave(d->thumbBar->currentUrl())) { return; } bool currentIsNull = d->thumbBar->currentInfo().isNull(); if (!currentIsNull) { d->thumbBar->toPreviousIndex(); slotOpenUrl(d->thumbBar->currentInfo()); } }
void ShowFoto::slotOpenFilesInFolder() { if (!d->thumbBar->currentInfo().isNull() && !promptUserSave(d->thumbBar->currentUrl())) { return; } QUrl url = QUrl::fromLocalFile(QFileDialog::getExistingDirectory(this, i18n("Open Images From Folder"), d->lastOpenedDirectory.toLocalFile())); if (!url.isEmpty()) { m_canvas->load(QString(), m_IOFileSettings); d->thumbBar->showfotoItemInfos().clear(); d->lastOpenedDirectory = url; emit signalNoCurrentItem(); openFolder(url); toggleNavigation(1); } }