summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/multimedia/opieplayer/audiowidget.cpp20
-rw-r--r--core/multimedia/opieplayer/playlistwidget.cpp48
-rw-r--r--core/multimedia/opieplayer/playlistwidget.h5
3 files changed, 63 insertions, 10 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
@@ -50,3 +50,2 @@ MediaButton audioButtons[] = {
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
@@ -58,7 +57,7 @@ MediaButton audioButtons[] = {
58 { FALSE, FALSE, FALSE }, // forward 57 { FALSE, FALSE, FALSE }, // forward
59 { FALSE, FALSE, FALSE } // back 58 { FALSE, FALSE, FALSE } // back
60}; 59};
61 60
62const char *skin_mask_file_names[11] = { 61const 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"
@@ -66,3 +65,2 @@ const char *skin_mask_file_names[11] = {
66 65
67
68static void changeTextColor( QWidget *w ) { 66static void changeTextColor( QWidget *w ) {
@@ -83,3 +81,3 @@ AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) :
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");
@@ -89,2 +87,4 @@ AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) :
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) ) );
@@ -96,3 +96,3 @@ AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) :
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";
@@ -163,3 +163,3 @@ 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];
@@ -171,3 +171,3 @@ AudioWidget::~AudioWidget() {
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];
@@ -212,3 +212,3 @@ void AudioWidget::resizeEvent( QResizeEvent * ) {
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() ) {
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
@@ -195,2 +195,10 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl )
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 );
@@ -1352 +1360,41 @@ void PlayListWidget::doUnblank() {
1352 1360
1361void 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
1391void 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
@@ -39,2 +39,3 @@ class QAction;
39class QLabel; 39class QLabel;
40class QPopupMenu;
40 41
@@ -69,2 +70,3 @@ public slots:
69protected: 70protected:
71 QPopupMenu *skinsMenu;
70/* void contentsMousePressEvent( QMouseEvent * e ); */ 72/* void contentsMousePressEvent( QMouseEvent * e ); */
@@ -74,2 +76,3 @@ void keyPressEvent( QKeyEvent *e);
74private: 76private:
77 int defaultSkinIndex;
75 bool audioScan, videoScan; 78 bool audioScan, videoScan;
@@ -89,2 +92,4 @@ private slots:
89 92
93 void populateSkinsMenu();
94 void skinsMenuActivated(int);
90 void writem3u(); 95 void writem3u();