HPlayerContext::HPlayerContext(QWidget *parent) : QWidget(parent), s_magic(0), s_slideshow(0), ui(new Ui::HPlayerContext) { ui->setupUi(this); ui->widget_trackContext->setLayout(new QVBoxLayout); ui->widget_trackContext->layout()->setContentsMargins(0,0,0,0); connect(HPlayer::singleton(),SIGNAL(trackChanged(HTrack&)),this,SLOT(showTrack(HTrack&))); if(HPlayer::singleton()->currentTrack()) showTrack(*HPlayer::singleton()->currentTrack()); }
void Tracking::setMap( MarbleQuickItem* item ) { if ( item != m_marbleQuickItem ) { m_marbleQuickItem = item; if ( m_marbleQuickItem ) { m_marbleQuickItem->model()->positionTracking()->setTrackVisible( showTrack() ); setShowPositionMarkerPlugin( m_positionMarkerType == Arrow ); connect( m_marbleQuickItem, SIGNAL(visibleLatLonAltBoxChanged()), this, SLOT(updatePositionMarker()) ); connect( m_marbleQuickItem, SIGNAL(mapThemeChanged()), this, SLOT(updatePositionMarker()) ); } emit mapChanged(); } }
void SoundCloudPlaylistWindow::loadBaseUi() { setWindowTitle(tr("Set")); setCentralWidget(new QWidget); m_view->setModel(m_model); m_view->setItemDelegate(m_delegate); m_view->setContextMenuPolicy(Qt::CustomContextMenu); m_thumbnail->setFixedSize(320, 320); m_thumbnail->setFallbackSource(QUrl::fromLocalFile("/usr/share/icons/hicolor/295x295/hildon/mediaplayer_default_album.png")); m_avatar->setFixedSize(60, 60); m_avatar->setFallbackSource(QUrl::fromLocalFile("/usr/share/icons/hicolor/64x64/hildon/general_default_avatar.png")); m_titleLabel->setWordWrap(true); m_dateLabel->setStyleSheet(QString("color: %1; font-size: 13pt").arg(palette().color(QPalette::Mid).name())); m_artistLabel->setStyleSheet("font-size: 13pt"); m_noTracksLabel->hide(); m_reloadAction->setEnabled(false); m_contextMenu->addAction(m_queueAction); m_contextMenu->addAction(m_downloadAction); m_contextMenu->addAction(m_shareAction); QWidget *scrollWidget = new QWidget(m_scrollArea); QGridLayout *grid = new QGridLayout(scrollWidget); grid->addWidget(m_thumbnail, 0, 0, 1, 2, Qt::AlignLeft); grid->addWidget(m_titleLabel, 1, 0, 1, 2); grid->addWidget(m_avatar, 2, 0, 2, 1, Qt::AlignLeft); grid->addWidget(m_artistLabel, 2, 1, Qt::AlignLeft | Qt::AlignTop); grid->addWidget(m_dateLabel, 3, 1, Qt::AlignLeft | Qt::AlignBottom); grid->addWidget(m_descriptionLabel, 4, 0, 1, 2); grid->setRowStretch(4, 1); grid->setColumnStretch(1, 1); grid->setContentsMargins(0, 0, 0, 0); m_scrollArea->setWidget(scrollWidget); m_scrollArea->setWidgetResizable(true); m_scrollArea->setFixedWidth(330); m_layout = new QHBoxLayout(centralWidget()); m_layout->addWidget(m_scrollArea); m_layout->addWidget(m_view); m_layout->addWidget(m_noTracksLabel); m_layout->setStretch(1, 1); m_layout->setStretch(2, 1); m_layout->setContentsMargins(0, 0, 0, 0); menuBar()->addAction(m_reloadAction); menuBar()->addAction(m_queuePlaylistAction); menuBar()->addAction(m_nowPlayingAction); connect(m_model, SIGNAL(statusChanged(QSoundCloud::ResourcesRequest::Status)), this, SLOT(onModelStatusChanged(QSoundCloud::ResourcesRequest::Status))); connect(m_cache, SIGNAL(imageReady()), this, SLOT(onImageReady())); connect(m_view, SIGNAL(activated(QModelIndex)), this, SLOT(showTrack(QModelIndex))); connect(m_view, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(showContextMenu(QPoint))); connect(m_thumbnail, SIGNAL(clicked()), this, SLOT(playPlaylist())); connect(m_delegate, SIGNAL(thumbnailClicked(QModelIndex)), this, SLOT(playTrack(QModelIndex))); connect(m_reloadAction, SIGNAL(triggered()), m_model, SLOT(reload())); connect(m_queuePlaylistAction, SIGNAL(triggered()), this, SLOT(queuePlaylist())); connect(m_avatar, SIGNAL(clicked()), this, SLOT(showArtist())); connect(m_descriptionLabel, SIGNAL(anchorClicked(QUrl)), this, SLOT(showResource(QUrl))); connect(m_queueAction, SIGNAL(triggered()), this, SLOT(queueTrack())); connect(m_downloadAction, SIGNAL(triggered()), this, SLOT(downloadTrack())); connect(m_shareAction, SIGNAL(triggered()), this, SLOT(shareTrack())); if (!SoundCloud::instance()->userId().isEmpty()) { m_favouriteAction = new QAction(this); m_contextMenu->addAction(m_favouriteAction); connect(m_favouriteAction, SIGNAL(triggered()), this, SLOT(setTrackFavourite())); } }
void HPlayerContext::showEvent(QShowEvent *e) { if(s_magic) { showTrack(s_magic->getTrack()); } QWidget::showEvent(e); }