1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-06 06:07:37 +02:00

* Style fixes.

This commit is contained in:
Christian Muehlhaeuser
2012-07-12 11:22:25 +02:00
parent c09dcc74e3
commit f239473f0c
2 changed files with 43 additions and 39 deletions

View File

@@ -362,7 +362,6 @@ TomahawkWindow::setupWindowsButtons()
m_thumbButtons[TP_PLAY_PAUSE].dwFlags = THBF_ENABLED; m_thumbButtons[TP_PLAY_PAUSE].dwFlags = THBF_ENABLED;
m_thumbButtons[TP_PLAY_PAUSE].szTip[ tr( "Play" ).toWCharArray( m_thumbButtons[TP_PLAY_PAUSE].szTip ) ] = 0; m_thumbButtons[TP_PLAY_PAUSE].szTip[ tr( "Play" ).toWCharArray( m_thumbButtons[TP_PLAY_PAUSE].szTip ) ] = 0;
m_thumbButtons[TP_NEXT].dwMask = dwMask; m_thumbButtons[TP_NEXT].dwMask = dwMask;
m_thumbButtons[TP_NEXT].iId = TP_NEXT; m_thumbButtons[TP_NEXT].iId = TP_NEXT;
m_thumbButtons[TP_NEXT].hIcon = next.toWinHICON(); m_thumbButtons[TP_NEXT].hIcon = next.toWinHICON();
@@ -629,61 +628,66 @@ TomahawkWindow::winEvent( MSG* msg, long* result )
return false; return false;
} }
void TomahawkWindow::audioStateChanged( AudioState newState, AudioState oldState )
void
TomahawkWindow::audioStateChanged( AudioState newState, AudioState oldState )
{ {
if(m_taskbarList == 0) if ( m_taskbarList == 0 )
return; return;
switch(newState){
case AudioEngine::Playing: switch ( newState )
{ {
QPixmap pause( RESPATH "images/pause-rest.png" ); case AudioEngine::Playing:
m_thumbButtons[TP_PLAY_PAUSE].hIcon = pause.toWinHICON();
m_thumbButtons[TP_PLAY_PAUSE].szTip[ tr( "Pause" ).toWCharArray( m_thumbButtons[TP_PLAY_PAUSE].szTip ) ] = 0;
if ( !AudioEngine::instance()->currentTrack().isNull() && AudioEngine::instance()->currentTrack()->toQuery()->loved())
{ {
QPixmap loved( RESPATH "images/loved.png" ); QPixmap pause( RESPATH "images/pause-rest.png" );
m_thumbButtons[TP_LOVE].hIcon = loved.toWinHICON(); m_thumbButtons[TP_PLAY_PAUSE].hIcon = pause.toWinHICON();
m_thumbButtons[TP_LOVE].szTip[ tr( "Unlove" ).toWCharArray( m_thumbButtons[TP_LOVE].szTip ) ] = 0; m_thumbButtons[TP_PLAY_PAUSE].szTip[ tr( "Pause" ).toWCharArray( m_thumbButtons[TP_PLAY_PAUSE].szTip ) ] = 0;
if ( !AudioEngine::instance()->currentTrack().isNull() && AudioEngine::instance()->currentTrack()->toQuery()->loved() )
{
QPixmap loved( RESPATH "images/loved.png" );
m_thumbButtons[TP_LOVE].hIcon = loved.toWinHICON();
m_thumbButtons[TP_LOVE].szTip[ tr( "Unlove" ).toWCharArray( m_thumbButtons[TP_LOVE].szTip ) ] = 0;
}
else
{
QPixmap not_loved( RESPATH "images/not-loved.png" );
m_thumbButtons[TP_LOVE].hIcon = not_loved.toWinHICON();
m_thumbButtons[TP_LOVE].szTip[ tr( "Love" ).toWCharArray( m_thumbButtons[TP_LOVE].szTip ) ] = 0;
}
m_thumbButtons[TP_LOVE].dwFlags = THBF_ENABLED;
} }
else break;
case AudioEngine::Paused:
{ {
QPixmap play( RESPATH "images/play-rest.png" );
m_thumbButtons[TP_PLAY_PAUSE].hIcon = play.toWinHICON();
m_thumbButtons[TP_PLAY_PAUSE].szTip[ tr( "Play" ).toWCharArray( m_thumbButtons[TP_PLAY_PAUSE].szTip ) ] = 0;
}
break;
case AudioEngine::Stopped:
{
QPixmap play( RESPATH "images/play-rest.png" );
m_thumbButtons[TP_PLAY_PAUSE].hIcon = play.toWinHICON();
m_thumbButtons[TP_PLAY_PAUSE].szTip[ tr( "Play" ).toWCharArray( m_thumbButtons[TP_PLAY_PAUSE].szTip ) ] = 0;
QPixmap not_loved( RESPATH "images/not-loved.png" ); QPixmap not_loved( RESPATH "images/not-loved.png" );
m_thumbButtons[TP_LOVE].hIcon = not_loved.toWinHICON(); m_thumbButtons[TP_LOVE].hIcon = not_loved.toWinHICON();
m_thumbButtons[TP_LOVE].szTip[ tr( "Love" ).toWCharArray( m_thumbButtons[TP_LOVE].szTip ) ] = 0; m_thumbButtons[TP_LOVE].dwFlags = THBF_DISABLED;
} }
m_thumbButtons[TP_LOVE].dwFlags = THBF_ENABLED;
}
break; break;
case AudioEngine::Paused:
{
QPixmap play( RESPATH "images/play-rest.png" );
m_thumbButtons[TP_PLAY_PAUSE].hIcon = play.toWinHICON();
m_thumbButtons[TP_PLAY_PAUSE].szTip[ tr( "Play" ).toWCharArray( m_thumbButtons[TP_PLAY_PAUSE].szTip ) ] = 0;
}
break;
case AudioEngine::Stopped:
{
QPixmap play( RESPATH "images/play-rest.png" );
m_thumbButtons[TP_PLAY_PAUSE].hIcon = play.toWinHICON();
m_thumbButtons[TP_PLAY_PAUSE].szTip[ tr( "Play" ).toWCharArray( m_thumbButtons[TP_PLAY_PAUSE].szTip ) ] = 0;
QPixmap not_loved( RESPATH "images/not-loved.png" ); default:
m_thumbButtons[TP_LOVE].hIcon = not_loved.toWinHICON(); return;
m_thumbButtons[TP_LOVE].dwFlags = THBF_DISABLED;
}
break;
default:
return;
} }
m_taskbarList->ThumbBarUpdateButtons( winId(), ARRAYSIZE( m_thumbButtons ), m_thumbButtons ); m_taskbarList->ThumbBarUpdateButtons( winId(), ARRAYSIZE( m_thumbButtons ), m_thumbButtons );
} }
#endif #endif
void void
TomahawkWindow::onHistoryBackAvailable( bool avail ) TomahawkWindow::onHistoryBackAvailable( bool avail )
{ {

View File

@@ -32,7 +32,7 @@
#include "utils/XspfLoader.h" #include "utils/XspfLoader.h"
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
#include <shobjidl.h> #include <shobjidl.h>
#endif #endif
namespace Tomahawk namespace Tomahawk