Diffstat (limited to 'core/multimedia/opieplayer/playlistwidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/multimedia/opieplayer/playlistwidget.cpp | 35 |
1 files changed, 17 insertions, 18 deletions
diff --git a/core/multimedia/opieplayer/playlistwidget.cpp b/core/multimedia/opieplayer/playlistwidget.cpp index a6202bc..3171a84 100644 --- a/core/multimedia/opieplayer/playlistwidget.cpp +++ b/core/multimedia/opieplayer/playlistwidget.cpp | |||
@@ -409,31 +409,39 @@ void PlayListWidget::addAllVideoToList() { | |||
409 | Global::findDocuments(&files, "video/*"); | 409 | Global::findDocuments(&files, "video/*"); |
410 | QListIterator<DocLnk> dit( files.children() ); | 410 | QListIterator<DocLnk> dit( files.children() ); |
411 | for ( ; dit.current(); ++dit ) | 411 | for ( ; dit.current(); ++dit ) |
412 | d->selectedFiles->addToSelection( **dit ); | 412 | d->selectedFiles->addToSelection( **dit ); |
413 | } | 413 | } |
414 | 414 | ||
415 | 415 | ||
416 | void PlayListWidget::setDocument(const QString& fileref) { | 416 | void PlayListWidget::setDocument(const QString& fileref) { |
417 | if ( fileref.isNull() ) { | 417 | if ( fileref.isNull() ) { |
418 | QMessageBox::critical( 0, tr( "Invalid File" ), tr( "There was a problem in getting the file." ) ); | 418 | QMessageBox::critical( 0, tr( "Invalid File" ), tr( "There was a problem in getting the file." ) ); |
419 | return; | 419 | return; |
420 | } | 420 | } |
421 | if(fileref.find("playlist",0,TRUE) == -1) { | ||
421 | addToSelection( DocLnk( fileref ) ); | 422 | addToSelection( DocLnk( fileref ) ); |
422 | d->setDocumentUsed = TRUE; | 423 | d->setDocumentUsed = TRUE; |
423 | qApp->processEvents(); | 424 | qApp->processEvents(); |
424 | mediaPlayerState->setPlaying( FALSE ); | 425 | mediaPlayerState->setPlaying( FALSE ); |
425 | qApp->processEvents(); | 426 | qApp->processEvents(); |
426 | mediaPlayerState->setPlaying( TRUE ); | 427 | mediaPlayerState->setPlaying( TRUE ); |
427 | d->selectedFiles->removeSelected( ); | 428 | d->selectedFiles->removeSelected( ); |
429 | } else { | ||
430 | loadList(DocLnk(fileref)); | ||
431 | d->selectedFiles->first(); | ||
432 | // mediaPlayerState->setPlaying( TRUE ); | ||
433 | // mediaPlayerState->setPlaying( FALSE ); | ||
434 | |||
435 | } | ||
428 | } | 436 | } |
429 | 437 | ||
430 | 438 | ||
431 | void PlayListWidget::setActiveWindow() { | 439 | void PlayListWidget::setActiveWindow() { |
432 | // When we get raised we need to ensure that it switches views | 440 | // When we get raised we need to ensure that it switches views |
433 | char origView = mediaPlayerState->view(); | 441 | char origView = mediaPlayerState->view(); |
434 | mediaPlayerState->setView( 'l' ); // invalidate | 442 | mediaPlayerState->setView( 'l' ); // invalidate |
435 | mediaPlayerState->setView( origView ); // now switch back | 443 | mediaPlayerState->setView( origView ); // now switch back |
436 | } | 444 | } |
437 | 445 | ||
438 | 446 | ||
439 | void PlayListWidget::useSelectedDocument() { | 447 | void PlayListWidget::useSelectedDocument() { |
@@ -520,48 +528,39 @@ bool PlayListWidget::last() { | |||
520 | } | 528 | } |
521 | 529 | ||
522 | 530 | ||
523 | void PlayListWidget::saveList() { | 531 | void PlayListWidget::saveList() { |
524 | 532 | ||
525 | QString filename; | 533 | QString filename; |
526 | InputDialog *fileDlg; | 534 | InputDialog *fileDlg; |
527 | fileDlg=new InputDialog(this,"Save Playlist",TRUE, 0); | 535 | fileDlg=new InputDialog(this,"Save Playlist",TRUE, 0); |
528 | fileDlg->exec(); | 536 | fileDlg->exec(); |
529 | if( fileDlg->result() == 1 ) { | 537 | if( fileDlg->result() == 1 ) { |
530 | filename = fileDlg->LineEdit1->text();//+".playlist"; | 538 | filename = fileDlg->LineEdit1->text();//+".playlist"; |
531 | qDebug("saving playlist "+filename+".playlist"); | 539 | qDebug("saving playlist "+filename+".playlist"); |
532 | |||
533 | // DocLnk *lnk; | ||
534 | // lnk.setName( filename); //sets file name | ||
535 | // // lnk.setComment(title); | ||
536 | // lnk.setFile( filename+".playlist"); //sets File property | ||
537 | // lnk.setType("player/plain");// hey is this a REGISTERED mime type?!?!? ;D | ||
538 | // lnk.setIcon("MPEGPlayer"); | ||
539 | // if(!lnk.writeLink()) | ||
540 | // qDebug("Writing doclink did not work"); | ||
541 | |||
542 | Config cfg( filename +".playlist"); | 540 | Config cfg( filename +".playlist"); |
543 | writeConfig( cfg ); | 541 | writeConfig( cfg ); |
542 | DocLnk lnk; | ||
543 | lnk.setName( filename); //sets file name | ||
544 | // lnk.setComment( ""); | ||
545 | lnk.setFile(QPEApplication::qpeDir()+"Settings/"+filename+".playlist.conf"); //sets File property | ||
546 | lnk.setType("playlist/plain");// hey is this a REGISTERED mime type?!?!? ;D | ||
547 | lnk.setIcon("mpegplayer/playlist2"); | ||
548 | if(!lnk.writeLink()) | ||
549 | qDebug("Writing doclink did not work"); | ||
544 | } | 550 | } |
545 | DocLnk lnk; | ||
546 | lnk.setName( filename); //sets file name | ||
547 | // lnk.setComment(title); | ||
548 | lnk.setFile(QPEApplication::qpeDir()+"Settings/"+filename+".playlist.conf"); //sets File property | ||
549 | lnk.setType("playlist/plain");// hey is this a REGISTERED mime type?!?!? ;D | ||
550 | lnk.setIcon("MPEGPlayer"); | ||
551 | if(!lnk.writeLink()) | ||
552 | qDebug("Writing doclink did not work"); | ||
553 | 551 | ||
554 | if(fileDlg) | 552 | if(fileDlg) |
555 | delete fileDlg; | 553 | delete fileDlg; |
554 | |||
556 | } | 555 | } |
557 | 556 | ||
558 | 557 | ||
559 | void PlayListWidget::loadList( const DocLnk & lnk) { | 558 | void PlayListWidget::loadList( const DocLnk & lnk) { |
560 | qDebug("load list "+ lnk.name()+".playlist"); | 559 | qDebug("load list "+ lnk.name()+".playlist"); |
561 | clearList(); | 560 | clearList(); |
562 | Config cfg( lnk.name()+".playlist"); | 561 | Config cfg( lnk.name()+".playlist"); |
563 | readConfig(cfg); | 562 | readConfig(cfg); |
564 | tabWidget->setCurrentPage(0); | 563 | tabWidget->setCurrentPage(0); |
565 | setCaption("OpiePlayer: "+lnk.name()); | 564 | setCaption("OpiePlayer: "+lnk.name()); |
566 | } | 565 | } |
567 | 566 | ||