Diffstat (limited to 'core/multimedia/opieplayer/playlistselection.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/multimedia/opieplayer/playlistselection.cpp | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/core/multimedia/opieplayer/playlistselection.cpp b/core/multimedia/opieplayer/playlistselection.cpp index 6259b3f..8f3711a 100644 --- a/core/multimedia/opieplayer/playlistselection.cpp +++ b/core/multimedia/opieplayer/playlistselection.cpp | |||
@@ -10,24 +10,26 @@ | |||
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
15 | ** | 15 | ** |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | #include <qpe/applnk.h> | 20 | #include <qpe/applnk.h> |
21 | #include <qpe/resource.h> | 21 | #include <qpe/resource.h> |
22 | #include <qpe/config.h> | ||
23 | |||
22 | #include <qpainter.h> | 24 | #include <qpainter.h> |
23 | #include <qimage.h> | 25 | #include <qimage.h> |
24 | #include <qheader.h> | 26 | #include <qheader.h> |
25 | #include <qlistview.h> | 27 | #include <qlistview.h> |
26 | #include <qlist.h> | 28 | #include <qlist.h> |
27 | #include <qpixmap.h> | 29 | #include <qpixmap.h> |
28 | 30 | ||
29 | #include "playlistselection.h" | 31 | #include "playlistselection.h" |
30 | 32 | ||
31 | #include <stdlib.h> | 33 | #include <stdlib.h> |
32 | 34 | ||
33 | class PlayListSelectionItem : public QListViewItem { | 35 | class PlayListSelectionItem : public QListViewItem { |
@@ -41,25 +43,25 @@ public: | |||
41 | }; | 43 | }; |
42 | 44 | ||
43 | const DocLnk *file() const { return fl; } | 45 | const DocLnk *file() const { return fl; } |
44 | 46 | ||
45 | private: | 47 | private: |
46 | const DocLnk *fl; | 48 | const DocLnk *fl; |
47 | }; | 49 | }; |
48 | 50 | ||
49 | 51 | ||
50 | PlayListSelection::PlayListSelection( QWidget *parent, const char *name ) | 52 | PlayListSelection::PlayListSelection( QWidget *parent, const char *name ) |
51 | : QListView( parent, name ) | 53 | : QListView( parent, name ) |
52 | { | 54 | { |
53 | qDebug("starting playlistselector"); | 55 | // qDebug("starting playlistselector"); |
54 | // #ifdef USE_PLAYLIST_BACKGROUND | 56 | // #ifdef USE_PLAYLIST_BACKGROUND |
55 | // setStaticBackground( TRUE ); | 57 | // setStaticBackground( TRUE ); |
56 | // setBackgroundPixmap( Resource::loadPixmap( "mpegplayer/background" ) ); | 58 | // setBackgroundPixmap( Resource::loadPixmap( "mpegplayer/background" ) ); |
57 | 59 | ||
58 | // setBackgroundPixmap( Resource::loadPixmap( "launcher/opielogo" ) ); | 60 | // setBackgroundPixmap( Resource::loadPixmap( "launcher/opielogo" ) ); |
59 | // #endif | 61 | // #endif |
60 | // addColumn("Title",236); | 62 | // addColumn("Title",236); |
61 | // setAllColumnsShowFocus( TRUE ); | 63 | // setAllColumnsShowFocus( TRUE ); |
62 | addColumn( tr( "Playlist Selection" ) ); | 64 | addColumn( tr( "Playlist Selection" ) ); |
63 | header()->hide(); | 65 | header()->hide(); |
64 | setSorting( -1, FALSE ); | 66 | setSorting( -1, FALSE ); |
65 | } | 67 | } |
@@ -175,13 +177,27 @@ bool PlayListSelection::last() { | |||
175 | if ( prevItem ) | 177 | if ( prevItem ) |
176 | setSelected( prevItem, TRUE ); | 178 | setSelected( prevItem, TRUE ); |
177 | else | 179 | else |
178 | return FALSE; | 180 | return FALSE; |
179 | ensureItemVisible( selectedItem() ); | 181 | ensureItemVisible( selectedItem() ); |
180 | return TRUE; | 182 | return TRUE; |
181 | } | 183 | } |
182 | 184 | ||
183 | void PlayListSelection::unSelect() | 185 | void PlayListSelection::unSelect() |
184 | { | 186 | { |
185 | QListViewItem *item = selectedItem(); | 187 | QListViewItem *item = selectedItem(); |
186 | setSelected( currentItem(), FALSE); | 188 | setSelected( currentItem(), FALSE); |
187 | } \ No newline at end of file | 189 | } |
190 | |||
191 | void PlayListSelection::writeCurrent( Config& cfg ) { | ||
192 | cfg.setGroup("PlayList"); | ||
193 | QListViewItem *item = selectedItem(); | ||
194 | if ( item ) | ||
195 | cfg.writeEntry("current", item->text(0) ); | ||
196 | qDebug(item->text(0)); | ||
197 | |||
198 | } | ||
199 | |||
200 | void PlayListSelection::setSelectedItem(const QString &strk ) { | ||
201 | // setSelected( item, TRUE ); | ||
202 | // ensureItemVisible( selectedItem() ); | ||
203 | } | ||