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 @@ -10,24 +10,25 @@ ** ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ** ** 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> #include "audiowidget.h" #include "mediaplayerstate.h" extern MediaPlayerState *mediaPlayerState; @@ -56,46 +57,53 @@ MediaButton audioButtons[] = { { 5*30+xo, 1*30+yo, 0, TRUE, FALSE, FALSE, FALSE }, // repeat/loop { 1*30+xo, 1*30+yo, 0, FALSE, FALSE, FALSE, FALSE } // playlist }; 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) ) ); connect( mediaPlayerState, SIGNAL( viewChanged(char) ), this, SLOT( setView(char) ) ); connect( mediaPlayerState, SIGNAL( loopingToggled(bool) ), this, SLOT( setLooping(bool) ) ); connect( mediaPlayerState, SIGNAL( pausedToggled(bool) ), this, SLOT( setPaused(bool) ) ); connect( mediaPlayerState, SIGNAL( playingToggled(bool) ), this, SLOT( setPlaying(bool) ) ); |