mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-03-28 11:42:42 +01:00
More account updates
This commit is contained in:
parent
f548d36586
commit
8f24acd008
@ -102,8 +102,10 @@ private slots:
|
||||
void onPeerOnline( const QString &peerId );
|
||||
void onPeerOffline( const QString &peerId );
|
||||
|
||||
private:
|
||||
protected:
|
||||
Tomahawk::Accounts::Account *m_account;
|
||||
|
||||
private:
|
||||
QString m_cachedError;
|
||||
QStringList m_peersOnline;
|
||||
};
|
||||
|
@ -8,18 +8,10 @@ add_definitions( -DSIPDLLEXPORT_PRO )
|
||||
|
||||
set( twitterSources
|
||||
twittersip.cpp
|
||||
twitterconfigwidget.cpp
|
||||
tomahawkoauthtwitter.cpp
|
||||
)
|
||||
|
||||
set( twitterHeaders
|
||||
twittersip.h
|
||||
twitterconfigwidget.h
|
||||
tomahawkoauthtwitter.h
|
||||
)
|
||||
|
||||
set( twitterUI
|
||||
twitterconfigwidget.ui
|
||||
)
|
||||
|
||||
include_directories( . ${CMAKE_CURRENT_BINARY_DIR} ..
|
||||
@ -29,8 +21,7 @@ include_directories( . ${CMAKE_CURRENT_BINARY_DIR} ..
|
||||
|
||||
qt4_add_resources( RC_SRCS "resources.qrc" )
|
||||
qt4_wrap_cpp( twitterMoc ${twitterHeaders} )
|
||||
qt4_wrap_ui( twitterUI_H ${twitterUI} )
|
||||
add_library( tomahawk_siptwitter SHARED ${twitterUI_H} ${twitterSources} ${twitterMoc} ${RC_SRCS} )
|
||||
add_library( tomahawk_siptwitter SHARED ${twitterSources} ${twitterMoc} ${RC_SRCS} )
|
||||
|
||||
IF( WIN32 )
|
||||
SET( OS_SPECIFIC_LINK_LIBRARIES
|
||||
|
@ -1,32 +0,0 @@
|
||||
#include "tomahawkoauthtwitter.h"
|
||||
|
||||
#include <QInputDialog>
|
||||
|
||||
#include "utils/logger.h"
|
||||
|
||||
|
||||
TomahawkOAuthTwitter::TomahawkOAuthTwitter( QNetworkAccessManager *nam, QObject* parent )
|
||||
: OAuthTwitter( QByteArray::fromBase64( "QzR2NFdmYTIxcmZJRGNrNEhNUjNB" ), QByteArray::fromBase64( "elhTalU2Ympydmc2VVZNSlg0SnVmcUh5amozaWV4dFkxNFNSOXVCRUFv" ), parent )
|
||||
{
|
||||
setNetworkAccessManager( nam );
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
TomahawkOAuthTwitter::authorizationWidget()
|
||||
{
|
||||
bool ok;
|
||||
int i = QInputDialog::getInt(0, tr( "Twitter PIN" ), tr( "After authenticating on Twitter's web site,\nenter the displayed PIN number here:" ), 0, 0, 2147483647, 1, &ok);
|
||||
if (ok)
|
||||
return i;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
TomahawkOAuthTwitter::error()
|
||||
{
|
||||
qDebug() << Q_FUNC_INFO;
|
||||
setOAuthToken( QString().toLatin1() );
|
||||
setOAuthTokenSecret( QString().toLatin1() );
|
||||
}
|
@ -1,25 +0,0 @@
|
||||
#ifndef TOMAHAWKOAUTHTWITTER
|
||||
#define TOMAHAWKOAUTHTWITTER
|
||||
|
||||
#include "../sipdllmacro.h"
|
||||
|
||||
#include <QTweetLib/qtweetlib_global.h>
|
||||
#include <QTweetLib/oauthtwitter.h>
|
||||
|
||||
class SIPDLLEXPORT TomahawkOAuthTwitter : public OAuthTwitter
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
TomahawkOAuthTwitter( QNetworkAccessManager *nam, QObject *parent = 0 );
|
||||
|
||||
~TomahawkOAuthTwitter() {}
|
||||
|
||||
protected:
|
||||
virtual int authorizationWidget();
|
||||
|
||||
private slots:
|
||||
void error();
|
||||
};
|
||||
|
||||
#endif
|
@ -1,270 +0,0 @@
|
||||
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
|
||||
*
|
||||
* Copyright 2010-2011, Christian Muehlhaeuser <muesli@tomahawk-player.org>
|
||||
*
|
||||
* Tomahawk is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Tomahawk is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Tomahawk. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "twitterconfigwidget.h"
|
||||
#include "twittersip.h"
|
||||
#include "ui_twitterconfigwidget.h"
|
||||
|
||||
#include "tomahawksettings.h"
|
||||
#include "utils/tomahawkutils.h"
|
||||
#include "database/database.h"
|
||||
|
||||
#include "tomahawkoauthtwitter.h"
|
||||
#include <QTweetLib/qtweetaccountverifycredentials.h>
|
||||
#include <QTweetLib/qtweetstatusupdate.h>
|
||||
#include <QTweetLib/qtweetdirectmessagenew.h>
|
||||
|
||||
#include <QMessageBox>
|
||||
|
||||
#include "utils/logger.h"
|
||||
|
||||
|
||||
TwitterConfigWidget::TwitterConfigWidget( TwitterPlugin* plugin, QWidget *parent ) :
|
||||
QWidget( parent ),
|
||||
ui( new Ui::TwitterConfigWidget ),
|
||||
m_plugin( plugin )
|
||||
{
|
||||
ui->setupUi( this );
|
||||
|
||||
connect( ui->twitterAuthenticateButton, SIGNAL( pressed() ),
|
||||
this, SLOT( authDeauthTwitter() ) );
|
||||
connect( ui->twitterTweetGotTomahawkButton, SIGNAL( pressed() ),
|
||||
this, SLOT( startPostGotTomahawkStatus() ) );
|
||||
connect( ui->twitterTweetComboBox, SIGNAL( currentIndexChanged( int ) ),
|
||||
this, SLOT( tweetComboBoxIndexChanged( int ) ) );
|
||||
|
||||
ui->twitterTweetComboBox->setCurrentIndex( 0 );
|
||||
ui->twitterTweetGotTomahawkButton->setText( tr( "Tweet!" ) );
|
||||
|
||||
if ( m_plugin->twitterOAuthToken().isEmpty() || m_plugin->twitterOAuthTokenSecret().isEmpty() || m_plugin->twitterScreenName().isEmpty() )
|
||||
{
|
||||
ui->twitterStatusLabel->setText( tr( "Status: No saved credentials" ) );
|
||||
ui->twitterAuthenticateButton->setText( tr( "Authenticate" ) );
|
||||
ui->twitterSyncGroupBox->setVisible( false );
|
||||
|
||||
emit twitterAuthed( false );
|
||||
}
|
||||
else
|
||||
{
|
||||
ui->twitterStatusLabel->setText( tr( "Status: Credentials saved for %1" ).arg( m_plugin->twitterScreenName() ) );
|
||||
ui->twitterAuthenticateButton->setText( tr( "De-authenticate" ) );
|
||||
ui->twitterSyncGroupBox->setVisible( true );
|
||||
ui->twitterUserTweetLineEdit->setVisible( false );
|
||||
|
||||
emit twitterAuthed( true );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
TwitterConfigWidget::~TwitterConfigWidget()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void
|
||||
TwitterConfigWidget::authDeauthTwitter()
|
||||
{
|
||||
if ( ui->twitterAuthenticateButton->text() == tr( "Authenticate" ) ) //FIXME: don't rely on UI strings here!
|
||||
authenticateTwitter();
|
||||
else
|
||||
deauthenticateTwitter();
|
||||
}
|
||||
|
||||
void
|
||||
TwitterConfigWidget::authenticateTwitter()
|
||||
{
|
||||
qDebug() << Q_FUNC_INFO;
|
||||
TomahawkOAuthTwitter *twitAuth = new TomahawkOAuthTwitter( TomahawkUtils::nam(), this );
|
||||
twitAuth->authorizePin();
|
||||
|
||||
m_plugin->setTwitterOAuthToken( twitAuth->oauthToken() );
|
||||
m_plugin->setTwitterOAuthTokenSecret( twitAuth->oauthTokenSecret() );
|
||||
|
||||
QTweetAccountVerifyCredentials *credVerifier = new QTweetAccountVerifyCredentials( twitAuth, this );
|
||||
connect( credVerifier, SIGNAL( parsedUser( const QTweetUser & ) ), SLOT( authenticateVerifyReply( const QTweetUser & ) ) );
|
||||
connect( credVerifier, SIGNAL( error( QTweetNetBase::ErrorCode, QString ) ), SLOT( authenticateVerifyError( QTweetNetBase::ErrorCode, QString ) ) );
|
||||
credVerifier->verify();
|
||||
}
|
||||
|
||||
void
|
||||
TwitterConfigWidget::authenticateVerifyReply( const QTweetUser &user )
|
||||
{
|
||||
qDebug() << Q_FUNC_INFO;
|
||||
if ( user.id() == 0 )
|
||||
{
|
||||
QMessageBox::critical( this, tr("Tweetin' Error"), tr("The credentials could not be verified.\nYou may wish to try re-authenticating.") );
|
||||
emit twitterAuthed( false );
|
||||
return;
|
||||
}
|
||||
|
||||
m_plugin->setTwitterScreenName( user.screenName() );
|
||||
m_plugin->setTwitterCachedFriendsSinceId( 0 );
|
||||
m_plugin->setTwitterCachedMentionsSinceId( 0 );
|
||||
|
||||
ui->twitterStatusLabel->setText( tr( "Status: Credentials saved for %1" ).arg( m_plugin->twitterScreenName() ) );
|
||||
ui->twitterAuthenticateButton->setText( tr( "De-authenticate" ) );
|
||||
ui->twitterSyncGroupBox->setVisible( true );
|
||||
ui->twitterTweetComboBox->setCurrentIndex( 0 );
|
||||
ui->twitterUserTweetLineEdit->setVisible( false );
|
||||
ui->twitterTweetGotTomahawkButton->setText( tr( "Tweet!" ) );
|
||||
|
||||
m_plugin->connectPlugin();
|
||||
|
||||
emit twitterAuthed( true );
|
||||
emit sizeHintChanged();
|
||||
}
|
||||
|
||||
void
|
||||
TwitterConfigWidget::authenticateVerifyError( QTweetNetBase::ErrorCode code, const QString &errorMsg )
|
||||
{
|
||||
qDebug() << Q_FUNC_INFO;
|
||||
qDebug() << "Error validating credentials, error code is " << code << ", error message is " << errorMsg;
|
||||
ui->twitterStatusLabel->setText(tr("Status: Error validating credentials"));
|
||||
emit twitterAuthed( false );
|
||||
return;
|
||||
}
|
||||
|
||||
void
|
||||
TwitterConfigWidget::deauthenticateTwitter()
|
||||
{
|
||||
qDebug() << Q_FUNC_INFO;
|
||||
m_plugin->setTwitterOAuthToken( QString() );
|
||||
m_plugin->setTwitterOAuthTokenSecret( QString() );
|
||||
m_plugin->setTwitterScreenName( QString() );
|
||||
|
||||
ui->twitterStatusLabel->setText(tr("Status: No saved credentials"));
|
||||
ui->twitterAuthenticateButton->setText( tr( "Authenticate" ) );
|
||||
ui->twitterSyncGroupBox->setVisible( false );
|
||||
|
||||
emit twitterAuthed( false );
|
||||
emit sizeHintChanged();
|
||||
}
|
||||
|
||||
void
|
||||
TwitterConfigWidget::tweetComboBoxIndexChanged( int index )
|
||||
{
|
||||
Q_UNUSED( index );
|
||||
if ( ui->twitterTweetComboBox->currentText() == tr( "Global Tweet" ) ) //FIXME: use data!
|
||||
ui->twitterUserTweetLineEdit->setVisible( false );
|
||||
else
|
||||
ui->twitterUserTweetLineEdit->setVisible( true );
|
||||
|
||||
if ( ui->twitterTweetComboBox->currentText() == tr( "Direct Message" ) ) //FIXME: use data!
|
||||
ui->twitterTweetGotTomahawkButton->setText( tr( "Send Message!" ) );
|
||||
else if ( ui->twitterTweetComboBox->currentText() == tr( "@Mention" ) )
|
||||
ui->twitterTweetGotTomahawkButton->setText( tr( "Send Mention!" ) );
|
||||
else
|
||||
ui->twitterTweetGotTomahawkButton->setText( tr( "Tweet!" ) );
|
||||
}
|
||||
|
||||
void
|
||||
TwitterConfigWidget::startPostGotTomahawkStatus()
|
||||
{
|
||||
qDebug() << Q_FUNC_INFO;
|
||||
m_postGTtype = ui->twitterTweetComboBox->currentText();
|
||||
|
||||
if ( m_postGTtype != "Global Tweet" && ( ui->twitterUserTweetLineEdit->text().isEmpty() || ui->twitterUserTweetLineEdit->text() == "@" ) )
|
||||
{
|
||||
QMessageBox::critical( this, tr("Tweetin' Error"), tr("You must enter a user name for this type of tweet.") );
|
||||
return;
|
||||
}
|
||||
|
||||
qDebug() << "Posting Got Tomahawk status";
|
||||
if ( m_plugin->twitterOAuthToken().isEmpty() || m_plugin->twitterOAuthTokenSecret().isEmpty() || m_plugin->twitterScreenName().isEmpty() )
|
||||
{
|
||||
QMessageBox::critical( this, tr("Tweetin' Error"), tr("Your saved credentials could not be loaded.\nYou may wish to try re-authenticating.") );
|
||||
emit twitterAuthed( false );
|
||||
return;
|
||||
}
|
||||
TomahawkOAuthTwitter *twitAuth = new TomahawkOAuthTwitter( TomahawkUtils::nam(), this );
|
||||
twitAuth->setOAuthToken( m_plugin->twitterOAuthToken().toLatin1() );
|
||||
twitAuth->setOAuthTokenSecret( m_plugin->twitterOAuthTokenSecret().toLatin1() );
|
||||
QTweetAccountVerifyCredentials *credVerifier = new QTweetAccountVerifyCredentials( twitAuth, this );
|
||||
connect( credVerifier, SIGNAL( parsedUser(const QTweetUser &) ), SLOT( postGotTomahawkStatusAuthVerifyReply(const QTweetUser &) ) );
|
||||
credVerifier->verify();
|
||||
}
|
||||
|
||||
void
|
||||
TwitterConfigWidget::postGotTomahawkStatusAuthVerifyReply( const QTweetUser &user )
|
||||
{
|
||||
qDebug() << Q_FUNC_INFO;
|
||||
if ( user.id() == 0 )
|
||||
{
|
||||
QMessageBox::critical( this, tr("Tweetin' Error"), tr("Your saved credentials could not be verified.\nYou may wish to try re-authenticating.") );
|
||||
emit twitterAuthed( false );
|
||||
return;
|
||||
}
|
||||
m_plugin->setTwitterScreenName( user.screenName() );
|
||||
TomahawkOAuthTwitter *twitAuth = new TomahawkOAuthTwitter( TomahawkUtils::nam(), this );
|
||||
twitAuth->setOAuthToken( m_plugin->twitterOAuthToken().toLatin1() );
|
||||
twitAuth->setOAuthTokenSecret( m_plugin->twitterOAuthTokenSecret().toLatin1() );
|
||||
if ( m_postGTtype != "Direct Message" )
|
||||
{
|
||||
QTweetStatusUpdate *statUpdate = new QTweetStatusUpdate( twitAuth, this );
|
||||
connect( statUpdate, SIGNAL( postedStatus(const QTweetStatus &) ), SLOT( postGotTomahawkStatusUpdateReply(const QTweetStatus &) ) );
|
||||
connect( statUpdate, SIGNAL( error(QTweetNetBase::ErrorCode, const QString&) ), SLOT( postGotTomahawkStatusUpdateError(QTweetNetBase::ErrorCode, const QString &) ) );
|
||||
QString uuid = QUuid::createUuid();
|
||||
QString message = QString( "Got Tomahawk? {" ) + Database::instance()->dbid() + QString( "} (" ) + uuid.mid( 1, 8 ) + QString( ")" ) + QString( " http://gettomahawk.com" );
|
||||
if ( m_postGTtype == "@Mention" )
|
||||
{
|
||||
QString user = ui->twitterUserTweetLineEdit->text();
|
||||
if ( user.startsWith( "@" ) )
|
||||
user.remove( 0, 1 );
|
||||
message = QString( "@" ) + user + QString( " " ) + message;
|
||||
}
|
||||
statUpdate->post( message );
|
||||
}
|
||||
else
|
||||
{
|
||||
QTweetDirectMessageNew *statUpdate = new QTweetDirectMessageNew( twitAuth, this );
|
||||
connect( statUpdate, SIGNAL( parsedDirectMessage(const QTweetDMStatus &)), SLOT( postGotTomahawkDirectMessageReply(const QTweetDMStatus &) ) );
|
||||
connect( statUpdate, SIGNAL( error(QTweetNetBase::ErrorCode, const QString&) ), SLOT( postGotTomahawkStatusUpdateError(QTweetNetBase::ErrorCode, const QString &) ) );
|
||||
QString uuid = QUuid::createUuid();
|
||||
QString message = QString( "Got Tomahawk? {" ) + Database::instance()->dbid() + QString( "} (" ) + uuid.mid( 1, 8 ) + QString( ")" ) + QString( " http://gettomahawk.com" );
|
||||
QString user = ui->twitterUserTweetLineEdit->text();
|
||||
if ( user.startsWith( "@" ) )
|
||||
user.remove( 0, 1 );
|
||||
statUpdate->post( user, message );
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
TwitterConfigWidget::postGotTomahawkStatusUpdateReply( const QTweetStatus& status )
|
||||
{
|
||||
if ( status.id() == 0 )
|
||||
QMessageBox::critical( this, tr("Tweetin' Error"), tr("There was an error posting your status -- sorry!") );
|
||||
else
|
||||
QMessageBox::information( this, tr("Tweeted!"), tr("Your tweet has been posted!") );
|
||||
}
|
||||
|
||||
void
|
||||
TwitterConfigWidget::postGotTomahawkDirectMessageReply( const QTweetDMStatus& status )
|
||||
{
|
||||
if ( status.id() == 0 )
|
||||
QMessageBox::critical( this, tr("Tweetin' Error"), tr("There was an error posting your direct message -- sorry!") );
|
||||
else
|
||||
QMessageBox::information( this, tr("Tweeted!"), tr("Your message has been posted!") );
|
||||
}
|
||||
|
||||
void
|
||||
TwitterConfigWidget::postGotTomahawkStatusUpdateError( QTweetNetBase::ErrorCode code, const QString& errorMsg )
|
||||
{
|
||||
qDebug() << Q_FUNC_INFO;
|
||||
qDebug() << "Error posting Got Tomahawk message, error code is " << code << ", error message is " << errorMsg;
|
||||
QMessageBox::critical( this, tr("Tweetin' Error"), tr("There was an error posting your status -- sorry!") );
|
||||
}
|
@ -1,69 +0,0 @@
|
||||
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
|
||||
*
|
||||
* Copyright 2010-2011, Christian Muehlhaeuser <muesli@tomahawk-player.org>
|
||||
*
|
||||
* Tomahawk is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Tomahawk is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Tomahawk. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef TWITTERCONFIGWIDGET_H
|
||||
#define TWITTERCONFIGWIDGET_H
|
||||
|
||||
#include "sip/SipPlugin.h"
|
||||
|
||||
#include <QTweetLib/qtweetstatus.h>
|
||||
#include <QTweetLib/qtweetdmstatus.h>
|
||||
#include <QTweetLib/qtweetuser.h>
|
||||
#include <QTweetLib/qtweetnetbase.h>
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
class TwitterPlugin;
|
||||
|
||||
namespace Ui {
|
||||
class TwitterConfigWidget;
|
||||
}
|
||||
|
||||
class TwitterConfigWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit TwitterConfigWidget( TwitterPlugin* plugin = 0, QWidget *parent = 0 );
|
||||
~TwitterConfigWidget();
|
||||
|
||||
signals:
|
||||
void twitterAuthed( bool authed );
|
||||
|
||||
void sizeHintChanged();
|
||||
private slots:
|
||||
void authDeauthTwitter();
|
||||
void startPostGotTomahawkStatus();
|
||||
void authenticateVerifyReply( const QTweetUser &user );
|
||||
void authenticateVerifyError( QTweetNetBase::ErrorCode code, const QString &errorMsg );
|
||||
void postGotTomahawkStatusAuthVerifyReply( const QTweetUser &user );
|
||||
void postGotTomahawkStatusUpdateReply( const QTweetStatus &status );
|
||||
void postGotTomahawkDirectMessageReply( const QTweetDMStatus &status );
|
||||
void postGotTomahawkStatusUpdateError( QTweetNetBase::ErrorCode, const QString &errorMsg );
|
||||
void tweetComboBoxIndexChanged( int index );
|
||||
|
||||
private:
|
||||
void authenticateTwitter();
|
||||
void deauthenticateTwitter();
|
||||
|
||||
Ui::TwitterConfigWidget *ui;
|
||||
TwitterPlugin *m_plugin;
|
||||
QString m_postGTtype;
|
||||
};
|
||||
|
||||
#endif // TWITTERCONFIGWIDGET_H
|
@ -1,381 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>TwitterConfigWidget</class>
|
||||
<widget class="QWidget" name="TwitterConfigWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>580</width>
|
||||
<height>390</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>580</width>
|
||||
<height>390</height>
|
||||
</size>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="pixmap">
|
||||
<pixmap resource="resources.qrc">:/twitter-icon.png</pixmap>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>11</pointsize>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Configure this Twitter account</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Expanding</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer_4">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="twitterInfoLabel">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>The Twitter plugin allows you to discover and play music from your Twitter friends running Tomahawk and post messages to your account.</string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QLabel" name="twitterStatusLabel">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Status: No saved credentials</string>
|
||||
</property>
|
||||
<property name="textFormat">
|
||||
<enum>Qt::AutoText</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="twitterAuthenticateButton">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Authenticate with Twitter</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="twitterSyncGroupBox">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Twitter Connections</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<item>
|
||||
<widget class="QLabel" name="twitterInstructionsInfoLabel">
|
||||
<property name="text">
|
||||
<string>
|
||||
If you only want to post tweets, you're done.
|
||||
|
||||
If you want to connect Tomahawk to your friends using Twitter, select the type of tweet and press the button below to send a sync message. You must both be following each other as Direct Messages are used. Then be (very) patient -- it can take several minutes!
|
||||
|
||||
You can re-send a sync message at any time simply by sending another tweet using the button.</string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Expanding</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="twitterTweetVLayout">
|
||||
<property name="sizeConstraint">
|
||||
<enum>QLayout::SetFixedSize</enum>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="twitterGlobalTweetLabel">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Select the kind of tweet you would like, then press the button to post it:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>10</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="twitterGlobalTweetHLayout">
|
||||
<item>
|
||||
<widget class="QComboBox" name="twitterTweetComboBox">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Global Tweet</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>@Mention</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Direct Message</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_4">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>10</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="twitterUserTweetLineEdit">
|
||||
<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. @tomahawk</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_6">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>10</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="twitterTweetGotTomahawkButton">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Send Message</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_5">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="resources.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
@ -18,8 +18,6 @@
|
||||
|
||||
#include "twittersip.h"
|
||||
|
||||
#include "twitterconfigwidget.h"
|
||||
|
||||
#include <QtPlugin>
|
||||
#include <QDateTime>
|
||||
#include <QRegExp>
|
||||
|
@ -35,9 +35,7 @@
|
||||
#include "../sipdllmacro.h"
|
||||
#include "sip/SipPlugin.h"
|
||||
#include "accounts/account.h"
|
||||
#include "tomahawkoauthtwitter.h"
|
||||
|
||||
#define MYNAME "SIPTWITTER"
|
||||
#include "accounts/twitter/tomahawkoauthtwitter.h"
|
||||
|
||||
class SIPDLLEXPORT TwitterSipPlugin : public SipPlugin
|
||||
{
|
||||
@ -124,11 +122,6 @@ private:
|
||||
QHash< QString, QPixmap > m_cachedAvatars;
|
||||
QSet<QString> m_keyCache;
|
||||
ConnectionState m_state;
|
||||
|
||||
QWeakPointer<TwitterConfigWidget > m_configWidget;
|
||||
|
||||
// for settings access
|
||||
friend class TwitterConfigWidget;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user