From cc29364f06178f8f6b457384f2ec37a042bd9d43 Mon Sep 17 00:00:00 2001 From: tpearson Date: Wed, 1 Sep 2010 00:37:02 +0000 Subject: * Massive set of changes to bring in all fixes and enhancements from the Enterprise PIM branch * Ensured that the Trinity changes were applied on top of those enhancements, and any redundancy removed * Added journal read support to the CalDAV resource * Fixed CalDAV resource to use events URL for tasks and journals when separate URL checkbox unchecked git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1170461 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kmail/identitydialog.cpp | 46 +++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 41 insertions(+), 5 deletions(-) (limited to 'kmail/identitydialog.cpp') diff --git a/kmail/identitydialog.cpp b/kmail/identitydialog.cpp index c0a1952d7..22b5a4c81 100644 --- a/kmail/identitydialog.cpp +++ b/kmail/identitydialog.cpp @@ -48,6 +48,7 @@ using KMail::FolderRequester; #include "kmfolder.h" #include "templatesconfiguration.h" #include "templatesconfiguration_kfg.h" +#include "simplestringlisteditor.h" // other kdepim headers: // libkdepim @@ -76,6 +77,8 @@ using KMail::FolderRequester; #include #include #include +#include +#include // other headers: #include @@ -107,7 +110,7 @@ namespace KMail { tab = new TQWidget( tabWidget ); tabWidget->addTab( tab, i18n("&General") ); - glay = new TQGridLayout( tab, 4, 2, marginHint(), spacingHint() ); + glay = new TQGridLayout( tab, 5, 2, marginHint(), spacingHint() ); glay->setRowStretch( 3, 1 ); glay->setColStretch( 1, 1 ); @@ -140,19 +143,40 @@ namespace KMail { TQWhatsThis::add( mOrganizationEdit, msg ); // "Email Address" line edit and label: - // (row 3: spacer) ++row; mEmailEdit = new KLineEdit( tab ); glay->addWidget( mEmailEdit, row, 1 ); label = new TQLabel( mEmailEdit, i18n("&Email address:"), tab ); glay->addWidget( label, row, 0 ); msg = i18n("

Email address

" - "

This field should have your full email address.

" + "

This field should have your full email address

" + "

This address is the primary one, used for all outgoing mail. " + "If you have more than one address, either create a new identity, " + "or add additional alias addresses in the field below.

" "

If you leave this blank, or get it wrong, people " "will have trouble replying to you.

"); TQWhatsThis::add( label, msg ); TQWhatsThis::add( mEmailEdit, msg ); + // "Email Aliases" string list edit and label: + ++row; + mAliasEdit = new SimpleStringListEditor( tab ); + glay->addMultiCellWidget( mAliasEdit, row, row+1, 1, 1 ); + label = new TQLabel( mAliasEdit, i18n("Email a&liases:"), tab ); + glay->addWidget( label, row, 0, TQt::AlignTop ); + msg = i18n("

Email aliases

" + "

This field contains alias addresses that should also " + "be considered as belonging to this identity (as opposed " + "to representing a different identity).

" + "

Example:

" + "" + "" + "" + "
Primary address:first.last@example.org
Aliases:first@example.org
last@example.org
" + "

Type one alias address per line.

"); + TQWhatsThis::add( label, msg ); + TQWhatsThis::add( mAliasEdit, msg ); + // // Tab Widget: Cryptography // @@ -499,6 +523,15 @@ void IdentityDialog::slotOk() { return; } + const TQStringList aliases = mAliasEdit->stringList(); + for ( TQStringList::const_iterator it = aliases.begin(), end = aliases.end() ; it != end ; ++it ) { + if ( !isValidSimpleEmailAddress( *it ) ) { + TQString errorMsg( simpleEmailAddressErrorMsg()); + KMessageBox::sorry( this, errorMsg, i18n("Invalid Email Alias \"%1\"").arg( *it ) ); + return; + } + } + if ( !validateAddresses( mReplyToEdit->text().stripWhiteSpace() ) ) { return; } @@ -584,7 +617,8 @@ void IdentityDialog::slotOk() { // "General" tab: mNameEdit->setText( ident.fullName() ); mOrganizationEdit->setText( ident.organization() ); - mEmailEdit->setText( ident.emailAddr() ); + mEmailEdit->setText( ident.primaryEmailAddress() ); + mAliasEdit->setStringList( ident.emailAliases() ); // "Cryptography" tab: mPGPSigningKeyRequester->setFingerprint( ident.pgpSigningKey() ); @@ -652,7 +686,9 @@ void IdentityDialog::slotOk() { ident.setFullName( mNameEdit->text() ); ident.setOrganization( mOrganizationEdit->text() ); TQString email = mEmailEdit->text(); - ident.setEmailAddr( email ); + ident.setPrimaryEmailAddress( email ); + const TQStringList aliases = mAliasEdit->stringList(); + ident.setEmailAliases( aliases ); // "Cryptography" tab: ident.setPGPSigningKey( mPGPSigningKeyRequester->fingerprint().latin1() ); ident.setPGPEncryptionKey( mPGPEncryptionKeyRequester->fingerprint().latin1() ); -- cgit v1.2.1