void TvShowWidgetSeason::setSeason(TvShow *show, int season) { onClear(); m_show = show; m_season = season; emit sigSetActionSearchEnabled(false, WidgetTvShows); ui->title->setText(QString(show->name()) + " - " + tr("Season %1").arg(season)); updateImages(QList<ImageType>() << TypeSeasonPoster << TypeSeasonBackdrop << TypeSeasonBanner); onSetEnabled(!show->downloadsInProgress()); emit sigSetActionSaveEnabled(!show->downloadsInProgress(), WidgetTvShows); }
void TvShowWidgetSeason::setSeason(TvShow *show, int season) { onClear(); m_show = show; m_season = season; emit sigSetActionSearchEnabled(false, WidgetTvShows); ui->title->setText(QString(show->name()) + " - " + tr("Season %1").arg(season)); if (!m_show->seasonPosterImage(season).isNull()) { QImage img = QImage::fromData(m_show->seasonPosterImage(season)); ui->poster->setPixmap(QPixmap::fromImage(img).scaledToWidth(200, Qt::SmoothTransformation)); ui->posterResolution->setText(QString("%1x%2").arg(img.width()).arg(img.height())); ui->buttonPreviewPoster->setEnabled(true); m_currentPoster = img; } else if (!Manager::instance()->mediaCenterInterfaceTvShow()->seasonPosterImageName(m_show, season).isEmpty()) { QPixmap p(Manager::instance()->mediaCenterInterfaceTvShow()->seasonPosterImageName(m_show, season)); ui->poster->setPixmap(p.scaledToWidth(200, Qt::SmoothTransformation)); ui->posterResolution->setText(QString("%1x%2").arg(p.width()).arg(p.height())); ui->buttonPreviewPoster->setEnabled(true); m_currentPoster = p.toImage(); } else { ui->poster->setPixmap(QPixmap(":/img/poster.png")); ui->posterResolution->clear(); ui->buttonPreviewPoster->setEnabled(false); } if (!m_show->seasonBackdropImage(season).isNull()) { QImage img = QImage::fromData(m_show->seasonBackdropImage(season)); ui->backdrop->setPixmap(QPixmap::fromImage(img).scaledToWidth(200, Qt::SmoothTransformation)); ui->backdropResolution->setText(QString("%1x%2").arg(img.width()).arg(img.height())); ui->buttonPreviewBackdrop->setEnabled(true); m_currentBackdrop = img; } else if (!Manager::instance()->mediaCenterInterfaceTvShow()->seasonBackdropImageName(m_show, season).isEmpty()) { QPixmap p(Manager::instance()->mediaCenterInterfaceTvShow()->seasonBackdropImageName(m_show, season)); ui->backdrop->setPixmap(p.scaledToWidth(200, Qt::SmoothTransformation)); ui->backdropResolution->setText(QString("%1x%2").arg(p.width()).arg(p.height())); ui->buttonPreviewBackdrop->setEnabled(true); m_currentBackdrop = p.toImage(); } else { ui->backdrop->setPixmap(QPixmap(":/img/missing_art.png").scaled(64, 64, Qt::KeepAspectRatio, Qt::SmoothTransformation)); ui->backdropResolution->clear(); ui->buttonPreviewBackdrop->setEnabled(false); } if (!m_show->seasonBannerImage(season).isNull()) { QImage img = QImage::fromData(m_show->seasonBannerImage(season)); ui->banner->setPixmap(QPixmap::fromImage(img).scaledToWidth(200, Qt::SmoothTransformation)); ui->bannerResolution->setText(QString("%1x%2").arg(img.width()).arg(img.height())); ui->buttonPreviewBanner->setEnabled(true); m_currentBanner = img; } else if (!Manager::instance()->mediaCenterInterfaceTvShow()->seasonBannerImageName(m_show, season).isEmpty()) { QPixmap p(Manager::instance()->mediaCenterInterfaceTvShow()->seasonBannerImageName(m_show, season)); ui->banner->setPixmap(p.scaledToWidth(200, Qt::SmoothTransformation)); ui->bannerResolution->setText(QString("%1x%2").arg(p.width()).arg(p.height())); ui->buttonPreviewBanner->setEnabled(true); m_currentBanner = p.toImage(); } else { ui->banner->setPixmap(QPixmap(":/img/missing_art_small.png")); ui->bannerResolution->clear(); ui->buttonPreviewBanner->setEnabled(false); } onSetEnabled(!show->downloadsInProgress()); emit sigSetActionSaveEnabled(!show->downloadsInProgress(), WidgetTvShows); }