From ee65c8d82425977f712b9823c3ca19f04bda0cbf Mon Sep 17 00:00:00 2001 From: Will Stott Date: Sun, 21 Sep 2014 17:47:58 +0100 Subject: [PATCH] Added a link to prompt users with restrictive security settings on google. --- src/accounts/google/GoogleWrapper.cpp | 1 + src/accounts/xmpp/XmppAccount.cpp | 4 ++++ src/accounts/xmpp/XmppConfigWidget.h | 1 + src/accounts/xmpp/XmppConfigWidget.ui | 27 ++++++++++++++++++++++++++- 4 files changed, 32 insertions(+), 1 deletion(-) diff --git a/src/accounts/google/GoogleWrapper.cpp b/src/accounts/google/GoogleWrapper.cpp index c91bf9763..c0ab8cc8f 100644 --- a/src/accounts/google/GoogleWrapper.cpp +++ b/src/accounts/google/GoogleWrapper.cpp @@ -94,6 +94,7 @@ GoogleWrapper::GoogleWrapper ( const QString& pluginID ) config->m_ui->xmppServer->setText( "talk.google.com" ); config->m_ui->xmppPort->setValue( 5222 ); config->m_ui->groupBoxXmppAdvanced->hide(); + config->m_ui->googleHint->show(); m_onlinePixmap = QPixmap( ":/google-account/gmail-logo.png" ); m_offlinePixmap = QPixmap( ":/google-account/gmail-offline-logo.png" ); diff --git a/src/accounts/xmpp/XmppAccount.cpp b/src/accounts/xmpp/XmppAccount.cpp index 932956738..c9ca306af 100644 --- a/src/accounts/xmpp/XmppAccount.cpp +++ b/src/accounts/xmpp/XmppAccount.cpp @@ -23,6 +23,7 @@ #include "sip/SipPlugin.h" #include "XmppInfoPlugin.h" #include "accounts/AccountConfigWidget.h" +#include "ui_XmppConfigWidget.h" #include @@ -47,6 +48,9 @@ XmppAccount::XmppAccount( const QString &accountId ) m_configWidget = QPointer< AccountConfigWidget >( new XmppConfigWidget( this, 0 ) ); + XmppConfigWidget* config = static_cast< XmppConfigWidget* >( m_configWidget.data() ); + config->m_ui->googleHint->hide(); + m_onlinePixmap = QPixmap( ":/xmpp-account/xmpp-icon.png" ); m_offlinePixmap = QPixmap( ":/xmpp-account/xmpp-offline-icon.png" ); } diff --git a/src/accounts/xmpp/XmppConfigWidget.h b/src/accounts/xmpp/XmppConfigWidget.h index ec3739735..203f301a4 100644 --- a/src/accounts/xmpp/XmppConfigWidget.h +++ b/src/accounts/xmpp/XmppConfigWidget.h @@ -66,6 +66,7 @@ private: bool m_disableChecksForGoogle; friend class GoogleWrapper; // So google wrapper can modify the labels and text + friend class XmppAccount; // So xmpp 'wrapper' can modify the labels and text }; } diff --git a/src/accounts/xmpp/XmppConfigWidget.ui b/src/accounts/xmpp/XmppConfigWidget.ui index 96eacb053..6c05a1cde 100644 --- a/src/accounts/xmpp/XmppConfigWidget.ui +++ b/src/accounts/xmpp/XmppConfigWidget.ui @@ -7,7 +7,7 @@ 0 0 451 - 337 + 448 @@ -413,6 +413,31 @@ + + + + + 16777215 + 20 + + + + <html><head/><body><p>You may need to change your <a href="https://www.google.com/settings/security/lesssecureapps"><span style=" text-decoration: underline; color:#0000ff;">Google Account settings</span></a> to login.</p></body></html> + + + Qt::RichText + + + Qt::AlignCenter + + + true + + + Qt::TextBrowserInteraction + + +