summaryrefslogtreecommitdiff
authorsimon <simon>2002-12-02 15:11:50 (UTC)
committer simon <simon>2002-12-02 15:11:50 (UTC)
commit9f770813346acbe7817b20c5fe0fea03827fc41a (patch) (unidiff)
tree271e8091f19e5701576fa5f1503cca08f955a7b0
parent5380767372ecf3ab22f799abda32f414b0cc7ede (diff)
downloadopie-9f770813346acbe7817b20c5fe0fea03827fc41a.zip
opie-9f770813346acbe7817b20c5fe0fea03827fc41a.tar.gz
opie-9f770813346acbe7817b20c5fe0fea03827fc41a.tar.bz2
- removed whichList() alltogether
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/playlistwidget.cpp25
-rw-r--r--noncore/multimedia/opieplayer2/playlistwidget.h4
2 files changed, 11 insertions, 18 deletions
diff --git a/noncore/multimedia/opieplayer2/playlistwidget.cpp b/noncore/multimedia/opieplayer2/playlistwidget.cpp
index a8429e3..fd256b7 100644
--- a/noncore/multimedia/opieplayer2/playlistwidget.cpp
+++ b/noncore/multimedia/opieplayer2/playlistwidget.cpp
@@ -569,21 +569,18 @@ void PlayListWidget::playIt( QListViewItem *it) {
569 d->selectedFiles->unSelect(); 569 d->selectedFiles->unSelect();
570} 570}
571 571
572 572
573void PlayListWidget::addToSelection( QListViewItem *it) { 573void PlayListWidget::addToSelection( QListViewItem *it) {
574 d->setDocumentUsed = FALSE; 574 d->setDocumentUsed = FALSE;
575 575
576 if(it) { 576 if(it) {
577 switch ( whichList()) { 577 if ( currentTab() == CurrentPlayList )
578 case 0: //playlist 578 return;
579 return;
580 break;
581 };
582 // case 1: { 579 // case 1: {
583 DocLnk lnk; 580 DocLnk lnk;
584 QString filename; 581 QString filename;
585 582
586 filename=it->text(3); 583 filename=it->text(3);
587 lnk.setName( QFileInfo(filename).baseName() ); //sets name 584 lnk.setName( QFileInfo(filename).baseName() ); //sets name
588 lnk.setFile( filename ); //sets file name 585 lnk.setFile( filename ); //sets file name
589 d->selectedFiles->addToSelection( lnk); 586 d->selectedFiles->addToSelection( lnk);
@@ -592,50 +589,50 @@ void PlayListWidget::addToSelection( QListViewItem *it) {
592 tabWidget->setCurrentPage(0); 589 tabWidget->setCurrentPage(0);
593 590
594 } 591 }
595} 592}
596 593
597 594
598void PlayListWidget::tabChanged(QWidget *) { 595void PlayListWidget::tabChanged(QWidget *) {
599 596
600 switch ( whichList()) { 597 switch ( currentTab() ) {
601 case 0: 598 case CurrentPlayList:
602 { 599 {
603 if( !tbDeletePlaylist->isHidden() ) { 600 if( !tbDeletePlaylist->isHidden() ) {
604 tbDeletePlaylist->hide(); 601 tbDeletePlaylist->hide();
605 } 602 }
606 d->tbRemoveFromList->setEnabled(TRUE); 603 d->tbRemoveFromList->setEnabled(TRUE);
607 d->tbAddToList->setEnabled(FALSE); 604 d->tbAddToList->setEnabled(FALSE);
608 } 605 }
609 break; 606 break;
610 case 1: 607 case AudioFiles:
611 { 608 {
612 // audioView->clear(); 609 // audioView->clear();
613 if(!audioPopulated) populateAudioView(); 610 if(!audioPopulated) populateAudioView();
614 611
615 if( !tbDeletePlaylist->isHidden() ) { 612 if( !tbDeletePlaylist->isHidden() ) {
616 tbDeletePlaylist->hide(); 613 tbDeletePlaylist->hide();
617 } 614 }
618 d->tbRemoveFromList->setEnabled(FALSE); 615 d->tbRemoveFromList->setEnabled(FALSE);
619 d->tbAddToList->setEnabled(TRUE); 616 d->tbAddToList->setEnabled(TRUE);
620 } 617 }
621 break; 618 break;
622 case 2: 619 case VideoFiles:
623 { 620 {
624 // videoView->clear(); 621 // videoView->clear();
625 if(!videoPopulated) populateVideoView(); 622 if(!videoPopulated) populateVideoView();
626 if( !tbDeletePlaylist->isHidden() ) { 623 if( !tbDeletePlaylist->isHidden() ) {
627 tbDeletePlaylist->hide(); 624 tbDeletePlaylist->hide();
628 } 625 }
629 d->tbRemoveFromList->setEnabled(FALSE); 626 d->tbRemoveFromList->setEnabled(FALSE);
630 d->tbAddToList->setEnabled(TRUE); 627 d->tbAddToList->setEnabled(TRUE);
631 } 628 }
632 break; 629 break;
633 case 3: 630 case PlayLists:
634 { 631 {
635 if( tbDeletePlaylist->isHidden() ) { 632 if( tbDeletePlaylist->isHidden() ) {
636 tbDeletePlaylist->show(); 633 tbDeletePlaylist->show();
637 } 634 }
638 playLists->reread(); 635 playLists->reread();
639 d->tbAddToList->setEnabled(FALSE); 636 d->tbAddToList->setEnabled(FALSE);
640 } 637 }
641 break; 638 break;
@@ -1128,26 +1125,22 @@ void PlayListWidget::skinsMenuActivated( int item ) {
1128 1125
1129 Config cfg( "OpiePlayer" ); 1126 Config cfg( "OpiePlayer" );
1130 cfg.setGroup("Options"); 1127 cfg.setGroup("Options");
1131 cfg.writeEntry("Skin", skinsMenu->text( item ) ); 1128 cfg.writeEntry("Skin", skinsMenu->text( item ) );
1132 QMessageBox::warning( this, tr( "OpiePlayer" ), 1129 QMessageBox::warning( this, tr( "OpiePlayer" ),
1133 tr( "You must <b>restart</b> Opieplayer<br>to see your changes." ) ); 1130 tr( "You must <b>restart</b> Opieplayer<br>to see your changes." ) );
1134} 1131}
1135 1132
1136int PlayListWidget::whichList() const {
1137 return tabWidget->currentPageIndex();
1138}
1139
1140PlayListWidget::TabType PlayListWidget::currentTab() const 1133PlayListWidget::TabType PlayListWidget::currentTab() const
1141{ 1134{
1142 static const TabType indexToTabType[ NumTabTypes ] = 1135 static const TabType indexToTabType[ TabTypeCount ] =
1143 { CurrentPlayList, AudioFiles, VideoFiles, PlayLists }; 1136 { CurrentPlayList, AudioFiles, VideoFiles, PlayLists };
1144 1137
1145 int index = tabWidget->currentPageIndex(); 1138 int index = tabWidget->currentPageIndex();
1146 assert( index < NumTabTypes && index >= 0 ); 1139 assert( index < TabTypeCount && index >= 0 );
1147 1140
1148 return indexToTabType[ index ]; 1141 return indexToTabType[ index ];
1149} 1142}
1150 1143
1151QString PlayListWidget::currentFileListPathName() const { 1144QString PlayListWidget::currentFileListPathName() const {
1152 return currentFileListView()->currentItem()->text( 3 ); 1145 return currentFileListView()->currentItem()->text( 3 );
1153} 1146}
diff --git a/noncore/multimedia/opieplayer2/playlistwidget.h b/noncore/multimedia/opieplayer2/playlistwidget.h
index 238a75c..2e2ff89 100644
--- a/noncore/multimedia/opieplayer2/playlistwidget.h
+++ b/noncore/multimedia/opieplayer2/playlistwidget.h
@@ -50,30 +50,30 @@ class QListViewItem;
50class QListView; 50class QListView;
51class QPoint; 51class QPoint;
52class QAction; 52class QAction;
53class QLabel; 53class QLabel;
54 54
55class PlayListWidget : public PlayListWidgetGui { 55class PlayListWidget : public PlayListWidgetGui {
56 Q_OBJECT 56 Q_OBJECT
57public: 57public:
58 enum TabType { CurrentPlayList, AudioFiles, VideoFiles, PlayLists, NumTabTypes = 4 }; 58 enum TabType { CurrentPlayList, AudioFiles, VideoFiles, PlayLists };
59 enum { TabTypeCount = 4 };
59 60
60 PlayListWidget( QWidget* parent=0, const char* name=0, WFlags fl=0 ); 61 PlayListWidget( QWidget* parent=0, const char* name=0, WFlags fl=0 );
61 ~PlayListWidget(); 62 ~PlayListWidget();
62 DocLnkSet files; 63 DocLnkSet files;
63 DocLnkSet vFiles; 64 DocLnkSet vFiles;
64 bool fromSetDocument; 65 bool fromSetDocument;
65 bool insanityBool; 66 bool insanityBool;
66 QString setDocFileRef, currentPlayList; 67 QString setDocFileRef, currentPlayList;
67 // retrieve the current playlist entry (media file link) 68 // retrieve the current playlist entry (media file link)
68 const DocLnk *current(); 69 const DocLnk *current();
69 void useSelectedDocument(); 70 void useSelectedDocument();
70 int selected; 71 int selected;
71 int whichList() const;
72 TabType currentTab() const; 72 TabType currentTab() const;
73 73
74public slots: 74public slots:
75 bool first(); 75 bool first();
76 bool last(); 76 bool last();
77 bool next(); 77 bool next();
78 bool prev(); 78 bool prev();
79 void writeDefaultPlaylist( ); 79 void writeDefaultPlaylist( );