-rw-r--r-- | core/multimedia/opieplayer/playlistselection.cpp | 6 | ||||
-rw-r--r-- | core/multimedia/opieplayer/playlistselection.h | 1 | ||||
-rw-r--r-- | core/multimedia/opieplayer/playlistwidget.cpp | 2 |
3 files changed, 8 insertions, 1 deletions
diff --git a/core/multimedia/opieplayer/playlistselection.cpp b/core/multimedia/opieplayer/playlistselection.cpp index 756e3b4..6259b3f 100644 --- a/core/multimedia/opieplayer/playlistselection.cpp +++ b/core/multimedia/opieplayer/playlistselection.cpp | |||
@@ -136,25 +136,24 @@ void PlayListSelection::moveSelectedDown() { | |||
136 | 136 | ||
137 | 137 | ||
138 | bool PlayListSelection::prev() { | 138 | bool PlayListSelection::prev() { |
139 | QListViewItem *item = selectedItem(); | 139 | QListViewItem *item = selectedItem(); |
140 | if ( item && item->itemAbove() ) | 140 | if ( item && item->itemAbove() ) |
141 | setSelected( item->itemAbove(), TRUE ); | 141 | setSelected( item->itemAbove(), TRUE ); |
142 | else | 142 | else |
143 | return FALSE; | 143 | return FALSE; |
144 | ensureItemVisible( selectedItem() ); | 144 | ensureItemVisible( selectedItem() ); |
145 | return TRUE; | 145 | return TRUE; |
146 | } | 146 | } |
147 | 147 | ||
148 | |||
149 | bool PlayListSelection::next() { | 148 | bool PlayListSelection::next() { |
150 | QListViewItem *item = selectedItem(); | 149 | QListViewItem *item = selectedItem(); |
151 | if ( item && item->itemBelow() ) | 150 | if ( item && item->itemBelow() ) |
152 | setSelected( item->itemBelow(), TRUE ); | 151 | setSelected( item->itemBelow(), TRUE ); |
153 | else | 152 | else |
154 | return FALSE; | 153 | return FALSE; |
155 | ensureItemVisible( selectedItem() ); | 154 | ensureItemVisible( selectedItem() ); |
156 | return TRUE; | 155 | return TRUE; |
157 | } | 156 | } |
158 | 157 | ||
159 | 158 | ||
160 | bool PlayListSelection::first() { | 159 | bool PlayListSelection::first() { |
@@ -172,12 +171,17 @@ bool PlayListSelection::last() { | |||
172 | QListViewItem *prevItem = NULL; | 171 | QListViewItem *prevItem = NULL; |
173 | QListViewItem *item = firstChild(); | 172 | QListViewItem *item = firstChild(); |
174 | while ( ( item = item->nextSibling() ) ) | 173 | while ( ( item = item->nextSibling() ) ) |
175 | prevItem = item; | 174 | prevItem = item; |
176 | if ( prevItem ) | 175 | if ( prevItem ) |
177 | setSelected( prevItem, TRUE ); | 176 | setSelected( prevItem, TRUE ); |
178 | else | 177 | else |
179 | return FALSE; | 178 | return FALSE; |
180 | ensureItemVisible( selectedItem() ); | 179 | ensureItemVisible( selectedItem() ); |
181 | return TRUE; | 180 | return TRUE; |
182 | } | 181 | } |
183 | 182 | ||
183 | void PlayListSelection::unSelect() | ||
184 | { | ||
185 | QListViewItem *item = selectedItem(); | ||
186 | setSelected( currentItem(), FALSE); | ||
187 | } \ No newline at end of file | ||
diff --git a/core/multimedia/opieplayer/playlistselection.h b/core/multimedia/opieplayer/playlistselection.h index b0d249c..ba37271 100644 --- a/core/multimedia/opieplayer/playlistselection.h +++ b/core/multimedia/opieplayer/playlistselection.h | |||
@@ -28,24 +28,25 @@ | |||
28 | class PlayListSelection : public QListView { | 28 | class PlayListSelection : public QListView { |
29 | Q_OBJECT | 29 | Q_OBJECT |
30 | public: | 30 | public: |
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 | public slots: | 35 | public slots: |
36 | void addToSelection( const DocLnk & ); // Add a media file to the playlist | 36 | void addToSelection( const DocLnk & ); // Add a media file to the playlist |
37 | void removeSelected(); // Remove a media file from the playlist | 37 | void removeSelected(); // Remove a media file from the playlist |
38 | 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 |
39 | 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 |
40 | void unSelect(); | ||
40 | bool prev(); | 41 | bool prev(); |
41 | bool next(); | 42 | bool next(); |
42 | bool first(); | 43 | bool first(); |
43 | bool last(); | 44 | bool last(); |
44 | 45 | ||
45 | protected: | 46 | protected: |
46 | virtual void contentsMouseMoveEvent(QMouseEvent *); | 47 | virtual void contentsMouseMoveEvent(QMouseEvent *); |
47 | /* #ifdef USE_PLAYLIST_BACKGROUND */ | 48 | /* #ifdef USE_PLAYLIST_BACKGROUND */ |
48 | virtual void drawBackground( QPainter *p, const QRect &r ); | 49 | virtual void drawBackground( QPainter *p, const QRect &r ); |
49 | virtual void paintEmptyArea( QPainter *p, const QRect &r ) { drawBackground( p, r ); }; | 50 | virtual void paintEmptyArea( QPainter *p, const QRect &r ) { drawBackground( p, r ); }; |
50 | /* #endif */ | 51 | /* #endif */ |
51 | 52 | ||
diff --git a/core/multimedia/opieplayer/playlistwidget.cpp b/core/multimedia/opieplayer/playlistwidget.cpp index cf665c8..db6533a 100644 --- a/core/multimedia/opieplayer/playlistwidget.cpp +++ b/core/multimedia/opieplayer/playlistwidget.cpp | |||
@@ -804,34 +804,36 @@ void PlayListWidget::btnPlay(bool b) { | |||
804 | case 0: | 804 | case 0: |
805 | { | 805 | { |
806 | mediaPlayerState->setPlaying(b); | 806 | mediaPlayerState->setPlaying(b); |
807 | } | 807 | } |
808 | break; | 808 | break; |
809 | case 1: | 809 | case 1: |
810 | { | 810 | { |
811 | addToSelection( audioView->selectedItem() ); | 811 | addToSelection( audioView->selectedItem() ); |
812 | mediaPlayerState->setPlaying(b); | 812 | mediaPlayerState->setPlaying(b); |
813 | // qApp->processEvents(); | 813 | // qApp->processEvents(); |
814 | d->selectedFiles->removeSelected( ); | 814 | d->selectedFiles->removeSelected( ); |
815 | tabWidget->setCurrentPage(1); | 815 | tabWidget->setCurrentPage(1); |
816 | d->selectedFiles->unSelect(); | ||
816 | // mediaPlayerState->setPlaying(FALSE); | 817 | // mediaPlayerState->setPlaying(FALSE); |
817 | } | 818 | } |
818 | break; | 819 | break; |
819 | case 2: | 820 | case 2: |
820 | { | 821 | { |
821 | addToSelection( videoView->selectedItem() ); | 822 | addToSelection( videoView->selectedItem() ); |
822 | mediaPlayerState->setPlaying(b); | 823 | mediaPlayerState->setPlaying(b); |
823 | qApp->processEvents(); | 824 | qApp->processEvents(); |
824 | d->selectedFiles->removeSelected( ); | 825 | d->selectedFiles->removeSelected( ); |
825 | tabWidget->setCurrentPage(2); | 826 | tabWidget->setCurrentPage(2); |
827 | d->selectedFiles->unSelect(); | ||
826 | // mediaPlayerState->setPlaying(FALSE); | 828 | // mediaPlayerState->setPlaying(FALSE); |
827 | } | 829 | } |
828 | break; | 830 | break; |
829 | }; | 831 | }; |
830 | 832 | ||
831 | 833 | ||
832 | 834 | ||
833 | 835 | ||
834 | } | 836 | } |
835 | 837 | ||
836 | void PlayListWidget::deletePlaylist() { | 838 | void PlayListWidget::deletePlaylist() { |
837 | switch( QMessageBox::information( this, (tr("Remove Playlist?")), | 839 | switch( QMessageBox::information( this, (tr("Remove Playlist?")), |