Diffstat (limited to 'core/multimedia/opieplayer/audiowidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/multimedia/opieplayer/audiowidget.cpp | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/core/multimedia/opieplayer/audiowidget.cpp b/core/multimedia/opieplayer/audiowidget.cpp index 94b979f..aa48961 100644 --- a/core/multimedia/opieplayer/audiowidget.cpp +++ b/core/multimedia/opieplayer/audiowidget.cpp @@ -14,16 +14,17 @@ ** See http://www.trolltech.com/gpl/ for GPL licensing information. ** ** Contact info@trolltech.com if any conditions of this licensing are ** not clear to you. ** **********************************************************************/ #include <qpe/qpeapplication.h> #include <qpe/resource.h> +#include <qpe/config.h> #include <qwidget.h> #include <qpixmap.h> #include <qbutton.h> #include <qpainter.h> #include <qframe.h> #include <qlayout.h> @@ -60,38 +61,45 @@ MediaButton audioButtons[] = { static const int numButtons = (sizeof(audioButtons)/sizeof(MediaButton)); AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) : QWidget( parent, name, f ) { setCaption( tr("OpiePlayer") ); - + Config cfg("OpiePlayer"); + cfg.setGroup("AudioWidget"); // QGridLayout *layout = new QGridLayout( this ); // layout->setSpacing( 2); // layout->setMargin( 2); - - setBackgroundPixmap( Resource::loadPixmap( "opieplayer/metalFinish" ) ); - pixmaps[0] = new QPixmap( Resource::loadPixmap( "opieplayer/mediaButtonsAll" ) ); - pixmaps[1] = new QPixmap( Resource::loadPixmap( "opieplayer/mediaButtonsBig" ) ); - pixmaps[2] = new QPixmap( Resource::loadPixmap( "opieplayer/mediaControls" ) ); - pixmaps[3] = new QPixmap( Resource::loadPixmap( "opieplayer/animatedButton" ) ); + QString backgroundPix, buttonsAllPix, buttonsBigPix, controlsPix, animatedPix; + backgroundPix=cfg.readEntry( " backgroundPix", "opieplayer/metalFinish"); + buttonsAllPix=cfg.readEntry( "buttonsAllPix","opieplayer/mediaButtonsAll"); + buttonsBigPix=cfg.readEntry( "buttonsBigPix","opieplayer/mediaButtonsBig"); + controlsPix=cfg.readEntry( "controlsPix","opieplayer/mediaControls"); + animatedPix=cfg.readEntry( "animatedPix", "opieplayer/animatedButton"); + + setBackgroundPixmap( Resource::loadPixmap( backgroundPix) ); + pixmaps[0] = new QPixmap( Resource::loadPixmap( buttonsAllPix ) ); + pixmaps[1] = new QPixmap( Resource::loadPixmap( buttonsBigPix ) ); + pixmaps[2] = new QPixmap( Resource::loadPixmap( controlsPix ) ); + pixmaps[3] = new QPixmap( Resource::loadPixmap( animatedPix) ); songInfo = new Ticker( this ); songInfo->setFocusPolicy( QWidget::NoFocus ); - songInfo->setGeometry( QRect( 7, 3, 220, 20 ) ); + songInfo->setGeometry( QRect( 7, 3, 220, 20 ) ); // layout->addMultiCellWidget( songInfo, 0, 0, 0, 2 ); slider = new QSlider( Qt::Horizontal, this ); slider->setFixedWidth( 220 ); slider->setFixedHeight( 20 ); slider->setMinValue( 0 ); slider->setMaxValue( 1 ); - slider->setBackgroundPixmap( Resource::loadPixmap( "opieplayer/metalFinish" ) ); + slider->setBackgroundPixmap( Resource::loadPixmap( backgroundPix ) ); slider->setFocusPolicy( QWidget::NoFocus ); slider->setGeometry( QRect( 7, 262, 220, 20 ) ); // layout->addMultiCellWidget( slider, 4, 4, 0, 2 ); connect( slider, SIGNAL( sliderPressed() ), this, SLOT( sliderPressed() ) ); connect( slider, SIGNAL( sliderReleased() ), this, SLOT( sliderReleased() ) ); connect( mediaPlayerState, SIGNAL( lengthChanged(long) ), this, SLOT( setLength(long) ) ); |