summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/multimedia/opieplayer/playlistselection.cpp21
-rw-r--r--core/multimedia/opieplayer/playlistselection.h1
-rw-r--r--core/multimedia/opieplayer/playlistwidget.cpp35
3 files changed, 29 insertions, 28 deletions
diff --git a/core/multimedia/opieplayer/playlistselection.cpp b/core/multimedia/opieplayer/playlistselection.cpp
index d70df51..d6aff66 100644
--- a/core/multimedia/opieplayer/playlistselection.cpp
+++ b/core/multimedia/opieplayer/playlistselection.cpp
@@ -47,36 +47,39 @@ private:
47}; 47};
48 48
49 49
50PlayListSelection::PlayListSelection( QWidget *parent, const char *name ) 50PlayListSelection::PlayListSelection( QWidget *parent, const char *name )
51 : QListView( parent, name ) 51 : QListView( parent, name )
52{ 52{
53 qDebug("starting playlistselector");
53// #ifdef USE_PLAYLIST_BACKGROUND 54// #ifdef USE_PLAYLIST_BACKGROUND
54 setStaticBackground( TRUE ); 55// setStaticBackground( TRUE );
55// setBackgroundPixmap( Resource::loadPixmap( "mpegplayer/background" ) ); 56// setBackgroundPixmap( Resource::loadPixmap( "mpegplayer/background" ) );
56 setBackgroundPixmap( Resource::loadPixmap( "opielogo" ) ); 57
58// setBackgroundPixmap( Resource::loadPixmap( "opielogo" ) );
57// #endif 59// #endif
58// addColumn("Title",236); 60// addColumn("Title",236);
59// setAllColumnsShowFocus( TRUE ); 61// setAllColumnsShowFocus( TRUE );
60 addColumn( tr( "Playlist Selection" ) ); 62 addColumn( tr( "Playlist Selection" ) );
61 header()->hide(); 63 header()->hide();
62 setSorting( -1, FALSE ); 64 setSorting( -1, FALSE );
63} 65}
64 66
65 67
66PlayListSelection::~PlayListSelection() { 68PlayListSelection::~PlayListSelection() {
67} 69}
68 70
69 71
70// #ifdef USE_PLAYLIST_BACKGROUND 72// #ifdef USE_PLAYLIST_BACKGROUND
71void PlayListSelection::drawBackground( QPainter *p, const QRect &r ) { 73void PlayListSelection::drawBackground( QPainter *p, const QRect &r ) {
72 p->fillRect( r, QBrush( white ) ); 74// qDebug("drawBackground");
73// QImage logo = Resource::loadImage( "mpegplayer/background" ); 75// p->fillRect( r, QBrush( white ) );
74 QImage logo = Resource::loadImage( "opielogo" ); 76// QImage logo = Resource::loadImage( "mpegplayer/background" );
75 if ( !logo.isNull() ) 77// // QImage logo = Resource::loadImage( "opielogo" );
76 p->drawImage( (width() - logo.width()) / 2, (height() - logo.height()) / 2, logo ); 78// if ( !logo.isNull() )
79// p->drawImage( (width() - logo.width()) / 2, (height() - logo.height()) / 2, logo );
77} 80}
78// #endif 81// #endif
79 82
80 83
81void PlayListSelection::contentsMouseMoveEvent( QMouseEvent *event ) { 84void PlayListSelection::contentsMouseMoveEvent( QMouseEvent *event ) {
82 if ( event->state() == QMouseEvent::LeftButton ) { 85 if ( event->state() == QMouseEvent::LeftButton ) {
diff --git a/core/multimedia/opieplayer/playlistselection.h b/core/multimedia/opieplayer/playlistselection.h
index 57e10f1..b0d249c 100644
--- a/core/multimedia/opieplayer/playlistselection.h
+++ b/core/multimedia/opieplayer/playlistselection.h
@@ -29,13 +29,12 @@ class PlayListSelection : public QListView {
29 Q_OBJECT 29 Q_OBJECT
30public: 30public:
31 PlayListSelection( QWidget *parent, const char *name=0 ); 31 PlayListSelection( QWidget *parent, const char *name=0 );
32 ~PlayListSelection(); 32 ~PlayListSelection();
33 33
34 const DocLnk *current(); // retrieve the current playlist entry (media file link) 34 const DocLnk *current(); // retrieve the current playlist entry (media file link)
35
36public slots: 35public slots:
37 void addToSelection( const DocLnk & ); // Add a media file to the playlist 36 void addToSelection( const DocLnk & ); // Add a media file to the playlist
38 void removeSelected(); // Remove a media file from the playlist 37 void removeSelected(); // Remove a media file from the playlist
39 void moveSelectedUp(); // Move the media file up the playlist so it is played earlier 38 void moveSelectedUp(); // Move the media file up the playlist so it is played earlier
40 void moveSelectedDown(); // Move the media file down the playlist so it is played later 39 void moveSelectedDown(); // Move the media file down the playlist so it is played later
41 bool prev(); 40 bool prev();
diff --git a/core/multimedia/opieplayer/playlistwidget.cpp b/core/multimedia/opieplayer/playlistwidget.cpp
index a6202bc..3171a84 100644
--- a/core/multimedia/opieplayer/playlistwidget.cpp
+++ b/core/multimedia/opieplayer/playlistwidget.cpp
@@ -415,19 +415,27 @@ void PlayListWidget::addAllVideoToList() {
415 415
416void PlayListWidget::setDocument(const QString& fileref) { 416void PlayListWidget::setDocument(const QString& fileref) {
417 if ( fileref.isNull() ) { 417 if ( fileref.isNull() ) {
418 QMessageBox::critical( 0, tr( "Invalid File" ), tr( "There was a problem in getting the file." ) ); 418 QMessageBox::critical( 0, tr( "Invalid File" ), tr( "There was a problem in getting the file." ) );
419 return; 419 return;
420 } 420 }
421 if(fileref.find("playlist",0,TRUE) == -1) {
421 addToSelection( DocLnk( fileref ) ); 422 addToSelection( DocLnk( fileref ) );
422 d->setDocumentUsed = TRUE; 423 d->setDocumentUsed = TRUE;
423 qApp->processEvents(); 424 qApp->processEvents();
424 mediaPlayerState->setPlaying( FALSE ); 425 mediaPlayerState->setPlaying( FALSE );
425 qApp->processEvents(); 426 qApp->processEvents();
426 mediaPlayerState->setPlaying( TRUE ); 427 mediaPlayerState->setPlaying( TRUE );
427 d->selectedFiles->removeSelected( ); 428 d->selectedFiles->removeSelected( );
429 } else {
430 loadList(DocLnk(fileref));
431 d->selectedFiles->first();
432// mediaPlayerState->setPlaying( TRUE );
433// mediaPlayerState->setPlaying( FALSE );
434
435 }
428} 436}
429 437
430 438
431void PlayListWidget::setActiveWindow() { 439void PlayListWidget::setActiveWindow() {
432 // When we get raised we need to ensure that it switches views 440 // When we get raised we need to ensure that it switches views
433 char origView = mediaPlayerState->view(); 441 char origView = mediaPlayerState->view();
@@ -526,36 +534,27 @@ void PlayListWidget::saveList() {
526 InputDialog *fileDlg; 534 InputDialog *fileDlg;
527 fileDlg=new InputDialog(this,"Save Playlist",TRUE, 0); 535 fileDlg=new InputDialog(this,"Save Playlist",TRUE, 0);
528 fileDlg->exec(); 536 fileDlg->exec();
529 if( fileDlg->result() == 1 ) { 537 if( fileDlg->result() == 1 ) {
530 filename = fileDlg->LineEdit1->text();//+".playlist"; 538 filename = fileDlg->LineEdit1->text();//+".playlist";
531 qDebug("saving playlist "+filename+".playlist"); 539 qDebug("saving playlist "+filename+".playlist");
532
533// DocLnk *lnk;
534// lnk.setName( filename); //sets file name
535// // lnk.setComment(title);
536// lnk.setFile( filename+".playlist"); //sets File property
537// lnk.setType("player/plain");// hey is this a REGISTERED mime type?!?!? ;D
538// lnk.setIcon("MPEGPlayer");
539// if(!lnk.writeLink())
540// qDebug("Writing doclink did not work");
541
542 Config cfg( filename +".playlist"); 540 Config cfg( filename +".playlist");
543 writeConfig( cfg ); 541 writeConfig( cfg );
542 DocLnk lnk;
543 lnk.setName( filename); //sets file name
544// lnk.setComment( "");
545 lnk.setFile(QPEApplication::qpeDir()+"Settings/"+filename+".playlist.conf"); //sets File property
546 lnk.setType("playlist/plain");// hey is this a REGISTERED mime type?!?!? ;D
547 lnk.setIcon("mpegplayer/playlist2");
548 if(!lnk.writeLink())
549 qDebug("Writing doclink did not work");
544 } 550 }
545 DocLnk lnk;
546 lnk.setName( filename); //sets file name
547// lnk.setComment(title);
548 lnk.setFile(QPEApplication::qpeDir()+"Settings/"+filename+".playlist.conf"); //sets File property
549 lnk.setType("playlist/plain");// hey is this a REGISTERED mime type?!?!? ;D
550 lnk.setIcon("MPEGPlayer");
551 if(!lnk.writeLink())
552 qDebug("Writing doclink did not work");
553 551
554 if(fileDlg) 552 if(fileDlg)
555 delete fileDlg; 553 delete fileDlg;
554
556} 555}
557 556
558 557
559void PlayListWidget::loadList( const DocLnk & lnk) { 558void PlayListWidget::loadList( const DocLnk & lnk) {
560 qDebug("load list "+ lnk.name()+".playlist"); 559 qDebug("load list "+ lnk.name()+".playlist");
561 clearList(); 560 clearList();