mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-06 14:16:32 +02:00
* Prevent more than one SocialWidget showing up at a time.
This commit is contained in:
@@ -600,10 +600,13 @@ AudioControls::droppedTracks( QList< query_ptr > tracks )
|
|||||||
void
|
void
|
||||||
AudioControls::onSocialButtonClicked()
|
AudioControls::onSocialButtonClicked()
|
||||||
{
|
{
|
||||||
SocialWidget* sw = new SocialWidget( m_parent );
|
if ( !m_socialWidget.isNull() )
|
||||||
sw->setPosition( sw->mapFromGlobal( QCursor::pos() ) );
|
return;
|
||||||
sw->setQuery( m_currentTrack->toQuery() );
|
|
||||||
sw->show();
|
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();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -31,6 +31,7 @@
|
|||||||
class QDropEvent;
|
class QDropEvent;
|
||||||
class QDragEnterEvent;
|
class QDragEnterEvent;
|
||||||
class QDragMoveEvent;
|
class QDragMoveEvent;
|
||||||
|
class SocialWidget;
|
||||||
|
|
||||||
namespace Ui
|
namespace Ui
|
||||||
{
|
{
|
||||||
@@ -91,6 +92,8 @@ private:
|
|||||||
void setSocialActions();
|
void setSocialActions();
|
||||||
|
|
||||||
Ui::AudioControls* ui;
|
Ui::AudioControls* ui;
|
||||||
|
|
||||||
|
QWeakPointer<SocialWidget> m_socialWidget;
|
||||||
|
|
||||||
Tomahawk::result_ptr m_currentTrack;
|
Tomahawk::result_ptr m_currentTrack;
|
||||||
Tomahawk::PlaylistModes::RepeatMode m_repeatMode;
|
Tomahawk::PlaylistModes::RepeatMode m_repeatMode;
|
||||||
|
Reference in New Issue
Block a user