mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-06 14:16:32 +02:00
Make publishing the user tune optional
This commit is contained in:
@@ -59,7 +59,13 @@ Tomahawk::InfoSystem::XmppInfoPlugin::~XmppInfoPlugin()
|
|||||||
void
|
void
|
||||||
Tomahawk::InfoSystem::XmppInfoPlugin::pushInfo(QString caller, Tomahawk::InfoSystem::InfoType type, QVariant input)
|
Tomahawk::InfoSystem::XmppInfoPlugin::pushInfo(QString caller, Tomahawk::InfoSystem::InfoType type, QVariant input)
|
||||||
{
|
{
|
||||||
tDebug() << Q_FUNC_INFO;
|
tDebug() << Q_FUNC_INFO << m_sipPlugin->m_client->jid().full();
|
||||||
|
|
||||||
|
if( m_sipPlugin->m_account->configuration().value("publishtracks").toBool() == false )
|
||||||
|
{
|
||||||
|
tDebug() << Q_FUNC_INFO << m_sipPlugin->m_client->jid().full() << "Not publishing now playing info (disabled in account config)";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
switch ( type )
|
switch ( type )
|
||||||
{
|
{
|
||||||
|
@@ -43,6 +43,7 @@ XmppConfigWidget::XmppConfigWidget( XmppAccount* account, QWidget *parent ) :
|
|||||||
m_ui->xmppPassword->setText( account->credentials().contains( "password" ) ? account->credentials()[ "password" ].toString() : QString() );
|
m_ui->xmppPassword->setText( account->credentials().contains( "password" ) ? account->credentials()[ "password" ].toString() : QString() );
|
||||||
m_ui->xmppServer->setText( account->configuration().contains( "server" ) ? account->configuration()[ "server" ].toString() : QString() );
|
m_ui->xmppServer->setText( account->configuration().contains( "server" ) ? account->configuration()[ "server" ].toString() : QString() );
|
||||||
m_ui->xmppPort->setValue( account->configuration().contains( "port" ) ? account->configuration()[ "port" ].toInt() : 5222 );
|
m_ui->xmppPort->setValue( account->configuration().contains( "port" ) ? account->configuration()[ "port" ].toInt() : 5222 );
|
||||||
|
m_ui->xmppPublishTracksCheckbox->setChecked( account->configuration().contains( "publishtracks" ) ? account->configuration()[ "publishtracks" ].toBool() : true);
|
||||||
m_ui->jidExistsLabel->hide();
|
m_ui->jidExistsLabel->hide();
|
||||||
|
|
||||||
connect( m_ui->xmppUsername, SIGNAL( textChanged( QString ) ), SLOT( onCheckJidExists( QString ) ) );
|
connect( m_ui->xmppUsername, SIGNAL( textChanged( QString ) ), SLOT( onCheckJidExists( QString ) ) );
|
||||||
@@ -64,6 +65,7 @@ XmppConfigWidget::saveConfig()
|
|||||||
QVariantHash configuration = m_account->configuration();
|
QVariantHash configuration = m_account->configuration();
|
||||||
configuration[ "server" ] = m_ui->xmppServer->text().trimmed();
|
configuration[ "server" ] = m_ui->xmppServer->text().trimmed();
|
||||||
configuration[ "port" ] = m_ui->xmppPort->text().trimmed();
|
configuration[ "port" ] = m_ui->xmppPort->text().trimmed();
|
||||||
|
configuration[ "publishtracks"] = m_ui->xmppPublishTracksCheckbox->checkState() == Qt::Checked ? true : false;
|
||||||
|
|
||||||
m_account->setAccountFriendlyName( m_ui->xmppUsername->text() );
|
m_account->setAccountFriendlyName( m_ui->xmppUsername->text() );
|
||||||
m_account->setCredentials( credentials );
|
m_account->setCredentials( credentials );
|
||||||
|
@@ -209,7 +209,7 @@
|
|||||||
<property name="title">
|
<property name="title">
|
||||||
<string>Advanced Xmpp Settings</string>
|
<string>Advanced Xmpp Settings</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_5">
|
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||||
<item>
|
<item>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||||
<item>
|
<item>
|
||||||
@@ -293,6 +293,16 @@
|
|||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="xmppPublishTracksCheckbox">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Lots of servers don't support this (e.g. GTalk, jabber.org)</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Publish currently playing track</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
Reference in New Issue
Block a user