-rw-r--r-- | noncore/multimedia/opieplayer2/playlistwidget.cpp | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/noncore/multimedia/opieplayer2/playlistwidget.cpp b/noncore/multimedia/opieplayer2/playlistwidget.cpp index 5c804f5..404e1fe 100644 --- a/noncore/multimedia/opieplayer2/playlistwidget.cpp +++ b/noncore/multimedia/opieplayer2/playlistwidget.cpp | |||
@@ -97,13 +97,13 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl ) | |||
97 | audioScan = FALSE; | 97 | audioScan = FALSE; |
98 | videoScan = FALSE; | 98 | videoScan = FALSE; |
99 | 99 | ||
100 | setBackgroundMode( PaletteButton ); | 100 | setBackgroundMode( PaletteButton ); |
101 | 101 | ||
102 | // setCaption( tr("OpiePlayer") ); | 102 | // setCaption( tr("OpiePlayer") ); |
103 | setIcon( Resource::loadPixmap( "opieplayer2/MPEGPlayer" ) ); | 103 | // setIcon( Resource::loadPixmap( "opieplayer2/MPEGPlayer" ) ); |
104 | 104 | ||
105 | setToolBarsMovable( FALSE ); | 105 | setToolBarsMovable( FALSE ); |
106 | 106 | ||
107 | // Create Toolbar | 107 | // Create Toolbar |
108 | QPEToolBar *toolbar = new QPEToolBar( this ); | 108 | QPEToolBar *toolbar = new QPEToolBar( this ); |
109 | toolbar->setHorizontalStretchable( TRUE ); | 109 | toolbar->setHorizontalStretchable( TRUE ); |
@@ -455,13 +455,13 @@ void PlayListWidget::setDocument(const QString& fileref) { | |||
455 | setCaption(tr("OpiePlayer")); | 455 | setCaption(tr("OpiePlayer")); |
456 | } | 456 | } |
457 | } | 457 | } |
458 | 458 | ||
459 | 459 | ||
460 | void PlayListWidget::setActiveWindow() { | 460 | void PlayListWidget::setActiveWindow() { |
461 | qDebug("SETTING active window"); | 461 | // qDebug("SETTING active window"); |
462 | // When we get raised we need to ensure that it switches views | 462 | // When we get raised we need to ensure that it switches views |
463 | char origView = mediaPlayerState->view(); | 463 | char origView = mediaPlayerState->view(); |
464 | mediaPlayerState->setView( 'l' ); // invalidate | 464 | mediaPlayerState->setView( 'l' ); // invalidate |
465 | mediaPlayerState->setView( origView ); // now switch back | 465 | mediaPlayerState->setView( origView ); // now switch back |
466 | } | 466 | } |
467 | 467 | ||
@@ -473,38 +473,37 @@ void PlayListWidget::useSelectedDocument() { | |||
473 | 473 | ||
474 | const DocLnk *PlayListWidget::current() { // this is fugly | 474 | const DocLnk *PlayListWidget::current() { // this is fugly |
475 | 475 | ||
476 | switch (tabWidget->currentPageIndex()) { | 476 | switch (tabWidget->currentPageIndex()) { |
477 | case 0: //playlist | 477 | case 0: //playlist |
478 | { | 478 | { |
479 | qDebug("playlist"); | 479 | // qDebug("playlist"); |
480 | if ( mediaPlayerState->playlist() ) { | 480 | if ( mediaPlayerState->playlist() ) { |
481 | return d->selectedFiles->current(); | 481 | return d->selectedFiles->current(); |
482 | } else if ( d->setDocumentUsed && d->current ) { | 482 | } else if ( d->setDocumentUsed && d->current ) { |
483 | return d->current; | 483 | return d->current; |
484 | } else { | 484 | } else { |
485 | return d->files->selected(); | 485 | return d->files->selected(); |
486 | } | 486 | } |
487 | } | 487 | } |
488 | break; | 488 | break; |
489 | case 1://audio | 489 | case 1://audio |
490 | { | 490 | { |
491 | qDebug("audioView"); | 491 | // qDebug("audioView"); |
492 | QListIterator<DocLnk> dit( files.children() ); | 492 | QListIterator<DocLnk> dit( files.children() ); |
493 | for ( ; dit.current(); ++dit ) { | 493 | for ( ; dit.current(); ++dit ) { |
494 | if( dit.current()->name() == audioView->currentItem()->text(0) && !insanityBool) { | 494 | if( dit.current()->name() == audioView->currentItem()->text(0) && !insanityBool) { |
495 | qDebug("here"); | ||
496 | insanityBool=TRUE; | 495 | insanityBool=TRUE; |
497 | return dit; | 496 | return dit; |
498 | } | 497 | } |
499 | } | 498 | } |
500 | } | 499 | } |
501 | break; | 500 | break; |
502 | case 2: // video | 501 | case 2: // video |
503 | { | 502 | { |
504 | qDebug("videoView"); | 503 | // qDebug("videoView"); |
505 | QListIterator<DocLnk> Vdit( vFiles.children() ); | 504 | QListIterator<DocLnk> Vdit( vFiles.children() ); |
506 | for ( ; Vdit.current(); ++Vdit ) { | 505 | for ( ; Vdit.current(); ++Vdit ) { |
507 | if( Vdit.current()->name() == videoView->currentItem()->text(0) && !insanityBool) { | 506 | if( Vdit.current()->name() == videoView->currentItem()->text(0) && !insanityBool) { |
508 | insanityBool=TRUE; | 507 | insanityBool=TRUE; |
509 | return Vdit; | 508 | return Vdit; |
510 | } | 509 | } |
@@ -862,24 +861,24 @@ void PlayListWidget::playlistViewPressed( int mouse, QListViewItem *, const QPoi | |||
862 | break; | 861 | break; |
863 | }; | 862 | }; |
864 | } | 863 | } |
865 | 864 | ||
866 | 865 | ||
867 | void PlayListWidget::scanForAudio() { | 866 | void PlayListWidget::scanForAudio() { |
868 | qDebug("scan for audio"); | 867 | // qDebug("scan for audio"); |
869 | files.detachChildren(); | 868 | files.detachChildren(); |
870 | QListIterator<DocLnk> sdit( files.children() ); | 869 | QListIterator<DocLnk> sdit( files.children() ); |
871 | for ( ; sdit.current(); ++sdit ) { | 870 | for ( ; sdit.current(); ++sdit ) { |
872 | delete sdit.current(); | 871 | delete sdit.current(); |
873 | } | 872 | } |
874 | Global::findDocuments(&files, "audio/*"); | 873 | Global::findDocuments(&files, "audio/*"); |
875 | audioScan = TRUE; | 874 | audioScan = TRUE; |
876 | } | 875 | } |
877 | 876 | ||
878 | void PlayListWidget::scanForVideo() { | 877 | void PlayListWidget::scanForVideo() { |
879 | qDebug("scan for video"); | 878 | // qDebug("scan for video"); |
880 | vFiles.detachChildren(); | 879 | vFiles.detachChildren(); |
881 | QListIterator<DocLnk> sdit( vFiles.children() ); | 880 | QListIterator<DocLnk> sdit( vFiles.children() ); |
882 | for ( ; sdit.current(); ++sdit ) { | 881 | for ( ; sdit.current(); ++sdit ) { |
883 | delete sdit.current(); | 882 | delete sdit.current(); |
884 | } | 883 | } |
885 | Global::findDocuments(&vFiles, "video/*"); | 884 | Global::findDocuments(&vFiles, "video/*"); |
@@ -993,24 +992,22 @@ void PlayListWidget::keyReleaseEvent( QKeyEvent *e) | |||
993 | // doBlank(); | 992 | // doBlank(); |
994 | break; | 993 | break; |
995 | case Key_F13: //mail | 994 | case Key_F13: //mail |
996 | // doUnblank(); | 995 | // doUnblank(); |
997 | break; | 996 | break; |
998 | case Key_Q: //add to playlist | 997 | case Key_Q: //add to playlist |
999 | qDebug("Add"); | ||
1000 | addSelected(); | 998 | addSelected(); |
1001 | break; | 999 | break; |
1002 | case Key_R: //remove from playlist | 1000 | case Key_R: //remove from playlist |
1003 | removeSelected(); | 1001 | removeSelected(); |
1004 | break; | 1002 | break; |
1005 | // case Key_P: //play | 1003 | // case Key_P: //play |
1006 | // qDebug("Play"); | 1004 | // qDebug("Play"); |
1007 | // playSelected(); | 1005 | // playSelected(); |
1008 | // break; | 1006 | // break; |
1009 | case Key_Space: | 1007 | case Key_Space: |
1010 | qDebug("Play"); | ||
1011 | // playSelected(); puh | 1008 | // playSelected(); puh |
1012 | break; | 1009 | break; |
1013 | case Key_1: | 1010 | case Key_1: |
1014 | tabWidget->setCurrentPage(0); | 1011 | tabWidget->setCurrentPage(0); |
1015 | break; | 1012 | break; |
1016 | case Key_2: | 1013 | case Key_2: |
@@ -1194,13 +1191,13 @@ void PlayListWidget::readPls(const QString &filename) { | |||
1194 | } | 1191 | } |
1195 | i++; | 1192 | i++; |
1196 | } | 1193 | } |
1197 | } | 1194 | } |
1198 | 1195 | ||
1199 | void PlayListWidget::pmViewActivated(int index) { | 1196 | void PlayListWidget::pmViewActivated(int index) { |
1200 | qDebug("%d", index); | 1197 | // qDebug("%d", index); |
1201 | switch(index) { | 1198 | switch(index) { |
1202 | case -16: | 1199 | case -16: |
1203 | { | 1200 | { |
1204 | 1201 | ||
1205 | mediaPlayerState->toggleFullscreen(); | 1202 | mediaPlayerState->toggleFullscreen(); |
1206 | bool b=mediaPlayerState->fullscreen(); | 1203 | bool b=mediaPlayerState->fullscreen(); |