diff options
author | Justin Luth <justin_luth@sil.org> | 2018-01-19 11:09:29 +0300 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-01-28 14:34:09 +0100 |
commit | f679fb89b6d021f12ebeb543a1efe519bd44f96b (patch) | |
tree | e95a37bcd680069e210330e1e50b7b559edbc78d | |
parent | c0fc7910f1bfb7159f6fd7022dfd838bfb66b624 (diff) |
mailconfig UI: pre-fill username from mail address
Be nice to the user. We already asked them for their email address.
Typically, the username for authentication matches the email
address, so pre-populate that.
Change-Id: Ia390bdc293510900220c996be13c238d88817b81
Reviewed-on: https://gerrit.libreoffice.org/48213
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | sw/source/ui/config/mailconfigpage.cxx | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/sw/source/ui/config/mailconfigpage.cxx b/sw/source/ui/config/mailconfigpage.cxx index 1787465d263b..df0984ea5f72 100644 --- a/sw/source/ui/config/mailconfigpage.cxx +++ b/sw/source/ui/config/mailconfigpage.cxx @@ -215,6 +215,8 @@ IMPL_LINK(SwMailConfigPage, ReplyToHdl, Button*, pBox, void) IMPL_LINK_NOARG(SwMailConfigPage, AuthenticationHdl, Button*, void) { + m_pConfigItem->SetMailAddress(m_pAddressED->GetText()); + ScopedVclPtrInstance< SwAuthenticationSettingsDialog > aDlg(this, *m_pConfigItem); aDlg->Execute(); } @@ -503,6 +505,16 @@ IMPL_LINK_NOARG(SwAuthenticationSettingsDialog, RadioButtonHdl_Impl, Button*, vo bool bNotSeparate = !bSeparate && bIsEnabled; bSeparate &= bIsEnabled; + if ( bSeparate && m_pUserNameED->GetText().isEmpty() ) + m_pUserNameED->SetText( rConfigItem.GetMailAddress() ); + else if ( m_pUserNameED->GetText() == rConfigItem.GetMailAddress() ) + m_pUserNameED->SetText(""); + + if ( bNotSeparate && m_pInUsernameED->GetText().isEmpty() ) + m_pInUsernameED->SetText( rConfigItem.GetMailAddress() ); + else if ( m_pInUsernameED->GetText() == rConfigItem.GetMailAddress() ) + m_pInUsernameED->SetText(""); + m_pOutgoingServerFT->Enable(bSeparate); m_pUserNameFT->Enable(bSeparate); m_pUserNameED->Enable(bSeparate); |