void OverviewPlaylistWidget::StartPlaylist() { if (!mIsPlayed) { if (mLwFiles->count() == 0) AddEntryDialog(); PlayItem(mLwFiles->item(mCurrentFileId)); } }
void OverviewPlaylistWidget::StartPlaylist() { if (GetListSize() == 0) LOG(LOG_VERBOSE, "Playlist start triggered but we don't have entries in the list"); else LOG(LOG_VERBOSE, "Playlist start triggered and we already have entries in the list"); if (AddEntryDialog()) { Play(GetListSize() - 1); if (!isVisible()) SetVisible(true); } }
void OverviewPlaylistWidget::contextMenuEvent(QContextMenuEvent *pContextMenuEvent) { QAction *tAction; QMenu tMenu(this); tAction = tMenu.addAction("Add an entry"); QIcon tIcon1; tIcon1.addPixmap(QPixmap(":/images/22_22/Plus.png"), QIcon::Normal, QIcon::Off); tAction->setIcon(tIcon1); if (!mLwFiles->selectedItems().isEmpty()) { tAction = tMenu.addAction("Delete selected"); QIcon tIcon2; tIcon2.addPixmap(QPixmap(":/images/22_22/Minus.png"), QIcon::Normal, QIcon::Off); tAction->setIcon(tIcon2); } tMenu.addSeparator(); tAction = tMenu.addAction("Endless loop"); tAction->setCheckable(true); tAction->setChecked(mEndlessLoop); QAction* tPopupRes = tMenu.exec(pContextMenuEvent->globalPos()); if (tPopupRes != NULL) { if (tPopupRes->text().compare("Add an entry") == 0) { AddEntryDialog(); return; } if (tPopupRes->text().compare("Delete selected") == 0) { DelEntryDialog(); return; } if (tPopupRes->text().compare("Endless loop") == 0) { mEndlessLoop = !mEndlessLoop; LOG(LOG_VERBOSE, "Playlist %d has now endless loop activation %d", mPlaylistId, mEndlessLoop); return; } } }