-rw-r--r-- | noncore/multimedia/opieplayer2/audiowidget.cpp | 2 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/playlistwidget.cpp | 48 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/playlistwidget.h | 4 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/videowidget.cpp | 2 |
4 files changed, 54 insertions, 2 deletions
diff --git a/noncore/multimedia/opieplayer2/audiowidget.cpp b/noncore/multimedia/opieplayer2/audiowidget.cpp index 2ee9383..a3d34f4 100644 --- a/noncore/multimedia/opieplayer2/audiowidget.cpp +++ b/noncore/multimedia/opieplayer2/audiowidget.cpp | |||
@@ -133,5 +133,5 @@ AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) : | |||
133 | 133 | ||
134 | Config cfg("OpiePlayer"); | 134 | Config cfg("OpiePlayer"); |
135 | cfg.setGroup("AudioWidget"); | 135 | cfg.setGroup("Options"); |
136 | skin = cfg.readEntry("Skin","default"); | 136 | skin = cfg.readEntry("Skin","default"); |
137 | //skin = "scaleTest"; | 137 | //skin = "scaleTest"; |
diff --git a/noncore/multimedia/opieplayer2/playlistwidget.cpp b/noncore/multimedia/opieplayer2/playlistwidget.cpp index 2521906..c210ffb 100644 --- a/noncore/multimedia/opieplayer2/playlistwidget.cpp +++ b/noncore/multimedia/opieplayer2/playlistwidget.cpp | |||
@@ -174,4 +174,11 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl ) | |||
174 | pmView->insertItem( Resource::loadPixmap("opieplayer/scale") , tr( "Scale"), mediaPlayerState, SLOT(toggleScaled() ) ); | 174 | pmView->insertItem( Resource::loadPixmap("opieplayer/scale") , tr( "Scale"), mediaPlayerState, SLOT(toggleScaled() ) ); |
175 | 175 | ||
176 | pmView->insertSeparator(-1); | ||
177 | |||
178 | skinsMenu = new QPopupMenu( this ); | ||
179 | pmView->insertItem( tr( "Skins" ), skinsMenu ); | ||
180 | skinsMenu->isCheckable(); | ||
181 | populateSkinsMenu(); | ||
182 | |||
176 | QVBox *vbox5 = new QVBox( this ); vbox5->setBackgroundMode( PaletteButton ); | 183 | QVBox *vbox5 = new QVBox( this ); vbox5->setBackgroundMode( PaletteButton ); |
177 | QVBox *vbox4 = new QVBox( vbox5 ); vbox4->setBackgroundMode( PaletteButton ); | 184 | QVBox *vbox4 = new QVBox( vbox5 ); vbox4->setBackgroundMode( PaletteButton ); |
@@ -253,4 +260,6 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl ) | |||
253 | connect( pmView, SIGNAL( activated(int)), this, SLOT( pmViewActivated(int) ) ); | 260 | connect( pmView, SIGNAL( activated(int)), this, SLOT( pmViewActivated(int) ) ); |
254 | 261 | ||
262 | connect( skinsMenu, SIGNAL( activated(int)), this, SLOT(skinsMenuActivated(int) ) ); | ||
263 | |||
255 | // connect( scaleButton, SIGNAL(activated()), mediaPlayerState, SLOT(toggleScaled() ) ); | 264 | // connect( scaleButton, SIGNAL(activated()), mediaPlayerState, SLOT(toggleScaled() ) ); |
256 | 265 | ||
@@ -1236,2 +1245,41 @@ switch(index) { | |||
1236 | }; | 1245 | }; |
1237 | } | 1246 | } |
1247 | |||
1248 | void PlayListWidget::populateSkinsMenu() { | ||
1249 | int item=0; | ||
1250 | defaultSkinIndex=0; | ||
1251 | QString skinName; | ||
1252 | Config cfg( "OpiePlayer" ); | ||
1253 | cfg.setGroup("Options"); | ||
1254 | QString skin = cfg.readEntry("Skin","default"); | ||
1255 | |||
1256 | QDir skinsDir(QPEApplication::qpeDir()+"/pics/opieplayer2/skins"); | ||
1257 | skinsDir.setFilter( QDir::Dirs); | ||
1258 | skinsDir.setSorting(QDir::Name); | ||
1259 | const QFileInfoList *skinslist = skinsDir.entryInfoList(); | ||
1260 | QFileInfoListIterator it( *skinslist ); | ||
1261 | QFileInfo *fi; | ||
1262 | while ( (fi=it.current()) ) { | ||
1263 | skinName = fi->fileName(); | ||
1264 | qDebug( fi->fileName()); | ||
1265 | if( skinName != "." && skinName != ".." && skinName !="CVS") | ||
1266 | item = skinsMenu->insertItem( fi->fileName()); | ||
1267 | if( skinName == "default") | ||
1268 | defaultSkinIndex = item; | ||
1269 | if( skinName == skin) | ||
1270 | skinsMenu->setItemChecked( item, TRUE); | ||
1271 | |||
1272 | ++it; | ||
1273 | } | ||
1274 | } | ||
1275 | |||
1276 | void PlayListWidget::skinsMenuActivated(int item) { | ||
1277 | for(int i = defaultSkinIndex; i > defaultSkinIndex - skinsMenu->count(); i--) { | ||
1278 | skinsMenu->setItemChecked( i, FALSE); | ||
1279 | } | ||
1280 | skinsMenu->setItemChecked( item, TRUE); | ||
1281 | |||
1282 | Config cfg( "OpiePlayer" ); | ||
1283 | cfg.setGroup("Options"); | ||
1284 | cfg.writeEntry("Skin", skinsMenu->text( item)); | ||
1285 | } | ||
diff --git a/noncore/multimedia/opieplayer2/playlistwidget.h b/noncore/multimedia/opieplayer2/playlistwidget.h index dd49892..67a85a8 100644 --- a/noncore/multimedia/opieplayer2/playlistwidget.h +++ b/noncore/multimedia/opieplayer2/playlistwidget.h | |||
@@ -57,4 +57,6 @@ void keyReleaseEvent( QKeyEvent *e); | |||
57 | void keyPressEvent( QKeyEvent *e); | 57 | void keyPressEvent( QKeyEvent *e); |
58 | private: | 58 | private: |
59 | int defaultSkinIndex; | ||
60 | QPopupMenu *skinsMenu; | ||
59 | bool audioScan, videoScan; | 61 | bool audioScan, videoScan; |
60 | void doBlank(); | 62 | void doBlank(); |
@@ -70,4 +72,6 @@ private: | |||
70 | void populateVideoView(); | 72 | void populateVideoView(); |
71 | private slots: | 73 | private slots: |
74 | void populateSkinsMenu(); | ||
75 | void skinsMenuActivated(int); | ||
72 | void pmViewActivated(int); | 76 | void pmViewActivated(int); |
73 | void writem3u(); | 77 | void writem3u(); |
diff --git a/noncore/multimedia/opieplayer2/videowidget.cpp b/noncore/multimedia/opieplayer2/videowidget.cpp index b4e69b5..fb375f0 100644 --- a/noncore/multimedia/opieplayer2/videowidget.cpp +++ b/noncore/multimedia/opieplayer2/videowidget.cpp | |||
@@ -88,5 +88,5 @@ QWidget( parent, name, f ), scaledWidth( 0 ), scaledHeight( 0 ) { | |||
88 | 88 | ||
89 | Config cfg("OpiePlayer"); | 89 | Config cfg("OpiePlayer"); |
90 | cfg.setGroup("VideoWidget"); | 90 | cfg.setGroup("Options"); |
91 | skin = cfg.readEntry("Skin","default"); | 91 | skin = cfg.readEntry("Skin","default"); |
92 | 92 | ||