Diffstat (limited to 'noncore/multimedia/opieplayer2/mediawidget.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/multimedia/opieplayer2/mediawidget.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/noncore/multimedia/opieplayer2/mediawidget.cpp b/noncore/multimedia/opieplayer2/mediawidget.cpp index 70ef8d9..617e0fe 100644 --- a/noncore/multimedia/opieplayer2/mediawidget.cpp +++ b/noncore/multimedia/opieplayer2/mediawidget.cpp | |||
@@ -14,24 +14,25 @@ | |||
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
15 | Library General Public License for more details. | 15 | Library General Public License for more details. |
16 | 16 | ||
17 | You should have received a copy of the GNU Library General Public License | 17 | You should have received a copy of the GNU Library General Public License |
18 | along with this library; see the file COPYING.LIB. If not, write to | 18 | along with this library; see the file COPYING.LIB. If not, write to |
19 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 19 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
20 | Boston, MA 02111-1307, USA. | 20 | Boston, MA 02111-1307, USA. |
21 | */ | 21 | */ |
22 | 22 | ||
23 | 23 | ||
24 | #include "mediawidget.h" | 24 | #include "mediawidget.h" |
25 | #include "playlistwidget.h" | 25 | #include "playlistwidget.h" |
26 | #include "skin.h" | ||
26 | 27 | ||
27 | #include <qpe/config.h> | 28 | #include <qpe/config.h> |
28 | #include <qpe/qpeapplication.h> | 29 | #include <qpe/qpeapplication.h> |
29 | 30 | ||
30 | MediaWidget::MediaWidget( PlayListWidget &_playList, MediaPlayerState &_mediaPlayerState, QWidget *parent, const char *name ) | 31 | MediaWidget::MediaWidget( PlayListWidget &_playList, MediaPlayerState &_mediaPlayerState, QWidget *parent, const char *name ) |
31 | : QWidget( parent, name ), mediaPlayerState( _mediaPlayerState ), playList( _playList ) | 32 | : QWidget( parent, name ), mediaPlayerState( _mediaPlayerState ), playList( _playList ) |
32 | { | 33 | { |
33 | connect( &mediaPlayerState, SIGNAL( displayTypeChanged( MediaPlayerState::DisplayType ) ), | 34 | connect( &mediaPlayerState, SIGNAL( displayTypeChanged( MediaPlayerState::DisplayType ) ), |
34 | this, SLOT( setDisplayType( MediaPlayerState::DisplayType ) ) ); | 35 | this, SLOT( setDisplayType( MediaPlayerState::DisplayType ) ) ); |
35 | connect( &mediaPlayerState, SIGNAL( lengthChanged( long ) ), | 36 | connect( &mediaPlayerState, SIGNAL( lengthChanged( long ) ), |
36 | this, SLOT( setLength( long ) ) ); | 37 | this, SLOT( setLength( long ) ) ); |
37 | connect( &mediaPlayerState, SIGNAL( playingToggled( bool ) ), | 38 | connect( &mediaPlayerState, SIGNAL( playingToggled( bool ) ), |
@@ -91,26 +92,28 @@ QBitmap MediaWidget::setupButtonMask( const Command &command, const QString &fil | |||
91 | 92 | ||
92 | void MediaWidget::loadDefaultSkin( const SkinButtonInfo *skinInfo, uint buttonCount, const QString &fileNameInfix ) | 93 | void MediaWidget::loadDefaultSkin( const SkinButtonInfo *skinInfo, uint buttonCount, const QString &fileNameInfix ) |
93 | { | 94 | { |
94 | Config cfg( "OpiePlayer" ); | 95 | Config cfg( "OpiePlayer" ); |
95 | cfg.setGroup( "Options" ); | 96 | cfg.setGroup( "Options" ); |
96 | QString skin = cfg.readEntry( "Skin","default" ); | 97 | QString skin = cfg.readEntry( "Skin","default" ); |
97 | 98 | ||
98 | loadSkin( skinInfo, buttonCount, skin, fileNameInfix ); | 99 | loadSkin( skinInfo, buttonCount, skin, fileNameInfix ); |
99 | } | 100 | } |
100 | 101 | ||
101 | void MediaWidget::loadSkin( const SkinButtonInfo *skinInfo, uint buttonCount, const QString &name, const QString &fileNameInfix ) | 102 | void MediaWidget::loadSkin( const SkinButtonInfo *skinInfo, uint buttonCount, const QString &name, const QString &fileNameInfix ) |
102 | { | 103 | { |
104 | Skin skin( name, fileNameInfix ); | ||
105 | |||
103 | QString skinPath = "opieplayer2/skins/" + name; | 106 | QString skinPath = "opieplayer2/skins/" + name; |
104 | backgroundPixmap = QPixmap( Resource::loadPixmap( QString( "%1/background" ).arg( skinPath ) ) ); | 107 | backgroundPixmap = skin.backgroundImage(); |
105 | buttonUpImage = QImage( Resource::loadImage( QString( "%1/skin%2_up" ).arg( skinPath ).arg( fileNameInfix ) ) ); | 108 | buttonUpImage = QImage( Resource::loadImage( QString( "%1/skin%2_up" ).arg( skinPath ).arg( fileNameInfix ) ) ); |
106 | buttonDownImage = QImage( Resource::loadImage( QString( "%1/skin%2_down" ).arg( skinPath ).arg( fileNameInfix ) ) ); | 109 | buttonDownImage = QImage( Resource::loadImage( QString( "%1/skin%2_down" ).arg( skinPath ).arg( fileNameInfix ) ) ); |
107 | 110 | ||
108 | setupButtons( skinInfo, buttonCount, | 111 | setupButtons( skinInfo, buttonCount, |
109 | skinPath + QString::fromLatin1( "/skin%1_mask_" ).arg( fileNameInfix ), buttonUpImage.size() ); | 112 | skinPath + QString::fromLatin1( "/skin%1_mask_" ).arg( fileNameInfix ), buttonUpImage.size() ); |
110 | } | 113 | } |
111 | 114 | ||
112 | void MediaWidget::closeEvent( QCloseEvent * ) | 115 | void MediaWidget::closeEvent( QCloseEvent * ) |
113 | { | 116 | { |
114 | mediaPlayerState.setList(); | 117 | mediaPlayerState.setList(); |
115 | } | 118 | } |
116 | 119 | ||