Diffstat (limited to 'core/multimedia/opieplayer/playlistwidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/multimedia/opieplayer/playlistwidget.cpp | 48 |
1 files changed, 48 insertions, 0 deletions
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 | |||
@@ -184,24 +184,32 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl ) | |||
184 | pmPlayList->insertSeparator(-1); | 184 | pmPlayList->insertSeparator(-1); |
185 | new MenuItem( pmPlayList, tr( "Rescan for Audio Files" ), this,SLOT( scanForAudio() ) ); | 185 | new MenuItem( pmPlayList, tr( "Rescan for Audio Files" ), this,SLOT( scanForAudio() ) ); |
186 | new MenuItem( pmPlayList, tr( "Rescan for Video Files" ), this,SLOT( scanForVideo() ) ); | 186 | new MenuItem( pmPlayList, tr( "Rescan for Video Files" ), this,SLOT( scanForVideo() ) ); |
187 | 187 | ||
188 | QPopupMenu *pmView = new QPopupMenu( this ); | 188 | QPopupMenu *pmView = new QPopupMenu( this ); |
189 | menu->insertItem( tr( "View" ), pmView ); | 189 | menu->insertItem( tr( "View" ), pmView ); |
190 | 190 | ||
191 | fullScreenButton = new QAction(tr("Full Screen"), Resource::loadPixmap("fullscreen"), QString::null, 0, this, 0); | 191 | fullScreenButton = new QAction(tr("Full Screen"), Resource::loadPixmap("fullscreen"), QString::null, 0, this, 0); |
192 | fullScreenButton->addTo(pmView); | 192 | fullScreenButton->addTo(pmView); |
193 | scaleButton = new QAction(tr("Scale"), Resource::loadPixmap("opieplayer/scale"), QString::null, 0, this, 0); | 193 | scaleButton = new QAction(tr("Scale"), Resource::loadPixmap("opieplayer/scale"), QString::null, 0, this, 0); |
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 ); |
198 | 206 | ||
199 | QHBox *hbox6 = new QHBox( vbox4 ); hbox6->setBackgroundMode( PaletteButton ); | 207 | QHBox *hbox6 = new QHBox( vbox4 ); hbox6->setBackgroundMode( PaletteButton ); |
200 | 208 | ||
201 | tabWidget = new QTabWidget( hbox6, "tabWidget" ); | 209 | tabWidget = new QTabWidget( hbox6, "tabWidget" ); |
202 | tabWidget->setTabShape(QTabWidget::Triangular); | 210 | tabWidget->setTabShape(QTabWidget::Triangular); |
203 | 211 | ||
204 | QWidget *pTab; | 212 | QWidget *pTab; |
205 | pTab = new QWidget( tabWidget, "pTab" ); | 213 | pTab = new QWidget( tabWidget, "pTab" ); |
206 | // playlistView = new QListView( pTab, "playlistview" ); | 214 | // playlistView = new QListView( pTab, "playlistview" ); |
207 | // playlistView->setMinimumSize(236,260); | 215 | // playlistView->setMinimumSize(236,260); |
@@ -1341,12 +1349,52 @@ void PlayListWidget::doUnblank() { | |||
1341 | // this crashes opieplayer with a segfault | 1349 | // this crashes opieplayer with a segfault |
1342 | // int fd; | 1350 | // int fd; |
1343 | // fd=open("/dev/fb0",O_RDWR); | 1351 | // fd=open("/dev/fb0",O_RDWR); |
1344 | qDebug("do unblanking"); | 1352 | qDebug("do unblanking"); |
1345 | if (fd != -1) { | 1353 | if (fd != -1) { |
1346 | ioctl(fd,FBIOBLANK,0); | 1354 | ioctl(fd,FBIOBLANK,0); |
1347 | close(fd); | 1355 | close(fd); |
1348 | } | 1356 | } |
1349 | QCopEnvelope h("QPE/System", "setBacklight(int)"); | 1357 | QCopEnvelope h("QPE/System", "setBacklight(int)"); |
1350 | h <<-3;// v[1]; // -3 Force on | 1358 | h <<-3;// v[1]; // -3 Force on |
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 | } | ||