1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-03-19 15:29:42 +01:00

* Prevent more than one SocialWidget showing up at a time.

This commit is contained in:
Christian Muehlhaeuser 2012-06-12 05:18:27 +02:00
parent caaec5c1c8
commit 2bb175860b
2 changed files with 10 additions and 4 deletions

View File

@ -600,10 +600,13 @@ AudioControls::droppedTracks( QList< query_ptr > tracks )
void
AudioControls::onSocialButtonClicked()
{
SocialWidget* sw = new SocialWidget( m_parent );
sw->setPosition( sw->mapFromGlobal( QCursor::pos() ) );
sw->setQuery( m_currentTrack->toQuery() );
sw->show();
if ( !m_socialWidget.isNull() )
return;
m_socialWidget = new SocialWidget( m_parent );
m_socialWidget.data()->setPosition( m_socialWidget.data()->mapFromGlobal( QCursor::pos() ) );
m_socialWidget.data()->setQuery( m_currentTrack->toQuery() );
m_socialWidget.data()->show();
}

View File

@ -31,6 +31,7 @@
class QDropEvent;
class QDragEnterEvent;
class QDragMoveEvent;
class SocialWidget;
namespace Ui
{
@ -91,6 +92,8 @@ private:
void setSocialActions();
Ui::AudioControls* ui;
QWeakPointer<SocialWidget> m_socialWidget;
Tomahawk::result_ptr m_currentTrack;
Tomahawk::PlaylistModes::RepeatMode m_repeatMode;