Kaydet (Commit) 972cb3ea authored tarafından Justin Luth's avatar Justin Luth Kaydeden (comit) Caolán McNamara

mailconfig UI: default POP port 995 and toggle with IMAP ports

SSL is now default, so change POP3's default to port 995.
Also, suggest appropriate secure/insecure ports for
IMAP and POP as the user switches between them.

Change-Id: Ib930504956a222d0d6eb3cad969907751602c106
Reviewed-on: https://gerrit.libreoffice.org/48212Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 69acbf19
...@@ -107,6 +107,7 @@ class SwAuthenticationSettingsDialog : public SfxModalDialog ...@@ -107,6 +107,7 @@ class SwAuthenticationSettingsDialog : public SfxModalDialog
DECL_LINK(OKHdl_Impl, Button*, void); DECL_LINK(OKHdl_Impl, Button*, void);
DECL_LINK( CheckBoxHdl_Impl, Button*, void); DECL_LINK( CheckBoxHdl_Impl, Button*, void);
DECL_LINK(RadioButtonHdl_Impl, Button*, void); DECL_LINK(RadioButtonHdl_Impl, Button*, void);
DECL_LINK(InServerHdl_Impl, Button*, void);
public: public:
SwAuthenticationSettingsDialog(SwMailConfigPage* pParent, SwMailMergeConfigItem& rItem); SwAuthenticationSettingsDialog(SwMailConfigPage* pParent, SwMailMergeConfigItem& rItem);
...@@ -423,6 +424,9 @@ SwAuthenticationSettingsDialog::SwAuthenticationSettingsDialog( ...@@ -423,6 +424,9 @@ SwAuthenticationSettingsDialog::SwAuthenticationSettingsDialog(
m_pSeparateAuthenticationRB->SetClickHdl( aRBLink ); m_pSeparateAuthenticationRB->SetClickHdl( aRBLink );
m_pSMTPAfterPOPRB->SetClickHdl( aRBLink ); m_pSMTPAfterPOPRB->SetClickHdl( aRBLink );
m_pOKPB->SetClickHdl( LINK( this, SwAuthenticationSettingsDialog, OKHdl_Impl)); m_pOKPB->SetClickHdl( LINK( this, SwAuthenticationSettingsDialog, OKHdl_Impl));
Link<Button*,void> aInServerLink = LINK( this, SwAuthenticationSettingsDialog, InServerHdl_Impl );
m_pPOP3RB->SetClickHdl( aInServerLink );
m_pIMAPRB->SetClickHdl( aInServerLink );
m_pAuthenticationCB->Check( rConfigItem.IsAuthentication() ); m_pAuthenticationCB->Check( rConfigItem.IsAuthentication() );
if(rConfigItem.IsSMTPAfterPOP()) if(rConfigItem.IsSMTPAfterPOP())
...@@ -535,4 +539,11 @@ IMPL_LINK_NOARG(SwAuthenticationSettingsDialog, RadioButtonHdl_Impl, Button*, vo ...@@ -535,4 +539,11 @@ IMPL_LINK_NOARG(SwAuthenticationSettingsDialog, RadioButtonHdl_Impl, Button*, vo
m_pInPasswordED->Enable(bNotSeparate); m_pInPasswordED->Enable(bNotSeparate);
} }
IMPL_LINK_NOARG( SwAuthenticationSettingsDialog, InServerHdl_Impl, Button*, void)
{
bool bPOP = m_pPOP3RB->IsChecked();
rConfigItem.SetInServerPOP(bPOP);
m_pPortNF->SetValue(rConfigItem.GetInServerPort());
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -62,6 +62,9 @@ const char cDataCommandType[] = "DataSource/DataCommandType"; ...@@ -62,6 +62,9 @@ const char cDataCommandType[] = "DataSource/DataCommandType";
#define SECURE_PORT 587 #define SECURE_PORT 587
#define DEFAULT_PORT 25 #define DEFAULT_PORT 25
#define POP_PORT 110 #define POP_PORT 110
#define POP_SECURE_PORT 995
#define IMAP_PORT 143
#define IMAP_SECURE_PORT 993
struct DBAddressDataAssignment struct DBAddressDataAssignment
{ {
...@@ -191,7 +194,7 @@ SwMailMergeConfigItem_Impl::SwMailMergeConfigItem_Impl() : ...@@ -191,7 +194,7 @@ SwMailMergeConfigItem_Impl::SwMailMergeConfigItem_Impl() :
m_bIsGreetingLineInMail(false), m_bIsGreetingLineInMail(false),
m_bIsIndividualGreetingLineInMail(false), m_bIsIndividualGreetingLineInMail(false),
m_bIsSMPTAfterPOP(false), m_bIsSMPTAfterPOP(false),
m_nInServerPort( POP_PORT ), m_nInServerPort( POP_SECURE_PORT ),
m_bInServerPOP( true ), m_bInServerPOP( true ),
m_nMailPort(0), m_nMailPort(0),
m_bIsMailReplyTo(false), m_bIsMailReplyTo(false),
...@@ -1479,7 +1482,21 @@ void SwMailMergeConfigItem::SetInServerName(const OUString& rServer) ...@@ -1479,7 +1482,21 @@ void SwMailMergeConfigItem::SetInServerName(const OUString& rServer)
sal_Int16 SwMailMergeConfigItem::GetInServerPort() const sal_Int16 SwMailMergeConfigItem::GetInServerPort() const
{ {
return m_pImpl->m_nInServerPort; // provide appropriate TCP port as user toggles between POP/IMAP if current port is one of the defaults
switch (m_pImpl->m_nInServerPort)
{
case POP_SECURE_PORT:
case POP_PORT:
case IMAP_SECURE_PORT:
case IMAP_PORT:
if ( m_pImpl->m_bInServerPOP )
return m_pImpl->m_bIsSecureConnection ? POP_SECURE_PORT : POP_PORT;
else
return m_pImpl->m_bIsSecureConnection ? IMAP_SECURE_PORT : IMAP_PORT;
break;
default:
return m_pImpl->m_nInServerPort;
}
} }
void SwMailMergeConfigItem::SetInServerPort(sal_Int16 nSet) void SwMailMergeConfigItem::SetInServerPort(sal_Int16 nSet)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment