void VimeoPlaylistDialog::createNewPlaylist() { if (isBusy()) { return; } QVariantMap playlist; playlist["name"] = m_titleEdit->text(); QString description = m_descriptionEdit->toPlainText(); if (!description.isEmpty()) { playlist["description"] = description; } if (!m_passwordEdit->text().isEmpty()) { playlist["privacy"] = "password"; playlist["password"] = m_passwordEdit->text(); } m_playlist = new VimeoPlaylist(playlist, this); connect(m_playlist, SIGNAL(statusChanged(QVimeo::ResourcesRequest::Status)), this, SLOT(onPlaylistStatusChanged(QVimeo::ResourcesRequest::Status))); m_playlist->addVideo(m_video); }
SoundCloudPlaylistWindow::SoundCloudPlaylistWindow(const QString &id, StackedWindow *parent) : StackedWindow(parent), m_playlist(new SoundCloudPlaylist(this)), m_artist(new SoundCloudArtist(this)), m_model(new SoundCloudTrackModel(this)), m_cache(new ImageCache), m_thumbnail(new Image(this)), m_avatar(new Image(this)), m_nowPlayingAction(new NowPlayingAction(this)), m_view(new ListView(this)), m_delegate(new TrackDelegate(m_cache, SoundCloudTrackModel::ArtistRole, SoundCloudTrackModel::DateRole, SoundCloudTrackModel::DurationStringRole, SoundCloudTrackModel::ThumbnailUrlRole, SoundCloudTrackModel::TitleRole, this)), m_scrollArea(new QScrollArea(this)), m_titleLabel(new QLabel(this)), m_descriptionLabel(new TextBrowser(this)), m_dateLabel(new QLabel(this)), m_artistLabel(new QLabel(this)), m_noTracksLabel(new QLabel(QString("<p align='center'; style='font-size: 40px; color: %1'>%2</p>") .arg(palette().color(QPalette::Mid).name()).arg(tr("No tracks found")), this)), m_reloadAction(new QAction(tr("Reload"), this)), m_queuePlaylistAction(new QAction(tr("Queue"), this)), m_contextMenu(new QMenu(this)), m_queueAction(new QAction(tr("Queue"), this)), m_downloadAction(new QAction(tr("Download"), this)), m_shareAction(new QAction(tr("Copy URL"), this)), m_favouriteAction(0) { loadBaseUi(); connect(m_playlist, SIGNAL(statusChanged(QSoundCloud::ResourcesRequest::Status)), this, SLOT(onPlaylistStatusChanged(QSoundCloud::ResourcesRequest::Status))); m_playlist->loadPlaylist(id); }
void VimeoPlaylistDialog::addToPlaylist(const QModelIndex &index) { if (isBusy()) { return; } m_playlist = m_model->get(index.row()); if (m_playlist) { connect(m_playlist, SIGNAL(statusChanged(QVimeo::ResourcesRequest::Status)), this, SLOT(onPlaylistStatusChanged(QVimeo::ResourcesRequest::Status))); m_playlist->addVideo(m_video); } }
void VimeoPlaylistDialog::onPlaylistStatusChanged(QVimeo::ResourcesRequest::Status status) { switch (status) { case QVimeo::ResourcesRequest::Loading: showProgressIndicator(); return; case QVimeo::ResourcesRequest::Ready: accept(); return; case QVimeo::ResourcesRequest::Failed: QMessageBox::critical(this, tr("Error"), m_playlist->errorString()); break; default: break; } hideProgressIndicator(); disconnect(m_playlist, SIGNAL(statusChanged(QVimeo::ResourcesRequest::Status)), this, SLOT(onPlaylistStatusChanged(QVimeo::ResourcesRequest::Status))); }
void SoundCloudPlaylistWindow::onPlaylistStatusChanged(QSoundCloud::ResourcesRequest::Status status) { switch (status) { case QSoundCloud::ResourcesRequest::Loading: showProgressIndicator(); return; case QSoundCloud::ResourcesRequest::Ready: loadPlaylistUi(); getTracks(); connect(m_artist, SIGNAL(statusChanged(QSoundCloud::ResourcesRequest::Status)), this, SLOT(onArtistStatusChanged(QSoundCloud::ResourcesRequest::Status))); m_artist->loadArtist(m_playlist->artistId()); break; case QSoundCloud::ResourcesRequest::Failed: QMessageBox::critical(this, tr("Error"), m_playlist->errorString()); break; default: break; } hideProgressIndicator(); disconnect(m_playlist, SIGNAL(statusChanged(QSoundCloud::ResourcesRequest::Status)), this, SLOT(onPlaylistStatusChanged(QSoundCloud::ResourcesRequest::Status))); }