author | simon <simon> | 2002-12-02 16:38:16 (UTC) |
---|---|---|
committer | simon <simon> | 2002-12-02 16:38:16 (UTC) |
commit | cb03905d1be2f8b98f770201bc4cb98f75c80c1d (patch) (side-by-side diff) | |
tree | e2ad2689b12a63e0ac597d394e9ff6d385d817b1 | |
parent | a0cfa5b76aac8de36304faef4bb2b14237c04c9a (diff) | |
download | opie-cb03905d1be2f8b98f770201bc4cb98f75c80c1d.zip opie-cb03905d1be2f8b98f770201bc4cb98f75c80c1d.tar.gz opie-cb03905d1be2f8b98f770201bc4cb98f75c80c1d.tar.bz2 |
- disable 'play' in the play list tab
-rw-r--r-- | noncore/multimedia/opieplayer2/playlistwidget.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/noncore/multimedia/opieplayer2/playlistwidget.cpp b/noncore/multimedia/opieplayer2/playlistwidget.cpp index ce73252..b04fe8d 100644 --- a/noncore/multimedia/opieplayer2/playlistwidget.cpp +++ b/noncore/multimedia/opieplayer2/playlistwidget.cpp @@ -501,232 +501,236 @@ bool PlayListWidget::last() { if ( mediaPlayerState->isUsingPlaylist() ) return d->selectedFiles->last(); else return mediaPlayerState->isLooping(); } void PlayListWidget::saveList() { writem3u(); } void PlayListWidget::loadList( const DocLnk & lnk) { QString name = lnk.name(); // qDebug("<<<<<<<<<<<<<<<<<<<<<<<<currentList is "+name); if( name.length()>0) { setCaption("OpiePlayer: "+name); // qDebug("<<<<<<<<<<<<load list "+ lnk.file()); clearList(); readm3u(lnk.file()); tabWidget->setCurrentPage(0); } } void PlayListWidget::setPlaylist( bool shown ) { if ( shown ) { d->playListFrame->show(); } else { d->playListFrame->hide(); } } void PlayListWidget::addSelected() { assert( inFileListMode() ); QListView *fileListView = currentFileListView(); QListViewItemIterator it( fileListView ); for ( ; it.current(); ++it ) if ( it.current()->isSelected() ) { QString filename = it.current()->text(3); DocLnk lnk; lnk.setName( QFileInfo( filename ).baseName() ); //sets name lnk.setFile( filename ); //sets file name d->selectedFiles->addToSelection( lnk ); } fileListView->clearSelection(); tabWidget->setCurrentPage( 0 ); writeCurrentM3u(); } void PlayListWidget::removeSelected() { d->selectedFiles->removeSelected( ); writeCurrentM3u(); } void PlayListWidget::playIt( QListViewItem *it) { if(!it) return; mediaPlayerState->setPlaying(FALSE); mediaPlayerState->setPlaying(TRUE); d->selectedFiles->unSelect(); } void PlayListWidget::addToSelection( QListViewItem *it) { d->setDocumentUsed = FALSE; if(it) { if ( currentTab() == CurrentPlayList ) return; // case 1: { DocLnk lnk; QString filename; filename=it->text(3); lnk.setName( QFileInfo(filename).baseName() ); //sets name lnk.setFile( filename ); //sets file name d->selectedFiles->addToSelection( lnk); writeCurrentM3u(); tabWidget->setCurrentPage(0); } } void PlayListWidget::tabChanged(QWidget *) { + d->tbPlay->setEnabled( true ); + switch ( currentTab() ) { case CurrentPlayList: { if( !tbDeletePlaylist->isHidden() ) { tbDeletePlaylist->hide(); } d->tbRemoveFromList->setEnabled(TRUE); d->tbAddToList->setEnabled(FALSE); } break; case AudioFiles: { // audioView->clear(); if(!audioPopulated) populateAudioView(); if( !tbDeletePlaylist->isHidden() ) { tbDeletePlaylist->hide(); } d->tbRemoveFromList->setEnabled(FALSE); d->tbAddToList->setEnabled(TRUE); } break; case VideoFiles: { // videoView->clear(); if(!videoPopulated) populateVideoView(); if( !tbDeletePlaylist->isHidden() ) { tbDeletePlaylist->hide(); } d->tbRemoveFromList->setEnabled(FALSE); d->tbAddToList->setEnabled(TRUE); } break; case PlayLists: { if( tbDeletePlaylist->isHidden() ) { tbDeletePlaylist->show(); } playLists->reread(); d->tbAddToList->setEnabled(FALSE); + + d->tbPlay->setEnabled( false ); } break; }; } void PlayListWidget::btnPlay(bool b) { // mediaPlayerState->setPlaying(false); mediaPlayerState->setPlaying(b); insanityBool=FALSE; } void PlayListWidget::deletePlaylist() { switch( QMessageBox::information( this, (tr("Remove Playlist?")), (tr("You really want to delete\nthis playlist?")), (tr("Yes")), (tr("No")), 0 )){ case 0: // Yes clicked, QFile().remove(playLists->selectedDocument().file()); QFile().remove(playLists->selectedDocument().linkFile()); playLists->reread(); break; case 1: // Cancel break; }; } void PlayListWidget::playSelected() { btnPlay( TRUE); } void PlayListWidget::scanForAudio() { // qDebug("scan for audio"); files.detachChildren(); QListIterator<DocLnk> sdit( files.children() ); for ( ; sdit.current(); ++sdit ) { delete sdit.current(); } // Global::findDocuments( &files, "audio/*"); Global::findDocuments( &files, audioMimes); audioScan = true; populateAudioView(); } void PlayListWidget::scanForVideo() { // qDebug("scan for video"); vFiles.detachChildren(); QListIterator<DocLnk> sdit( vFiles.children() ); for ( ; sdit.current(); ++sdit ) { delete sdit.current(); } Global::findDocuments(&vFiles, "video/*"); videoScan = true; populateVideoView(); } void PlayListWidget::populateAudioView() { audioView->clear(); StorageInfo storageInfo; // const QList<FileSystem> &fs = storageInfo.fileSystems(); if(!audioScan) { scanForAudio(); } QListIterator<DocLnk> dit( files.children() ); // QListIterator<FileSystem> it ( fs ); audioView->clear(); QString storage; for ( ; dit.current(); ++dit ) { // // for( ; it.current(); ++it ){ // const QString name = (*dit)->name(); // const QString path = (*dit)->path(); // if(dit.current()->file().find(path) != -1 ) { // storage = name; // // } // } QListViewItem * newItem; if ( QFile( dit.current()->file()).exists() || dit.current()->file().left(4) == "http" ) { long size; if( dit.current()->file().left(4) == "http" ) size=0; else size = QFile( dit.current()->file() ).size(); newItem= /*(void)*/ new QListViewItem( audioView, dit.current()->name(), QString::number(size ), "" /*storage*/, dit.current()->file() ); newItem->setPixmap( 0, Resource::loadPixmap( "opieplayer2/musicfile" ) ); // qDebug("<<<< "+dit.current()->file()); } } audioPopulated=true; |