Diffstat (limited to 'noncore/multimedia/opieplayer2') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/multimedia/opieplayer2/playlistwidget.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/noncore/multimedia/opieplayer2/playlistwidget.cpp b/noncore/multimedia/opieplayer2/playlistwidget.cpp index dc2c496..2e9553f 100644 --- a/noncore/multimedia/opieplayer2/playlistwidget.cpp +++ b/noncore/multimedia/opieplayer2/playlistwidget.cpp | |||
@@ -856,193 +856,193 @@ void PlayListWidget::writem3u() { | |||
856 | lnk.setName( name); //sets file name | 856 | lnk.setName( name); //sets file name |
857 | 857 | ||
858 | // odebug << filename << oendl; | 858 | // odebug << filename << oendl; |
859 | Config config( "OpiePlayer" ); | 859 | Config config( "OpiePlayer" ); |
860 | config.setGroup( "PlayList" ); | 860 | config.setGroup( "PlayList" ); |
861 | 861 | ||
862 | config.writeEntry("CurrentPlaylist",filename); | 862 | config.writeEntry("CurrentPlaylist",filename); |
863 | currentPlayList=filename; | 863 | currentPlayList=filename; |
864 | 864 | ||
865 | if(!lnk.writeLink()) { | 865 | if(!lnk.writeLink()) { |
866 | odebug << "Writing doclink did not work" << oendl; | 866 | odebug << "Writing doclink did not work" << oendl; |
867 | } | 867 | } |
868 | 868 | ||
869 | setCaption(tr("OpiePlayer: ") + name); | 869 | setCaption(tr("OpiePlayer: ") + name); |
870 | } | 870 | } |
871 | } | 871 | } |
872 | } | 872 | } |
873 | 873 | ||
874 | void PlayListWidget::keyReleaseEvent( QKeyEvent *e ) { | 874 | void PlayListWidget::keyReleaseEvent( QKeyEvent *e ) { |
875 | switch ( e->key() ) { | 875 | switch ( e->key() ) { |
876 | ////////////////////////////// Zaurus keys | 876 | ////////////////////////////// Zaurus keys |
877 | case Key_F9: //activity | 877 | case Key_F9: //activity |
878 | // if(audioUI->isHidden()) | 878 | // if(audioUI->isHidden()) |
879 | // audioUI->showMaximized(); | 879 | // audioUI->showMaximized(); |
880 | break; | 880 | break; |
881 | case Key_F10: //contacts | 881 | case Key_F10: //contacts |
882 | // if( videoUI->isHidden()) | 882 | // if( videoUI->isHidden()) |
883 | // videoUI->showMaximized(); | 883 | // videoUI->showMaximized(); |
884 | break; | 884 | break; |
885 | case Key_F11: //menu | 885 | case Key_F11: //menu |
886 | break; | 886 | break; |
887 | case Key_F12: //home | 887 | case Key_F12: //home |
888 | // doBlank(); | 888 | // doBlank(); |
889 | break; | 889 | break; |
890 | case Key_F13: //mail | 890 | case Key_F13: //mail |
891 | // doUnblank(); | 891 | // doUnblank(); |
892 | break; | 892 | break; |
893 | case Key_Q: //add to playlist | 893 | case Key_Q: //add to playlist |
894 | addSelected(); | 894 | addSelected(); |
895 | break; | 895 | break; |
896 | case Key_R: //remove from playlist | 896 | case Key_R: //remove from playlist |
897 | removeSelected(); | 897 | removeSelected(); |
898 | break; | 898 | break; |
899 | // case Key_P: //play | 899 | // case Key_P: //play |
900 | // odebug << "Play" << oendl; | 900 | // odebug << "Play" << oendl; |
901 | // playSelected(); | 901 | // playSelected(); |
902 | // break; | 902 | // break; |
903 | case Key_Space: | 903 | case Key_Space: |
904 | // playSelected(); puh | 904 | // playSelected(); puh |
905 | break; | 905 | break; |
906 | case Key_1: | 906 | case Key_1: |
907 | tabWidget->setCurrentPage( 0 ); | 907 | tabWidget->setCurrentPage( 0 ); |
908 | break; | 908 | break; |
909 | case Key_2: | 909 | case Key_2: |
910 | tabWidget->setCurrentPage( 1 ); | 910 | tabWidget->setCurrentPage( 1 ); |
911 | break; | 911 | break; |
912 | case Key_3: | 912 | case Key_3: |
913 | tabWidget->setCurrentPage( 2 ); | 913 | tabWidget->setCurrentPage( 2 ); |
914 | break; | 914 | break; |
915 | case Key_4: | 915 | case Key_4: |
916 | tabWidget->setCurrentPage( 3 ); | 916 | tabWidget->setCurrentPage( 3 ); |
917 | break; | 917 | break; |
918 | case Key_Down: | 918 | case Key_Down: |
919 | if ( !d->selectedFiles->next() ) | 919 | if ( !d->selectedFiles->next() ) |
920 | d->selectedFiles->first(); | 920 | d->selectedFiles->first(); |
921 | break; | 921 | break; |
922 | case Key_Up: | 922 | case Key_Up: |
923 | if ( !d->selectedFiles->prev() ) | 923 | if ( !d->selectedFiles->prev() ) |
924 | // d->selectedFiles->last(); | 924 | // d->selectedFiles->last(); |
925 | break; | 925 | break; |
926 | } | 926 | } |
927 | } | 927 | } |
928 | 928 | ||
929 | void PlayListWidget::pmViewActivated(int index) { | 929 | void PlayListWidget::pmViewActivated(int index) { |
930 | // odebug << "" << index << "" << oendl; | 930 | // odebug << "" << index << "" << oendl; |
931 | switch(index) { | 931 | switch(index) { |
932 | case -16: | 932 | case -16: |
933 | { | 933 | { |
934 | mediaPlayerState->toggleFullscreen(); | 934 | mediaPlayerState->toggleFullscreen(); |
935 | bool b=mediaPlayerState->isFullscreen(); | 935 | bool b=mediaPlayerState->isFullscreen(); |
936 | pmView->setItemChecked( index, b); | 936 | pmView->setItemChecked( index, b); |
937 | Config cfg( "OpiePlayer" ); | 937 | Config cfg( "OpiePlayer" ); |
938 | cfg.writeEntry( "FullScreen", b ); | 938 | cfg.writeEntry( "FullScreen", b ); |
939 | } | 939 | } |
940 | break; | 940 | break; |
941 | }; | 941 | }; |
942 | } | 942 | } |
943 | 943 | ||
944 | void PlayListWidget::populateSkinsMenu() { | 944 | void PlayListWidget::populateSkinsMenu() { |
945 | int item = 0; | 945 | int item = 0; |
946 | defaultSkinIndex = 0; | 946 | defaultSkinIndex = 0; |
947 | QString skinName; | 947 | QString skinName; |
948 | Config cfg( "OpiePlayer" ); | 948 | Config cfg( "OpiePlayer" ); |
949 | cfg.setGroup("Options" ); | 949 | cfg.setGroup("Options" ); |
950 | QString skin = cfg.readEntry( "Skin", "default" ); | 950 | QString skin = cfg.readEntry( "Skin", "default" ); |
951 | 951 | ||
952 | QDir skinsDir( QPEApplication::qpeDir() + "/pics/opieplayer2/skins" ); | 952 | QDir skinsDir( QPEApplication::qpeDir() + "pics/opieplayer2/skins" ); |
953 | skinsDir.setFilter( QDir::Dirs ); | 953 | skinsDir.setFilter( QDir::Dirs ); |
954 | skinsDir.setSorting(QDir::Name ); | 954 | skinsDir.setSorting(QDir::Name ); |
955 | const QFileInfoList *skinslist = skinsDir.entryInfoList(); | 955 | const QFileInfoList *skinslist = skinsDir.entryInfoList(); |
956 | QFileInfoListIterator it( *skinslist ); | 956 | QFileInfoListIterator it( *skinslist ); |
957 | QFileInfo *fi; | 957 | QFileInfo *fi; |
958 | while ( ( fi = it.current() ) ) { | 958 | while ( ( fi = it.current() ) ) { |
959 | skinName = fi->fileName(); | 959 | skinName = fi->fileName(); |
960 | // odebug << fi->fileName() << oendl; | 960 | // odebug << fi->fileName() << oendl; |
961 | if( skinName != "." && skinName != ".." && skinName !="CVS" ) { | 961 | if( skinName != "." && skinName != ".." && skinName !="CVS" ) { |
962 | item = skinsMenu->insertItem( fi->fileName() ) ; | 962 | item = skinsMenu->insertItem( fi->fileName() ) ; |
963 | } | 963 | } |
964 | if( skinName == "default" ) { | 964 | if( skinName == "default" ) { |
965 | defaultSkinIndex = item; | 965 | defaultSkinIndex = item; |
966 | } | 966 | } |
967 | if( skinName == skin ) { | 967 | if( skinName == skin ) { |
968 | skinsMenu->setItemChecked( item, TRUE ); | 968 | skinsMenu->setItemChecked( item, TRUE ); |
969 | } | 969 | } |
970 | ++it; | 970 | ++it; |
971 | } | 971 | } |
972 | } | 972 | } |
973 | 973 | ||
974 | void PlayListWidget::skinsMenuActivated( int item ) { | 974 | void PlayListWidget::skinsMenuActivated( int item ) { |
975 | for(unsigned int i = defaultSkinIndex; i > defaultSkinIndex - skinsMenu->count(); i-- ) { | 975 | for(unsigned int i = defaultSkinIndex; i > defaultSkinIndex - skinsMenu->count(); i-- ) { |
976 | skinsMenu->setItemChecked( i, FALSE ); | 976 | skinsMenu->setItemChecked( i, FALSE ); |
977 | } | 977 | } |
978 | skinsMenu->setItemChecked( item, TRUE ); | 978 | skinsMenu->setItemChecked( item, TRUE ); |
979 | 979 | ||
980 | { | 980 | { |
981 | Config cfg( "OpiePlayer" ); | 981 | Config cfg( "OpiePlayer" ); |
982 | cfg.setGroup("Options"); | 982 | cfg.setGroup("Options"); |
983 | cfg.writeEntry("Skin", skinsMenu->text( item ) ); | 983 | cfg.writeEntry("Skin", skinsMenu->text( item ) ); |
984 | } | 984 | } |
985 | 985 | ||
986 | emit skinSelected(); | 986 | emit skinSelected(); |
987 | } | 987 | } |
988 | 988 | ||
989 | PlayListWidget::TabType PlayListWidget::currentTab() const | 989 | PlayListWidget::TabType PlayListWidget::currentTab() const |
990 | { | 990 | { |
991 | static const TabType indexToTabType[ TabTypeCount ] = | 991 | static const TabType indexToTabType[ TabTypeCount ] = |
992 | { CurrentPlayList, AudioFiles, VideoFiles, PlayLists }; | 992 | { CurrentPlayList, AudioFiles, VideoFiles, PlayLists }; |
993 | 993 | ||
994 | int index = tabWidget->currentPageIndex(); | 994 | int index = tabWidget->currentPageIndex(); |
995 | assert( index < TabTypeCount && index >= 0 ); | 995 | assert( index < TabTypeCount && index >= 0 ); |
996 | 996 | ||
997 | return indexToTabType[ index ]; | 997 | return indexToTabType[ index ]; |
998 | } | 998 | } |
999 | 999 | ||
1000 | PlayListWidget::Entry PlayListWidget::currentEntry() const | 1000 | PlayListWidget::Entry PlayListWidget::currentEntry() const |
1001 | { | 1001 | { |
1002 | if ( currentTab() == CurrentPlayList ) { | 1002 | if ( currentTab() == CurrentPlayList ) { |
1003 | const DocLnk *lnk = current(); | 1003 | const DocLnk *lnk = current(); |
1004 | return Entry( lnk->name(), lnk->file() ); | 1004 | return Entry( lnk->name(), lnk->file() ); |
1005 | } | 1005 | } |
1006 | 1006 | ||
1007 | return Entry( currentFileListPathName() ); | 1007 | return Entry( currentFileListPathName() ); |
1008 | } | 1008 | } |
1009 | 1009 | ||
1010 | QString PlayListWidget::currentFileListPathName() const { | 1010 | QString PlayListWidget::currentFileListPathName() const { |
1011 | return currentFileListView->currentItem()->text( 3 ); | 1011 | return currentFileListView->currentItem()->text( 3 ); |
1012 | } | 1012 | } |
1013 | 1013 | ||
1014 | 1014 | ||
1015 | void PlayListWidget::qcopReceive(const QCString &msg, const QByteArray &data) { | 1015 | void PlayListWidget::qcopReceive(const QCString &msg, const QByteArray &data) { |
1016 | QDataStream stream ( data, IO_ReadOnly ); | 1016 | QDataStream stream ( data, IO_ReadOnly ); |
1017 | if ( msg == "play()" ) { //plays current selection | 1017 | if ( msg == "play()" ) { //plays current selection |
1018 | btnPlay( true); | 1018 | btnPlay( true); |
1019 | } else if ( msg == "stop()" ) { | 1019 | } else if ( msg == "stop()" ) { |
1020 | mediaPlayerState->setPlaying( false); | 1020 | mediaPlayerState->setPlaying( false); |
1021 | } else if ( msg == "togglePause()" ) { | 1021 | } else if ( msg == "togglePause()" ) { |
1022 | mediaPlayerState->togglePaused(); | 1022 | mediaPlayerState->togglePaused(); |
1023 | } else if ( msg == "next()" ) { //select next in list | 1023 | } else if ( msg == "next()" ) { //select next in list |
1024 | mediaPlayerState->setNext(); | 1024 | mediaPlayerState->setNext(); |
1025 | } else if ( msg == "prev()" ) { //select previous in list | 1025 | } else if ( msg == "prev()" ) { //select previous in list |
1026 | mediaPlayerState->setPrev(); | 1026 | mediaPlayerState->setPrev(); |
1027 | } else if ( msg == "toggleLooping()" ) { //loop or not loop | 1027 | } else if ( msg == "toggleLooping()" ) { //loop or not loop |
1028 | mediaPlayerState->toggleLooping(); | 1028 | mediaPlayerState->toggleLooping(); |
1029 | } else if ( msg == "toggleShuffled()" ) { //shuffled or not shuffled | 1029 | } else if ( msg == "toggleShuffled()" ) { //shuffled or not shuffled |
1030 | mediaPlayerState->toggleShuffled(); | 1030 | mediaPlayerState->toggleShuffled(); |
1031 | } else if ( msg == "volUp()" ) { //volume more | 1031 | } else if ( msg == "volUp()" ) { //volume more |
1032 | // emit moreClicked(); | 1032 | // emit moreClicked(); |
1033 | // emit moreReleased(); | 1033 | // emit moreReleased(); |
1034 | } else if ( msg == "volDown()" ) { //volume less | 1034 | } else if ( msg == "volDown()" ) { //volume less |
1035 | // emit lessClicked(); | 1035 | // emit lessClicked(); |
1036 | // emit lessReleased(); | 1036 | // emit lessReleased(); |
1037 | } else if ( msg == "play(QString)" ) { //play this now | 1037 | } else if ( msg == "play(QString)" ) { //play this now |
1038 | QString file; | 1038 | QString file; |
1039 | stream >> file; | 1039 | stream >> file; |
1040 | setDocument( (const QString &) file); | 1040 | setDocument( (const QString &) file); |
1041 | } else if ( msg == "add(QString)" ) { //add to playlist | 1041 | } else if ( msg == "add(QString)" ) { //add to playlist |
1042 | QString file; | 1042 | QString file; |
1043 | stream >> file; | 1043 | stream >> file; |
1044 | QFileInfo fileInfo(file); | 1044 | QFileInfo fileInfo(file); |
1045 | DocLnk lnk; | 1045 | DocLnk lnk; |
1046 | lnk.setName( fileInfo.baseName() ); //sets name | 1046 | lnk.setName( fileInfo.baseName() ); //sets name |
1047 | lnk.setFile( file ); //sets file name | 1047 | lnk.setFile( file ); //sets file name |
1048 | addToSelection( lnk ); | 1048 | addToSelection( lnk ); |