From 7d7650f97ca2391f14cd04268da088f075676501 Mon Sep 17 00:00:00 2001 From: Jeff Mitchell Date: Sat, 16 Jul 2011 13:36:59 -0400 Subject: [PATCH] Fix twitter copy and also size issues. Fixes TWK-209. --- src/sip/twitter/twitterconfigwidget.cpp | 47 +-- src/sip/twitter/twitterconfigwidget.ui | 400 ++++++++++++++++-------- 2 files changed, 282 insertions(+), 165 deletions(-) diff --git a/src/sip/twitter/twitterconfigwidget.cpp b/src/sip/twitter/twitterconfigwidget.cpp index ddf5e89df..027cf3726 100644 --- a/src/sip/twitter/twitterconfigwidget.cpp +++ b/src/sip/twitter/twitterconfigwidget.cpp @@ -46,18 +46,13 @@ TwitterConfigWidget::TwitterConfigWidget( TwitterPlugin* plugin, QWidget *parent this, SLOT( tweetComboBoxIndexChanged( int ) ) ); ui->twitterTweetComboBox->setCurrentIndex( 0 ); - ui->twitterUserTweetLineEdit->setReadOnly( true ); - ui->twitterUserTweetLineEdit->setEnabled( false ); + 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->twitterInstructionsInfoLabel->setVisible( false ); - ui->twitterGlobalTweetLabel->setVisible( false ); - ui->twitterTweetGotTomahawkButton->setVisible( false ); - ui->twitterUserTweetLineEdit->setVisible( false ); - ui->twitterTweetComboBox->setVisible( false ); + ui->twitterSyncGroupBox->setVisible( false ); emit twitterAuthed( false ); } @@ -65,11 +60,8 @@ TwitterConfigWidget::TwitterConfigWidget( TwitterPlugin* plugin, QWidget *parent { ui->twitterStatusLabel->setText( tr( "Status: Credentials saved for %1" ).arg( m_plugin->twitterScreenName() ) ); ui->twitterAuthenticateButton->setText( tr( "De-authenticate" ) ); - ui->twitterInstructionsInfoLabel->setVisible( true ); - ui->twitterGlobalTweetLabel->setVisible( true ); - ui->twitterTweetGotTomahawkButton->setVisible( true ); - ui->twitterUserTweetLineEdit->setVisible( true ); - ui->twitterTweetComboBox->setVisible( true ); + ui->twitterSyncGroupBox->setVisible( true ); + ui->twitterUserTweetLineEdit->setVisible( false ); emit twitterAuthed( true ); } @@ -123,11 +115,10 @@ TwitterConfigWidget::authenticateVerifyReply( const QTweetUser &user ) ui->twitterStatusLabel->setText( tr( "Status: Credentials saved for %1" ).arg( m_plugin->twitterScreenName() ) ); ui->twitterAuthenticateButton->setText( tr( "De-authenticate" ) ); - ui->twitterInstructionsInfoLabel->setVisible( true ); - ui->twitterGlobalTweetLabel->setVisible( true ); - ui->twitterTweetGotTomahawkButton->setVisible( true ); - ui->twitterUserTweetLineEdit->setVisible( true ); - ui->twitterTweetComboBox->setVisible( true ); + ui->twitterSyncGroupBox->setVisible( true ); + ui->twitterTweetComboBox->setCurrentIndex( 0 ); + ui->twitterUserTweetLineEdit->setVisible( false ); + ui->twitterTweetGotTomahawkButton->setText( tr( "Tweet!" ) ); m_plugin->connectPlugin( false ); @@ -155,11 +146,7 @@ TwitterConfigWidget::deauthenticateTwitter() ui->twitterStatusLabel->setText(tr("Status: No saved credentials")); ui->twitterAuthenticateButton->setText( tr( "Authenticate" ) ); - ui->twitterInstructionsInfoLabel->setVisible( false ); - ui->twitterGlobalTweetLabel->setVisible( false ); - ui->twitterTweetGotTomahawkButton->setVisible( false ); - ui->twitterUserTweetLineEdit->setVisible( false ); - ui->twitterTweetComboBox->setVisible( false ); + ui->twitterSyncGroupBox->setVisible( false ); emit twitterAuthed( false ); emit sizeHintChanged(); @@ -169,19 +156,15 @@ void TwitterConfigWidget::tweetComboBoxIndexChanged( int index ) { Q_UNUSED( index ); - if( ui->twitterTweetComboBox->currentText() == tr( "Global Tweet" ) ) //FIXME: use data! - { - ui->twitterUserTweetLineEdit->setReadOnly( true ); - ui->twitterUserTweetLineEdit->setEnabled( false ); - } + if ( ui->twitterTweetComboBox->currentText() == tr( "Global Tweet" ) ) //FIXME: use data! + ui->twitterUserTweetLineEdit->setVisible( false ); else - { - ui->twitterUserTweetLineEdit->setReadOnly( false ); - ui->twitterUserTweetLineEdit->setEnabled( true ); - } + ui->twitterUserTweetLineEdit->setVisible( true ); - if( ui->twitterTweetComboBox->currentText() == tr( "Direct Message" ) ) //FIXME: use data! + 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!" ) ); } diff --git a/src/sip/twitter/twitterconfigwidget.ui b/src/sip/twitter/twitterconfigwidget.ui index 57035c5de..f60dbb5f8 100644 --- a/src/sip/twitter/twitterconfigwidget.ui +++ b/src/sip/twitter/twitterconfigwidget.ui @@ -6,17 +6,23 @@ 0 0 - 526 - 358 + 580 + 390 + + + 0 + 0 + + - 0 - 0 + 580 + 390 - + @@ -27,13 +33,19 @@ 40 - 20 + 0 + + + 0 + 0 + + @@ -44,6 +56,12 @@ + + + 0 + 0 + + 11 @@ -61,10 +79,13 @@ Qt::Horizontal + + QSizePolicy::Expanding + 40 - 20 + 0 @@ -72,17 +93,30 @@ - + + + Qt::Vertical + + + + 20 + 40 + + + + + + - + 0 0 - Authenticating with Twitter allows you to discover and play music from your Twitter friends running Tomahawk. + The Twitter plugin allows you to discover and play music from your Twitter friends running Tomahawk and post messages to your account. true @@ -90,19 +124,15 @@ - - - This feature works best when you have set a static host name in the "Network" settings tab under Advanced Settings, but may work even if you do not. Tomahawk uses Direct Messages and this will only work when both Twitter users have followed each other. - - - true - - - - - + + + + 0 + 0 + + Status: No saved credentials @@ -111,8 +141,27 @@ + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + 0 + 0 + + Authenticate with Twitter @@ -123,121 +172,206 @@ - - - Here's how it works: just press one of the buttons below to tweet "Got Tomahawk?" and some necessary information. Then be (very) patient. Twitter is an asynchronous protocol so it can take a bit! + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + 0 + 0 + + + + Twitter Connections + + + + + + +If you only want to post tweets, you're done. -If connections to peers seem to have been lost, just press the appropriate button again to re-post a tweet for resynchronization. - - - true - +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. + + + true + + + + + + + Qt::Vertical + + + QSizePolicy::Expanding + + + + 20 + 40 + + + + + + + + QLayout::SetFixedSize + + + + + + 0 + 0 + + + + Select the kind of tweet you would like, then press the button to post it: + + + + + + + Qt::Vertical + + + QSizePolicy::Fixed + + + + 20 + 10 + + + + + + + + + + + 0 + 0 + + + + + Global Tweet + + + + + @Mention + + + + + Direct Message + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 10 + 20 + + + + + + + + + 0 + 0 + + + + + 250 + 0 + + + + e.g. @tomahawk + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 10 + 20 + + + + + + + + + 0 + 0 + + + + Send Message + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - - 0 - 0 - - - - Select the kind of tweet you would like, then press the button to post it: - - - - - - - - - - 0 - 0 - - - - - Global Tweet - - - - - @Mention - - - - - Direct Message - - - - - - - - - 0 - 0 - - - - - 250 - 0 - - - - e.g. @tomahawkplayer - - - - - - - - 0 - 0 - - - - Tweet! - - - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - -