void PicasawebWindow::slotAddPhotoSucceeded() { m_uploadCount++; m_progressDlg->setMaximum(m_uploadTotal); m_progressDlg->setValue(m_uploadCount); slotAddPhotoNext(); }
void GalleryWindow::slotAddPhoto() { QTreeWidgetItem* item = d->albumView->currentItem(); int column = d->albumView->currentColumn(); if (!item) return; // NO album selected: FIXME: do something // albumName QString albumTitle = item->text(column); if(!d->albumDict.contains(albumTitle)) return; // NO album name found: FIXME: do something // photoPath KUrl::List urls = KPImageDialog::getImageUrls(this, m_interface); if (urls.isEmpty()) return; // NO photo selected: FIXME: do something for (KUrl::List::ConstIterator it = urls.constBegin(); it != urls.constEnd(); ++it) { mpUploadList->append( (*it).path() ); } m_uploadTotal = mpUploadList->count(); m_progressDlg->reset(); m_progressDlg->setMaximum(m_uploadTotal); m_uploadCount = 0; slotAddPhotoNext(); }
void FlickrWindow::slotAddPhotoSucceeded() { // Remove photo uploaded from the list m_imglst->removeItemByUrl(m_uploadQueue.first().first); m_uploadQueue.pop_front(); m_uploadCount++; m_progressDlg->setMaximum(m_uploadTotal); m_progressDlg->setValue(m_uploadCount); slotAddPhotoNext(); }
void PiwigoWindow::slotAddPhotoFailed(const QString& msg) { d->progressDlg->reset(); d->progressDlg->hide(); if (QMessageBox::question(this, i18n("Uploading Failed"), i18n("Failed to upload media into remote Piwigo. ") + msg + i18n("\nDo you want to continue?")) != QMessageBox::Yes) { return; } else { slotAddPhotoNext(); } }
void GalleryWindow::slotAddPhotoFailed(const QString& msg) { m_progressDlg->reset(); m_progressDlg->hide(); if (KMessageBox::warningContinueCancel(this, i18n("Failed to upload photo into " "remote gallery. ") + msg + i18n("\nDo you want to continue?")) != KMessageBox::Continue) { } else { slotAddPhotoNext(); } }
void PicasawebWindow::slotAddPhotoFailed(const QString& msg) { if ( KMessageBox::warningContinueCancel(this, i18n("Failed to upload photo into Picasaweb. %1\nDo you want to continue?", msg )) != KMessageBox::Continue) { m_uploadQueue.clear(); m_progressDlg->reset(); m_progressDlg->hide(); // refresh the thumbnails //slotTagSelected(); } else { m_uploadTotal--; m_progressDlg->setMaximum( m_uploadTotal); m_progressDlg->setValue(m_uploadCount); slotAddPhotoNext(); } }
void PiwigoWindow::slotAddPhoto() { const QList<QUrl> urls(d->iface->currentSelectedItems()); if (urls.isEmpty()) { QMessageBox::critical(this, QString(), i18n("Nothing to upload - please select photos to upload.")); return; } for (QList<QUrl>::const_iterator it = urls.constBegin(); it != urls.constEnd(); ++it) { d->pUploadList->append( (*it).toLocalFile() ); } d->uploadTotal = d->pUploadList->count(); d->progressDlg->reset(); d->progressDlg->setMaximum(d->uploadTotal); d->uploadCount = 0; slotAddPhotoNext(); }
/** This slot is call when 'Start Uploading' button is pressed. */ void FlickrWindow::slotUser1() { kDebug() << "SlotUploadImages invoked"; m_widget->m_tab->setCurrentIndex(FlickrWidget::FILELIST); if (m_imglst->imageUrls().isEmpty()) { return; } typedef QPair<KUrl, FPhotoInfo> Pair; m_uploadQueue.clear(); for (int i = 0; i < m_imglst->listView()->topLevelItemCount(); ++i) { FlickrListViewItem* lvItem = dynamic_cast<FlickrListViewItem*> (m_imglst->listView()->topLevelItem(i)); KIPIPlugins::KPImageInfo info(m_interface, lvItem->url()); kDebug() << "Adding images to the list"; FPhotoInfo temp; temp.title = info.title(); temp.description = info.description(); temp.is_public = lvItem->isPublic() ? 1 : 0; temp.is_family = lvItem->isFamily() ? 1 : 0; temp.is_friend = lvItem->isFriends() ? 1 : 0; temp.safety_level = lvItem->safetyLevel(); temp.content_type = lvItem->contentType(); QStringList tagsFromDialog = m_tagsLineEdit->text().split(',', QString::SkipEmptyParts); QStringList tagsFromList = lvItem->extraTags(); QStringList allTags; QStringList::Iterator itTags; // Tags from the dialog itTags = tagsFromDialog.begin(); while (itTags != tagsFromDialog.end()) { allTags.append(*itTags); ++itTags; } // Tags from the database if (m_exportHostTagsCheckBox->isChecked()) { QStringList tagsFromDatabase; tagsFromDatabase = info.keywords(); itTags = tagsFromDatabase.begin(); while (itTags != tagsFromDatabase.end()) { allTags.append(*itTags); ++itTags; } } // Tags from the list view. itTags = tagsFromList.begin(); while (itTags != tagsFromList.end()) { allTags.append(*itTags); ++itTags; } // Remove spaces if the user doesn't like them. if (m_stripSpaceTagsCheckBox->isChecked()) { for (QStringList::iterator it = allTags.begin(); it != allTags.end(); ++it) { *it = (*it).trimmed().remove(' '); } } // Debug the tag list. itTags = allTags.begin(); while (itTags != allTags.end()) { kDebug() << "Tags list: " << (*itTags); ++itTags; } temp.tags = allTags; m_uploadQueue.append(Pair(lvItem->url(), temp)); } m_uploadTotal = m_uploadQueue.count(); m_uploadCount = 0; m_progressDlg->reset(); slotAddPhotoNext(); kDebug() << "SlotUploadImages done"; }
void PiwigoWindow::slotAddPhotoSucceeded() { d->uploadCount++; d->progressDlg->setValue(d->uploadCount); slotAddPhotoNext(); }
void PicasawebWindow::slotUploadImages() { if(m_widget->m_currentSelectionButton->isChecked()) { delete m_urls; m_urls=new KUrl::List(m_interface->currentSelection().images()); } if (m_urls == NULL || m_urls->isEmpty()) return; typedef QPair<QString,FPhotoInfo> Pair; m_uploadQueue.clear(); for (KUrl::List::ConstIterator it = m_urls->constBegin(); it != m_urls->constEnd(); ++it) { KIPI::ImageInfo info = m_interface->info( *it ); FPhotoInfo temp; temp.title=info.title(); temp.description=info.description(); QStringList allTags; QStringList tagsFromDialog = m_tagsLineEdit->text().split(" ", QString::SkipEmptyParts); QStringList::Iterator itTags; // Tags from the interface itTags = tagsFromDialog.begin(); while( itTags != tagsFromDialog.end() ) { allTags.append( *itTags ); ++itTags; } //Tags from the database QMap <QString, QVariant> attribs = info.attributes(); QStringList tagsFromDatabase; if(m_exportApplicationTags->isChecked()) { // tagsFromDatabase=attribs["tags"].asStringList(); } itTags = tagsFromDatabase.begin(); while( itTags != tagsFromDatabase.end() ) { allTags.append( *itTags ); ++itTags; } itTags = allTags.begin(); while( itTags != allTags.end() ) { ++itTags; } temp.tags=allTags; m_uploadQueue.append( Pair( (*it).path(), temp) ); } m_uploadTotal = m_uploadQueue.count(); m_uploadCount = 0; m_progressDlg->reset(); slotAddPhotoNext(); }
void GalleryWindow::slotAddPhotoSucceeded() { m_uploadCount++; m_progressDlg->setValue(m_uploadCount); slotAddPhotoNext(); }