summaryrefslogtreecommitdiff
authorsimon <simon>2002-12-11 13:12:29 (UTC)
committer simon <simon>2002-12-11 13:12:29 (UTC)
commitcd5e96b40ceae9158e5cb01e71769e895ea7a3c1 (patch) (unidiff)
tree0a5e1961a31096f995e00215d851c3af8e8ae877
parent57a776c8345422a0fc32b3fb9d604be1c050d201 (diff)
downloadopie-cd5e96b40ceae9158e5cb01e71769e895ea7a3c1.zip
opie-cd5e96b40ceae9158e5cb01e71769e895ea7a3c1.tar.gz
opie-cd5e96b40ceae9158e5cb01e71769e895ea7a3c1.tar.bz2
- moved default skin name reading over to skin class
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/mediawidget.cpp9
-rw-r--r--noncore/multimedia/opieplayer2/skin.cpp21
-rw-r--r--noncore/multimedia/opieplayer2/skin.h6
3 files changed, 26 insertions, 10 deletions
diff --git a/noncore/multimedia/opieplayer2/mediawidget.cpp b/noncore/multimedia/opieplayer2/mediawidget.cpp
index 0d1c8b6..ab23aa8 100644
--- a/noncore/multimedia/opieplayer2/mediawidget.cpp
+++ b/noncore/multimedia/opieplayer2/mediawidget.cpp
@@ -26,7 +26,4 @@
26#include "skin.h" 26#include "skin.h"
27 27
28#include <qpe/config.h>
29#include <qpe/qpeapplication.h>
30
31MediaWidget::MediaWidget( PlayListWidget &_playList, MediaPlayerState &_mediaPlayerState, QWidget *parent, const char *name ) 28MediaWidget::MediaWidget( PlayListWidget &_playList, MediaPlayerState &_mediaPlayerState, QWidget *parent, const char *name )
32 : QWidget( parent, name ), mediaPlayerState( _mediaPlayerState ), playList( _playList ) 29 : QWidget( parent, name ), mediaPlayerState( _mediaPlayerState ), playList( _playList )
@@ -70,9 +67,5 @@ MediaWidget::Button MediaWidget::setupButton( const SkinButtonInfo &buttonInfo,
70void MediaWidget::loadDefaultSkin( const SkinButtonInfo *skinInfo, uint buttonCount, const QString &fileNameInfix ) 67void MediaWidget::loadDefaultSkin( const SkinButtonInfo *skinInfo, uint buttonCount, const QString &fileNameInfix )
71{ 68{
72 Config cfg( "OpiePlayer" ); 69 Skin skin( fileNameInfix );
73 cfg.setGroup( "Options" );
74 QString name = cfg.readEntry( "Skin","default" );
75
76 Skin skin( name, fileNameInfix );
77 loadSkin( skinInfo, buttonCount, skin ); 70 loadSkin( skinInfo, buttonCount, skin );
78} 71}
diff --git a/noncore/multimedia/opieplayer2/skin.cpp b/noncore/multimedia/opieplayer2/skin.cpp
index d3918d1..8281b20 100644
--- a/noncore/multimedia/opieplayer2/skin.cpp
+++ b/noncore/multimedia/opieplayer2/skin.cpp
@@ -3,7 +3,19 @@
3 3
4#include <qpe/resource.h> 4#include <qpe/resource.h>
5#include <qpe/config.h>
5 6
6Skin::Skin( const QString &name, const QString &fileNameInfix ) 7Skin::Skin( const QString &name, const QString &fileNameInfix )
7 : m_name( name ), m_fileNameInfix( fileNameInfix ) 8 : m_fileNameInfix( fileNameInfix )
9{
10 init( name );
11}
12
13Skin::Skin( const QString &fileNameInfix )
14 : m_fileNameInfix( fileNameInfix )
15{
16 init( defaultSkinName() );
17}
18
19void Skin::init( const QString &name )
8{ 20{
9 m_skinPath = "opieplayer2/skins/" + name; 21 m_skinPath = "opieplayer2/skins/" + name;
@@ -80,4 +92,11 @@ QImage Skin::buttonMaskImage( const QString &fileName ) const
80} 92}
81 93
94QString Skin::defaultSkinName()
95{
96 Config cfg( "OpiePlayer" );
97 cfg.setGroup( "Options" );
98 return cfg.readEntry( "Skin", "default" );
99}
100
82/* vim: et sw=4 ts=4 101/* vim: et sw=4 ts=4
83 */ 102 */
diff --git a/noncore/multimedia/opieplayer2/skin.h b/noncore/multimedia/opieplayer2/skin.h
index ee19f4b..58f1849 100644
--- a/noncore/multimedia/opieplayer2/skin.h
+++ b/noncore/multimedia/opieplayer2/skin.h
@@ -12,4 +12,5 @@ class Skin
12public: 12public:
13 Skin( const QString &name, const QString &fileNameInfix ); 13 Skin( const QString &name, const QString &fileNameInfix );
14 Skin( const QString &fileNameInfix );
14 15
15 void preload( const MediaWidget::SkinButtonInfo *skinButtonInfo, uint buttonCount ); 16 void preload( const MediaWidget::SkinButtonInfo *skinButtonInfo, uint buttonCount );
@@ -23,8 +24,11 @@ public:
23 QImage buttonMaskImage( const QString &fileName ) const; 24 QImage buttonMaskImage( const QString &fileName ) const;
24 25
26 static QString defaultSkinName();
27
25private: 28private:
29 void init( const QString &name );
30
26 void addButtonToMask( int tag, const QImage &maskImage ) const; 31 void addButtonToMask( int tag, const QImage &maskImage ) const;
27 32
28 QString m_name;
29 QString m_fileNameInfix; 33 QString m_fileNameInfix;
30 QString m_skinPath; 34 QString m_skinPath;