author | mickeyl <mickeyl> | 2004-04-04 13:54:40 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2004-04-04 13:54:40 (UTC) |
commit | 16cf79e90b5217f8d4bfce2a0fa817ae4b73db36 (patch) (unidiff) | |
tree | 0701eae15aa606a0211a2fccfde0eafdac69357c /noncore/multimedia/opieplayer2/playlistwidget.cpp | |
parent | 8d2d2664e5f544b8292806e617deb7a0e4170dc0 (diff) | |
download | opie-16cf79e90b5217f8d4bfce2a0fa817ae4b73db36.zip opie-16cf79e90b5217f8d4bfce2a0fa817ae4b73db36.tar.gz opie-16cf79e90b5217f8d4bfce2a0fa817ae4b73db36.tar.bz2 |
convert to Opie Debugging Framework
Diffstat (limited to 'noncore/multimedia/opieplayer2/playlistwidget.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/multimedia/opieplayer2/playlistwidget.cpp | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/noncore/multimedia/opieplayer2/playlistwidget.cpp b/noncore/multimedia/opieplayer2/playlistwidget.cpp index 4460833..956d206 100644 --- a/noncore/multimedia/opieplayer2/playlistwidget.cpp +++ b/noncore/multimedia/opieplayer2/playlistwidget.cpp | |||
@@ -173,29 +173,29 @@ void PlayListWidget::initializeStates() { | |||
173 | d->tbShuffle->setOn( mediaPlayerState->isShuffled() ); | 173 | d->tbShuffle->setOn( mediaPlayerState->isShuffled() ); |
174 | d->playListFrame->show(); | 174 | d->playListFrame->show(); |
175 | } | 175 | } |
176 | 176 | ||
177 | void PlayListWidget::writeDefaultPlaylist() { | 177 | void PlayListWidget::writeDefaultPlaylist() { |
178 | 178 | ||
179 | Config config( "OpiePlayer" ); | 179 | Config config( "OpiePlayer" ); |
180 | config.setGroup( "PlayList" ); | 180 | config.setGroup( "PlayList" ); |
181 | QString filename=QPEApplication::documentDir() + "/default.m3u"; | 181 | QString filename=QPEApplication::documentDir() + "/default.m3u"; |
182 | QString currentString = config.readEntry( "CurrentPlaylist", filename); | 182 | QString currentString = config.readEntry( "CurrentPlaylist", filename); |
183 | if( currentString == filename) { | 183 | if( currentString == filename) { |
184 | Om3u *m3uList; | 184 | Om3u *m3uList; |
185 | // qDebug("<<<<<<<<<<<<<default>>>>>>>>>>>>>>>>>>>"); | 185 | // odebug << "<<<<<<<<<<<<<default>>>>>>>>>>>>>>>>>>>" << oendl; |
186 | if( d->selectedFiles->first() ) { | 186 | if( d->selectedFiles->first() ) { |
187 | m3uList = new Om3u(filename, IO_ReadWrite | IO_Truncate); | 187 | m3uList = new Om3u(filename, IO_ReadWrite | IO_Truncate); |
188 | do { | 188 | do { |
189 | // qDebug(d->selectedFiles->current()->file()); | 189 | // odebug << d->selectedFiles->current()->file() << oendl; |
190 | m3uList->add( d->selectedFiles->current()->file() ); | 190 | m3uList->add( d->selectedFiles->current()->file() ); |
191 | } | 191 | } |
192 | while ( d->selectedFiles->next() ); | 192 | while ( d->selectedFiles->next() ); |
193 | 193 | ||
194 | m3uList->write(); | 194 | m3uList->write(); |
195 | m3uList->close(); | 195 | m3uList->close(); |
196 | delete m3uList; | 196 | delete m3uList; |
197 | 197 | ||
198 | } | 198 | } |
199 | } | 199 | } |
200 | } | 200 | } |
201 | 201 | ||
@@ -316,25 +316,25 @@ void PlayListWidget::addAllVideoToList() { | |||
316 | filename = videoIt.current()->text(3); | 316 | filename = videoIt.current()->text(3); |
317 | lnk.setName( QFileInfo(filename).baseName() ); //sets name | 317 | lnk.setName( QFileInfo(filename).baseName() ); //sets name |
318 | lnk.setFile( filename ); //sets file name | 318 | lnk.setFile( filename ); //sets file name |
319 | d->selectedFiles->addToSelection( lnk); | 319 | d->selectedFiles->addToSelection( lnk); |
320 | } | 320 | } |
321 | tabWidget->setCurrentPage(0); | 321 | tabWidget->setCurrentPage(0); |
322 | writeCurrentM3u(); | 322 | writeCurrentM3u(); |
323 | d->selectedFiles->first(); | 323 | d->selectedFiles->first(); |
324 | } | 324 | } |
325 | 325 | ||
326 | 326 | ||
327 | void PlayListWidget::setDocument( const QString& fileref ) { | 327 | void PlayListWidget::setDocument( const QString& fileref ) { |
328 | // qDebug( "<<<<<<<<set document>>>>>>>>>> "+fileref ); | 328 | // odebug << "<<<<<<<<set document>>>>>>>>>> "+fileref << oendl; |
329 | fromSetDocument = TRUE; | 329 | fromSetDocument = TRUE; |
330 | QFileInfo fileInfo(fileref); | 330 | QFileInfo fileInfo(fileref); |
331 | 331 | ||
332 | if ( !fileInfo.exists() ) { | 332 | if ( !fileInfo.exists() ) { |
333 | QMessageBox::warning( this, tr( "Invalid File" ), | 333 | QMessageBox::warning( this, tr( "Invalid File" ), |
334 | tr( "There was a problem in getting the file." ) ); | 334 | tr( "There was a problem in getting the file." ) ); |
335 | return; | 335 | return; |
336 | } | 336 | } |
337 | 337 | ||
338 | clearList(); | 338 | clearList(); |
339 | QString extension = fileInfo.extension(false); | 339 | QString extension = fileInfo.extension(false); |
340 | 340 | ||
@@ -392,25 +392,25 @@ bool PlayListWidget::prev() { | |||
392 | if ( mediaPlayerState->isLooping() ) { | 392 | if ( mediaPlayerState->isLooping() ) { |
393 | return d->selectedFiles->last(); | 393 | return d->selectedFiles->last(); |
394 | } else { | 394 | } else { |
395 | return FALSE; | 395 | return FALSE; |
396 | } | 396 | } |
397 | } | 397 | } |
398 | return TRUE; | 398 | return TRUE; |
399 | } | 399 | } |
400 | } | 400 | } |
401 | 401 | ||
402 | 402 | ||
403 | bool PlayListWidget::next() { | 403 | bool PlayListWidget::next() { |
404 | //qDebug("<<<<<<<<<<<<next()"); | 404 | //odebug << "<<<<<<<<<<<<next()" << oendl; |
405 | if ( mediaPlayerState->isShuffled() ) { | 405 | if ( mediaPlayerState->isShuffled() ) { |
406 | return prev(); | 406 | return prev(); |
407 | } else { | 407 | } else { |
408 | if ( !d->selectedFiles->next() ) { | 408 | if ( !d->selectedFiles->next() ) { |
409 | if ( mediaPlayerState->isLooping() ) { | 409 | if ( mediaPlayerState->isLooping() ) { |
410 | return d->selectedFiles->first(); | 410 | return d->selectedFiles->first(); |
411 | } else { | 411 | } else { |
412 | return FALSE; | 412 | return FALSE; |
413 | } | 413 | } |
414 | } | 414 | } |
415 | return TRUE; | 415 | return TRUE; |
416 | } | 416 | } |
@@ -603,25 +603,25 @@ bool PlayListWidget::inFileListMode() const | |||
603 | return tab == AudioFiles || tab == VideoFiles; | 603 | return tab == AudioFiles || tab == VideoFiles; |
604 | } | 604 | } |
605 | 605 | ||
606 | void PlayListWidget::openURL() { | 606 | void PlayListWidget::openURL() { |
607 | // http://66.28.164.33:2080 | 607 | // http://66.28.164.33:2080 |
608 | // http://somafm.com/star0242.m3u | 608 | // http://somafm.com/star0242.m3u |
609 | QString filename, name; | 609 | QString filename, name; |
610 | InputDialog *fileDlg; | 610 | InputDialog *fileDlg; |
611 | fileDlg = new InputDialog(this,tr("Add URL"),TRUE, 0); | 611 | fileDlg = new InputDialog(this,tr("Add URL"),TRUE, 0); |
612 | fileDlg->exec(); | 612 | fileDlg->exec(); |
613 | if( fileDlg->result() == 1 ) { | 613 | if( fileDlg->result() == 1 ) { |
614 | filename = fileDlg->text(); | 614 | filename = fileDlg->text(); |
615 | qDebug( "Selected filename is " + filename ); | 615 | odebug << "Selected filename is " + filename << oendl; |
616 | // Om3u *m3uList; | 616 | // Om3u *m3uList; |
617 | DocLnk lnk; | 617 | DocLnk lnk; |
618 | Config cfg( "OpiePlayer" ); | 618 | Config cfg( "OpiePlayer" ); |
619 | cfg.setGroup("PlayList"); | 619 | cfg.setGroup("PlayList"); |
620 | 620 | ||
621 | if(filename.left(4) == "http") { | 621 | if(filename.left(4) == "http") { |
622 | QString m3uFile, m3uFilePath; | 622 | QString m3uFile, m3uFilePath; |
623 | if(filename.find(":",8,TRUE) != -1) { //found a port | 623 | if(filename.find(":",8,TRUE) != -1) { //found a port |
624 | m3uFile = filename.left( filename.find( ":",8,TRUE)); | 624 | m3uFile = filename.left( filename.find( ":",8,TRUE)); |
625 | m3uFile = m3uFile.right( 7); | 625 | m3uFile = m3uFile.right( 7); |
626 | } else if(filename.left(4) == "http"){ | 626 | } else if(filename.left(4) == "http"){ |
627 | m3uFile=filename; | 627 | m3uFile=filename; |
@@ -679,56 +679,56 @@ void PlayListWidget::openFile() { | |||
679 | 679 | ||
680 | QString str = OFileDialog::getOpenFileName( 1, | 680 | QString str = OFileDialog::getOpenFileName( 1, |
681 | cfg.readEntry("LastDirectory",QPEApplication::documentDir()),"", | 681 | cfg.readEntry("LastDirectory",QPEApplication::documentDir()),"", |
682 | types, 0 ); | 682 | types, 0 ); |
683 | 683 | ||
684 | if(str.left(2) == "//") { | 684 | if(str.left(2) == "//") { |
685 | str=str.right(str.length()-1); | 685 | str=str.right(str.length()-1); |
686 | } | 686 | } |
687 | cfg.writeEntry( "LastDirectory" ,QFileInfo( str ).dirPath() ); | 687 | cfg.writeEntry( "LastDirectory" ,QFileInfo( str ).dirPath() ); |
688 | 688 | ||
689 | if( !str.isEmpty() ) { | 689 | if( !str.isEmpty() ) { |
690 | 690 | ||
691 | qDebug( "Selected filename is " + str ); | 691 | odebug << "Selected filename is " + str << oendl; |
692 | filename = str; | 692 | filename = str; |
693 | DocLnk lnk; | 693 | DocLnk lnk; |
694 | 694 | ||
695 | if( filename.right( 3) == "m3u" || filename.right(3) == "pls" ) { | 695 | if( filename.right( 3) == "m3u" || filename.right(3) == "pls" ) { |
696 | readListFromFile( filename ); | 696 | readListFromFile( filename ); |
697 | } else { | 697 | } else { |
698 | lnk.setName( QFileInfo(filename).baseName() ); //sets name | 698 | lnk.setName( QFileInfo(filename).baseName() ); //sets name |
699 | lnk.setFile( filename ); //sets file name | 699 | lnk.setFile( filename ); //sets file name |
700 | d->selectedFiles->addToSelection( lnk ); | 700 | d->selectedFiles->addToSelection( lnk ); |
701 | writeCurrentM3u(); | 701 | writeCurrentM3u(); |
702 | d->selectedFiles->setSelectedItem( lnk.name() ); | 702 | d->selectedFiles->setSelectedItem( lnk.name() ); |
703 | } | 703 | } |
704 | } | 704 | } |
705 | } | 705 | } |
706 | 706 | ||
707 | 707 | ||
708 | void PlayListWidget::readListFromFile( const QString &filename ) { | 708 | void PlayListWidget::readListFromFile( const QString &filename ) { |
709 | qDebug( "read list filename " + filename ); | 709 | odebug << "read list filename " + filename << oendl; |
710 | QFileInfo fi(filename); | 710 | QFileInfo fi(filename); |
711 | Om3u *m3uList; | 711 | Om3u *m3uList; |
712 | QString s, name; | 712 | QString s, name; |
713 | m3uList = new Om3u( filename, IO_ReadOnly ); | 713 | m3uList = new Om3u( filename, IO_ReadOnly ); |
714 | if(fi.extension(false).find("m3u",0,false) != -1 ) | 714 | if(fi.extension(false).find("m3u",0,false) != -1 ) |
715 | m3uList->readM3u(); | 715 | m3uList->readM3u(); |
716 | else if(fi.extension(false).find("pls",0,false) != -1 ) | 716 | else if(fi.extension(false).find("pls",0,false) != -1 ) |
717 | m3uList->readPls(); | 717 | m3uList->readPls(); |
718 | 718 | ||
719 | DocLnk lnk; | 719 | DocLnk lnk; |
720 | for ( QStringList::ConstIterator it = m3uList->begin(); it != m3uList->end(); ++it ) { | 720 | for ( QStringList::ConstIterator it = m3uList->begin(); it != m3uList->end(); ++it ) { |
721 | s = *it; | 721 | s = *it; |
722 | // qDebug(s); | 722 | // odebug << s << oendl; |
723 | if(s.left(4)=="http") { | 723 | if(s.left(4)=="http") { |
724 | lnk.setName( s ); //sets file name | 724 | lnk.setName( s ); //sets file name |
725 | lnk.setIcon("opieplayer2/musicfile"); | 725 | lnk.setIcon("opieplayer2/musicfile"); |
726 | lnk.setFile( s ); //sets file name | 726 | lnk.setFile( s ); //sets file name |
727 | 727 | ||
728 | } else { //is file | 728 | } else { //is file |
729 | lnk.setName( QFileInfo(s).baseName()); | 729 | lnk.setName( QFileInfo(s).baseName()); |
730 | if(s.left(1) != "/") { | 730 | if(s.left(1) != "/") { |
731 | 731 | ||
732 | lnk.setFile( QFileInfo(filename).dirPath()+"/"+s); | 732 | lnk.setFile( QFileInfo(filename).dirPath()+"/"+s); |
733 | } else { | 733 | } else { |
734 | lnk.setFile( s); | 734 | lnk.setFile( s); |
@@ -744,39 +744,39 @@ void PlayListWidget::readListFromFile( const QString &filename ) { | |||
744 | currentPlayList=filename; | 744 | currentPlayList=filename; |
745 | 745 | ||
746 | m3uList->close(); | 746 | m3uList->close(); |
747 | delete m3uList; | 747 | delete m3uList; |
748 | 748 | ||
749 | d->selectedFiles->setSelectedItem( s); | 749 | d->selectedFiles->setSelectedItem( s); |
750 | setCaption(tr("OpiePlayer: ")+ QFileInfo(filename).baseName()); | 750 | setCaption(tr("OpiePlayer: ")+ QFileInfo(filename).baseName()); |
751 | 751 | ||
752 | } | 752 | } |
753 | 753 | ||
754 | // writes current playlist to current m3u file */ | 754 | // writes current playlist to current m3u file */ |
755 | void PlayListWidget::writeCurrentM3u() { | 755 | void PlayListWidget::writeCurrentM3u() { |
756 | qDebug("writing to current m3u"); | 756 | odebug << "writing to current m3u" << oendl; |
757 | Config cfg( "OpiePlayer" ); | 757 | Config cfg( "OpiePlayer" ); |
758 | cfg.setGroup("PlayList"); | 758 | cfg.setGroup("PlayList"); |
759 | QString currentPlaylist = cfg.readEntry("CurrentPlaylist","default"); | 759 | QString currentPlaylist = cfg.readEntry("CurrentPlaylist","default"); |
760 | 760 | ||
761 | Om3u *m3uList; | 761 | Om3u *m3uList; |
762 | m3uList = new Om3u( currentPlaylist, IO_ReadWrite | IO_Truncate ); | 762 | m3uList = new Om3u( currentPlaylist, IO_ReadWrite | IO_Truncate ); |
763 | if( d->selectedFiles->first()) { | 763 | if( d->selectedFiles->first()) { |
764 | 764 | ||
765 | do { | 765 | do { |
766 | // qDebug( "add writeCurrentM3u " +d->selectedFiles->current()->file()); | 766 | // odebug << "add writeCurrentM3u " +d->selectedFiles->current()->file() << oendl; |
767 | m3uList->add( d->selectedFiles->current()->file() ); | 767 | m3uList->add( d->selectedFiles->current()->file() ); |
768 | } | 768 | } |
769 | while ( d->selectedFiles->next() ); | 769 | while ( d->selectedFiles->next() ); |
770 | // qDebug( "<<<<<<<<<<<<>>>>>>>>>>>>>>>>>" ); | 770 | // odebug << "<<<<<<<<<<<<>>>>>>>>>>>>>>>>>" << oendl; |
771 | m3uList->write(); | 771 | m3uList->write(); |
772 | m3uList->close(); | 772 | m3uList->close(); |
773 | } | 773 | } |
774 | delete m3uList; | 774 | delete m3uList; |
775 | 775 | ||
776 | } | 776 | } |
777 | 777 | ||
778 | /* | 778 | /* |
779 | writes current playlist to m3u file */ | 779 | writes current playlist to m3u file */ |
780 | void PlayListWidget::writem3u() { | 780 | void PlayListWidget::writem3u() { |
781 | //InputDilog *fileDlg; | 781 | //InputDilog *fileDlg; |
782 | //fileDlg = new InputDialog( this, tr( "Save m3u Playlist " ), TRUE, 0); | 782 | //fileDlg = new InputDialog( this, tr( "Save m3u Playlist " ), TRUE, 0); |
@@ -803,63 +803,63 @@ void PlayListWidget::writem3u() { | |||
803 | cfg.readEntry("LastDirectory",QPEApplication::documentDir()),"", | 803 | cfg.readEntry("LastDirectory",QPEApplication::documentDir()),"", |
804 | types, 0 ); | 804 | types, 0 ); |
805 | if(str.left(2) == "//") str=str.right(str.length()-1); | 805 | if(str.left(2) == "//") str=str.right(str.length()-1); |
806 | cfg.writeEntry("LastDirectory" ,QFileInfo(str).dirPath()); | 806 | cfg.writeEntry("LastDirectory" ,QFileInfo(str).dirPath()); |
807 | 807 | ||
808 | 808 | ||
809 | QString name, filename, list; | 809 | QString name, filename, list; |
810 | Om3u *m3uList; | 810 | Om3u *m3uList; |
811 | 811 | ||
812 | if( !str.isEmpty() ) { | 812 | if( !str.isEmpty() ) { |
813 | name = str; | 813 | name = str; |
814 | // name = fileDlg->text(); | 814 | // name = fileDlg->text(); |
815 | // qDebug( filename ); | 815 | // odebug << filename << oendl; |
816 | if( name.find("/",0,true) != -1) {// assume they specify a file path | 816 | if( name.find("/",0,true) != -1) {// assume they specify a file path |
817 | filename = name; | 817 | filename = name; |
818 | name = name.right(name.length()- name.findRev("/",-1,true) - 1 ); | 818 | name = name.right(name.length()- name.findRev("/",-1,true) - 1 ); |
819 | } | 819 | } |
820 | else //otherwise dump it somewhere noticable | 820 | else //otherwise dump it somewhere noticable |
821 | filename = QPEApplication::documentDir() + "/" + name; | 821 | filename = QPEApplication::documentDir() + "/" + name; |
822 | 822 | ||
823 | if( filename.right( 3 ) != "m3u" ) //needs filename extension | 823 | if( filename.right( 3 ) != "m3u" ) //needs filename extension |
824 | filename += ".m3u"; | 824 | filename += ".m3u"; |
825 | 825 | ||
826 | if( d->selectedFiles->first()) { //ramble through playlist view | 826 | if( d->selectedFiles->first()) { //ramble through playlist view |
827 | m3uList = new Om3u( filename, IO_ReadWrite | IO_Truncate); | 827 | m3uList = new Om3u( filename, IO_ReadWrite | IO_Truncate); |
828 | 828 | ||
829 | do { | 829 | do { |
830 | m3uList->add( d->selectedFiles->current()->file()); | 830 | m3uList->add( d->selectedFiles->current()->file()); |
831 | } | 831 | } |
832 | while ( d->selectedFiles->next() ); | 832 | while ( d->selectedFiles->next() ); |
833 | // qDebug( list ); | 833 | // odebug << list << oendl; |
834 | m3uList->write(); | 834 | m3uList->write(); |
835 | m3uList->close(); | 835 | m3uList->close(); |
836 | delete m3uList; | 836 | delete m3uList; |
837 | 837 | ||
838 | //delete fileDlg; | 838 | //delete fileDlg; |
839 | 839 | ||
840 | DocLnk lnk; | 840 | DocLnk lnk; |
841 | lnk.setFile( filename); | 841 | lnk.setFile( filename); |
842 | lnk.setIcon("opieplayer2/playlist2"); | 842 | lnk.setIcon("opieplayer2/playlist2"); |
843 | lnk.setName( name); //sets file name | 843 | lnk.setName( name); //sets file name |
844 | 844 | ||
845 | // qDebug(filename); | 845 | // odebug << filename << oendl; |
846 | Config config( "OpiePlayer" ); | 846 | Config config( "OpiePlayer" ); |
847 | config.setGroup( "PlayList" ); | 847 | config.setGroup( "PlayList" ); |
848 | 848 | ||
849 | config.writeEntry("CurrentPlaylist",filename); | 849 | config.writeEntry("CurrentPlaylist",filename); |
850 | currentPlayList=filename; | 850 | currentPlayList=filename; |
851 | 851 | ||
852 | if(!lnk.writeLink()) { | 852 | if(!lnk.writeLink()) { |
853 | qDebug("Writing doclink did not work"); | 853 | odebug << "Writing doclink did not work" << oendl; |
854 | } | 854 | } |
855 | 855 | ||
856 | setCaption(tr("OpiePlayer: ") + name); | 856 | setCaption(tr("OpiePlayer: ") + name); |
857 | } | 857 | } |
858 | } | 858 | } |
859 | } | 859 | } |
860 | 860 | ||
861 | void PlayListWidget::keyReleaseEvent( QKeyEvent *e ) { | 861 | void PlayListWidget::keyReleaseEvent( QKeyEvent *e ) { |
862 | switch ( e->key() ) { | 862 | switch ( e->key() ) { |
863 | ////////////////////////////// Zaurus keys | 863 | ////////////////////////////// Zaurus keys |
864 | case Key_F9: //activity | 864 | case Key_F9: //activity |
865 | // if(audioUI->isHidden()) | 865 | // if(audioUI->isHidden()) |
@@ -875,25 +875,25 @@ void PlayListWidget::keyReleaseEvent( QKeyEvent *e ) { | |||
875 | // doBlank(); | 875 | // doBlank(); |
876 | break; | 876 | break; |
877 | case Key_F13: //mail | 877 | case Key_F13: //mail |
878 | // doUnblank(); | 878 | // doUnblank(); |
879 | break; | 879 | break; |
880 | case Key_Q: //add to playlist | 880 | case Key_Q: //add to playlist |
881 | addSelected(); | 881 | addSelected(); |
882 | break; | 882 | break; |
883 | case Key_R: //remove from playlist | 883 | case Key_R: //remove from playlist |
884 | removeSelected(); | 884 | removeSelected(); |
885 | break; | 885 | break; |
886 | // case Key_P: //play | 886 | // case Key_P: //play |
887 | // qDebug("Play"); | 887 | // odebug << "Play" << oendl; |
888 | // playSelected(); | 888 | // playSelected(); |
889 | // break; | 889 | // break; |
890 | case Key_Space: | 890 | case Key_Space: |
891 | // playSelected(); puh | 891 | // playSelected(); puh |
892 | break; | 892 | break; |
893 | case Key_1: | 893 | case Key_1: |
894 | tabWidget->setCurrentPage( 0 ); | 894 | tabWidget->setCurrentPage( 0 ); |
895 | break; | 895 | break; |
896 | case Key_2: | 896 | case Key_2: |
897 | tabWidget->setCurrentPage( 1 ); | 897 | tabWidget->setCurrentPage( 1 ); |
898 | break; | 898 | break; |
899 | case Key_3: | 899 | case Key_3: |
@@ -905,25 +905,25 @@ void PlayListWidget::keyReleaseEvent( QKeyEvent *e ) { | |||
905 | case Key_Down: | 905 | case Key_Down: |
906 | if ( !d->selectedFiles->next() ) | 906 | if ( !d->selectedFiles->next() ) |
907 | d->selectedFiles->first(); | 907 | d->selectedFiles->first(); |
908 | break; | 908 | break; |
909 | case Key_Up: | 909 | case Key_Up: |
910 | if ( !d->selectedFiles->prev() ) | 910 | if ( !d->selectedFiles->prev() ) |
911 | // d->selectedFiles->last(); | 911 | // d->selectedFiles->last(); |
912 | break; | 912 | break; |
913 | } | 913 | } |
914 | } | 914 | } |
915 | 915 | ||
916 | void PlayListWidget::pmViewActivated(int index) { | 916 | void PlayListWidget::pmViewActivated(int index) { |
917 | // qDebug("%d", index); | 917 | // odebug << "" << index << "" << oendl; |
918 | switch(index) { | 918 | switch(index) { |
919 | case -16: | 919 | case -16: |
920 | { | 920 | { |
921 | mediaPlayerState->toggleFullscreen(); | 921 | mediaPlayerState->toggleFullscreen(); |
922 | bool b=mediaPlayerState->isFullscreen(); | 922 | bool b=mediaPlayerState->isFullscreen(); |
923 | pmView->setItemChecked( index, b); | 923 | pmView->setItemChecked( index, b); |
924 | Config cfg( "OpiePlayer" ); | 924 | Config cfg( "OpiePlayer" ); |
925 | cfg.writeEntry( "FullScreen", b ); | 925 | cfg.writeEntry( "FullScreen", b ); |
926 | } | 926 | } |
927 | break; | 927 | break; |
928 | }; | 928 | }; |
929 | } | 929 | } |
@@ -935,25 +935,25 @@ void PlayListWidget::populateSkinsMenu() { | |||
935 | Config cfg( "OpiePlayer" ); | 935 | Config cfg( "OpiePlayer" ); |
936 | cfg.setGroup("Options" ); | 936 | cfg.setGroup("Options" ); |
937 | QString skin = cfg.readEntry( "Skin", "default" ); | 937 | QString skin = cfg.readEntry( "Skin", "default" ); |
938 | 938 | ||
939 | QDir skinsDir( QPEApplication::qpeDir() + "/pics/opieplayer2/skins" ); | 939 | QDir skinsDir( QPEApplication::qpeDir() + "/pics/opieplayer2/skins" ); |
940 | skinsDir.setFilter( QDir::Dirs ); | 940 | skinsDir.setFilter( QDir::Dirs ); |
941 | skinsDir.setSorting(QDir::Name ); | 941 | skinsDir.setSorting(QDir::Name ); |
942 | const QFileInfoList *skinslist = skinsDir.entryInfoList(); | 942 | const QFileInfoList *skinslist = skinsDir.entryInfoList(); |
943 | QFileInfoListIterator it( *skinslist ); | 943 | QFileInfoListIterator it( *skinslist ); |
944 | QFileInfo *fi; | 944 | QFileInfo *fi; |
945 | while ( ( fi = it.current() ) ) { | 945 | while ( ( fi = it.current() ) ) { |
946 | skinName = fi->fileName(); | 946 | skinName = fi->fileName(); |
947 | // qDebug( fi->fileName() ); | 947 | // odebug << fi->fileName() << oendl; |
948 | if( skinName != "." && skinName != ".." && skinName !="CVS" ) { | 948 | if( skinName != "." && skinName != ".." && skinName !="CVS" ) { |
949 | item = skinsMenu->insertItem( fi->fileName() ) ; | 949 | item = skinsMenu->insertItem( fi->fileName() ) ; |
950 | } | 950 | } |
951 | if( skinName == "default" ) { | 951 | if( skinName == "default" ) { |
952 | defaultSkinIndex = item; | 952 | defaultSkinIndex = item; |
953 | } | 953 | } |
954 | if( skinName == skin ) { | 954 | if( skinName == skin ) { |
955 | skinsMenu->setItemChecked( item, TRUE ); | 955 | skinsMenu->setItemChecked( item, TRUE ); |
956 | } | 956 | } |
957 | ++it; | 957 | ++it; |
958 | } | 958 | } |
959 | } | 959 | } |
@@ -991,25 +991,25 @@ PlayListWidget::Entry PlayListWidget::currentEntry() const | |||
991 | return Entry( lnk->name(), lnk->file() ); | 991 | return Entry( lnk->name(), lnk->file() ); |
992 | } | 992 | } |
993 | 993 | ||
994 | return Entry( currentFileListPathName() ); | 994 | return Entry( currentFileListPathName() ); |
995 | } | 995 | } |
996 | 996 | ||
997 | QString PlayListWidget::currentFileListPathName() const { | 997 | QString PlayListWidget::currentFileListPathName() const { |
998 | return currentFileListView->currentItem()->text( 3 ); | 998 | return currentFileListView->currentItem()->text( 3 ); |
999 | } | 999 | } |
1000 | 1000 | ||
1001 | 1001 | ||
1002 | void PlayListWidget::qcopReceive(const QCString &msg, const QByteArray &data) { | 1002 | void PlayListWidget::qcopReceive(const QCString &msg, const QByteArray &data) { |
1003 | qDebug("qcop message "+msg ); | 1003 | odebug << "qcop message "+msg << oendl; |
1004 | QDataStream stream ( data, IO_ReadOnly ); | 1004 | QDataStream stream ( data, IO_ReadOnly ); |
1005 | if ( msg == "play()" ) { //plays current selection | 1005 | if ( msg == "play()" ) { //plays current selection |
1006 | btnPlay( true); | 1006 | btnPlay( true); |
1007 | } else if ( msg == "stop()" ) { | 1007 | } else if ( msg == "stop()" ) { |
1008 | mediaPlayerState->setPlaying( false); | 1008 | mediaPlayerState->setPlaying( false); |
1009 | } else if ( msg == "togglePause()" ) { | 1009 | } else if ( msg == "togglePause()" ) { |
1010 | mediaPlayerState->togglePaused(); | 1010 | mediaPlayerState->togglePaused(); |
1011 | } else if ( msg == "next()" ) { //select next in list | 1011 | } else if ( msg == "next()" ) { //select next in list |
1012 | mediaPlayerState->setNext(); | 1012 | mediaPlayerState->setNext(); |
1013 | } else if ( msg == "prev()" ) { //select previous in list | 1013 | } else if ( msg == "prev()" ) { //select previous in list |
1014 | mediaPlayerState->setPrev(); | 1014 | mediaPlayerState->setPrev(); |
1015 | } else if ( msg == "toggleLooping()" ) { //loop or not loop | 1015 | } else if ( msg == "toggleLooping()" ) { //loop or not loop |