1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-09 07:36:48 +02:00

shrink the twitter config dialog a bit.

The text didn't fit by default in on OS X. Removed the groupbox as it made huge margins and cut off text.
Removed some text, and reworked some of the contents of a qlabel into another qlabel because multiline
qlabels fail at layouting
This commit is contained in:
Leo Franchi
2011-03-19 20:34:04 -04:00
parent e72010b263
commit 1f66b31416
2 changed files with 101 additions and 98 deletions

View File

@@ -47,13 +47,15 @@ TwitterConfigWidget::TwitterConfigWidget(SipPlugin* plugin, QWidget *parent) :
{ {
ui->twitterStatusLabel->setText("Status: No saved credentials"); ui->twitterStatusLabel->setText("Status: No saved credentials");
ui->twitterAuthenticateButton->setText( "Authenticate" ); ui->twitterAuthenticateButton->setText( "Authenticate" );
ui->twitterInstructionsBox->setVisible( false ); ui->twitterInstructionsInfoLabel->setVisible( false );
ui->twitterTweetGotTomahawkButton->setVisible( false );
} }
else else
{ {
ui->twitterStatusLabel->setText("Status: Credentials saved"); ui->twitterStatusLabel->setText("Status: Credentials saved");
ui->twitterAuthenticateButton->setText( "Re-authenticate" ); ui->twitterAuthenticateButton->setText( "Re-authenticate" );
ui->twitterInstructionsBox->setVisible( true ); ui->twitterInstructionsInfoLabel->setVisible( true );
ui->twitterTweetGotTomahawkButton->setVisible( true );
} }
} }
@@ -77,7 +79,10 @@ TwitterConfigWidget::authenticateTwitter()
s->setTwitterOAuthTokenSecret( twitAuth->oauthTokenSecret() ); s->setTwitterOAuthTokenSecret( twitAuth->oauthTokenSecret() );
ui->twitterStatusLabel->setText("Status: Credentials saved"); ui->twitterStatusLabel->setText("Status: Credentials saved");
ui->twitterAuthenticateButton->setText( "Re-authenticate" ); ui->twitterAuthenticateButton->setText( "Re-authenticate" );
ui->twitterInstructionsBox->setVisible( true );
ui->twitterInstructionsInfoLabel->setVisible( true );
ui->twitterTweetGotTomahawkButton->setVisible( true );
TomahawkSettings::instance()->setTwitterCachedFriendsSinceId( 0 ); TomahawkSettings::instance()->setTwitterCachedFriendsSinceId( 0 );
TomahawkSettings::instance()->setTwitterCachedMentionsSinceId( 0 ); TomahawkSettings::instance()->setTwitterCachedMentionsSinceId( 0 );
m_plugin->connectPlugin( false ); m_plugin->connectPlugin( false );
@@ -90,7 +95,10 @@ TwitterConfigWidget::authenticateTwitter()
s->setTwitterOAuthTokenSecret( QString() ); s->setTwitterOAuthTokenSecret( QString() );
ui->twitterStatusLabel->setText("Status: No saved credentials"); ui->twitterStatusLabel->setText("Status: No saved credentials");
ui->twitterAuthenticateButton->setText( "Authenticate" ); ui->twitterAuthenticateButton->setText( "Authenticate" );
ui->twitterInstructionsBox->setVisible( false );
ui->twitterInstructionsInfoLabel->setVisible( false );
ui->twitterTweetGotTomahawkButton->setVisible( false );
QMessageBox::critical( 0, QString("Tweetin' Error"), QString("There was an error validating your authentication") ); QMessageBox::critical( 0, QString("Tweetin' Error"), QString("There was an error validating your authentication") );
} }
} }

View File

@@ -1,106 +1,101 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0"> <ui version="4.0">
<author/>
<comment/>
<exportmacro/>
<class>TwitterConfigWidget</class> <class>TwitterConfigWidget</class>
<widget class="QWidget" name="TwitterConfigWidget"> <widget class="QWidget" name="TwitterConfigWidget">
<attribute name="title"> <property name="geometry">
<string>Twitter</string> <rect>
</attribute> <x>0</x>
<layout class="QVBoxLayout" name="verticalLayout_10"> <y>0</y>
<width>795</width>
<height>509</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_10">
<item>
<layout class="QVBoxLayout" name="twitterVertLayout">
<item>
<widget class="QLabel" name="twitterInfoLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Authenticating with Twitter allows you to discover and play music from your Twitter friends running Tomahawk.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_2">
<property name="text">
<string>This feature works best when you have set a static host name in the &quot;Network&quot; 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.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="twitterHorizontalLayout">
<item> <item>
<layout class="QVBoxLayout" name="twitterVertLayout"> <widget class="QLabel" name="twitterStatusLabel">
<item> <property name="text">
<widget class="QLabel" name="twitterInfoLabel"> <string>Status: No saved credentials</string>
<property name="sizePolicy"> </property>
<sizepolicy hsizetype="Preferred" vsizetype="Fixed"> <property name="textFormat">
<horstretch>0</horstretch> <enum>Qt::AutoText</enum>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Authenticating with Twitter allows you to discover and play music from your Twitter friends running Tomahawk.
This feature works best when you have set a static host name in the &quot;Network&quot; settings tab under Advanced Settings, but may work even if you do not. Please note: this discovery uses Direct Messages and will only work when both Twitter users have followed each other. Tomahawk will attempt to &quot;clean up&quot; after itself to keep your Direct Message inbox tidy, but may miss some.
When you press the button your web browser will launch and take you to Twitter.com to authenticate. You must copy and paste the PIN number into the dialog box that appears.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="twitterHorizontalLayout">
<item>
<widget class="QLabel" name="twitterStatusLabel">
<property name="text">
<string>Status: No saved credentials</string>
</property>
<property name="textFormat">
<enum>Qt::AutoText</enum>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="twitterAuthenticateButton">
<property name="text">
<string>Authenticate with Twitter</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
<item>
<widget class="QGroupBox" name="twitterInstructionsBox">
<property name="title">
<string>Instructions</string>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_12">
<item>
<layout class="QVBoxLayout" name="twitterInstructionsVLayout">
<item>
<widget class="QLabel" name="twitterInstructionsInfoLabel">
<property name="text">
<string>How it works is simple: just press the button below to tweet &quot;Got Tomahawk?&quot; and some necessary information. Then be (very) patient. Twitter is an asynchronous protocol so it can take a bit!
If connections to peers seem to have been lost, just press the button again to re-post a tweet for resynchronization.
</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="twitterTweetGotTomahawkButton">
<property name="text">
<string>Press here to have Tomahawk post a tweet</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget> </widget>
</item> </item>
<item> <item>
<spacer name="twitterVertSpacer"> <widget class="QPushButton" name="twitterAuthenticateButton">
<property name="orientation"> <property name="text">
<enum>Qt::Vertical</enum> <string>Authenticate with Twitter</string>
</property> </property>
<property name="sizeHint" stdset="0"> </widget>
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item> </item>
</layout> </layout>
</widget> </item>
<pixmapfunction/> </layout>
</item>
<item>
<widget class="QLabel" name="twitterInstructionsInfoLabel">
<property name="text">
<string>Here's how it works: just press the button below to tweet &quot;Got Tomahawk?&quot; and some necessary information. Then be (very) patient. Twitter is an asynchronous protocol so it can take a bit!
If connections to peers seem to have been lost, just press the button again to re-post a tweet for resynchronization.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="twitterTweetGotTomahawkButton">
<property name="text">
<string>Press here to have Tomahawk post a tweet</string>
</property>
</widget>
</item>
<item>
<spacer name="twitterVertSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<resources/>
<connections/> <connections/>
</ui> </ui>