author | simon <simon> | 2002-12-02 15:02:50 (UTC) |
---|---|---|
committer | simon <simon> | 2002-12-02 15:02:50 (UTC) |
commit | 5380767372ecf3ab22f799abda32f414b0cc7ede (patch) (unidiff) | |
tree | e8e2f3d96589cad708c2ffe8f5c3dd2fb200fc69 | |
parent | 77147a2001cf991e3581bcb2401143e20a3973d4 (diff) | |
download | opie-5380767372ecf3ab22f799abda32f414b0cc7ede.zip opie-5380767372ecf3ab22f799abda32f414b0cc7ede.tar.gz opie-5380767372ecf3ab22f799abda32f414b0cc7ede.tar.bz2 |
- disable playlist addition in the playlists tab
-rw-r--r-- | noncore/multimedia/opieplayer2/playlistwidget.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/noncore/multimedia/opieplayer2/playlistwidget.cpp b/noncore/multimedia/opieplayer2/playlistwidget.cpp index c9ae225..a8429e3 100644 --- a/noncore/multimedia/opieplayer2/playlistwidget.cpp +++ b/noncore/multimedia/opieplayer2/playlistwidget.cpp | |||
@@ -543,192 +543,193 @@ void PlayListWidget::addSelected() { | |||
543 | QString filename = it.current()->text(3); | 543 | QString filename = it.current()->text(3); |
544 | 544 | ||
545 | DocLnk lnk; | 545 | DocLnk lnk; |
546 | lnk.setName( QFileInfo( filename ).baseName() ); //sets name | 546 | lnk.setName( QFileInfo( filename ).baseName() ); //sets name |
547 | lnk.setFile( filename ); //sets file name | 547 | lnk.setFile( filename ); //sets file name |
548 | 548 | ||
549 | d->selectedFiles->addToSelection( lnk ); | 549 | d->selectedFiles->addToSelection( lnk ); |
550 | } | 550 | } |
551 | 551 | ||
552 | fileListView->clearSelection(); | 552 | fileListView->clearSelection(); |
553 | 553 | ||
554 | tabWidget->setCurrentPage( 0 ); | 554 | tabWidget->setCurrentPage( 0 ); |
555 | writeCurrentM3u(); | 555 | writeCurrentM3u(); |
556 | } | 556 | } |
557 | 557 | ||
558 | 558 | ||
559 | void PlayListWidget::removeSelected() { | 559 | void PlayListWidget::removeSelected() { |
560 | d->selectedFiles->removeSelected( ); | 560 | d->selectedFiles->removeSelected( ); |
561 | writeCurrentM3u(); | 561 | writeCurrentM3u(); |
562 | } | 562 | } |
563 | 563 | ||
564 | 564 | ||
565 | void PlayListWidget::playIt( QListViewItem *it) { | 565 | void PlayListWidget::playIt( QListViewItem *it) { |
566 | if(!it) return; | 566 | if(!it) return; |
567 | mediaPlayerState->setPlaying(FALSE); | 567 | mediaPlayerState->setPlaying(FALSE); |
568 | mediaPlayerState->setPlaying(TRUE); | 568 | mediaPlayerState->setPlaying(TRUE); |
569 | d->selectedFiles->unSelect(); | 569 | d->selectedFiles->unSelect(); |
570 | } | 570 | } |
571 | 571 | ||
572 | 572 | ||
573 | void PlayListWidget::addToSelection( QListViewItem *it) { | 573 | void PlayListWidget::addToSelection( QListViewItem *it) { |
574 | d->setDocumentUsed = FALSE; | 574 | d->setDocumentUsed = FALSE; |
575 | 575 | ||
576 | if(it) { | 576 | if(it) { |
577 | switch ( whichList()) { | 577 | switch ( whichList()) { |
578 | case 0: //playlist | 578 | case 0: //playlist |
579 | return; | 579 | return; |
580 | break; | 580 | break; |
581 | }; | 581 | }; |
582 | // case 1: { | 582 | // case 1: { |
583 | DocLnk lnk; | 583 | DocLnk lnk; |
584 | QString filename; | 584 | QString filename; |
585 | 585 | ||
586 | filename=it->text(3); | 586 | filename=it->text(3); |
587 | lnk.setName( QFileInfo(filename).baseName() ); //sets name | 587 | lnk.setName( QFileInfo(filename).baseName() ); //sets name |
588 | lnk.setFile( filename ); //sets file name | 588 | lnk.setFile( filename ); //sets file name |
589 | d->selectedFiles->addToSelection( lnk); | 589 | d->selectedFiles->addToSelection( lnk); |
590 | 590 | ||
591 | writeCurrentM3u(); | 591 | writeCurrentM3u(); |
592 | tabWidget->setCurrentPage(0); | 592 | tabWidget->setCurrentPage(0); |
593 | 593 | ||
594 | } | 594 | } |
595 | } | 595 | } |
596 | 596 | ||
597 | 597 | ||
598 | void PlayListWidget::tabChanged(QWidget *) { | 598 | void PlayListWidget::tabChanged(QWidget *) { |
599 | 599 | ||
600 | switch ( whichList()) { | 600 | switch ( whichList()) { |
601 | case 0: | 601 | case 0: |
602 | { | 602 | { |
603 | if( !tbDeletePlaylist->isHidden() ) { | 603 | if( !tbDeletePlaylist->isHidden() ) { |
604 | tbDeletePlaylist->hide(); | 604 | tbDeletePlaylist->hide(); |
605 | } | 605 | } |
606 | d->tbRemoveFromList->setEnabled(TRUE); | 606 | d->tbRemoveFromList->setEnabled(TRUE); |
607 | d->tbAddToList->setEnabled(FALSE); | 607 | d->tbAddToList->setEnabled(FALSE); |
608 | } | 608 | } |
609 | break; | 609 | break; |
610 | case 1: | 610 | case 1: |
611 | { | 611 | { |
612 | // audioView->clear(); | 612 | // audioView->clear(); |
613 | if(!audioPopulated) populateAudioView(); | 613 | if(!audioPopulated) populateAudioView(); |
614 | 614 | ||
615 | if( !tbDeletePlaylist->isHidden() ) { | 615 | if( !tbDeletePlaylist->isHidden() ) { |
616 | tbDeletePlaylist->hide(); | 616 | tbDeletePlaylist->hide(); |
617 | } | 617 | } |
618 | d->tbRemoveFromList->setEnabled(FALSE); | 618 | d->tbRemoveFromList->setEnabled(FALSE); |
619 | d->tbAddToList->setEnabled(TRUE); | 619 | d->tbAddToList->setEnabled(TRUE); |
620 | } | 620 | } |
621 | break; | 621 | break; |
622 | case 2: | 622 | case 2: |
623 | { | 623 | { |
624 | // videoView->clear(); | 624 | // videoView->clear(); |
625 | if(!videoPopulated) populateVideoView(); | 625 | if(!videoPopulated) populateVideoView(); |
626 | if( !tbDeletePlaylist->isHidden() ) { | 626 | if( !tbDeletePlaylist->isHidden() ) { |
627 | tbDeletePlaylist->hide(); | 627 | tbDeletePlaylist->hide(); |
628 | } | 628 | } |
629 | d->tbRemoveFromList->setEnabled(FALSE); | 629 | d->tbRemoveFromList->setEnabled(FALSE); |
630 | d->tbAddToList->setEnabled(TRUE); | 630 | d->tbAddToList->setEnabled(TRUE); |
631 | } | 631 | } |
632 | break; | 632 | break; |
633 | case 3: | 633 | case 3: |
634 | { | 634 | { |
635 | if( tbDeletePlaylist->isHidden() ) { | 635 | if( tbDeletePlaylist->isHidden() ) { |
636 | tbDeletePlaylist->show(); | 636 | tbDeletePlaylist->show(); |
637 | } | 637 | } |
638 | playLists->reread(); | 638 | playLists->reread(); |
639 | d->tbAddToList->setEnabled(FALSE); | ||
639 | } | 640 | } |
640 | break; | 641 | break; |
641 | }; | 642 | }; |
642 | } | 643 | } |
643 | 644 | ||
644 | 645 | ||
645 | void PlayListWidget::btnPlay(bool b) { | 646 | void PlayListWidget::btnPlay(bool b) { |
646 | // mediaPlayerState->setPlaying(false); | 647 | // mediaPlayerState->setPlaying(false); |
647 | mediaPlayerState->setPlaying(b); | 648 | mediaPlayerState->setPlaying(b); |
648 | insanityBool=FALSE; | 649 | insanityBool=FALSE; |
649 | } | 650 | } |
650 | 651 | ||
651 | void PlayListWidget::deletePlaylist() { | 652 | void PlayListWidget::deletePlaylist() { |
652 | switch( QMessageBox::information( this, (tr("Remove Playlist?")), | 653 | switch( QMessageBox::information( this, (tr("Remove Playlist?")), |
653 | (tr("You really want to delete\nthis playlist?")), | 654 | (tr("You really want to delete\nthis playlist?")), |
654 | (tr("Yes")), (tr("No")), 0 )){ | 655 | (tr("Yes")), (tr("No")), 0 )){ |
655 | case 0: // Yes clicked, | 656 | case 0: // Yes clicked, |
656 | QFile().remove(playLists->selectedDocument().file()); | 657 | QFile().remove(playLists->selectedDocument().file()); |
657 | QFile().remove(playLists->selectedDocument().linkFile()); | 658 | QFile().remove(playLists->selectedDocument().linkFile()); |
658 | playLists->reread(); | 659 | playLists->reread(); |
659 | break; | 660 | break; |
660 | case 1: // Cancel | 661 | case 1: // Cancel |
661 | break; | 662 | break; |
662 | }; | 663 | }; |
663 | } | 664 | } |
664 | 665 | ||
665 | 666 | ||
666 | void PlayListWidget::playSelected() { | 667 | void PlayListWidget::playSelected() { |
667 | btnPlay( TRUE); | 668 | btnPlay( TRUE); |
668 | } | 669 | } |
669 | 670 | ||
670 | 671 | ||
671 | void PlayListWidget::scanForAudio() { | 672 | void PlayListWidget::scanForAudio() { |
672 | // qDebug("scan for audio"); | 673 | // qDebug("scan for audio"); |
673 | files.detachChildren(); | 674 | files.detachChildren(); |
674 | QListIterator<DocLnk> sdit( files.children() ); | 675 | QListIterator<DocLnk> sdit( files.children() ); |
675 | for ( ; sdit.current(); ++sdit ) { | 676 | for ( ; sdit.current(); ++sdit ) { |
676 | delete sdit.current(); | 677 | delete sdit.current(); |
677 | } | 678 | } |
678 | // Global::findDocuments( &files, "audio/*"); | 679 | // Global::findDocuments( &files, "audio/*"); |
679 | Global::findDocuments( &files, audioMimes); | 680 | Global::findDocuments( &files, audioMimes); |
680 | audioScan = true; | 681 | audioScan = true; |
681 | populateAudioView(); | 682 | populateAudioView(); |
682 | } | 683 | } |
683 | 684 | ||
684 | void PlayListWidget::scanForVideo() { | 685 | void PlayListWidget::scanForVideo() { |
685 | // qDebug("scan for video"); | 686 | // qDebug("scan for video"); |
686 | vFiles.detachChildren(); | 687 | vFiles.detachChildren(); |
687 | QListIterator<DocLnk> sdit( vFiles.children() ); | 688 | QListIterator<DocLnk> sdit( vFiles.children() ); |
688 | for ( ; sdit.current(); ++sdit ) { | 689 | for ( ; sdit.current(); ++sdit ) { |
689 | delete sdit.current(); | 690 | delete sdit.current(); |
690 | } | 691 | } |
691 | Global::findDocuments(&vFiles, "video/*"); | 692 | Global::findDocuments(&vFiles, "video/*"); |
692 | videoScan = true; | 693 | videoScan = true; |
693 | populateVideoView(); | 694 | populateVideoView(); |
694 | } | 695 | } |
695 | 696 | ||
696 | void PlayListWidget::populateAudioView() { | 697 | void PlayListWidget::populateAudioView() { |
697 | audioView->clear(); | 698 | audioView->clear(); |
698 | StorageInfo storageInfo; | 699 | StorageInfo storageInfo; |
699 | // const QList<FileSystem> &fs = storageInfo.fileSystems(); | 700 | // const QList<FileSystem> &fs = storageInfo.fileSystems(); |
700 | if(!audioScan) { | 701 | if(!audioScan) { |
701 | scanForAudio(); | 702 | scanForAudio(); |
702 | } | 703 | } |
703 | 704 | ||
704 | QListIterator<DocLnk> dit( files.children() ); | 705 | QListIterator<DocLnk> dit( files.children() ); |
705 | // QListIterator<FileSystem> it ( fs ); | 706 | // QListIterator<FileSystem> it ( fs ); |
706 | audioView->clear(); | 707 | audioView->clear(); |
707 | 708 | ||
708 | QString storage; | 709 | QString storage; |
709 | for ( ; dit.current(); ++dit ) { | 710 | for ( ; dit.current(); ++dit ) { |
710 | // // for( ; it.current(); ++it ){ | 711 | // // for( ; it.current(); ++it ){ |
711 | // const QString name = (*dit)->name(); | 712 | // const QString name = (*dit)->name(); |
712 | // const QString path = (*dit)->path(); | 713 | // const QString path = (*dit)->path(); |
713 | // if(dit.current()->file().find(path) != -1 ) { | 714 | // if(dit.current()->file().find(path) != -1 ) { |
714 | // storage = name; | 715 | // storage = name; |
715 | // // } | 716 | // // } |
716 | // } | 717 | // } |
717 | 718 | ||
718 | QListViewItem * newItem; | 719 | QListViewItem * newItem; |
719 | if ( QFile( dit.current()->file()).exists() || | 720 | if ( QFile( dit.current()->file()).exists() || |
720 | dit.current()->file().left(4) == "http" ) { | 721 | dit.current()->file().left(4) == "http" ) { |
721 | long size; | 722 | long size; |
722 | if( dit.current()->file().left(4) == "http" ) | 723 | if( dit.current()->file().left(4) == "http" ) |
723 | size=0; | 724 | size=0; |
724 | else | 725 | else |
725 | size = QFile( dit.current()->file() ).size(); | 726 | size = QFile( dit.current()->file() ).size(); |
726 | 727 | ||
727 | newItem= /*(void)*/ new QListViewItem( audioView, dit.current()->name(), | 728 | newItem= /*(void)*/ new QListViewItem( audioView, dit.current()->name(), |
728 | QString::number(size ), "" /*storage*/, | 729 | QString::number(size ), "" /*storage*/, |
729 | dit.current()->file() ); | 730 | dit.current()->file() ); |
730 | newItem->setPixmap( 0, Resource::loadPixmap( "opieplayer2/musicfile" ) ); | 731 | newItem->setPixmap( 0, Resource::loadPixmap( "opieplayer2/musicfile" ) ); |
731 | // qDebug("<<<< "+dit.current()->file()); | 732 | // qDebug("<<<< "+dit.current()->file()); |
732 | } | 733 | } |
733 | } | 734 | } |
734 | audioPopulated=true; | 735 | audioPopulated=true; |