mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-06 06:07:37 +02:00
remove autoconnect options from config pages---now checking/unchecking sip plugins in the config dialog does the same thing and it was confusing
This commit is contained in:
@@ -302,13 +302,6 @@
|
|||||||
</property>
|
</property>
|
||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
|
||||||
<widget class="QCheckBox" name="checkBoxAutoConnect">
|
|
||||||
<property name="text">
|
|
||||||
<string>Connect automatically when Tomahawk starts</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<resources>
|
<resources>
|
||||||
|
@@ -41,7 +41,7 @@ GoogleWrapper::GoogleWrapper ( const QString& pluginID )
|
|||||||
m_ui->emailLabel->setText( tr( "Google Address" ) );
|
m_ui->emailLabel->setText( tr( "Google Address" ) );
|
||||||
m_ui->jabberBlurb->setText( tr( "Enter your Google login to connect with your friends using Tomahawk!" ) );
|
m_ui->jabberBlurb->setText( tr( "Enter your Google login to connect with your friends using Tomahawk!" ) );
|
||||||
m_ui->logoLabel->setPixmap( QPixmap( ":/gmail-logo.png" ) );
|
m_ui->logoLabel->setPixmap( QPixmap( ":/gmail-logo.png" ) );
|
||||||
|
m_ui->groupBoxJabberAdvanced->hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
QIcon
|
QIcon
|
||||||
|
@@ -72,7 +72,6 @@ JabberPlugin::JabberPlugin( const QString& pluginId )
|
|||||||
m_ui->setupUi( m_configWidget.data() );
|
m_ui->setupUi( m_configWidget.data() );
|
||||||
m_configWidget.data()->setVisible( false );
|
m_configWidget.data()->setVisible( false );
|
||||||
|
|
||||||
m_ui->checkBoxAutoConnect->setChecked( readAutoConnect() );
|
|
||||||
m_ui->jabberUsername->setText( accountName() );
|
m_ui->jabberUsername->setText( accountName() );
|
||||||
m_ui->jabberPassword->setText( readPassword() );
|
m_ui->jabberPassword->setText( readPassword() );
|
||||||
m_ui->jabberServer->setText( readServer() );
|
m_ui->jabberServer->setText( readServer() );
|
||||||
@@ -118,7 +117,6 @@ JabberPlugin::JabberPlugin( const QString& pluginId )
|
|||||||
qDebug() << "Our Port set to" << m_client->port();
|
qDebug() << "Our Port set to" << m_client->port();
|
||||||
|
|
||||||
// setup slots
|
// setup slots
|
||||||
connect(m_client->connection(), SIGNAL(error(SocketError)), SLOT(onError(SocketError)));
|
|
||||||
connect(m_client, SIGNAL(serverFeaturesReceived(QSet<QString>)), SLOT(onConnect()));
|
connect(m_client, SIGNAL(serverFeaturesReceived(QSet<QString>)), SLOT(onConnect()));
|
||||||
connect(m_client, SIGNAL(disconnected(Jreen::Client::DisconnectReason)), SLOT(onDisconnect(Jreen::Client::DisconnectReason)));
|
connect(m_client, SIGNAL(disconnected(Jreen::Client::DisconnectReason)), SLOT(onDisconnect(Jreen::Client::DisconnectReason)));
|
||||||
connect(m_client, SIGNAL(newMessage(Jreen::Message)), SLOT(onNewMessage(Jreen::Message)));
|
connect(m_client, SIGNAL(newMessage(Jreen::Message)), SLOT(onNewMessage(Jreen::Message)));
|
||||||
@@ -200,9 +198,6 @@ JabberPlugin::connectPlugin( bool startup )
|
|||||||
{
|
{
|
||||||
qDebug() << Q_FUNC_INFO;
|
qDebug() << Q_FUNC_INFO;
|
||||||
|
|
||||||
if ( startup && !readAutoConnect() )
|
|
||||||
return false;
|
|
||||||
|
|
||||||
if(m_client->isConnected())
|
if(m_client->isConnected())
|
||||||
{
|
{
|
||||||
qDebug() << Q_FUNC_INFO << "Already connected to server, not connecting again...";
|
qDebug() << Q_FUNC_INFO << "Already connected to server, not connecting again...";
|
||||||
@@ -218,6 +213,8 @@ JabberPlugin::connectPlugin( bool startup )
|
|||||||
QTimer::singleShot( 1000, m_client, SLOT( connectToServer() ) );
|
QTimer::singleShot( 1000, m_client, SLOT( connectToServer() ) );
|
||||||
|
|
||||||
|
|
||||||
|
connect(m_client->connection(), SIGNAL(error(Jreen::Connection::SocketError)), SLOT(onError(Jreen::Connection::SocketError)));
|
||||||
|
|
||||||
m_state = Connecting;
|
m_state = Connecting;
|
||||||
emit stateChanged( m_state );
|
emit stateChanged( m_state );
|
||||||
return true;
|
return true;
|
||||||
@@ -907,16 +904,9 @@ JabberPlugin::readServer()
|
|||||||
return TomahawkSettings::instance()->value( pluginId() + "/server" ).toString();
|
return TomahawkSettings::instance()->value( pluginId() + "/server" ).toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
|
||||||
JabberPlugin::readAutoConnect()
|
|
||||||
{
|
|
||||||
return TomahawkSettings::instance()->value( pluginId() + "/autoconnect", true ).toBool();
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
JabberPlugin::saveConfig()
|
JabberPlugin::saveConfig()
|
||||||
{
|
{
|
||||||
TomahawkSettings::instance()->setValue( pluginId() + "/autoconnect", m_ui->checkBoxAutoConnect->isChecked() );
|
|
||||||
TomahawkSettings::instance()->setValue( pluginId() + "/username", m_ui->jabberUsername->text() );
|
TomahawkSettings::instance()->setValue( pluginId() + "/username", m_ui->jabberUsername->text() );
|
||||||
TomahawkSettings::instance()->setValue( pluginId() + "/password", m_ui->jabberPassword->text() );
|
TomahawkSettings::instance()->setValue( pluginId() + "/password", m_ui->jabberPassword->text() );
|
||||||
TomahawkSettings::instance()->setValue( pluginId() + "/port", m_ui->jabberPort->value() );
|
TomahawkSettings::instance()->setValue( pluginId() + "/port", m_ui->jabberPort->value() );
|
||||||
|
@@ -117,7 +117,6 @@ private slots:
|
|||||||
private:
|
private:
|
||||||
QString readPassword();
|
QString readPassword();
|
||||||
QString readServer();
|
QString readServer();
|
||||||
bool readAutoConnect();
|
|
||||||
int readPort();
|
int readPort();
|
||||||
|
|
||||||
QString errorMessage( Jreen::Client::DisconnectReason reason );
|
QString errorMessage( Jreen::Client::DisconnectReason reason );
|
||||||
|
@@ -145,9 +145,6 @@ TwitterPlugin::connectPlugin( bool startup )
|
|||||||
{
|
{
|
||||||
qDebug() << Q_FUNC_INFO;
|
qDebug() << Q_FUNC_INFO;
|
||||||
|
|
||||||
if( startup && !twitterAutoConnect() )
|
|
||||||
return false;
|
|
||||||
|
|
||||||
m_cachedPeers = twitterCachedPeers();
|
m_cachedPeers = twitterCachedPeers();
|
||||||
QList<QString> peerlist = m_cachedPeers.keys();
|
QList<QString> peerlist = m_cachedPeers.keys();
|
||||||
qStableSort( peerlist.begin(), peerlist.end() );
|
qStableSort( peerlist.begin(), peerlist.end() );
|
||||||
@@ -720,7 +717,7 @@ TwitterPlugin::twitterScreenName() const
|
|||||||
TomahawkSettings::instance()->remove( pluginId() + "/ScreenName" );
|
TomahawkSettings::instance()->remove( pluginId() + "/ScreenName" );
|
||||||
|
|
||||||
TomahawkSettings::instance()->sync();
|
TomahawkSettings::instance()->sync();
|
||||||
|
|
||||||
TomahawkSettings::instance()->setValue( pluginId() + "/screenname",
|
TomahawkSettings::instance()->setValue( pluginId() + "/screenname",
|
||||||
TomahawkSettings::instance()->value( pluginId() + "/screenname_tmp" ).toString() );
|
TomahawkSettings::instance()->value( pluginId() + "/screenname_tmp" ).toString() );
|
||||||
TomahawkSettings::instance()->remove( pluginId() + "/screenname_tmp" );
|
TomahawkSettings::instance()->remove( pluginId() + "/screenname_tmp" );
|
||||||
@@ -745,12 +742,12 @@ TwitterPlugin::twitterOAuthToken() const
|
|||||||
TomahawkSettings::instance()->remove( pluginId() + "/OAuthToken" );
|
TomahawkSettings::instance()->remove( pluginId() + "/OAuthToken" );
|
||||||
|
|
||||||
TomahawkSettings::instance()->sync();
|
TomahawkSettings::instance()->sync();
|
||||||
|
|
||||||
TomahawkSettings::instance()->setValue( pluginId() + "/oauthtoken",
|
TomahawkSettings::instance()->setValue( pluginId() + "/oauthtoken",
|
||||||
TomahawkSettings::instance()->value( pluginId() + "/oauthtoken_tmp" ).toString() );
|
TomahawkSettings::instance()->value( pluginId() + "/oauthtoken_tmp" ).toString() );
|
||||||
TomahawkSettings::instance()->remove( pluginId() + "/oauthtoken_tmp" );
|
TomahawkSettings::instance()->remove( pluginId() + "/oauthtoken_tmp" );
|
||||||
}
|
}
|
||||||
|
|
||||||
return TomahawkSettings::instance()->value( pluginId() + "/oauthtoken" ).toString();
|
return TomahawkSettings::instance()->value( pluginId() + "/oauthtoken" ).toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -770,12 +767,12 @@ TwitterPlugin::twitterOAuthTokenSecret() const
|
|||||||
TomahawkSettings::instance()->remove( pluginId() + "/OAuthTokenSecret" );
|
TomahawkSettings::instance()->remove( pluginId() + "/OAuthTokenSecret" );
|
||||||
|
|
||||||
TomahawkSettings::instance()->sync();
|
TomahawkSettings::instance()->sync();
|
||||||
|
|
||||||
TomahawkSettings::instance()->setValue( pluginId() + "/oauthtokensecret",
|
TomahawkSettings::instance()->setValue( pluginId() + "/oauthtokensecret",
|
||||||
TomahawkSettings::instance()->value( pluginId() + "/oauthtokensecret_tmp" ).toString() );
|
TomahawkSettings::instance()->value( pluginId() + "/oauthtokensecret_tmp" ).toString() );
|
||||||
TomahawkSettings::instance()->remove( pluginId() + "/oauthtokensecret_tmp" );
|
TomahawkSettings::instance()->remove( pluginId() + "/oauthtokensecret_tmp" );
|
||||||
}
|
}
|
||||||
|
|
||||||
return TomahawkSettings::instance()->value( pluginId() + "/oauthtokensecret" ).toString();
|
return TomahawkSettings::instance()->value( pluginId() + "/oauthtokensecret" ).toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -795,7 +792,7 @@ TwitterPlugin::twitterCachedFriendsSinceId() const
|
|||||||
TomahawkSettings::instance()->remove( pluginId() + "/CachedFriendsSinceID" );
|
TomahawkSettings::instance()->remove( pluginId() + "/CachedFriendsSinceID" );
|
||||||
|
|
||||||
TomahawkSettings::instance()->sync();
|
TomahawkSettings::instance()->sync();
|
||||||
|
|
||||||
TomahawkSettings::instance()->setValue( pluginId() + "/cachedfriendssinceid",
|
TomahawkSettings::instance()->setValue( pluginId() + "/cachedfriendssinceid",
|
||||||
TomahawkSettings::instance()->value( pluginId() + "/cachedfriendssinceid_tmp" ).toLongLong() );
|
TomahawkSettings::instance()->value( pluginId() + "/cachedfriendssinceid_tmp" ).toLongLong() );
|
||||||
TomahawkSettings::instance()->remove( pluginId() + "/cachedfriendssinceid_tmp" );
|
TomahawkSettings::instance()->remove( pluginId() + "/cachedfriendssinceid_tmp" );
|
||||||
@@ -820,7 +817,7 @@ TwitterPlugin::twitterCachedMentionsSinceId() const
|
|||||||
TomahawkSettings::instance()->remove( pluginId() + "/CachedMentionsSinceID" );
|
TomahawkSettings::instance()->remove( pluginId() + "/CachedMentionsSinceID" );
|
||||||
|
|
||||||
TomahawkSettings::instance()->sync();
|
TomahawkSettings::instance()->sync();
|
||||||
|
|
||||||
TomahawkSettings::instance()->setValue( pluginId() + "/cachedmentionssinceid",
|
TomahawkSettings::instance()->setValue( pluginId() + "/cachedmentionssinceid",
|
||||||
TomahawkSettings::instance()->value( pluginId() + "/cachedmentionssinceid_tmp" ).toLongLong() );
|
TomahawkSettings::instance()->value( pluginId() + "/cachedmentionssinceid_tmp" ).toLongLong() );
|
||||||
TomahawkSettings::instance()->remove( pluginId() + "/cachedmentionssinceid_tmp" );
|
TomahawkSettings::instance()->remove( pluginId() + "/cachedmentionssinceid_tmp" );
|
||||||
@@ -845,12 +842,12 @@ TwitterPlugin::twitterCachedDirectMessagesSinceId() const
|
|||||||
TomahawkSettings::instance()->remove( pluginId() + "/CachedDirectMessagesSinceID" );
|
TomahawkSettings::instance()->remove( pluginId() + "/CachedDirectMessagesSinceID" );
|
||||||
|
|
||||||
TomahawkSettings::instance()->sync();
|
TomahawkSettings::instance()->sync();
|
||||||
|
|
||||||
TomahawkSettings::instance()->setValue( pluginId() + "/cacheddirectmessagessinceid",
|
TomahawkSettings::instance()->setValue( pluginId() + "/cacheddirectmessagessinceid",
|
||||||
TomahawkSettings::instance()->value( pluginId() + "/cacheddirectmessagessinceid_tmp" ).toLongLong() );
|
TomahawkSettings::instance()->value( pluginId() + "/cacheddirectmessagessinceid_tmp" ).toLongLong() );
|
||||||
TomahawkSettings::instance()->remove( pluginId() + "/cacheddirectmessagessinceid_tmp" );
|
TomahawkSettings::instance()->remove( pluginId() + "/cacheddirectmessagessinceid_tmp" );
|
||||||
}
|
}
|
||||||
|
|
||||||
return TomahawkSettings::instance()->value( pluginId() + "/cacheddirectmessagessinceid", 0 ).toLongLong();
|
return TomahawkSettings::instance()->value( pluginId() + "/cacheddirectmessagessinceid", 0 ).toLongLong();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -870,12 +867,12 @@ TwitterPlugin::twitterCachedPeers() const
|
|||||||
TomahawkSettings::instance()->remove( pluginId() + "/CachedPeers" );
|
TomahawkSettings::instance()->remove( pluginId() + "/CachedPeers" );
|
||||||
|
|
||||||
TomahawkSettings::instance()->sync();
|
TomahawkSettings::instance()->sync();
|
||||||
|
|
||||||
TomahawkSettings::instance()->setValue( pluginId() + "/cachedpeers",
|
TomahawkSettings::instance()->setValue( pluginId() + "/cachedpeers",
|
||||||
TomahawkSettings::instance()->value( pluginId() + "/cachedpeers_tmp" ).toHash() );
|
TomahawkSettings::instance()->value( pluginId() + "/cachedpeers_tmp" ).toHash() );
|
||||||
TomahawkSettings::instance()->remove( pluginId() + "/cachedpeers_tmp" );
|
TomahawkSettings::instance()->remove( pluginId() + "/cachedpeers_tmp" );
|
||||||
}
|
}
|
||||||
|
|
||||||
return TomahawkSettings::instance()->value( pluginId() + "/cachedpeers", QHash<QString, QVariant>() ).toHash();
|
return TomahawkSettings::instance()->value( pluginId() + "/cachedpeers", QHash<QString, QVariant>() ).toHash();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -885,28 +882,4 @@ TwitterPlugin::setTwitterCachedPeers( const QHash<QString, QVariant> &cachedPeer
|
|||||||
TomahawkSettings::instance()->setValue( pluginId() + "/cachedpeers", cachedPeers );
|
TomahawkSettings::instance()->setValue( pluginId() + "/cachedpeers", cachedPeers );
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
|
||||||
TwitterPlugin::twitterAutoConnect() const
|
|
||||||
{
|
|
||||||
if ( TomahawkSettings::instance()->contains( pluginId() + "/AutoConnect" ) )
|
|
||||||
{
|
|
||||||
TomahawkSettings::instance()->setValue( pluginId() + "/autoconnect_tmp",
|
|
||||||
TomahawkSettings::instance()->value( pluginId() + "/AutoConnect" ).toBool() );
|
|
||||||
TomahawkSettings::instance()->remove( pluginId() + "/AutoConnect" );
|
|
||||||
|
|
||||||
TomahawkSettings::instance()->sync();
|
|
||||||
|
|
||||||
TomahawkSettings::instance()->setValue( pluginId() + "/autoconnect",
|
|
||||||
TomahawkSettings::instance()->value( pluginId() + "/autoconnect_tmp" ).toBool() );
|
|
||||||
TomahawkSettings::instance()->remove( pluginId() + "/autoconnect_tmp" );
|
|
||||||
}
|
|
||||||
return TomahawkSettings::instance()->value( pluginId() + "/autoconnect", true ).toBool();
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
TwitterPlugin::setTwitterAutoConnect( bool autoConnect )
|
|
||||||
{
|
|
||||||
TomahawkSettings::instance()->setValue( pluginId() + "/autoconnect", autoConnect );
|
|
||||||
}
|
|
||||||
|
|
||||||
Q_EXPORT_PLUGIN2( sipfactory, TwitterFactory )
|
Q_EXPORT_PLUGIN2( sipfactory, TwitterFactory )
|
||||||
|
@@ -44,14 +44,10 @@ TwitterConfigWidget::TwitterConfigWidget( TwitterPlugin* plugin, QWidget *parent
|
|||||||
this, SLOT( startPostGotTomahawkStatus() ) );
|
this, SLOT( startPostGotTomahawkStatus() ) );
|
||||||
connect( ui->twitterTweetComboBox, SIGNAL( currentIndexChanged( int ) ),
|
connect( ui->twitterTweetComboBox, SIGNAL( currentIndexChanged( int ) ),
|
||||||
this, SLOT( tweetComboBoxIndexChanged( int ) ) );
|
this, SLOT( tweetComboBoxIndexChanged( int ) ) );
|
||||||
connect( ui->autoConnectCheckbox, SIGNAL( toggled( bool ) ),
|
|
||||||
this, SLOT( autoConnectToggled( bool ) ) );
|
|
||||||
|
|
||||||
|
|
||||||
ui->twitterTweetComboBox->setCurrentIndex( 0 );
|
ui->twitterTweetComboBox->setCurrentIndex( 0 );
|
||||||
ui->twitterUserTweetLineEdit->setReadOnly( true );
|
ui->twitterUserTweetLineEdit->setReadOnly( true );
|
||||||
ui->twitterUserTweetLineEdit->setEnabled( false );
|
ui->twitterUserTweetLineEdit->setEnabled( false );
|
||||||
ui->autoConnectCheckbox->setChecked( m_plugin->twitterAutoConnect() );
|
|
||||||
|
|
||||||
if ( m_plugin->twitterOAuthToken().isEmpty() || m_plugin->twitterOAuthTokenSecret().isEmpty() || m_plugin->twitterScreenName().isEmpty() )
|
if ( m_plugin->twitterOAuthToken().isEmpty() || m_plugin->twitterOAuthTokenSecret().isEmpty() || m_plugin->twitterScreenName().isEmpty() )
|
||||||
{
|
{
|
||||||
@@ -188,13 +184,6 @@ TwitterConfigWidget::tweetComboBoxIndexChanged( int index )
|
|||||||
ui->twitterTweetGotTomahawkButton->setText( tr( "Tweet!" ) );
|
ui->twitterTweetGotTomahawkButton->setText( tr( "Tweet!" ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
TwitterConfigWidget::autoConnectToggled( bool on )
|
|
||||||
{
|
|
||||||
m_plugin->setTwitterAutoConnect( on );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
TwitterConfigWidget::startPostGotTomahawkStatus()
|
TwitterConfigWidget::startPostGotTomahawkStatus()
|
||||||
{
|
{
|
||||||
|
@@ -55,7 +55,6 @@ private slots:
|
|||||||
void postGotTomahawkDirectMessageReply( const QTweetDMStatus &status );
|
void postGotTomahawkDirectMessageReply( const QTweetDMStatus &status );
|
||||||
void postGotTomahawkStatusUpdateError( QTweetNetBase::ErrorCode, const QString &errorMsg );
|
void postGotTomahawkStatusUpdateError( QTweetNetBase::ErrorCode, const QString &errorMsg );
|
||||||
void tweetComboBoxIndexChanged( int index );
|
void tweetComboBoxIndexChanged( int index );
|
||||||
void autoConnectToggled( bool on );
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void authenticateTwitter();
|
void authenticateTwitter();
|
||||||
|
@@ -238,13 +238,6 @@ If connections to peers seem to have been lost, just press the appropriate butto
|
|||||||
</property>
|
</property>
|
||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
|
||||||
<widget class="QCheckBox" name="autoConnectCheckbox">
|
|
||||||
<property name="text">
|
|
||||||
<string>Connect automatically when Tomahawk starts</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<resources>
|
<resources>
|
||||||
|
@@ -19,7 +19,6 @@
|
|||||||
#include "zeroconf.h"
|
#include "zeroconf.h"
|
||||||
|
|
||||||
#include "tomahawksettings.h"
|
#include "tomahawksettings.h"
|
||||||
#include "ui_configwidget.h"
|
|
||||||
|
|
||||||
#include <QtPlugin>
|
#include <QtPlugin>
|
||||||
|
|
||||||
@@ -36,12 +35,6 @@ ZeroconfPlugin::ZeroconfPlugin ( const QString& pluginId )
|
|||||||
, m_cachedNodes()
|
, m_cachedNodes()
|
||||||
{
|
{
|
||||||
qDebug() << Q_FUNC_INFO;
|
qDebug() << Q_FUNC_INFO;
|
||||||
|
|
||||||
m_configWidget = QWeakPointer< QWidget >( new QWidget );
|
|
||||||
m_ui = new Ui_ZeroconfConfig;
|
|
||||||
m_ui->setupUi( m_configWidget.data() );
|
|
||||||
m_ui->autoConnectCheckbox->setChecked( autoConnect() );
|
|
||||||
m_configWidget.data()->setVisible( false );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const QString
|
const QString
|
||||||
@@ -78,9 +71,6 @@ ZeroconfFactory::icon() const
|
|||||||
bool
|
bool
|
||||||
ZeroconfPlugin::connectPlugin( bool startup )
|
ZeroconfPlugin::connectPlugin( bool startup )
|
||||||
{
|
{
|
||||||
if( startup && !autoConnect() )
|
|
||||||
return false;
|
|
||||||
|
|
||||||
delete m_zeroconf;
|
delete m_zeroconf;
|
||||||
m_zeroconf = new TomahawkZeroconf( Servent::instance()->port(), this );
|
m_zeroconf = new TomahawkZeroconf( Servent::instance()->port(), this );
|
||||||
QObject::connect( m_zeroconf, SIGNAL( tomahawkHostFound( QString, int, QString, QString ) ),
|
QObject::connect( m_zeroconf, SIGNAL( tomahawkHostFound( QString, int, QString, QString ) ),
|
||||||
@@ -137,17 +127,5 @@ ZeroconfPlugin::lanHostFound( const QString& host, int port, const QString& name
|
|||||||
qDebug() << "Already connected to" << host;
|
qDebug() << "Already connected to" << host;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
ZeroconfPlugin::saveConfig()
|
|
||||||
{
|
|
||||||
TomahawkSettings::instance()->setValue( pluginId() + "/autoconnect", m_ui->autoConnectCheckbox->isChecked() );
|
|
||||||
}
|
|
||||||
|
|
||||||
bool
|
|
||||||
ZeroconfPlugin::autoConnect() const
|
|
||||||
{
|
|
||||||
return TomahawkSettings::instance()->value( pluginId() + "/autoconnect", true ).toBool();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Q_EXPORT_PLUGIN2( sipfactory, ZeroconfFactory )
|
Q_EXPORT_PLUGIN2( sipfactory, ZeroconfFactory )
|
||||||
|
@@ -26,8 +26,6 @@
|
|||||||
|
|
||||||
#define MYNAME "Local Network"
|
#define MYNAME "Local Network"
|
||||||
|
|
||||||
class Ui_ZeroconfConfig;
|
|
||||||
|
|
||||||
class SIPDLLEXPORT ZeroconfFactory : public SipPluginFactory
|
class SIPDLLEXPORT ZeroconfFactory : public SipPluginFactory
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
@@ -63,43 +61,23 @@ public:
|
|||||||
virtual ConnectionState connectionState() const;
|
virtual ConnectionState connectionState() const;
|
||||||
virtual bool isValid() const { return true; };
|
virtual bool isValid() const { return true; };
|
||||||
virtual QIcon icon() const;
|
virtual QIcon icon() const;
|
||||||
virtual QWidget* configWidget() { return m_configWidget.data(); }
|
virtual void checkSettings() {}
|
||||||
virtual void saveConfig();
|
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
virtual bool connectPlugin( bool startup );
|
virtual bool connectPlugin( bool startup );
|
||||||
void disconnectPlugin();
|
void disconnectPlugin();
|
||||||
void checkSettings() {}
|
|
||||||
|
|
||||||
void sendMsg( const QString& to, const QString& msg )
|
void sendMsg( const QString& , const QString& ) {}
|
||||||
{
|
void broadcastMsg( const QString & ) {}
|
||||||
Q_UNUSED( to );
|
void addContact( const QString &, const QString& ) {}
|
||||||
Q_UNUSED( msg );
|
|
||||||
}
|
|
||||||
|
|
||||||
void broadcastMsg( const QString &msg )
|
|
||||||
{
|
|
||||||
Q_UNUSED( msg );
|
|
||||||
}
|
|
||||||
|
|
||||||
void addContact( const QString &jid, const QString& msg = QString() )
|
|
||||||
{
|
|
||||||
Q_UNUSED( jid );
|
|
||||||
Q_UNUSED( msg );
|
|
||||||
}
|
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void lanHostFound( const QString& host, int port, const QString& name, const QString& nodeid );
|
void lanHostFound( const QString& host, int port, const QString& name, const QString& nodeid );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool autoConnect() const;
|
|
||||||
|
|
||||||
TomahawkZeroconf* m_zeroconf;
|
TomahawkZeroconf* m_zeroconf;
|
||||||
ConnectionState m_state;
|
ConnectionState m_state;
|
||||||
QVector<QStringList> m_cachedNodes;
|
QVector<QStringList> m_cachedNodes;
|
||||||
|
|
||||||
Ui_ZeroconfConfig* m_ui; // so the google wrapper can change the config dialog a bit
|
|
||||||
QWeakPointer< QWidget > m_configWidget;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user