1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-07-31 11:20:22 +02:00

More compilation fixes, though settings dialog needs serious reworking. Can't figure out why it isn't linking atm

This commit is contained in:
Jeff Mitchell
2011-10-22 14:45:40 -04:00
parent fb6d9967dc
commit 709a25ce97
7 changed files with 50 additions and 25 deletions

View File

@@ -9,27 +9,35 @@ add_definitions( -DDLLEXPORT_PRO )
set( twitterAccountSources set( twitterAccountSources
twitteraccount.cpp twitteraccount.cpp
twitterconfigwidget.cpp twitterconfigwidget.cpp
tomahawkoauthtwitter.cpp
) )
set( twitterAccountHeaders set( twitterAccountHeaders
twitteraccount.h twitteraccount.h
twitterconfigwidget.h twitterconfigwidget.h
tomahawkoauthtwitter.h
) )
set( twitterAccountUI set( twitterAccountUI
twitterconfigwidget.ui twitterconfigwidget.ui
) )
set( tomahawkOAuthTwitterSources
tomahawkoauthtwitter.cpp
)
set( tomahawkOAuthTwitterHeaders
tomahawkoauthtwitter.h
)
include_directories( . ${CMAKE_CURRENT_BINARY_DIR} .. include_directories( . ${CMAKE_CURRENT_BINARY_DIR} ..
${QT_INCLUDE_DIR} ${QT_INCLUDE_DIR}
${QTWEETLIB_INCLUDE_DIR} ${QTWEETLIB_INCLUDE_DIR}
) )
qt4_add_resources( RC_SRCS "resources.qrc" ) qt4_wrap_cpp( tomahawkOAuthTwitterMoc ${tomahawkOAuthTwitterSources} )
add_library( tomahawk_oauth_twitter SHARED ${tomahawkOAuthTwitterSources} ${tomahawkOAuthTwitterMoc} )
qt4_wrap_cpp( twitterAccountMoc ${twitterAccountHeaders} ) qt4_wrap_cpp( twitterAccountMoc ${twitterAccountHeaders} )
qt4_wrap_ui( twitterAccountUI_H ${twitterAccountUI} ) qt4_wrap_ui( twitterAccountUI_H ${twitterAccountUI} )
qt4_add_resources( RC_SRCS "resources.qrc" )
add_library( tomahawk_account_twitter SHARED ${twitterAccountUI_H} ${twitterAccountSources} ${twitterAccountMoc} ${RC_SRCS} ) add_library( tomahawk_account_twitter SHARED ${twitterAccountUI_H} ${twitterAccountSources} ${twitterAccountMoc} ${RC_SRCS} )
IF( WIN32 ) IF( WIN32 )
@@ -40,7 +48,15 @@ SET( OS_SPECIFIC_LINK_LIBRARIES
) )
ENDIF( WIN32 ) ENDIF( WIN32 )
target_link_libraries( tomahawk_oauth_twitter
${TOMAHAWK_LIBRARIES}
${QTWEETLIB_LIBRARIES}
${QT_LIBRARIES}
${OS_SPECIFIC_LINK_LIBRARIES}
)
target_link_libraries( tomahawk_account_twitter target_link_libraries( tomahawk_account_twitter
tomahawk_oauth_twitter
${TOMAHAWK_LIBRARIES} ${TOMAHAWK_LIBRARIES}
${QTWEETLIB_LIBRARIES} ${QTWEETLIB_LIBRARIES}
${QT_LIBRARIES} ${QT_LIBRARIES}
@@ -51,4 +67,5 @@ IF( APPLE )
# SET( CMAKE_SHARED_LINKER_FLAGS ${CMAKE_SHARED_LINKER_FLAGS} "-undefined dynamic_lookup" ) # SET( CMAKE_SHARED_LINKER_FLAGS ${CMAKE_SHARED_LINKER_FLAGS} "-undefined dynamic_lookup" )
ENDIF( APPLE ) ENDIF( APPLE )
install( TARGETS tomahawk_oauth_twitter DESTINATION lib${LIB_SUFFIX} )
install( TARGETS tomahawk_account_twitter DESTINATION lib${LIB_SUFFIX} ) install( TARGETS tomahawk_account_twitter DESTINATION lib${LIB_SUFFIX} )

View File

@@ -115,9 +115,9 @@ void DiagnosticsDialog::updateLogView()
} }
log.append( log.append(
QString(" %2 (%1): %3 (%4)\n") QString(" %2 (%1): %3 (%4)\n")
.arg(sip->name()) .arg(sip->account()->accountServiceName())
.arg(sip->friendlyName()) .arg(sip->friendlyName())
.arg(sip->accountName()) .arg(sip->account()->accountFriendlyName())
.arg(stateString) .arg(stateString)
); );

View File

@@ -128,7 +128,7 @@ SettingsDialog::SettingsDialog( QWidget *parent )
connect( Servent::instance(), SIGNAL( ready() ), this, SLOT( serventReady() ) ); connect( Servent::instance(), SIGNAL( ready() ), this, SLOT( serventReady() ) );
} }
setupSipButtons(); //setupSipButtons();
ui->staticHostName->setText( s->externalHostname() ); ui->staticHostName->setText( s->externalHostname() );
ui->staticPort->setValue( s->externalPort() ); ui->staticPort->setValue( s->externalPort() );
@@ -309,7 +309,7 @@ SettingsDialog::createIcons()
connect( ui->listWidget, SIGNAL( currentItemChanged( QListWidgetItem*, QListWidgetItem* ) ), SLOT( changePage( QListWidgetItem*, QListWidgetItem* ) ) ); connect( ui->listWidget, SIGNAL( currentItemChanged( QListWidgetItem*, QListWidgetItem* ) ), SLOT( changePage( QListWidgetItem*, QListWidgetItem* ) ) );
} }
/*
void void
SettingsDialog::setupSipButtons() SettingsDialog::setupSipButtons()
{ {
@@ -329,7 +329,7 @@ SettingsDialog::setupSipButtons()
connect( ui->removeSipButton, SIGNAL( clicked( bool ) ), this, SLOT( sipPluginDeleted( bool ) ) ); connect( ui->removeSipButton, SIGNAL( clicked( bool ) ), this, SLOT( sipPluginDeleted( bool ) ) );
} }
*/
void void
SettingsDialog::changePage( QListWidgetItem* current, QListWidgetItem* previous ) SettingsDialog::changePage( QListWidgetItem* current, QListWidgetItem* previous )
@@ -599,7 +599,7 @@ SettingsDialog::resolverConfigClosed( int value )
} }
} }
/*
void void
SettingsDialog::sipItemClicked( const QModelIndex& item ) SettingsDialog::sipItemClicked( const QModelIndex& item )
{ {
@@ -814,7 +814,7 @@ SettingsDialog::sipPluginDeleted( bool )
} }
} }
} }
*/
ProxyDialog::ProxyDialog( QWidget *parent ) ProxyDialog::ProxyDialog( QWidget *parent )
: QDialog( parent ) : QDialog( parent )

View File

@@ -89,6 +89,7 @@ private slots:
#endif #endif
void openResolverConfig( const QString& ); void openResolverConfig( const QString& );
/*
void sipItemClicked ( const QModelIndex& ); void sipItemClicked ( const QModelIndex& );
void openSipConfig( SipPlugin* ); void openSipConfig( SipPlugin* );
void factoryActionTriggered ( bool ); void factoryActionTriggered ( bool );
@@ -96,21 +97,22 @@ private slots:
void sipContextMenuRequest( const QPoint& ); void sipContextMenuRequest( const QPoint& );
void sipPluginDeleted( bool ); void sipPluginDeleted( bool );
void sipPluginRowDeleted( bool ); void sipPluginRowDeleted( bool );
*/
void updateScanOptionsView();
// dialog slots // dialog slots
void resolverConfigClosed( int value ); void resolverConfigClosed( int value );
/*
void sipConfigClosed( int value ); void sipConfigClosed( int value );
void sipCreateConfigClosed( int value ); void sipCreateConfigClosed( int value );
*/
void updateScanOptionsView();
void changePage( QListWidgetItem*, QListWidgetItem* ); void changePage( QListWidgetItem*, QListWidgetItem* );
void serventReady(); void serventReady();
private: private:
void createIcons(); void createIcons();
void setupSipButtons(); //void setupSipButtons();
void handleSipPluginAdded( SipPlugin* p, bool added ); //void handleSipPluginAdded( SipPlugin* p, bool added );
Ui_StackedSettingsDialog* ui; Ui_StackedSettingsDialog* ui;

View File

@@ -32,6 +32,8 @@ SET( OS_SPECIFIC_LINK_LIBRARIES
ENDIF( WIN32 ) ENDIF( WIN32 )
target_link_libraries( tomahawk_siptwitter target_link_libraries( tomahawk_siptwitter
tomahawk_oauth_twitter
tomahawk_account_twitter
${TOMAHAWK_LIBRARIES} ${TOMAHAWK_LIBRARIES}
${QTWEETLIB_LIBRARIES} ${QTWEETLIB_LIBRARIES}
${QT_LIBRARIES} ${QT_LIBRARIES}

View File

@@ -37,6 +37,7 @@
#include <network/servent.h> #include <network/servent.h>
#include "utils/logger.h" #include "utils/logger.h"
#include "accounts/twitter/tomahawkoauthtwitter.h"
static QString s_gotTomahawkRegex = QString( "^(@[a-zA-Z0-9]+ )?(Got Tomahawk\\?) (\\{[a-fA-F0-9\\-]+\\}) (.*)$" ); static QString s_gotTomahawkRegex = QString( "^(@[a-zA-Z0-9]+ )?(Got Tomahawk\\?) (\\{[a-fA-F0-9\\-]+\\}) (.*)$" );
@@ -92,13 +93,19 @@ TwitterSipPlugin::connectionState() const
} }
void TwitterSipPlugin::checkSettings()
{
//TODO/FIXME: check status and enable/disable?
}
bool bool
TwitterSipPlugin::connectPlugin() TwitterSipPlugin::connectPlugin()
{ {
qDebug() << Q_FUNC_INFO; qDebug() << Q_FUNC_INFO;
if ( !m_account->enabled() ) if ( !m_account->enabled() )
return; return false;
m_cachedPeers = m_configuration[ "cachedPeers" ].toHash(); m_cachedPeers = m_configuration[ "cachedPeers" ].toHash();
QStringList peerList = m_cachedPeers.keys(); QStringList peerList = m_cachedPeers.keys();
@@ -134,7 +141,7 @@ TwitterSipPlugin::refreshTwitterAuth()
Q_ASSERT( TomahawkUtils::nam() != 0 ); Q_ASSERT( TomahawkUtils::nam() != 0 );
qDebug() << Q_FUNC_INFO << " with nam " << TomahawkUtils::nam(); qDebug() << Q_FUNC_INFO << " with nam " << TomahawkUtils::nam();
m_twitterAuth = QWeakPointer<TomahawkOAuthTwitter>( new TomahawkOAuthTwitter( TomahawkUtils::nam(), this ) ); m_twitterAuth = QWeakPointer< TomahawkOAuthTwitter >( new TomahawkOAuthTwitter( TomahawkUtils::nam(), this ) );
if( m_twitterAuth.isNull() ) if( m_twitterAuth.isNull() )
return false; return false;
@@ -191,7 +198,7 @@ TwitterSipPlugin::connectAuthVerifyReply( const QTweetUser &user )
m_isAuthed = true; m_isAuthed = true;
if ( !m_twitterAuth.isNull() ) if ( !m_twitterAuth.isNull() )
{ {
m_configuration[ "screenName" ] = user.screenName; m_configuration[ "screenName" ] = user.screenName();
syncConfig(); syncConfig();
m_friendsTimeline = QWeakPointer<QTweetFriendsTimeline>( new QTweetFriendsTimeline( m_twitterAuth.data(), this ) ); m_friendsTimeline = QWeakPointer<QTweetFriendsTimeline>( new QTweetFriendsTimeline( m_twitterAuth.data(), this ) );
m_mentions = QWeakPointer<QTweetMentions>( new QTweetMentions( m_twitterAuth.data(), this ) ); m_mentions = QWeakPointer<QTweetMentions>( new QTweetMentions( m_twitterAuth.data(), this ) );

View File

@@ -72,6 +72,8 @@ public slots:
Q_UNUSED( msg ); Q_UNUSED( msg );
} }
void checkSettings();
private slots: private slots:
void connectAuthVerifyReply( const QTweetUser &user ); void connectAuthVerifyReply( const QTweetUser &user );
void checkTimerFired(); void checkTimerFired();
@@ -90,16 +92,11 @@ private slots:
void fetchAvatar( const QString &screenName ); void fetchAvatar( const QString &screenName );
void avatarUserDataSlot( const QTweetUser &user ); void avatarUserDataSlot( const QTweetUser &user );
void profilePicReply(); void profilePicReply();
private: private:
inline void syncConfig() { m_account->setCredentials( m_credentials ); m_account->setConfiguration( m_configuration ); m_account->syncConfig(); } inline void syncConfig() { m_account->setCredentials( m_credentials ); m_account->setConfiguration( m_configuration ); m_account->syncConfig(); }
bool refreshTwitterAuth(); bool refreshTwitterAuth();
void parseGotTomahawk( const QRegExp &regex, const QString &screenName, const QString &text ); void parseGotTomahawk( const QRegExp &regex, const QString &screenName, const QString &text );
// handle per-plugin config
QString twitterOAuthToken() const;
void setTwitterOAuthToken( const QString& oauthtoken );
QString twitterOAuthTokenSecret() const;
void setTwitterOAuthTokenSecret( const QString& oauthtokensecret );
QWeakPointer< TomahawkOAuthTwitter > m_twitterAuth; QWeakPointer< TomahawkOAuthTwitter > m_twitterAuth;
QWeakPointer< QTweetFriendsTimeline > m_friendsTimeline; QWeakPointer< QTweetFriendsTimeline > m_friendsTimeline;