-rw-r--r-- | core/multimedia/opieplayer/audiowidget.cpp | 18 | ||||
-rw-r--r-- | core/multimedia/opieplayer/playlistwidget.cpp | 48 | ||||
-rw-r--r-- | core/multimedia/opieplayer/playlistwidget.h | 5 |
3 files changed, 62 insertions, 9 deletions
diff --git a/core/multimedia/opieplayer/audiowidget.cpp b/core/multimedia/opieplayer/audiowidget.cpp index 896da91..d20d560 100644 --- a/core/multimedia/opieplayer/audiowidget.cpp +++ b/core/multimedia/opieplayer/audiowidget.cpp | |||
@@ -49,5 +49,4 @@ MediaButton audioButtons[] = { | |||
49 | { TRUE, FALSE, FALSE }, // play | 49 | { TRUE, FALSE, FALSE }, // play |
50 | { FALSE, FALSE, FALSE }, // stop | 50 | { FALSE, FALSE, FALSE }, // stop |
51 | { TRUE, FALSE, FALSE }, // pause | ||
52 | { FALSE, FALSE, FALSE }, // next | 51 | { FALSE, FALSE, FALSE }, // next |
53 | { FALSE, FALSE, FALSE }, // previous | 52 | { FALSE, FALSE, FALSE }, // previous |
@@ -60,10 +59,9 @@ MediaButton audioButtons[] = { | |||
60 | }; | 59 | }; |
61 | 60 | ||
62 | const char *skin_mask_file_names[11] = { | 61 | const char *skin_mask_file_names[10] = { |
63 | "play", "stop", "pause", "next", "prev", "up", | 62 | "play", "stop", "next", "prev", "up", |
64 | "down", "loop", "playlist", "forward", "back" | 63 | "down", "loop", "playlist", "forward", "back" |
65 | }; | 64 | }; |
66 | 65 | ||
67 | |||
68 | static void changeTextColor( QWidget *w ) { | 66 | static void changeTextColor( QWidget *w ) { |
69 | QPalette p = w->palette(); | 67 | QPalette p = w->palette(); |
@@ -82,5 +80,5 @@ AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) : | |||
82 | 80 | ||
83 | Config cfg("OpiePlayer"); | 81 | Config cfg("OpiePlayer"); |
84 | cfg.setGroup("AudioWidget"); | 82 | cfg.setGroup("Options"); |
85 | skin = cfg.readEntry("Skin","default"); | 83 | skin = cfg.readEntry("Skin","default"); |
86 | //skin = "scaleTest"; | 84 | //skin = "scaleTest"; |
@@ -88,4 +86,6 @@ AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) : | |||
88 | 86 | ||
89 | QString skinPath = "opieplayer2/skins/" + skin; | 87 | QString skinPath = "opieplayer2/skins/" + skin; |
88 | qDebug("skin path "+skinPath); | ||
89 | |||
90 | pixBg = new QPixmap( Resource::loadPixmap( QString("%1/background").arg(skinPath) ) ); | 90 | pixBg = new QPixmap( Resource::loadPixmap( QString("%1/background").arg(skinPath) ) ); |
91 | imgUp = new QImage( Resource::loadImage( QString("%1/skin_up").arg(skinPath) ) ); | 91 | imgUp = new QImage( Resource::loadImage( QString("%1/skin_up").arg(skinPath) ) ); |
@@ -95,5 +95,5 @@ AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) : | |||
95 | imgButtonMask->fill( 0 ); | 95 | imgButtonMask->fill( 0 ); |
96 | 96 | ||
97 | for ( int i = 0; i < 11; i++ ) { | 97 | for ( int i = 0; i < 10; i++ ) { |
98 | QString filename = QString(getenv("OPIEDIR")) + "/pics/" + skinPath + "/skin_mask_" + skin_mask_file_names[i] + ".png"; | 98 | QString filename = QString(getenv("OPIEDIR")) + "/pics/" + skinPath + "/skin_mask_" + skin_mask_file_names[i] + ".png"; |
99 | masks[i] = new QBitmap( filename ); | 99 | masks[i] = new QBitmap( filename ); |
@@ -162,5 +162,5 @@ AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) : | |||
162 | AudioWidget::~AudioWidget() { | 162 | AudioWidget::~AudioWidget() { |
163 | 163 | ||
164 | for ( int i = 0; i < 11; i++ ) { | 164 | for ( int i = 0; i < 10; i++ ) { |
165 | delete buttonPixUp[i]; | 165 | delete buttonPixUp[i]; |
166 | delete buttonPixDown[i]; | 166 | delete buttonPixDown[i]; |
@@ -170,5 +170,5 @@ AudioWidget::~AudioWidget() { | |||
170 | delete imgDn; | 170 | delete imgDn; |
171 | delete imgButtonMask; | 171 | delete imgButtonMask; |
172 | for ( int i = 0; i < 11; i++ ) { | 172 | for ( int i = 0; i < 10; i++ ) { |
173 | delete masks[i]; | 173 | delete masks[i]; |
174 | } | 174 | } |
@@ -211,5 +211,5 @@ void AudioWidget::resizeEvent( QResizeEvent * ) { | |||
211 | QPixmap *pixDn = combineImageWithBackground( *imgDn, *pixBg, p ); | 211 | QPixmap *pixDn = combineImageWithBackground( *imgDn, *pixBg, p ); |
212 | 212 | ||
213 | for ( int i = 0; i < 11; i++ ) { | 213 | for ( int i = 0; i < 10; i++ ) { |
214 | if ( !masks[i]->isNull() ) { | 214 | if ( !masks[i]->isNull() ) { |
215 | delete buttonPixUp[i]; | 215 | delete buttonPixUp[i]; |
diff --git a/core/multimedia/opieplayer/playlistwidget.cpp b/core/multimedia/opieplayer/playlistwidget.cpp index 6580a88..a937d7c 100644 --- a/core/multimedia/opieplayer/playlistwidget.cpp +++ b/core/multimedia/opieplayer/playlistwidget.cpp | |||
@@ -194,4 +194,12 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl ) | |||
194 | scaleButton->addTo(pmView); | 194 | scaleButton->addTo(pmView); |
195 | 195 | ||
196 | |||
197 | skinsMenu = new QPopupMenu( this ); | ||
198 | menu->insertItem( tr( "Skins" ), skinsMenu ); | ||
199 | skinsMenu->isCheckable(); | ||
200 | connect( skinsMenu, SIGNAL( activated( int ) ) , | ||
201 | this, SLOT( skinsMenuActivated( int ) ) ); | ||
202 | populateSkinsMenu(); | ||
203 | |||
196 | QVBox *vbox5 = new QVBox( this ); vbox5->setBackgroundMode( PaletteButton ); | 204 | QVBox *vbox5 = new QVBox( this ); vbox5->setBackgroundMode( PaletteButton ); |
197 | QVBox *vbox4 = new QVBox( vbox5 ); vbox4->setBackgroundMode( PaletteButton ); | 205 | QVBox *vbox4 = new QVBox( vbox5 ); vbox4->setBackgroundMode( PaletteButton ); |
@@ -1351,2 +1359,42 @@ void PlayListWidget::doUnblank() { | |||
1351 | } | 1359 | } |
1352 | 1360 | ||
1361 | void PlayListWidget::populateSkinsMenu() { | ||
1362 | int item = 0; | ||
1363 | defaultSkinIndex = 0; | ||
1364 | QString skinName; | ||
1365 | Config cfg( "OpiePlayer" ); | ||
1366 | cfg.setGroup("Options" ); | ||
1367 | QString skin = cfg.readEntry( "Skin", "default" ); | ||
1368 | |||
1369 | QDir skinsDir( QPEApplication::qpeDir() + "/pics/opieplayer2/skins" ); | ||
1370 | skinsDir.setFilter( QDir::Dirs ); | ||
1371 | skinsDir.setSorting(QDir::Name ); | ||
1372 | const QFileInfoList *skinslist = skinsDir.entryInfoList(); | ||
1373 | QFileInfoListIterator it( *skinslist ); | ||
1374 | QFileInfo *fi; | ||
1375 | while ( ( fi = it.current() ) ) { | ||
1376 | skinName = fi->fileName(); | ||
1377 | // qDebug( fi->fileName() ); | ||
1378 | if( skinName != "." && skinName != ".." && skinName !="CVS" ) { | ||
1379 | item = skinsMenu->insertItem( fi->fileName() ) ; | ||
1380 | } | ||
1381 | if( skinName == "default" ) { | ||
1382 | defaultSkinIndex = item; | ||
1383 | } | ||
1384 | if( skinName == skin ) { | ||
1385 | skinsMenu->setItemChecked( item, TRUE ); | ||
1386 | } | ||
1387 | ++it; | ||
1388 | } | ||
1389 | } | ||
1390 | |||
1391 | void PlayListWidget::skinsMenuActivated( int item ) { | ||
1392 | for( int i = defaultSkinIndex; i > defaultSkinIndex - skinsMenu->count(); i-- ) { | ||
1393 | skinsMenu->setItemChecked( i, FALSE ); | ||
1394 | } | ||
1395 | skinsMenu->setItemChecked( item, TRUE ); | ||
1396 | |||
1397 | Config cfg( "OpiePlayer" ); | ||
1398 | cfg.setGroup("Options"); | ||
1399 | cfg.writeEntry("Skin", skinsMenu->text( item ) ); | ||
1400 | } | ||
diff --git a/core/multimedia/opieplayer/playlistwidget.h b/core/multimedia/opieplayer/playlistwidget.h index 1be5a15..1118b76 100644 --- a/core/multimedia/opieplayer/playlistwidget.h +++ b/core/multimedia/opieplayer/playlistwidget.h | |||
@@ -38,4 +38,5 @@ class QPoint; | |||
38 | class QAction; | 38 | class QAction; |
39 | class QLabel; | 39 | class QLabel; |
40 | class QPopupMenu; | ||
40 | 41 | ||
41 | class PlayListWidget : public QMainWindow { | 42 | class PlayListWidget : public QMainWindow { |
@@ -68,4 +69,5 @@ public slots: | |||
68 | /* void setScaled(); */ | 69 | /* void setScaled(); */ |
69 | protected: | 70 | protected: |
71 | QPopupMenu *skinsMenu; | ||
70 | /* void contentsMousePressEvent( QMouseEvent * e ); */ | 72 | /* void contentsMousePressEvent( QMouseEvent * e ); */ |
71 | /* void contentsMouseReleaseEvent( QMouseEvent * e ); */ | 73 | /* void contentsMouseReleaseEvent( QMouseEvent * e ); */ |
@@ -73,4 +75,5 @@ void keyReleaseEvent( QKeyEvent *e); | |||
73 | void keyPressEvent( QKeyEvent *e); | 75 | void keyPressEvent( QKeyEvent *e); |
74 | private: | 76 | private: |
77 | int defaultSkinIndex; | ||
75 | bool audioScan, videoScan; | 78 | bool audioScan, videoScan; |
76 | void doBlank(); | 79 | void doBlank(); |
@@ -88,4 +91,6 @@ private: | |||
88 | private slots: | 91 | private slots: |
89 | 92 | ||
93 | void populateSkinsMenu(); | ||
94 | void skinsMenuActivated(int); | ||
90 | void writem3u(); | 95 | void writem3u(); |
91 | void writeCurrentM3u(); | 96 | void writeCurrentM3u(); |