summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/audiowidget.cpp13
-rw-r--r--noncore/multimedia/opieplayer2/mediawidget.cpp23
-rw-r--r--noncore/multimedia/opieplayer2/mediawidget.h3
-rw-r--r--noncore/multimedia/opieplayer2/videowidget.cpp11
4 files changed, 28 insertions, 22 deletions
diff --git a/noncore/multimedia/opieplayer2/audiowidget.cpp b/noncore/multimedia/opieplayer2/audiowidget.cpp
index 0b7cc45..bb686f1 100644
--- a/noncore/multimedia/opieplayer2/audiowidget.cpp
+++ b/noncore/multimedia/opieplayer2/audiowidget.cpp
@@ -194,14 +194,3 @@ void AudioWidget::loadSkin()
{
- Config cfg("OpiePlayer");
- cfg.setGroup("Options");
- skin = cfg.readEntry("Skin","default");
- //skin = "scaleTest";
- // color of background, frame, degree of transparency
-
- QString skinPath = "opieplayer2/skins/" + skin;
- backgroundPixmap = QPixmap( Resource::loadPixmap( QString("%1/background").arg(skinPath) ) );
- buttonUpImage = QImage( Resource::loadImage( QString("%1/skin_up").arg(skinPath) ) );
- buttonDownImage = QImage( Resource::loadImage( QString("%1/skin_down").arg(skinPath) ) );
-
- setupButtons( skinInfo, buttonCount, QPEApplication::qpeDir() + "/pics/" + skinPath + "/skin_mask_", buttonUpImage.size() );
+ loadDefaultSkin( skinInfo, buttonCount );
diff --git a/noncore/multimedia/opieplayer2/mediawidget.cpp b/noncore/multimedia/opieplayer2/mediawidget.cpp
index d60dc0d..c9d7db8 100644
--- a/noncore/multimedia/opieplayer2/mediawidget.cpp
+++ b/noncore/multimedia/opieplayer2/mediawidget.cpp
@@ -26,2 +26,5 @@
+#include <qpe/config.h>
+#include <qpe/qpeapplication.h>
+
MediaWidget::MediaWidget( PlayListWidget &_playList, MediaPlayerState &_mediaPlayerState, QWidget *parent, const char *name )
@@ -87,2 +90,22 @@ QBitmap MediaWidget::setupButtonMask( const Command &command, const QString &fil
+void MediaWidget::loadDefaultSkin( const SkinButtonInfo *skinInfo, uint buttonCount, const QString &fileNameInfix )
+{
+ Config cfg( "OpiePlayer" );
+ cfg.setGroup( "Options" );
+ QString skin = cfg.readEntry( "Skin","default" );
+
+ loadSkin( skinInfo, buttonCount, skin, fileNameInfix );
+}
+
+void MediaWidget::loadSkin( const SkinButtonInfo *skinInfo, uint buttonCount, const QString &name, const QString &fileNameInfix )
+{
+ QString skinPath = "opieplayer2/skins/" + name;
+ backgroundPixmap = QPixmap( Resource::loadPixmap( QString( "%1/background" ).arg( skinPath ) ) );
+ buttonUpImage = QImage( Resource::loadImage( QString( "%1/skin%2_up" ).arg( skinPath ).arg( fileNameInfix ) ) );
+ buttonDownImage = QImage( Resource::loadImage( QString( "%1/skin%2_down" ).arg( skinPath ).arg( fileNameInfix ) ) );
+
+ setupButtons( skinInfo, buttonCount,
+ QPEApplication::qpeDir() + "/pics/" + skinPath + QString::fromLatin1( "/skin%1_mask_" ).arg( fileNameInfix ), buttonUpImage.size() );
+}
+
void MediaWidget::closeEvent( QCloseEvent * )
diff --git a/noncore/multimedia/opieplayer2/mediawidget.h b/noncore/multimedia/opieplayer2/mediawidget.h
index 754228e..52b9fcb 100644
--- a/noncore/multimedia/opieplayer2/mediawidget.h
+++ b/noncore/multimedia/opieplayer2/mediawidget.h
@@ -106,2 +106,5 @@ protected:
+ void loadDefaultSkin( const SkinButtonInfo *skinInfo, uint buttonCount, const QString &fileNameInfix = QString::null );
+ void loadSkin( const SkinButtonInfo *skinInfo, uint buttonCount, const QString &name, const QString &fileNameInfix );
+
virtual void closeEvent( QCloseEvent * );
diff --git a/noncore/multimedia/opieplayer2/videowidget.cpp b/noncore/multimedia/opieplayer2/videowidget.cpp
index 0047ac0..bc47717 100644
--- a/noncore/multimedia/opieplayer2/videowidget.cpp
+++ b/noncore/multimedia/opieplayer2/videowidget.cpp
@@ -187,12 +187,3 @@ void VideoWidget::loadSkin()
{
- Config cfg("OpiePlayer");
- cfg.setGroup("Options");
- QString skin = cfg.readEntry("Skin","default");
-
- QString skinPath = "opieplayer2/skins/" + skin;
- backgroundPixmap = QPixmap( Resource::loadPixmap( QString("%1/background").arg(skinPath) ) );
- buttonUpImage = QImage( Resource::loadImage( QString("%1/skinV_up").arg(skinPath) ) );
- buttonDownImage = QImage( Resource::loadImage( QString("%1/skinV_down").arg(skinPath) ) );
-
- setupButtons( skinInfo, buttonCount, QPEApplication::qpeDir() + "/pics/" + skinPath + "/skinV_mask_", buttonUpImage.size() );
+ loadDefaultSkin( skinInfo, buttonCount, "V" );