void GalleryWindow::slotAddPhotoNext() { if ( mpUploadList->isEmpty() ) { m_progressDlg->reset(); m_progressDlg->hide(); slotAlbumSelected(); // ? return; } QTreeWidgetItem* item = d->albumView->currentItem(); int column = d->albumView->currentColumn(); QString albumTitle = item->text(column); const GAlbum& album = d->albumDict.value(albumTitle); QString photoPath = mpUploadList->takeFirst(); KPImageInfo info(m_interface, photoPath); QString title = info.title(); QString description = info.description(); bool res = m_talker->addPhoto(album.name, photoPath, title, description, d->resizeCheckBox->isChecked(), d->dimensionSpinBox->value() ); if (!res) { slotAddPhotoFailed( "" ); return; } m_progressDlg->setLabelText( i18n("Uploading file %1", KUrl(photoPath).fileName()) ); if (m_progressDlg->isHidden()) m_progressDlg->show(); }
void PiwigoWindow::connectSignals() { connect(d->albumView, SIGNAL(itemSelectionChanged()), this, SLOT(slotAlbumSelected())); connect(d->confButton, SIGNAL(clicked()), this, SLOT(slotSettings())); connect(d->resizeCheckBox, SIGNAL(stateChanged(int)), this, SLOT(slotEnableSpinBox(int))); connect(d->progressDlg, SIGNAL(canceled()), this, SLOT(slotAddPhotoCancel())); connect(d->talker, SIGNAL(signalProgressInfo(QString)), this, SLOT(slotProgressInfo(QString))); connect(d->talker, SIGNAL(signalError(QString)), this, SLOT(slotError(QString))); connect(d->talker, SIGNAL(signalBusy(bool)), this, SLOT(slotBusy(bool))); connect(d->talker, SIGNAL(signalLoginFailed(QString)), this, SLOT(slotLoginFailed(QString))); connect(d->talker, SIGNAL(signalAlbums(QList<PiwigoAlbum>)), this, SLOT(slotAlbums(QList<PiwigoAlbum>))); connect(d->talker, SIGNAL(signalAddPhotoSucceeded()), this, SLOT(slotAddPhotoSucceeded())); connect(d->talker, SIGNAL(signalAddPhotoFailed(QString)), this, SLOT(slotAddPhotoFailed(QString))); }
void GalleryWindow::connectSignals() { connect(d->albumView, SIGNAL(itemSelectionChanged()), this , SLOT(slotAlbumSelected()) ); connect(d->newAlbumBtn, SIGNAL(clicked()), this, SLOT(slotNewAlbum())); connect(d->addPhotoBtn, SIGNAL(clicked()), this, SLOT(slotAddPhoto())); connect(d->resizeCheckBox, SIGNAL(stateChanged(int)), this, SLOT(slotEnableSpinBox(int))); connect(d->logo, SIGNAL(leftClickedUrl(QString)), this, SLOT(slotProcessUrl(QString))); connect(m_progressDlg, SIGNAL(canceled()), this, SLOT(slotAddPhotoCancel())); connect(m_talker, SIGNAL(signalError(QString)), this, SLOT(slotError(QString))); connect(m_talker, SIGNAL(signalBusy(bool)), this, SLOT(slotBusy(bool))); connect(m_talker, SIGNAL(signalLoginFailed(QString)), this, SLOT(slotLoginFailed(QString))); connect(m_talker, SIGNAL(signalAlbums(QList<GAlbum>)), this, SLOT(slotAlbums(QList<GAlbum>))); connect(m_talker, SIGNAL(signalPhotos(QList<GPhoto>)), this, SLOT(slotPhotos(QList<GPhoto>))); connect(m_talker, SIGNAL(signalAddPhotoSucceeded()), this, SLOT(slotAddPhotoSucceeded())); connect(m_talker, SIGNAL(signalAddPhotoFailed(QString)), this, SLOT(slotAddPhotoFailed(QString))); }