-rw-r--r-- | noncore/multimedia/opieplayer2/playlistwidget.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/noncore/multimedia/opieplayer2/playlistwidget.cpp b/noncore/multimedia/opieplayer2/playlistwidget.cpp index 2e9553f..5f4159c 100644 --- a/noncore/multimedia/opieplayer2/playlistwidget.cpp +++ b/noncore/multimedia/opieplayer2/playlistwidget.cpp | |||
@@ -889,128 +889,133 @@ void PlayListWidget::keyReleaseEvent( QKeyEvent *e ) { | |||
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 | if(!skinsDir.exists()) { | ||
954 | QMessageBox::critical( 0, tr("Opieplayer Error"), | ||
955 | tr("<p><b>Opieplayer2 skin not found!</b></p><p>Please install an opieplayer2 skin package.</p>") ); | ||
956 | exit(1) ; | ||
957 | } | ||
953 | skinsDir.setFilter( QDir::Dirs ); | 958 | skinsDir.setFilter( QDir::Dirs ); |
954 | skinsDir.setSorting(QDir::Name ); | 959 | skinsDir.setSorting(QDir::Name ); |
955 | const QFileInfoList *skinslist = skinsDir.entryInfoList(); | 960 | const QFileInfoList *skinslist = skinsDir.entryInfoList(); |
956 | QFileInfoListIterator it( *skinslist ); | 961 | QFileInfoListIterator it( *skinslist ); |
957 | QFileInfo *fi; | 962 | QFileInfo *fi; |
958 | while ( ( fi = it.current() ) ) { | 963 | while ( ( fi = it.current() ) ) { |
959 | skinName = fi->fileName(); | 964 | skinName = fi->fileName(); |
960 | // odebug << fi->fileName() << oendl; | 965 | // odebug << fi->fileName() << oendl; |
961 | if( skinName != "." && skinName != ".." && skinName !="CVS" ) { | 966 | if( skinName != "." && skinName != ".." && skinName !="CVS" ) { |
962 | item = skinsMenu->insertItem( fi->fileName() ) ; | 967 | item = skinsMenu->insertItem( fi->fileName() ) ; |
963 | } | 968 | } |
964 | if( skinName == "default" ) { | 969 | if( skinName == "default" ) { |
965 | defaultSkinIndex = item; | 970 | defaultSkinIndex = item; |
966 | } | 971 | } |
967 | if( skinName == skin ) { | 972 | if( skinName == skin ) { |
968 | skinsMenu->setItemChecked( item, TRUE ); | 973 | skinsMenu->setItemChecked( item, TRUE ); |
969 | } | 974 | } |
970 | ++it; | 975 | ++it; |
971 | } | 976 | } |
972 | } | 977 | } |
973 | 978 | ||
974 | void PlayListWidget::skinsMenuActivated( int item ) { | 979 | void PlayListWidget::skinsMenuActivated( int item ) { |
975 | for(unsigned int i = defaultSkinIndex; i > defaultSkinIndex - skinsMenu->count(); i-- ) { | 980 | for(unsigned int i = defaultSkinIndex; i > defaultSkinIndex - skinsMenu->count(); i-- ) { |
976 | skinsMenu->setItemChecked( i, FALSE ); | 981 | skinsMenu->setItemChecked( i, FALSE ); |
977 | } | 982 | } |
978 | skinsMenu->setItemChecked( item, TRUE ); | 983 | skinsMenu->setItemChecked( item, TRUE ); |
979 | 984 | ||
980 | { | 985 | { |
981 | Config cfg( "OpiePlayer" ); | 986 | Config cfg( "OpiePlayer" ); |
982 | cfg.setGroup("Options"); | 987 | cfg.setGroup("Options"); |
983 | cfg.writeEntry("Skin", skinsMenu->text( item ) ); | 988 | cfg.writeEntry("Skin", skinsMenu->text( item ) ); |
984 | } | 989 | } |
985 | 990 | ||
986 | emit skinSelected(); | 991 | emit skinSelected(); |
987 | } | 992 | } |
988 | 993 | ||
989 | PlayListWidget::TabType PlayListWidget::currentTab() const | 994 | PlayListWidget::TabType PlayListWidget::currentTab() const |
990 | { | 995 | { |
991 | static const TabType indexToTabType[ TabTypeCount ] = | 996 | static const TabType indexToTabType[ TabTypeCount ] = |
992 | { CurrentPlayList, AudioFiles, VideoFiles, PlayLists }; | 997 | { CurrentPlayList, AudioFiles, VideoFiles, PlayLists }; |
993 | 998 | ||
994 | int index = tabWidget->currentPageIndex(); | 999 | int index = tabWidget->currentPageIndex(); |
995 | assert( index < TabTypeCount && index >= 0 ); | 1000 | assert( index < TabTypeCount && index >= 0 ); |
996 | 1001 | ||
997 | return indexToTabType[ index ]; | 1002 | return indexToTabType[ index ]; |
998 | } | 1003 | } |
999 | 1004 | ||
1000 | PlayListWidget::Entry PlayListWidget::currentEntry() const | 1005 | PlayListWidget::Entry PlayListWidget::currentEntry() const |
1001 | { | 1006 | { |
1002 | if ( currentTab() == CurrentPlayList ) { | 1007 | if ( currentTab() == CurrentPlayList ) { |
1003 | const DocLnk *lnk = current(); | 1008 | const DocLnk *lnk = current(); |
1004 | return Entry( lnk->name(), lnk->file() ); | 1009 | return Entry( lnk->name(), lnk->file() ); |
1005 | } | 1010 | } |
1006 | 1011 | ||
1007 | return Entry( currentFileListPathName() ); | 1012 | return Entry( currentFileListPathName() ); |
1008 | } | 1013 | } |
1009 | 1014 | ||
1010 | QString PlayListWidget::currentFileListPathName() const { | 1015 | QString PlayListWidget::currentFileListPathName() const { |
1011 | return currentFileListView->currentItem()->text( 3 ); | 1016 | return currentFileListView->currentItem()->text( 3 ); |
1012 | } | 1017 | } |
1013 | 1018 | ||
1014 | 1019 | ||
1015 | void PlayListWidget::qcopReceive(const QCString &msg, const QByteArray &data) { | 1020 | void PlayListWidget::qcopReceive(const QCString &msg, const QByteArray &data) { |
1016 | QDataStream stream ( data, IO_ReadOnly ); | 1021 | QDataStream stream ( data, IO_ReadOnly ); |