summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/multimedia/opieplayer/audiowidget.cpp7
-rw-r--r--core/multimedia/opieplayer/playlistwidget.cpp163
2 files changed, 74 insertions, 96 deletions
diff --git a/core/multimedia/opieplayer/audiowidget.cpp b/core/multimedia/opieplayer/audiowidget.cpp
index ef7c8dc..9a55608 100644
--- a/core/multimedia/opieplayer/audiowidget.cpp
+++ b/core/multimedia/opieplayer/audiowidget.cpp
@@ -86,2 +86,3 @@ AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) :
86 86
87// QString skinPath = "opieplayer/skins/" + skin;
87 QString skinPath = "opieplayer2/skins/" + skin; 88 QString skinPath = "opieplayer2/skins/" + skin;
@@ -122,5 +123,5 @@ AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) :
122 123
123 changeTextColor( &songInfo ); 124// changeTextColor( &songInfo );
124 songInfo.setBackgroundColor( QColor( 167, 212, 167 )); 125// songInfo.setBackgroundColor( QColor( 167, 212, 167 ));
125 songInfo.setFrameStyle( QFrame::NoFrame); 126// songInfo.setFrameStyle( QFrame::NoFrame);
126// songInfo.setFrameStyle( QFrame::WinPanel | QFrame::Sunken ); 127// songInfo.setFrameStyle( QFrame::WinPanel | QFrame::Sunken );
diff --git a/core/multimedia/opieplayer/playlistwidget.cpp b/core/multimedia/opieplayer/playlistwidget.cpp
index a937d7c..c28548c 100644
--- a/core/multimedia/opieplayer/playlistwidget.cpp
+++ b/core/multimedia/opieplayer/playlistwidget.cpp
@@ -246,2 +246,4 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl )
246 audioView->addColumn(tr("Media"),-1); 246 audioView->addColumn(tr("Media"),-1);
247 audioView->addColumn( tr( "Path" ), 0 );
248
247 audioView->setColumnAlignment(1, Qt::AlignRight); 249 audioView->setColumnAlignment(1, Qt::AlignRight);
@@ -269,2 +271,3 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl )
269 videoView->addColumn(tr("Media"),-1); 271 videoView->addColumn(tr("Media"),-1);
272 videoView->addColumn(tr( "Path" ), 0 );
270 videoView->setColumnAlignment(1, Qt::AlignRight); 273 videoView->setColumnAlignment(1, Qt::AlignRight);
@@ -321,5 +324,5 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl )
321 readConfig( cfg ); 324 readConfig( cfg );
322 QString currentPlaylist = cfg.readEntry("CurrentPlaylist",""); 325 QString currentPlaylist = cfg.readEntry("CurrentPlaylist","default");
323 loadList(DocLnk( currentPlaylist)); 326 loadList(DocLnk( currentPlaylist));
324 setCaption(tr("OpiePlayer: ")+ currentPlaylist ); 327 setCaption(tr("OpiePlayer: ")+ QFileInfo(currentPlaylist).baseName());
325 328
@@ -425,2 +428,6 @@ void PlayListWidget::addAllToList() {
425 d->selectedFiles->addToSelection( **Adit ); 428 d->selectedFiles->addToSelection( **Adit );
429 tabWidget->setCurrentPage(0);
430
431 writeCurrentM3u();
432 d->selectedFiles->first();
426} 433}
@@ -433,2 +440,6 @@ void PlayListWidget::addAllMusicToList() {
433 d->selectedFiles->addToSelection( **dit ); 440 d->selectedFiles->addToSelection( **dit );
441 tabWidget->setCurrentPage(0);
442
443 writeCurrentM3u();
444 d->selectedFiles->first();
434} 445}
@@ -441,2 +452,6 @@ void PlayListWidget::addAllVideoToList() {
441 d->selectedFiles->addToSelection( **dit ); 452 d->selectedFiles->addToSelection( **dit );
453 tabWidget->setCurrentPage(0);
454
455 writeCurrentM3u();
456 d->selectedFiles->first();
442} 457}
@@ -647,63 +662,29 @@ void PlayListWidget::setView( char view ) {
647void PlayListWidget::addSelected() { 662void PlayListWidget::addSelected() {
663 qDebug("addSelected");
664 DocLnk lnk;
665 QString filename;
666 switch (tabWidget->currentPageIndex()) {
648 667
649 Config cfg( "OpiePlayer" ); 668 case 0: //playlist
650 cfg.setGroup("PlayList"); 669 return;
651 QString currentPlaylist = cfg.readEntry("CurrentPlaylist",""); 670 break;
652// int noOfFiles = cfg.readNumEntry("NumberOfFiles", 0 ); 671 case 1: { //audio
672 filename=audioView->currentItem()->text(3);
673 // d->selectedFiles->next();
674 }
675 break;
676
677 case 2: { // video
678 filename=videoView->currentItem()->text(3);
679 // tabWidget->setCurrentPage(0);
680
681 }
682 break;
683 };
684 lnk.setName( QFileInfo(filename).baseName() ); //sets name
685 lnk.setFile( filename ); //sets file name
686 d->selectedFiles->addToSelection( lnk);
687 tabWidget->setCurrentPage(0);
688 writeCurrentM3u();
653 689
654 switch (tabWidget->currentPageIndex()) {
655 case 0: //playlist
656 break;
657 case 1: { //audio
658// QString entryName;
659// entryName.sprintf( "File%i", i + 1 );
660// QString linkFile = cfg.readEntry( entryName );
661 QListViewItemIterator it( audioView );
662 // iterate through all items of the listview
663 for ( ; it.current(); ++it ) {
664 if ( it.current()->isSelected() ) {
665 QListIterator<DocLnk> dit( files.children() );
666 for ( ; dit.current(); ++dit ) {
667 if( dit.current()->name() == it.current()->text(0) ) {
668 d->selectedFiles->addToSelection( **dit );
669 }
670 }
671 audioView->setSelected( it.current(),FALSE);
672 }
673 }
674 tabWidget->setCurrentPage(0);
675 }
676 break;
677 case 2: { // video
678 QListViewItemIterator it( videoView );
679 // iterate through all items of the listview
680 for ( ; it.current(); ++it ) {
681 if ( it.current()->isSelected() ) {
682 QListIterator<DocLnk> dit( vFiles.children() );
683 for ( ; dit.current(); ++dit ) {
684 if( dit.current()->name() == it.current()->text(0) ) {
685 d->selectedFiles->addToSelection( **dit );
686 }
687 }
688
689 videoView->setSelected( it.current(),FALSE);
690 }
691 }
692// for ( int i = 0; i < noOfFiles; i++ ) {
693// QString entryName;
694// entryName.sprintf( "File%i", i + 1 );
695// QString linkFile = cfg.readEntry( entryName );
696// if( DocLnk( linkFile).name() == videoView->selectedItem()->text(0) ) {
697// int result= QMessageBox::warning(this,tr("OpiePlayer"),
698// tr("This is all ready in your playlist.\nContinue?"),
699// tr("Yes"),tr("No"),0,0,1);
700// if (result !=0)
701// return;
702// }
703// }
704// addToSelection( videoView->selectedItem() );
705 tabWidget->setCurrentPage(0);
706 }
707 break;
708 };
709} 690}
@@ -724,29 +705,23 @@ void PlayListWidget::playIt( QListViewItem *) {
724void PlayListWidget::addToSelection( QListViewItem *it) { 705void PlayListWidget::addToSelection( QListViewItem *it) {
725 d->setDocumentUsed = FALSE; 706 d->setDocumentUsed = FALSE;
726 707
727 if(it) { 708 if(it) {
728 switch (tabWidget->currentPageIndex()) { 709 switch ( tabWidget->currentPageIndex()) {
729 case 1: { 710 case 0: //playlist
730 QListIterator<DocLnk> dit( files.children() ); 711 return;
731 for ( ; dit.current(); ++dit ) { 712 break;
732 if( dit.current()->name() == it->text(0)) { 713 };
733 d->selectedFiles->addToSelection( **dit ); 714 // case 1: {
734 } 715 DocLnk lnk;
735 } 716 QString filename;
736 } 717
737 break; 718 filename=it->text(3);
738 case 2: { 719 lnk.setName( QFileInfo(filename).baseName() ); //sets name
739 QListIterator<DocLnk> dit( vFiles.children() ); 720 lnk.setFile( filename ); //sets file name
740 for ( ; dit.current(); ++dit ) { 721 d->selectedFiles->addToSelection( lnk);
741 if( dit.current()->name() == it->text(0)) { 722
742 d->selectedFiles->addToSelection( **dit ); 723 writeCurrentM3u();
743 } 724 tabWidget->setCurrentPage(0);
744 } 725
745 } 726 }
746 break;
747 case 0:
748 break;
749 };
750 tabWidget->setCurrentPage(0);
751 }
752} 727}
@@ -991,3 +966,3 @@ void PlayListWidget::populateAudioView() {
991 newItem= /*(void)*/ new QListViewItem( audioView, dit.current()->name(), 966 newItem= /*(void)*/ new QListViewItem( audioView, dit.current()->name(),
992 QString::number(size ), storage); 967 QString::number(size ), storage, dit.current()->file());
993 newItem->setPixmap(0, Resource::loadPixmap( "opieplayer/musicfile" )); 968 newItem->setPixmap(0, Resource::loadPixmap( "opieplayer/musicfile" ));
@@ -1019,3 +994,4 @@ void PlayListWidget::populateVideoView() {
1019 newItem= /*(void)*/ new QListViewItem( videoView, Vdit.current()->name(), 994 newItem= /*(void)*/ new QListViewItem( videoView, Vdit.current()->name(),
1020 QString::number( QFile( Vdit.current()->file()).size() ), storage); 995 QString::number( QFile( Vdit.current()->file() ).size() ),
996 storage, Vdit.current()->file());
1021 newItem->setPixmap(0, Resource::loadPixmap( "opieplayer/videofile" )); 997 newItem->setPixmap(0, Resource::loadPixmap( "opieplayer/videofile" ));
@@ -1064,3 +1040,5 @@ void PlayListWidget::openFile() {
1064 } else { 1040 } else {
1065 d->selectedFiles->addToSelection( DocLnk(filename) ); 1041 lnk.setName( QFileInfo(filename).baseName() ); //sets name
1042 lnk.setFile( filename ); //sets file name
1043 d->selectedFiles->addToSelection( lnk);
1066 writeCurrentM3u(); 1044 writeCurrentM3u();
@@ -1179,4 +1157,2 @@ void PlayListWidget::writeCurrentM3u() {
1179 QString currentPlaylist = cfg.readEntry("CurrentPlaylist",""); 1157 QString currentPlaylist = cfg.readEntry("CurrentPlaylist","");
1180
1181 if( d->selectedFiles->first()) {
1182 Om3u *m3uList; 1158 Om3u *m3uList;
@@ -1184,2 +1160,3 @@ void PlayListWidget::writeCurrentM3u() {
1184 1160
1161 if( d->selectedFiles->first()) {
1185 do { 1162 do {