/** * @brief SetsWidget::SetsWidget * @param parent */ SetsWidget::SetsWidget(QWidget *parent) : QWidget(parent), ui(new Ui::SetsWidget) { ui->setupUi(this); ui->sets->verticalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents); ui->movies->verticalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents); ui->movies->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch); ui->buttonPreviewBackdrop->setEnabled(false); ui->buttonPreviewPoster->setEnabled(false); #ifdef Q_OS_MAC QFont setsFont = ui->sets->font(); setsFont.setPointSize(setsFont.pointSize()-2); ui->sets->setFont(setsFont); #endif #ifndef Q_OS_MAC QFont nameFont = ui->setName->font(); nameFont.setPointSize(nameFont.pointSize()-4); ui->setName->setFont(nameFont); #endif Helper::instance()->applyStyle(ui->movies); Helper::instance()->applyStyle(ui->label_13); Helper::instance()->applyStyle(ui->label_14); Helper::instance()->applyStyle(ui->posterResolution); Helper::instance()->applyStyle(ui->backdropResolution); Helper::instance()->applyStyle(ui->groupBox_3); Helper::instance()->applyEffect(ui->groupBox_3); m_loadingMovie = new QMovie(":/img/spinner.gif"); m_loadingMovie->start(); m_downloadManager = new DownloadManager(this); connect(ui->sets, SIGNAL(itemSelectionChanged()), this, SLOT(onSetSelected())); connect(ui->sets, SIGNAL(itemChanged(QTableWidgetItem*)), this, SLOT(onSetNameChanged(QTableWidgetItem*))); connect(ui->movies, SIGNAL(itemChanged(QTableWidgetItem*)), this, SLOT(onSortTitleChanged(QTableWidgetItem*))); connect(ui->movies, SIGNAL(itemDoubleClicked(QTableWidgetItem*)), this, SLOT(onJumpToMovie(QTableWidgetItem*))); connect(ui->buttonAddMovie, SIGNAL(clicked()), this, SLOT(onAddMovie())); connect(ui->buttonRemoveMovie, SIGNAL(clicked()), this, SLOT(onRemoveMovie())); connect(ui->poster, SIGNAL(clicked()), this, SLOT(chooseSetPoster())); connect(ui->backdrop, SIGNAL(clicked()), this, SLOT(chooseSetBackdrop())); connect(ui->buttonPreviewPoster, SIGNAL(clicked()), this, SLOT(onPreviewPoster())); connect(ui->buttonPreviewBackdrop, SIGNAL(clicked()), this, SLOT(onPreviewBackdrop())); connect(m_downloadManager, SIGNAL(downloadFinished(DownloadManagerElement)), this, SLOT(onDownloadFinished(DownloadManagerElement))); ui->sets->setContextMenuPolicy(Qt::CustomContextMenu); m_tableContextMenu = new QMenu(ui->sets); QAction *actionAddSet = new QAction(tr("Add Movie Set"), this); QAction *actionDeleteSet = new QAction(tr("Delete Movie Set"), this); m_tableContextMenu->addAction(actionAddSet); m_tableContextMenu->addAction(actionDeleteSet); connect(actionAddSet, SIGNAL(triggered()), this, SLOT(onAddMovieSet())); connect(actionDeleteSet, SIGNAL(triggered()), this, SLOT(onRemoveMovieSet())); connect(ui->sets, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(showSetsContextMenu(QPoint))); clear(); }
TvShowWidgetSeason::TvShowWidgetSeason(QWidget *parent) : QWidget(parent), ui(new Ui::TvShowWidgetSeason) { ui->setupUi(this); m_show = 0; m_season = -1; ui->title->clear(); ui->posterResolution->clear(); ui->backdropResolution->clear(); ui->bannerResolution->clear(); QFont font = ui->title->font(); font.setPointSize(font.pointSize()+4); ui->title->setFont(font); ui->buttonPreviewBackdrop->setEnabled(false); ui->buttonPreviewPoster->setEnabled(false); ui->buttonPreviewBanner->setEnabled(false); font = ui->posterResolution->font(); #ifdef Q_OS_WIN32 font.setPointSize(font.pointSize()-1); #else font.setPointSize(font.pointSize()-2); #endif ui->posterResolution->setFont(font); ui->backdropResolution->setFont(font); ui->bannerResolution->setFont(font); m_downloadManager = new DownloadManager(this); m_loadingMovie = new QMovie(":/img/spinner.gif"); m_loadingMovie->start(); m_savingWidget = new QLabel(this); m_savingWidget->setMovie(m_loadingMovie); m_savingWidget->hide(); onSetEnabled(false); onClear(); QPixmap zoomIn(":/img/zoom_in.png"); QPainter p; p.begin(&zoomIn); p.setCompositionMode(QPainter::CompositionMode_SourceIn); p.fillRect(zoomIn.rect(), QColor(0, 0, 0, 150)); p.end(); ui->buttonPreviewBackdrop->setIcon(QIcon(zoomIn)); ui->buttonPreviewPoster->setIcon(QIcon(zoomIn)); ui->buttonPreviewBanner->setIcon(QIcon(zoomIn)); QPixmap revert(":/img/reload.png"); p.begin(&revert); p.setCompositionMode(QPainter::CompositionMode_SourceIn); p.fillRect(revert.rect(), QColor(0, 0, 0, 200)); p.end(); ui->buttonRevert->setIcon(QIcon(revert)); ui->buttonRevert->setVisible(false); connect(ui->poster, SIGNAL(clicked()), this, SLOT(onChoosePoster())); connect(ui->backdrop, SIGNAL(clicked()), this, SLOT(onChooseBackdrop())); connect(ui->banner, SIGNAL(clicked()), this, SLOT(onChooseBanner())); connect(ui->buttonPreviewPoster, SIGNAL(clicked()), this, SLOT(onPreviewPoster())); connect(ui->buttonPreviewBackdrop, SIGNAL(clicked()), this, SLOT(onPreviewBackdrop())); connect(ui->buttonPreviewBanner, SIGNAL(clicked()), this, SLOT(onPreviewBanner())); connect(ui->buttonRevert, SIGNAL(clicked()), this, SLOT(onRevertChanges())); connect(m_downloadManager, SIGNAL(downloadFinished(DownloadManagerElement)), this, SLOT(onDownloadFinished(DownloadManagerElement))); }
/** * @brief ConcertWidget::ConcertWidget * @param parent */ ConcertWidget::ConcertWidget(QWidget *parent) : QWidget(parent), ui(new Ui::ConcertWidget) { ui->setupUi(this); ui->concertName->clear(); ui->genres->verticalHeader()->setResizeMode(QHeaderView::ResizeToContents); ui->buttonPreviewPoster->setEnabled(false); ui->buttonPreviewBackdrop->setEnabled(false); ui->buttonPreviewLogo->setEnabled(false); ui->buttonPreviewClearArt->setEnabled(false); ui->buttonPreviewCdArt->setEnabled(false); QFont font = ui->concertName->font(); font.setPointSize(font.pointSize()+4); ui->concertName->setFont(font); font = ui->posterResolution->font(); #ifdef Q_WS_WIN font.setPointSize(font.pointSize()-1); #else font.setPointSize(font.pointSize()-2); #endif ui->posterResolution->setFont(font); ui->backdropResolution->setFont(font); ui->logoResolution->setFont(font); ui->clearArtResolution->setFont(font); ui->cdArtResolution->setFont(font); ui->genres->setItemDelegate(new ComboDelegate(ui->genres, WidgetConcerts, ComboDelegateGenres)); m_concert = 0; m_posterDownloadManager = new DownloadManager(this); connect(ui->poster, SIGNAL(clicked()), this, SLOT(chooseConcertPoster())); connect(ui->backdrop, SIGNAL(clicked()), this, SLOT(chooseConcertBackdrop())); connect(ui->logo, SIGNAL(clicked()), this, SLOT(chooseConcertLogo())); connect(ui->clearArt, SIGNAL(clicked()), this, SLOT(chooseConcertClearArt())); connect(ui->cdArt, SIGNAL(clicked()), this, SLOT(chooseConcertCdArt())); connect(m_posterDownloadManager, SIGNAL(downloadFinished(DownloadManagerElement)), this, SLOT(posterDownloadFinished(DownloadManagerElement))); connect(ui->name, SIGNAL(textChanged(QString)), this, SLOT(concertNameChanged(QString))); connect(ui->buttonAddGenre, SIGNAL(clicked()), this, SLOT(addGenre())); connect(ui->buttonRemoveGenre, SIGNAL(clicked()), this, SLOT(removeGenre())); connect(ui->genres, SIGNAL(itemChanged(QTableWidgetItem*)), this, SLOT(onGenreEdited(QTableWidgetItem*))); connect(ui->buttonPreviewPoster, SIGNAL(clicked()), this, SLOT(onPreviewPoster())); connect(ui->buttonPreviewBackdrop, SIGNAL(clicked()), this, SLOT(onPreviewBackdrop())); connect(ui->buttonPreviewLogo, SIGNAL(clicked()), this, SLOT(onPreviewLogo())); connect(ui->buttonPreviewClearArt, SIGNAL(clicked()), this, SLOT(onPreviewClearArt())); connect(ui->buttonPreviewCdArt, SIGNAL(clicked()), this, SLOT(onPreviewCdArt())); connect(ui->buttonRevert, SIGNAL(clicked()), this, SLOT(onRevertChanges())); m_loadingMovie = new QMovie(":/img/spinner.gif"); m_loadingMovie->start(); setDisabledTrue(); clear(); m_savingWidget = new QLabel(this); m_savingWidget->setMovie(m_loadingMovie); m_savingWidget->hide(); // Connect GUI change events to concert object connect(ui->name, SIGNAL(textEdited(QString)), this, SLOT(onNameChange(QString))); connect(ui->tagline, SIGNAL(textEdited(QString)), this, SLOT(onTaglineChange(QString))); connect(ui->rating, SIGNAL(valueChanged(double)), this, SLOT(onRatingChange(double))); connect(ui->trailer, SIGNAL(textEdited(QString)), this, SLOT(onTrailerChange(QString))); connect(ui->runtime, SIGNAL(valueChanged(int)), this, SLOT(onRuntimeChange(int))); connect(ui->playcount, SIGNAL(valueChanged(int)), this, SLOT(onPlayCountChange(int))); connect(ui->certification, SIGNAL(editTextChanged(QString)), this, SLOT(onCertificationChange(QString))); connect(ui->watched, SIGNAL(stateChanged(int)), this, SLOT(onWatchedChange(int))); connect(ui->released, SIGNAL(dateChanged(QDate)), this, SLOT(onReleasedChange(QDate))); connect(ui->lastPlayed, SIGNAL(dateTimeChanged(QDateTime)), this, SLOT(onLastWatchedChange(QDateTime))); connect(ui->overview, SIGNAL(textChanged()), this, SLOT(onOverviewChange())); QPixmap zoomIn(":/img/zoom_in.png"); QPainter p; p.begin(&zoomIn); p.setCompositionMode(QPainter::CompositionMode_SourceIn); p.fillRect(zoomIn.rect(), QColor(0, 0, 0, 150)); p.end(); ui->buttonPreviewBackdrop->setIcon(QIcon(zoomIn)); ui->buttonPreviewPoster->setIcon(QIcon(zoomIn)); ui->buttonPreviewLogo->setIcon(QIcon(zoomIn)); ui->buttonPreviewClearArt->setIcon(QIcon(zoomIn)); ui->buttonPreviewCdArt->setIcon(QIcon(zoomIn)); QPixmap revert(":/img/arrow_circle_left.png"); p.begin(&revert); p.setCompositionMode(QPainter::CompositionMode_SourceIn); p.fillRect(revert.rect(), QColor(0, 0, 0, 200)); p.end(); ui->buttonRevert->setIcon(QIcon(revert)); ui->buttonRevert->setVisible(false); }