mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-06 14:16:32 +02:00
Merge branch 'stable'
This commit is contained in:
@@ -614,8 +614,7 @@ Jabber_p::handleSubscriptionRequest( const JID& jid, const std::string& /*msg*/
|
|||||||
|
|
||||||
// check if the requester is already on the roster
|
// check if the requester is already on the roster
|
||||||
RosterItem *item = m_client->rosterManager()->getRosterItem(jid);
|
RosterItem *item = m_client->rosterManager()->getRosterItem(jid);
|
||||||
if(item) qDebug() << "subscription status:" << static_cast<int>( item->subscription() );
|
if(item) qDebug() << Q_FUNC_INFO << jid.bare().c_str() << "subscription status:" << static_cast<int>( item->subscription() );
|
||||||
|
|
||||||
if(item &&
|
if(item &&
|
||||||
(
|
(
|
||||||
item->subscription() == gloox::S10nNoneOut || // Contact and user are not subscribed to each other, and user has sent contact a subscription request but contact has not replied yet.
|
item->subscription() == gloox::S10nNoneOut || // Contact and user are not subscribed to each other, and user has sent contact a subscription request but contact has not replied yet.
|
||||||
@@ -624,34 +623,32 @@ Jabber_p::handleSubscriptionRequest( const JID& jid, const std::string& /*msg*/
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
qDebug() << Q_FUNC_INFO << jid.bare().c_str() << "Already on the roster so we assume ack'ing subscription request is okay...";
|
qDebug() << Q_FUNC_INFO << jid.bare().c_str() << "already on the roster so we assume ack'ing subscription request is okay...";
|
||||||
|
|
||||||
|
// ack the request
|
||||||
m_client->rosterManager()->ackSubscriptionRequest( jid, true );
|
m_client->rosterManager()->ackSubscriptionRequest( jid, true );
|
||||||
|
|
||||||
|
// return anything, the result is ignored
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( !m_subscriptionConfirmBoxes.value(jid).isNull() )
|
// we don't have to check for an already open check box because gloox doesnt call this method until a former request was ack'ed
|
||||||
{
|
qDebug() << Q_FUNC_INFO << jid.bare().c_str() << "open subscription request box";
|
||||||
qDebug() << Q_FUNC_INFO << jid.bare().c_str() << " confirmBox already open" ;
|
|
||||||
|
|
||||||
// the user decides with the already open box, so we can return false here
|
|
||||||
m_client->rosterManager()->ackSubscriptionRequest( jid, false );
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// preparing the confirm box for the user
|
// preparing the confirm box for the user
|
||||||
QWeakPointer<QMessageBox> confirmBox = QWeakPointer<QMessageBox>( new QMessageBox(
|
QMessageBox *confirmBox = new QMessageBox(
|
||||||
QMessageBox::Question,
|
QMessageBox::Question,
|
||||||
tr("Friend Request in Jabber"),
|
tr("Friend Request in Jabber"),
|
||||||
QString(tr("Do you want to be friends with <b>%1</b>?")).arg(QLatin1String(jid.bare().c_str())),
|
QString(tr("Do you want to be friends with <b>%1</b>?")).arg(QLatin1String(jid.bare().c_str())),
|
||||||
QMessageBox::Ok | QMessageBox::Cancel,
|
QMessageBox::Ok | QMessageBox::Cancel,
|
||||||
0) );
|
0
|
||||||
|
);
|
||||||
|
|
||||||
// add confirmBox to m_subscriptionConfirmBoxes
|
// add confirmBox to m_subscriptionConfirmBoxes
|
||||||
m_subscriptionConfirmBoxes.insert( jid, confirmBox );
|
m_subscriptionConfirmBoxes.insert( jid, confirmBox );
|
||||||
|
|
||||||
// display the box and wait for the answer
|
// display the box and wait for the answer
|
||||||
confirmBox.data()->open( this, SLOT( onSubscriptionRequestConfirmed( int ) ) );
|
confirmBox->open( this, SLOT( onSubscriptionRequestConfirmed( int ) ) );
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -659,19 +656,22 @@ Jabber_p::handleSubscriptionRequest( const JID& jid, const std::string& /*msg*/
|
|||||||
void
|
void
|
||||||
Jabber_p::onSubscriptionRequestConfirmed(int result)
|
Jabber_p::onSubscriptionRequestConfirmed(int result)
|
||||||
{
|
{
|
||||||
qDebug() << Q_FUNC_INFO;
|
qDebug() << Q_FUNC_INFO << result;
|
||||||
|
|
||||||
QList< QWeakPointer<QMessageBox> > confirmBoxes = m_subscriptionConfirmBoxes.values();
|
QList< QMessageBox* > confirmBoxes = m_subscriptionConfirmBoxes.values();
|
||||||
JID jid;
|
JID jid;
|
||||||
foreach(QWeakPointer<QMessageBox> currentBox, confirmBoxes)
|
foreach(QMessageBox* currentBox, confirmBoxes)
|
||||||
{
|
{
|
||||||
if( !currentBox.isNull() && currentBox.data() == sender() )
|
if( currentBox == sender() )
|
||||||
{
|
{
|
||||||
jid = m_subscriptionConfirmBoxes.key( currentBox );
|
jid = m_subscriptionConfirmBoxes.key( currentBox );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
qDebug() << Q_FUNC_INFO << "box confirmed for" << jid.bare().c_str();
|
||||||
|
|
||||||
// we got an answer, deleting the box
|
// we got an answer, deleting the box
|
||||||
|
m_subscriptionConfirmBoxes.remove( jid );
|
||||||
sender()->deleteLater();
|
sender()->deleteLater();
|
||||||
|
|
||||||
QMessageBox::StandardButton allowSubscription = static_cast<QMessageBox::StandardButton>( result );
|
QMessageBox::StandardButton allowSubscription = static_cast<QMessageBox::StandardButton>( result );
|
||||||
@@ -683,13 +683,16 @@ Jabber_p::onSubscriptionRequestConfirmed(int result)
|
|||||||
groups.push_back( "Tomahawk" );
|
groups.push_back( "Tomahawk" );
|
||||||
m_client->rosterManager()->subscribe( jid, "", groups, "" );
|
m_client->rosterManager()->subscribe( jid, "", groups, "" );
|
||||||
|
|
||||||
|
// ack the request
|
||||||
m_client->rosterManager()->ackSubscriptionRequest( jid, true );
|
m_client->rosterManager()->ackSubscriptionRequest( jid, true );
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
qDebug() << Q_FUNC_INFO << jid.bare().c_str() << "declined by user";
|
qDebug() << Q_FUNC_INFO << jid.bare().c_str() << "declined by user";
|
||||||
|
|
||||||
|
// decl the request
|
||||||
m_client->rosterManager()->ackSubscriptionRequest( jid, false );
|
m_client->rosterManager()->ackSubscriptionRequest( jid, false );
|
||||||
return;
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
|
@@ -166,7 +166,7 @@ private:
|
|||||||
QSharedPointer<gloox::VCardManager> m_vcardManager;
|
QSharedPointer<gloox::VCardManager> m_vcardManager;
|
||||||
QString m_server;
|
QString m_server;
|
||||||
QScopedPointer<QSocketNotifier> m_notifier;
|
QScopedPointer<QSocketNotifier> m_notifier;
|
||||||
QHash<gloox::JID, QWeakPointer<QMessageBox> > m_subscriptionConfirmBoxes;
|
QHash<gloox::JID, QMessageBox*> m_subscriptionConfirmBoxes;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // JABBER_H
|
#endif // JABBER_H
|
||||||
|
@@ -30,21 +30,23 @@
|
|||||||
|
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
|
|
||||||
TwitterConfigWidget::TwitterConfigWidget(SipPlugin* plugin, QWidget *parent) :
|
TwitterConfigWidget::TwitterConfigWidget( SipPlugin* plugin, QWidget *parent ) :
|
||||||
QWidget(parent),
|
QWidget( parent ),
|
||||||
ui(new Ui::TwitterConfigWidget),
|
ui( new Ui::TwitterConfigWidget ),
|
||||||
m_plugin(plugin)
|
m_plugin( plugin )
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi( this );
|
||||||
|
|
||||||
connect(ui->twitterAuthenticateButton, SIGNAL(pressed()),
|
connect( ui->twitterAuthenticateButton, SIGNAL( pressed() ),
|
||||||
this, SLOT(authDeauthTwitter()));
|
this, SLOT( authDeauthTwitter() ) );
|
||||||
connect(ui->twitterTweetGotTomahawkButton, SIGNAL(pressed()),
|
connect( ui->twitterTweetGotTomahawkButton, SIGNAL( pressed() ),
|
||||||
this, SLOT(startPostGlobalGotTomahawkStatus()));
|
this, SLOT( startPostGotTomahawkStatus() ) );
|
||||||
connect(ui->twitterUserTweetButton, SIGNAL(pressed()),
|
connect( ui->twitterTweetComboBox, SIGNAL( currentIndexChanged( int ) ),
|
||||||
this, SLOT(startPostUserGotTomahawkStatus()));
|
this, SLOT( tweetComboBoxIndexChanged( int ) ) );
|
||||||
connect(ui->twitterDirectTweetButton, SIGNAL(pressed()),
|
|
||||||
this, SLOT(startPostDirectGotTomahawkStatus()));
|
ui->twitterTweetComboBox->setCurrentIndex( 0 );
|
||||||
|
ui->twitterUserTweetLineEdit->setReadOnly( true );
|
||||||
|
ui->twitterUserTweetLineEdit->setEnabled( false );
|
||||||
|
|
||||||
TomahawkSettings* s = TomahawkSettings::instance();
|
TomahawkSettings* s = TomahawkSettings::instance();
|
||||||
if ( s->twitterOAuthToken().isEmpty() || s->twitterOAuthTokenSecret().isEmpty() || s->twitterScreenName().isEmpty() )
|
if ( s->twitterOAuthToken().isEmpty() || s->twitterOAuthTokenSecret().isEmpty() || s->twitterScreenName().isEmpty() )
|
||||||
@@ -53,29 +55,21 @@ TwitterConfigWidget::TwitterConfigWidget(SipPlugin* plugin, QWidget *parent) :
|
|||||||
ui->twitterAuthenticateButton->setText( "Authenticate" );
|
ui->twitterAuthenticateButton->setText( "Authenticate" );
|
||||||
ui->twitterInstructionsInfoLabel->setVisible( false );
|
ui->twitterInstructionsInfoLabel->setVisible( false );
|
||||||
ui->twitterGlobalTweetLabel->setVisible( false );
|
ui->twitterGlobalTweetLabel->setVisible( false );
|
||||||
ui->twitterUserTweetLabel->setVisible( false );
|
|
||||||
ui->twitterDirectTweetLabel->setVisible( false );
|
|
||||||
ui->twitterTweetGotTomahawkButton->setVisible( false );
|
ui->twitterTweetGotTomahawkButton->setVisible( false );
|
||||||
ui->twitterUserTweetButton->setVisible( false );
|
|
||||||
ui->twitterUserTweetLineEdit->setVisible( false );
|
ui->twitterUserTweetLineEdit->setVisible( false );
|
||||||
ui->twitterDirectTweetButton->setVisible( false );
|
ui->twitterTweetComboBox->setVisible( false );
|
||||||
ui->twitterDirectTweetLineEdit->setVisible( false );
|
|
||||||
|
|
||||||
emit twitterAuthed( false );
|
emit twitterAuthed( false );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ui->twitterStatusLabel->setText("Status: Credentials saved");
|
ui->twitterStatusLabel->setText("Status: Credentials saved for " + s->twitterScreenName() );
|
||||||
ui->twitterAuthenticateButton->setText( "De-authenticate" );
|
ui->twitterAuthenticateButton->setText( "De-authenticate" );
|
||||||
ui->twitterInstructionsInfoLabel->setVisible( true );
|
ui->twitterInstructionsInfoLabel->setVisible( true );
|
||||||
ui->twitterGlobalTweetLabel->setVisible( true );
|
ui->twitterGlobalTweetLabel->setVisible( true );
|
||||||
ui->twitterUserTweetLabel->setVisible( true );
|
|
||||||
ui->twitterDirectTweetLabel->setVisible( true );
|
|
||||||
ui->twitterTweetGotTomahawkButton->setVisible( true );
|
ui->twitterTweetGotTomahawkButton->setVisible( true );
|
||||||
ui->twitterUserTweetButton->setVisible( true );
|
|
||||||
ui->twitterUserTweetLineEdit->setVisible( true );
|
ui->twitterUserTweetLineEdit->setVisible( true );
|
||||||
ui->twitterDirectTweetButton->setVisible( true );
|
ui->twitterTweetComboBox->setVisible( true );
|
||||||
ui->twitterDirectTweetLineEdit->setVisible( true );
|
|
||||||
|
|
||||||
emit twitterAuthed( true );
|
emit twitterAuthed( true );
|
||||||
}
|
}
|
||||||
@@ -130,17 +124,13 @@ TwitterConfigWidget::authenticateVerifyReply( const QTweetUser &user )
|
|||||||
s->setTwitterCachedFriendsSinceId( 0 );
|
s->setTwitterCachedFriendsSinceId( 0 );
|
||||||
s->setTwitterCachedMentionsSinceId( 0 );
|
s->setTwitterCachedMentionsSinceId( 0 );
|
||||||
|
|
||||||
ui->twitterStatusLabel->setText("Status: Credentials saved");
|
ui->twitterStatusLabel->setText("Status: Credentials saved for " + s->twitterScreenName() );
|
||||||
ui->twitterAuthenticateButton->setText( "De-authenticate" );
|
ui->twitterAuthenticateButton->setText( "De-authenticate" );
|
||||||
ui->twitterInstructionsInfoLabel->setVisible( true );
|
ui->twitterInstructionsInfoLabel->setVisible( true );
|
||||||
ui->twitterGlobalTweetLabel->setVisible( true );
|
ui->twitterGlobalTweetLabel->setVisible( true );
|
||||||
ui->twitterUserTweetLabel->setVisible( true );
|
|
||||||
ui->twitterDirectTweetLabel->setVisible( true );
|
|
||||||
ui->twitterTweetGotTomahawkButton->setVisible( true );
|
ui->twitterTweetGotTomahawkButton->setVisible( true );
|
||||||
ui->twitterUserTweetButton->setVisible( true );
|
|
||||||
ui->twitterUserTweetLineEdit->setVisible( true );
|
ui->twitterUserTweetLineEdit->setVisible( true );
|
||||||
ui->twitterDirectTweetButton->setVisible( true );
|
ui->twitterTweetComboBox->setVisible( true );
|
||||||
ui->twitterDirectTweetLineEdit->setVisible( true );
|
|
||||||
|
|
||||||
m_plugin->connectPlugin( false );
|
m_plugin->connectPlugin( false );
|
||||||
|
|
||||||
@@ -170,51 +160,44 @@ TwitterConfigWidget::deauthenticateTwitter()
|
|||||||
ui->twitterAuthenticateButton->setText( "Authenticate" );
|
ui->twitterAuthenticateButton->setText( "Authenticate" );
|
||||||
ui->twitterInstructionsInfoLabel->setVisible( false );
|
ui->twitterInstructionsInfoLabel->setVisible( false );
|
||||||
ui->twitterGlobalTweetLabel->setVisible( false );
|
ui->twitterGlobalTweetLabel->setVisible( false );
|
||||||
ui->twitterUserTweetLabel->setVisible( false );
|
|
||||||
ui->twitterDirectTweetLabel->setVisible( false );
|
|
||||||
ui->twitterTweetGotTomahawkButton->setVisible( false );
|
ui->twitterTweetGotTomahawkButton->setVisible( false );
|
||||||
ui->twitterUserTweetButton->setVisible( false );
|
|
||||||
ui->twitterUserTweetLineEdit->setVisible( false );
|
ui->twitterUserTweetLineEdit->setVisible( false );
|
||||||
ui->twitterDirectTweetButton->setVisible( false );
|
ui->twitterTweetComboBox->setVisible( false );
|
||||||
ui->twitterDirectTweetLineEdit->setVisible( false );
|
|
||||||
|
|
||||||
emit twitterAuthed( false );
|
emit twitterAuthed( false );
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
TwitterConfigWidget::startPostGlobalGotTomahawkStatus()
|
TwitterConfigWidget::tweetComboBoxIndexChanged( int index )
|
||||||
{
|
{
|
||||||
m_postGTtype = "global";
|
if( ui->twitterTweetComboBox->currentText() == "Global Tweet" )
|
||||||
startPostGotTomahawkStatus();
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
TwitterConfigWidget::startPostUserGotTomahawkStatus()
|
|
||||||
{
|
|
||||||
if ( ui->twitterUserTweetLineEdit->text().isEmpty() || ui->twitterUserTweetLineEdit->text() == "@" )
|
|
||||||
{
|
{
|
||||||
QMessageBox::critical( 0, QString("Tweetin' Error"), QString("You cannot leave the user name empty when sending a mention.") );
|
ui->twitterUserTweetLineEdit->setReadOnly( true );
|
||||||
return;
|
ui->twitterUserTweetLineEdit->setEnabled( false );
|
||||||
}
|
}
|
||||||
m_postGTtype = "user";
|
else
|
||||||
startPostGotTomahawkStatus();
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
TwitterConfigWidget::startPostDirectGotTomahawkStatus()
|
|
||||||
{
|
|
||||||
if ( ui->twitterDirectTweetLineEdit->text().isEmpty() || ui->twitterDirectTweetLineEdit->text() == "@" )
|
|
||||||
{
|
{
|
||||||
QMessageBox::critical( 0, QString("Tweetin' Error"), QString("You cannot leave the user name empty when sending a direct message.") );
|
ui->twitterUserTweetLineEdit->setReadOnly( false );
|
||||||
return;
|
ui->twitterUserTweetLineEdit->setEnabled( true );
|
||||||
}
|
}
|
||||||
m_postGTtype = "direct";
|
|
||||||
startPostGotTomahawkStatus();
|
if( ui->twitterTweetComboBox->currentText() == "Direct Message" )
|
||||||
|
ui->twitterTweetGotTomahawkButton->setText( "Send Message!" );
|
||||||
|
else
|
||||||
|
ui->twitterTweetGotTomahawkButton->setText( "Tweet!" );
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
TwitterConfigWidget::startPostGotTomahawkStatus()
|
TwitterConfigWidget::startPostGotTomahawkStatus()
|
||||||
{
|
{
|
||||||
|
m_postGTtype = ui->twitterTweetComboBox->currentText();
|
||||||
|
|
||||||
|
if ( m_postGTtype != "Global Tweet" && ( ui->twitterUserTweetLineEdit->text().isEmpty() || ui->twitterUserTweetLineEdit->text() == "@" ) )
|
||||||
|
{
|
||||||
|
QMessageBox::critical( 0, QString("Tweetin' Error"), QString("You must enter a user name for this type of tweet.") );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
qDebug() << "Posting Got Tomahawk status";
|
qDebug() << "Posting Got Tomahawk status";
|
||||||
TomahawkSettings* s = TomahawkSettings::instance();
|
TomahawkSettings* s = TomahawkSettings::instance();
|
||||||
if ( s->twitterOAuthToken().isEmpty() || s->twitterOAuthTokenSecret().isEmpty() || s->twitterScreenName().isEmpty() )
|
if ( s->twitterOAuthToken().isEmpty() || s->twitterOAuthTokenSecret().isEmpty() || s->twitterScreenName().isEmpty() )
|
||||||
@@ -247,14 +230,14 @@ TwitterConfigWidget::postGotTomahawkStatusAuthVerifyReply( const QTweetUser &use
|
|||||||
twitAuth->setNetworkAccessManager( TomahawkUtils::nam() );
|
twitAuth->setNetworkAccessManager( TomahawkUtils::nam() );
|
||||||
twitAuth->setOAuthToken( s->twitterOAuthToken().toLatin1() );
|
twitAuth->setOAuthToken( s->twitterOAuthToken().toLatin1() );
|
||||||
twitAuth->setOAuthTokenSecret( s->twitterOAuthTokenSecret().toLatin1() );
|
twitAuth->setOAuthTokenSecret( s->twitterOAuthTokenSecret().toLatin1() );
|
||||||
if ( m_postGTtype != "direct" )
|
if ( m_postGTtype != "Direct Message" )
|
||||||
{
|
{
|
||||||
QTweetStatusUpdate *statUpdate = new QTweetStatusUpdate( twitAuth, this );
|
QTweetStatusUpdate *statUpdate = new QTweetStatusUpdate( twitAuth, this );
|
||||||
connect( statUpdate, SIGNAL( postedStatus(const QTweetStatus &) ), SLOT( postGotTomahawkStatusUpdateReply(const QTweetStatus &) ) );
|
connect( statUpdate, SIGNAL( postedStatus(const QTweetStatus &) ), SLOT( postGotTomahawkStatusUpdateReply(const QTweetStatus &) ) );
|
||||||
connect( statUpdate, SIGNAL( error(QTweetNetBase::ErrorCode, const QString&) ), SLOT( postGotTomahawkStatusUpdateError(QTweetNetBase::ErrorCode, const QString &) ) );
|
connect( statUpdate, SIGNAL( error(QTweetNetBase::ErrorCode, const QString&) ), SLOT( postGotTomahawkStatusUpdateError(QTweetNetBase::ErrorCode, const QString &) ) );
|
||||||
QString uuid = QUuid::createUuid();
|
QString uuid = QUuid::createUuid();
|
||||||
QString message = QString( "Got Tomahawk? {" ) + Database::instance()->dbid() + QString( "} (" ) + uuid.mid( 1, 8 ) + QString( ")" ) + QString( " http://gettomahawk.com" );
|
QString message = QString( "Got Tomahawk? {" ) + Database::instance()->dbid() + QString( "} (" ) + uuid.mid( 1, 8 ) + QString( ")" ) + QString( " http://gettomahawk.com" );
|
||||||
if ( m_postGTtype == "user" )
|
if ( m_postGTtype == "@Mention" )
|
||||||
{
|
{
|
||||||
QString user = ui->twitterUserTweetLineEdit->text();
|
QString user = ui->twitterUserTweetLineEdit->text();
|
||||||
if ( user.startsWith( "@" ) )
|
if ( user.startsWith( "@" ) )
|
||||||
@@ -270,7 +253,7 @@ TwitterConfigWidget::postGotTomahawkStatusAuthVerifyReply( const QTweetUser &use
|
|||||||
connect( statUpdate, SIGNAL( error(QTweetNetBase::ErrorCode, const QString&) ), SLOT( postGotTomahawkStatusUpdateError(QTweetNetBase::ErrorCode, const QString &) ) );
|
connect( statUpdate, SIGNAL( error(QTweetNetBase::ErrorCode, const QString&) ), SLOT( postGotTomahawkStatusUpdateError(QTweetNetBase::ErrorCode, const QString &) ) );
|
||||||
QString uuid = QUuid::createUuid();
|
QString uuid = QUuid::createUuid();
|
||||||
QString message = QString( "Got Tomahawk? {" ) + Database::instance()->dbid() + QString( "} (" ) + uuid.mid( 1, 8 ) + QString( ")" ) + QString( " http://gettomahawk.com" );
|
QString message = QString( "Got Tomahawk? {" ) + Database::instance()->dbid() + QString( "} (" ) + uuid.mid( 1, 8 ) + QString( ")" ) + QString( " http://gettomahawk.com" );
|
||||||
QString user = ui->twitterDirectTweetLineEdit->text();
|
QString user = ui->twitterUserTweetLineEdit->text();
|
||||||
if ( user.startsWith( "@" ) )
|
if ( user.startsWith( "@" ) )
|
||||||
user.remove( 0, 1 );
|
user.remove( 0, 1 );
|
||||||
statUpdate->post( user, message );
|
statUpdate->post( user, message );
|
||||||
|
@@ -38,7 +38,7 @@ class TwitterConfigWidget : public QWidget
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit TwitterConfigWidget(SipPlugin* plugin = 0, QWidget *parent = 0);
|
explicit TwitterConfigWidget( SipPlugin* plugin = 0, QWidget *parent = 0 );
|
||||||
~TwitterConfigWidget();
|
~TwitterConfigWidget();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
@@ -46,9 +46,6 @@ signals:
|
|||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void authDeauthTwitter();
|
void authDeauthTwitter();
|
||||||
void startPostGlobalGotTomahawkStatus();
|
|
||||||
void startPostUserGotTomahawkStatus();
|
|
||||||
void startPostDirectGotTomahawkStatus();
|
|
||||||
void startPostGotTomahawkStatus();
|
void startPostGotTomahawkStatus();
|
||||||
void authenticateVerifyReply( const QTweetUser &user );
|
void authenticateVerifyReply( const QTweetUser &user );
|
||||||
void authenticateVerifyError( QTweetNetBase::ErrorCode code, const QString &errorMsg );
|
void authenticateVerifyError( QTweetNetBase::ErrorCode code, const QString &errorMsg );
|
||||||
@@ -56,6 +53,7 @@ private slots:
|
|||||||
void postGotTomahawkStatusUpdateReply( const QTweetStatus &status );
|
void postGotTomahawkStatusUpdateReply( const QTweetStatus &status );
|
||||||
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 );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void authenticateTwitter();
|
void authenticateTwitter();
|
||||||
|
@@ -101,51 +101,41 @@ If connections to peers seem to have been lost, just press the appropriate butto
|
|||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Use this button to send a normal, public tweet:</string>
|
<string>Select the kind of tweet you would like, then press the button to post it:</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<layout class="QHBoxLayout" name="twitterGlobalTweetHLayout">
|
<layout class="QHBoxLayout" name="twitterGlobalTweetHLayout">
|
||||||
<item>
|
<item>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
<widget class="QComboBox" name="twitterTweetComboBox">
|
||||||
<item>
|
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_2"/>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QPushButton" name="twitterTweetGotTomahawkButton">
|
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
|
<item>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Press here to post a public tweet</string>
|
<string>Global Tweet</string>
|
||||||
</property>
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>@Mention</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>Direct Message</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="twitterUserTweetLabel">
|
|
||||||
<property name="text">
|
|
||||||
<string>Use this button to send a public @mention to the user you enter:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<layout class="QHBoxLayout" name="twitterUserTweetHLayout">
|
|
||||||
<item>
|
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
|
||||||
<item>
|
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLineEdit" name="twitterUserTweetLineEdit">
|
<widget class="QLineEdit" name="twitterUserTweetLineEdit">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
@@ -162,7 +152,7 @@ If connections to peers seem to have been lost, just press the appropriate butto
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="twitterUserTweetButton">
|
<widget class="QPushButton" name="twitterTweetGotTomahawkButton">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
@@ -170,7 +160,7 @@ If connections to peers seem to have been lost, just press the appropriate butto
|
|||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Press here to post a public @mention</string>
|
<string>Tweet!</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@@ -178,61 +168,6 @@ If connections to peers seem to have been lost, just press the appropriate butto
|
|||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="twitterDirectTweetLabel">
|
|
||||||
<property name="text">
|
|
||||||
<string>Use this button to send a private, direct message to the user you enter:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<layout class="QHBoxLayout" name="twitterDirectTweetHLayout">
|
|
||||||
<item>
|
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_4">
|
|
||||||
<item>
|
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
|
||||||
<item>
|
|
||||||
<widget class="QLineEdit" name="twitterDirectTweetLineEdit">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>250</width>
|
|
||||||
<height>0</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="placeholderText">
|
|
||||||
<string>e.g. tomahawkplayer</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QPushButton" name="twitterDirectTweetButton">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Press here to post a private message</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
<item>
|
<item>
|
||||||
<spacer name="twitterVertSpacer">
|
<spacer name="twitterVertSpacer">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
|
Reference in New Issue
Block a user