1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-03-22 16:59:58 +01:00

Make publishing the user tune optional

This commit is contained in:
Dominik Schmidt 2012-03-28 15:34:51 +02:00
parent bac82c0abf
commit 301c1d21fe
3 changed files with 20 additions and 2 deletions

View File

@ -59,7 +59,13 @@ Tomahawk::InfoSystem::XmppInfoPlugin::~XmppInfoPlugin()
void
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 )
{

View File

@ -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->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->xmppPublishTracksCheckbox->setChecked( account->configuration().contains( "publishtracks" ) ? account->configuration()[ "publishtracks" ].toBool() : true);
m_ui->jidExistsLabel->hide();
connect( m_ui->xmppUsername, SIGNAL( textChanged( QString ) ), SLOT( onCheckJidExists( QString ) ) );
@ -64,6 +65,7 @@ XmppConfigWidget::saveConfig()
QVariantHash configuration = m_account->configuration();
configuration[ "server" ] = m_ui->xmppServer->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->setCredentials( credentials );

View File

@ -209,7 +209,7 @@
<property name="title">
<string>Advanced Xmpp Settings</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_5">
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
@ -293,6 +293,16 @@
</item>
</layout>
</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>
</widget>
</item>