Diffstat (limited to 'noncore/multimedia/opieplayer2/mediawidget.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/multimedia/opieplayer2/mediawidget.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
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 | |||
@@ -24,6 +24,9 @@ | |||
24 | #include "mediawidget.h" | 24 | #include "mediawidget.h" |
25 | #include "playlistwidget.h" | 25 | #include "playlistwidget.h" |
26 | 26 | ||
27 | #include <qpe/config.h> | ||
28 | #include <qpe/qpeapplication.h> | ||
29 | |||
27 | MediaWidget::MediaWidget( PlayListWidget &_playList, MediaPlayerState &_mediaPlayerState, QWidget *parent, const char *name ) | 30 | MediaWidget::MediaWidget( PlayListWidget &_playList, MediaPlayerState &_mediaPlayerState, QWidget *parent, const char *name ) |
28 | : QWidget( parent, name ), mediaPlayerState( _mediaPlayerState ), playList( _playList ) | 31 | : QWidget( parent, name ), mediaPlayerState( _mediaPlayerState ), playList( _playList ) |
29 | { | 32 | { |
@@ -85,6 +88,26 @@ QBitmap MediaWidget::setupButtonMask( const Command &command, const QString &fil | |||
85 | return mask; | 88 | return mask; |
86 | } | 89 | } |
87 | 90 | ||
91 | void MediaWidget::loadDefaultSkin( const SkinButtonInfo *skinInfo, uint buttonCount, const QString &fileNameInfix ) | ||
92 | { | ||
93 | Config cfg( "OpiePlayer" ); | ||
94 | cfg.setGroup( "Options" ); | ||
95 | QString skin = cfg.readEntry( "Skin","default" ); | ||
96 | |||
97 | loadSkin( skinInfo, buttonCount, skin, fileNameInfix ); | ||
98 | } | ||
99 | |||
100 | void MediaWidget::loadSkin( const SkinButtonInfo *skinInfo, uint buttonCount, const QString &name, const QString &fileNameInfix ) | ||
101 | { | ||
102 | QString skinPath = "opieplayer2/skins/" + name; | ||
103 | backgroundPixmap = QPixmap( Resource::loadPixmap( QString( "%1/background" ).arg( skinPath ) ) ); | ||
104 | buttonUpImage = QImage( Resource::loadImage( QString( "%1/skin%2_up" ).arg( skinPath ).arg( fileNameInfix ) ) ); | ||
105 | buttonDownImage = QImage( Resource::loadImage( QString( "%1/skin%2_down" ).arg( skinPath ).arg( fileNameInfix ) ) ); | ||
106 | |||
107 | setupButtons( skinInfo, buttonCount, | ||
108 | QPEApplication::qpeDir() + "/pics/" + skinPath + QString::fromLatin1( "/skin%1_mask_" ).arg( fileNameInfix ), buttonUpImage.size() ); | ||
109 | } | ||
110 | |||
88 | void MediaWidget::closeEvent( QCloseEvent * ) | 111 | void MediaWidget::closeEvent( QCloseEvent * ) |
89 | { | 112 | { |
90 | mediaPlayerState.setList(); | 113 | mediaPlayerState.setList(); |