MusicLrcSearchWidget::MusicLrcSearchWidget(QWidget *parent) : MusicAbstractMoveDialog(parent), ui(new Ui::MusicLrcSearchWidget) { ui->setupUi(this); ui->topTitleCloseButton->setIcon(QIcon(":/share/searchclosed")); ui->topTitleCloseButton->setStyleSheet(MusicUIObject::MToolButtonStyle03); ui->topTitleCloseButton->setCursor(QCursor(Qt::PointingHandCursor)); ui->topTitleCloseButton->setToolTip(tr("Close")); ui->songSearchEdit->setStyleSheet(MusicUIObject::MLineEditStyle01); ui->lrcSearchButton->setStyleSheet(MusicUIObject::MPushButtonStyle08); ui->lrcSearchDownload->setStyleSheet(MusicUIObject::MPushButtonStyle08); ui->closeButton->setStyleSheet(MusicUIObject::MPushButtonStyle08); ui->lrcSearchButton->setCursor(QCursor(Qt::PointingHandCursor)); ui->lrcSearchDownload->setCursor(QCursor(Qt::PointingHandCursor)); ui->closeButton->setCursor(QCursor(Qt::PointingHandCursor)); connect(ui->lrcSearchButton, SIGNAL(clicked()), SLOT(lrcSearchButtonClicked())); connect(ui->lrcSearchDownload, SIGNAL(clicked()), SLOT(lrcSearchDownloadClicked())); connect(ui->topTitleCloseButton, SIGNAL(clicked()), SLOT(close())); connect(ui->closeButton, SIGNAL(clicked()), SLOT(close())); connect(ui->label_checkBox, SIGNAL(clicked(bool)), ui->tableWidget, SLOT(setSelectedAllItems(bool))); connect(ui->tableWidget, SIGNAL(resolvedSuccess()), SLOT(lrcSearchFinished())); connect(ui->tableWidget, SIGNAL(lrcDownloadStateChanged(QString)), SLOT(lrcDownloadStateChanged(QString))); connect(ui->tableWidget, SIGNAL(restartSearchQuery(QString)), SLOT(setCurrentSongName(QString))); }
void MusicQueryTableWidget::actionGroupClick(QAction *action) { int row = currentRow(); if( row < 0) { return; } QString songName = (row != -1 && rowCount() > 0) ? item(row, 1)->text() : QString(); QString artistName = (row != -1 && rowCount() > 0) ? item(row, 2)->text() : QString(); switch( findActionGroup(action) ) { case 0: musicDownloadLocal(row); break; case 1: emit restartSearchQuery(songName); break; case 2: emit restartSearchQuery(artistName); break; case 3: emit restartSearchQuery(songName + "-" + artistName); break; } }
MusicVideoPlayWidget::MusicVideoPlayWidget(QWidget *parent) : MusicAbstractMoveWidget(false, parent) { setWindowTitle("TTKMovie"); m_leaverTimer = new QTimer(this); m_leaverTimer->setInterval(4*MT_S2MS); m_leaverTimer->setSingleShot(true); connect(m_leaverTimer, SIGNAL(timeout()), SLOT(leaveTimeout())); QVBoxLayout *layout = new QVBoxLayout(this); layout->setContentsMargins(0, 0, 0, 0); layout->setSpacing(0); m_topWidget = new QWidget(this); m_topWidget->setStyleSheet(MusicUIObject::MBackgroundStyle06 + MusicUIObject::MBorderStyle01); QHBoxLayout *topLayout = new QHBoxLayout(m_topWidget); topLayout->setContentsMargins(9, 4, 9, 4); m_textLabel = new QLabel(m_topWidget); m_textLabel->setAlignment(Qt::AlignLeft | Qt::AlignVCenter); m_textLabel->setStyleSheet(MusicUIObject::MColorStyle01); QWidget *searchWidget = new QWidget(m_topWidget); searchWidget->setFixedHeight(25); searchWidget->setStyleSheet(MusicUIObject::MBackgroundStyle11); QHBoxLayout *searchLayout = new QHBoxLayout(searchWidget); searchLayout->setContentsMargins(0, 0, 0, 0); searchLayout->setSpacing(0); m_searchEdit = new MusicLocalSongSearchEdit(searchWidget); m_searchEdit->setStyleSheet(MusicUIObject::MColorStyle09); m_searchEdit->setFixedHeight(25); m_searchButton = new QPushButton(searchWidget); m_searchButton->setIcon(QIcon(":/tiny/btn_search_main_hover")); m_searchButton->setCursor(QCursor(Qt::PointingHandCursor)); m_searchButton->setIconSize(QSize(25, 25)); searchLayout->addWidget(m_searchEdit); searchLayout->addWidget(m_searchButton); searchWidget->setLayout(searchLayout); topLayout->addWidget(m_textLabel); topLayout->addStretch(); topLayout->addWidget(searchWidget); m_closeButton = new QPushButton(this); m_closeButton->setToolTip(tr("Close")); m_closeButton->setFixedSize(14, 14); m_closeButton->setStyleSheet(MusicUIObject::MKGBtnPClose); m_closeButton->setCursor(QCursor(Qt::PointingHandCursor)); connect(m_closeButton, SIGNAL(clicked()), parent, SLOT(musicVideoClosed())); topLayout->addWidget(m_closeButton); m_topWidget->setLayout(topLayout); #ifdef Q_OS_UNIX m_searchButton->setFocusPolicy(Qt::NoFocus); m_closeButton->setFocusPolicy(Qt::NoFocus); #endif m_stackedWidget = new QStackedWidget(this); m_stackedWidget->setStyleSheet(MusicUIObject::MBorderStyle01); QWidget *topMaskWidget = new QWidget(this); topMaskWidget->setFixedHeight(35); topMaskWidget->setStyleSheet(MusicUIObject::MBackgroundStyle02); layout->addWidget(topMaskWidget); layout->addWidget(m_stackedWidget); setLayout(layout); m_searchEdit->hide(); m_searchButton->hide(); m_backButton = nullptr; m_topWidget->raise(); m_videoFloatWidget = new MusicVideoFloatWidget(this); m_videoTable = new MusicVideoTableWidget(this); m_videoView = new MusicVideoView(this); m_stackedWidget->addWidget(m_videoView); m_stackedWidget->addWidget(m_videoTable); m_stackedWidget->setCurrentIndex(VIDEO_WINDOW_INDEX_0); m_videoFloatWidget->setText(MusicVideoFloatWidget::FreshType, tr("PopupMode")); m_leaverAnimation = new QParallelAnimationGroup(this); QPropertyAnimation *topAnimation = new QPropertyAnimation(m_topWidget, "pos", m_leaverAnimation); topAnimation->setDuration(MT_S2MS/2); QPropertyAnimation *ctrlAnimation = new QPropertyAnimation(m_videoView->controlBarWidget(), "pos", m_leaverAnimation); ctrlAnimation->setDuration(MT_S2MS/2); m_leaverAnimation->addAnimation(topAnimation); m_leaverAnimation->addAnimation(ctrlAnimation); connect(m_searchButton,SIGNAL(clicked(bool)), SLOT(searchButtonClicked())); connect(m_videoTable, SIGNAL(mvURLNameChanged(MusicVideoItem)), SLOT(mvURLNameChanged(MusicVideoItem))); connect(m_videoTable, SIGNAL(restartSearchQuery(QString)), SLOT(videoResearchButtonSearched(QString))); connect(m_searchEdit, SIGNAL(enterFinished(QString)), SLOT(videoResearchButtonSearched(QString))); connect(m_videoFloatWidget, SIGNAL(searchButtonClicked()), SLOT(switchToSearchTable())); connect(m_videoFloatWidget, SIGNAL(freshButtonClicked()), SLOT(freshButtonClicked())); connect(m_videoFloatWidget, SIGNAL(fullscreenButtonClicked()), SLOT(fullscreenButtonClicked())); connect(m_videoFloatWidget, SIGNAL(downloadButtonClicked()), SLOT(downloadButtonClicked())); connect(m_videoFloatWidget, SIGNAL(shareButtonClicked()), SLOT(shareButtonClicked())); }
MusicVideoPlayWidget::MusicVideoPlayWidget(bool popup, QWidget *parent) : MusicAbstractMoveWidget(parent), m_closeButton(nullptr) { if(popup) { resize(541, 460); } QVBoxLayout *layout = new QVBoxLayout(this); layout->setMargin(0); layout->setSpacing(0); m_topWidget = new QWidget(this); m_topWidget->setObjectName("#topWidget"); m_topWidget->setStyleSheet(MusicUIObject::MCustomStyle19 + \ MusicUIObject::MCustomStyle20); QHBoxLayout *topLayout = new QHBoxLayout(m_topWidget); topLayout->setSpacing(0); m_backButton = new QPushButton(this); m_backButton->setIcon(QIcon(":/video/back")); m_backButton->setCursor(QCursor(Qt::PointingHandCursor)); m_backButton->setIconSize(QSize(18, 18)); m_afterButton = new QPushButton(this); m_afterButton->setIcon(QIcon(":/video/after")); m_afterButton->setCursor(QCursor(Qt::PointingHandCursor)); m_afterButton->setIconSize(QSize(18, 18)); m_textLabel = new QLabel(m_topWidget); m_textLabel->setStyleSheet(MusicUIObject::MCustomStyle11); m_searchEdit = new MusicLocalSongSearchEdit(m_topWidget); m_searchEdit->setFixedHeight(18); m_searchButton = new QPushButton(m_topWidget); m_searchButton->setIcon(QIcon(":/share/searchlineleft")); m_searchButton->setCursor(QCursor(Qt::PointingHandCursor)); m_searchButton->setIconSize(QSize(18, 18)); topLayout->addWidget(m_backButton); topLayout->addWidget(m_afterButton); topLayout->addStretch(); topLayout->addWidget(m_textLabel); topLayout->addStretch(); topLayout->addWidget(m_searchEdit); topLayout->addWidget(m_searchButton); if(popup) { m_closeButton = new QPushButton(this); m_closeButton->setToolTip(tr("Close")); m_closeButton->setIcon(QIcon(":/image/close")); m_closeButton->setCursor(QCursor(Qt::PointingHandCursor)); m_closeButton->setIconSize(QSize(18, 18)); topLayout->addWidget(m_closeButton); } m_topWidget->setLayout(topLayout); m_topWidget->setFixedHeight(40); m_stackedWidget = new QStackedWidget(this); m_stackedWidget->setStyleSheet(MusicUIObject::MCustomStyle20); layout->addWidget(m_topWidget); layout->addWidget(m_stackedWidget); setLayout(layout); m_videoTable = new MusicVideoTableWidget(this); m_videoView = new MusicVideoView(popup, this); m_stackedWidget->addWidget(m_videoView); m_stackedWidget->addWidget(m_videoTable); m_stackedWidget->setCurrentIndex(0); connect(m_afterButton, SIGNAL(clicked(bool)), SLOT(afterButtonClicked())); connect(m_backButton, SIGNAL(clicked(bool)), SLOT(backButtonClicked())); connect(m_searchButton,SIGNAL(clicked(bool)), SLOT(searchButtonClicked())); connect(m_videoTable, SIGNAL(mvURLNameChanged(QString,QString)), SLOT(mvURLNameChanged(QString,QString))); connect(m_videoTable, SIGNAL(restartSearchQuery(QString)), SLOT(musicResearchButtonSearched(QString))); connect(m_searchEdit, SIGNAL(enterFinished(QString)), SLOT(musicResearchButtonSearched(QString))); }
void MusicConnectionPool::poolConnect(const QString &from, const QString &to) { QObject *first = m_para.value(from); QObject *second = m_para.value(to); if(first == nullptr || second == nullptr) { return; } if(from == "MusicPlayer" && to == "MusicLrcMakerWidget" ) { QObject::connect(first, SIGNAL(positionChanged(qint64)), second, SLOT(setCurrentPosition(qint64))); } if( (from == "MusicLocalSongsManagerWidget" && to == "MusicApplication") || (from == "MusicMyDownloadRecordWidget" && to == "MusicApplication") ) { QObject::connect(first, SIGNAL(addSongToPlay(QStringList)), second, SLOT(addSongToPlayList(QStringList))); } if(from == "MusicTimerWidget" && to == "MusicApplicationObject" ) { QObject::connect(first, SIGNAL(timerParameterChanged()), second, SLOT(musicToolSetsParameter())); } if( (from == "MusicToolSetsWidget" && to == "MusicApplication") || (from == "MusicApplicationObject" && to == "MusicApplication") ) { QObject::connect(first, SIGNAL(getCurrentPlayList(QStringList&)), second, SLOT(getCurrentPlayList(QStringList&))); } if(from == "MusicEqualizerDialog" && to == "MusicPlayer" ) { QObject::connect(first, SIGNAL(setEqEffect(MIntList)), second, SLOT(setEqEffect(MIntList))); QObject::connect(first, SIGNAL(setEnaleEffect(bool)), second, SLOT(setEnaleEffect(bool))); } if(from == "MusicSongSearchOnlineTableWidget" && to == "MusicDownloadStatusLabel" ) { QObject::connect(first, SIGNAL(showDownLoadInfoFor(MusicObject::DownLoadType)), second, SLOT(showDownLoadInfoFor(MusicObject::DownLoadType))); } if(from == "MusicBgThemeDownload" && to == "MusicTopAreaWidget" ) { QObject::connect(first, SIGNAL(musicBgDownloadFinished()), second, SLOT(musicBgThemeDownloadFinished())); } if(from == "MusicSongSearchOnlineTableWidget" && to == "MusicSongsSummarizied" ) { QObject::connect(first, SIGNAL(muiscSongToPlayListChanged(QString,QString,QString)), second, SLOT(addNetMusicSongToList(QString,QString,QString))); } if(from == "MusicSongSearchOnlineTableWidget" && to == "MusicRightAreaWidget" ) { QObject::connect(first, SIGNAL(restartSearchQuery(QString)), second, SLOT(musicResearchButtonSearched(QString))); } if(from == "MusicNetworkThread" && to == "MusicDownloadStatusLabel" ) { QObject::connect(first, SIGNAL(networkConnectionStateChanged(bool)), second, SLOT(networkConnectionStateChanged(bool))); } if(from == "MusicSongSearchOnlineTableWidget" && to == "MusicQualityChoiceTableWidget" ) { QObject::connect(first, SIGNAL(getQualityString(QString&)), second, SLOT(getQualityString(QString&))); QObject::connect(second, SIGNAL(researchQueryByQuality()), first, SLOT(researchQueryByQuality())); } if(from == "MusicSongsListPlayWidget" && to == "MusicRightAreaWidget" ) { QObject::connect(first, SIGNAL(videoButtonClicked(QString)), second, SLOT(musicVideoButtonSearched(QString))); } if(from == "MusicVideoControl" && to == "MusicRightAreaWidget" ) { QObject::connect(first, SIGNAL(musicVideoSetPopup(bool)), second, SLOT(musicVideoSetPopup(bool))); QObject::connect(first, SIGNAL(musicVideoFullscreen(bool)), second, SLOT(musicVideoFullscreen(bool))); } if(from == "MusicApplicationObject" && to == "MusicEnhancedWidget" ) { QObject::connect(first, SIGNAL(enhancedMusicChanged(int)), second, SLOT(setEnhancedMusicConfig(int))); } if(from == "MusicVideoControl" && to == "MusicVideoTableWidget" ) { QObject::connect(first, SIGNAL(getMusicMvInfo(MusicSongAttributes&)), second, SLOT(getMusicMvInfo(MusicSongAttributes&))); QObject::connect(first, SIGNAL(downloadLocalByControl()), second, SLOT(downloadLocalFromControl())); } }