summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2005-01-08 19:56:24 (UTC)
committer llornkcor <llornkcor>2005-01-08 19:56:24 (UTC)
commit60a617583d0ccc793d9ea4465998d90ec208db58 (patch) (unidiff)
tree58b125c9526c9dff30efbfa427c92c49f2995aee
parent955213d274c2f0c11d0f153e2fed5df5170e50f6 (diff)
downloadopie-60a617583d0ccc793d9ea4465998d90ec208db58.zip
opie-60a617583d0ccc793d9ea4465998d90ec208db58.tar.gz
opie-60a617583d0ccc793d9ea4465998d90ec208db58.tar.bz2
check for skins directory and fail nicely if not found
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/playlistwidget.cpp5
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
@@ -929,48 +929,53 @@ void PlayListWidget::keyReleaseEvent( QKeyEvent *e ) {
929void PlayListWidget::pmViewActivated(int index) { 929void 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
944void PlayListWidget::populateSkinsMenu() { 944void 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
974void PlayListWidget::skinsMenuActivated( int item ) { 979void 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 );