summaryrefslogtreecommitdiff
path: root/core/multimedia/opieplayer/videowidget.cpp
Side-by-side diff
Diffstat (limited to 'core/multimedia/opieplayer/videowidget.cpp') (more/less context) (show whitespace changes)
-rw-r--r--core/multimedia/opieplayer/videowidget.cpp21
1 files changed, 16 insertions, 5 deletions
diff --git a/core/multimedia/opieplayer/videowidget.cpp b/core/multimedia/opieplayer/videowidget.cpp
index 3bce996..97997f9 100644
--- a/core/multimedia/opieplayer/videowidget.cpp
+++ b/core/multimedia/opieplayer/videowidget.cpp
@@ -10,24 +10,26 @@
**
** 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/resource.h>
#include <qpe/mediaplayerplugininterface.h>
+#include <qpe/config.h>
+
#include <qwidget.h>
#include <qpainter.h>
#include <qpixmap.h>
#include <qslider.h>
#include <qdrawutil.h>
#include "videowidget.h"
#include "mediaplayerstate.h"
#ifdef Q_WS_QWS
# define USE_DIRECT_PAINTER
# include <qdirectpainter_qws.h>
@@ -58,34 +60,43 @@ MediaButton videoButtons[] = {
{ 5+4*32+xo, 200+yo, FALSE, FALSE, FALSE, 3 }, // next
{ 5+5*32+xo, 200+yo, FALSE, FALSE, FALSE, 8 }, // playlist
{ 5+6*32+xo, 200+yo, TRUE, FALSE, FALSE, 9 } // fullscreen
};
static const int numButtons = (sizeof(videoButtons)/sizeof(MediaButton));
VideoWidget::VideoWidget(QWidget* parent, const char* name, WFlags f) :
QWidget( parent, name, f ), scaledWidth( 0 ), scaledHeight( 0 ) {
setCaption( tr("OpiePlayer") );
- setBackgroundPixmap( Resource::loadPixmap( "opieplayer/metalFinish" ) );
- pixmaps[0] = new QPixmap( Resource::loadPixmap( "opieplayer/mediaButton0a" ) );
- pixmaps[1] = new QPixmap( Resource::loadPixmap( "opieplayer/mediaButton0b" ) );
- pixmaps[2] = new QPixmap( Resource::loadPixmap( "opieplayer/mediaControls0" ) );
+ Config cfg("OpiePlayer");
+ cfg.setGroup("VideoWidget");
+
+ QString backgroundPix, Button0aPix, Button0bPix, controlsPix;
+ backgroundPix=cfg.readEntry( "backgroundPix", "opieplayer/metalFinish");
+ Button0aPix=cfg.readEntry( "Button0aPix", "opieplayer/mediaButton0a");
+ Button0bPix=cfg.readEntry( "Button0bPix","opieplayer/mediaButton0b");
+ controlsPix=cfg.readEntry( "controlsPix","opieplayer/mediaControls0" );
+
+ setBackgroundPixmap( Resource::loadPixmap( backgroundPix) );
+ pixmaps[0] = new QPixmap( Resource::loadPixmap( Button0aPix ) );
+ pixmaps[1] = new QPixmap( Resource::loadPixmap( Button0bPix ) );
+ pixmaps[2] = new QPixmap( Resource::loadPixmap( controlsPix) );
currentFrame = new QImage( 220 + 2, 160, (QPixmap::defaultDepth() == 16) ? 16 : 32 );
slider = new QSlider( Qt::Horizontal, this );
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, 250, 220, 20 ) );
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( positionChanged(long) ),this, SLOT( setPosition(long) ) );
connect( mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) );
connect( mediaPlayerState, SIGNAL( viewChanged(char) ), this, SLOT( setView(char) ) );
connect( mediaPlayerState, SIGNAL( pausedToggled(bool) ), this, SLOT( setPaused(bool) ) );
connect( mediaPlayerState, SIGNAL( playingToggled(bool) ), this, SLOT( setPlaying(bool) ) );