From 9e80500d78cea0a12cd2f65cfb3e0a40c9db7cfe Mon Sep 17 00:00:00 2001 From: Thomas McGuire Date: Wed, 24 Jun 2009 14:10:12 +0000 Subject: [PATCH] Merged revisions 966821 via svnmerge from svn+ssh://tmcguire@svn.kde.org/home/kde/branches/kdepim/enterprise4/kdepim ........ r966821 | tmcguire | 2009-05-12 00:35:10 +0200 (Tue, 12 May 2009) | 8 lines When inline forwarding a message, include the CCs as well by default. For this, a new template command OADDRESSEESADDR was added. Thanks to David "Usability" Faure for suggesting this. Note to self: When porting to trunk, use "templates.diff" in your KMail dir, to avoid conflicts. ........ svn path=/trunk/KDE/kdepim/; revision=986306 --- templateparser.cpp | 12 ++++++++++++ templatesconfiguration.cpp | 22 ++++++++++------------ templatesinsertcommand.cpp | 2 ++ templatesinsertcommand.h | 3 ++- 4 files changed, 26 insertions(+), 13 deletions(-) diff --git a/templateparser.cpp b/templateparser.cpp index f4f53c0ec..36aeb3a3b 100644 --- a/templateparser.cpp +++ b/templateparser.cpp @@ -404,6 +404,18 @@ void TemplateParser::processWithTemplate( const QString &tmpl ) body.append( quote ); } + } else if ( cmd.startsWith( QLatin1String("OADDRESSEESADDR") ) ) { + kDebug() << "Command: OADDRESSEESADDR"; + i += strlen( "OADDRESSEESADDR" ); + const QString to = mOrigMsg->to(); + const QString cc = mOrigMsg->cc(); + if ( !to.isEmpty() ) + body.append( i18n( "To:" ) + QLatin1Char( ' ' ) + to ); + if ( !to.isEmpty() && !cc.isEmpty() ) + body.append( QLatin1Char( '\n' ) ); + if ( !cc.isEmpty() ) + body.append( i18n( "CC:" ) + QLatin1Char( ' ' ) + cc ); + } else if ( cmd.startsWith( QLatin1String("CCADDR") ) ) { kDebug() <<"Command: CCADDR"; i += strlen( "CCADDR" ); diff --git a/templatesconfiguration.cpp b/templatesconfiguration.cpp index feed1f490..b15431f20 100644 --- a/templatesconfiguration.cpp +++ b/templatesconfiguration.cpp @@ -337,20 +337,18 @@ void TemplatesConfiguration::importFromPhrases() "%1: forward phrase, e.g. \"Forwarded Message\", " "%2: subject of original message, %3: date of original message, " "%4: mail address of sender of original message, " - "%5: mail address of receiver of original message, " - "%6: text of original message", + "%5: text of original message", "\n" "---------- %1 ----------\n" "\n" "Subject: %2\n" "Date: %3\n" "From: %4\n" - "To: %5\n" + "%OADDRESSEESADDR\n" "\n" - "%6\n" + "%5\n" "-------------------------------------------------------\n", - convertPhrases( str ), "%OFULLSUBJECT", "%ODATE", "%OFROMADDR", - "%OTOADDR", "%TEXT" ) ); + convertPhrases( str ), "%OFULLSUBJECT", "%ODATE", "%OFROMADDR", "%TEXT" ) ); } else { GlobalSettings::self()->setTemplateForward( defaultForward() ); @@ -480,25 +478,25 @@ QString TemplatesConfiguration::defaultReplyAll() { "%ODATE", "%OTIMELONG", "%OFROMNAME", "%QUOTE", "%CURSOR"); } -QString TemplatesConfiguration::defaultForward() { +QString TemplatesConfiguration::defaultForward() +{ return "%REM=\"" + i18n( "Default forward template" ) + "\"%-\n" + i18nc( "Default forward template: %1: subject of original message, " "%2: date of original message, " "%3: mail address of original sender, " - "%4: mail address of original receiver, " - "%5: original message text", + "%4: original message text", "\n" "---------- Forwarded Message ----------\n" "\n" "Subject: %1\n" "Date: %2\n" "From: %3\n" - "To: %4\n" + "%OADDRESSEESADDR\n" "\n" - "%5\n" + "%4\n" "-------------------------------------------------------", - "%OFULLSUBJECT", "%ODATE", "%OFROMADDR", "%OTOADDR", "%TEXT" ); + "%OFULLSUBJECT", "%ODATE", "%OFROMADDR", "%TEXT" ); } QString TemplatesConfiguration::defaultQuoteString() { diff --git a/templatesinsertcommand.cpp b/templatesinsertcommand.cpp index 92d1e422d..a73d107de 100644 --- a/templatesinsertcommand.cpp +++ b/templatesinsertcommand.cpp @@ -65,6 +65,7 @@ static const InsertCommand originalCommands[] = { { I18N_NOOP( "From Field Name" ), TemplatesInsertCommand::COFromName }, { I18N_NOOP( "From Field First Name" ), TemplatesInsertCommand::COFromFName }, { I18N_NOOP( "From Field Last Name" ), TemplatesInsertCommand::COFromLName }, + { I18N_NOOP( "Addresses of all original recipients" ), TemplatesInsertCommand::COAddresseesAddr }, { I18N_NOOP2( "Template value for subject of the message", "Subject" ), TemplatesInsertCommand::COFullSubject }, { I18N_NOOP( "Quoted Headers" ), TemplatesInsertCommand::CQHeaders }, @@ -238,6 +239,7 @@ void TemplatesInsertCommand::slotMapped( int cmd ) case TemplatesInsertCommand::CTime: emit insertCommand("%TIME"); break; case TemplatesInsertCommand::CTimeLong: emit insertCommand("%TIMELONG"); break; case TemplatesInsertCommand::CTimeLongEn: emit insertCommand("%TIMELONGEN"); break; + case TemplatesInsertCommand::COAddresseesAddr: emit insertCommand("%OADDRESSEESADDR"); break; case TemplatesInsertCommand::CToAddr: emit insertCommand("%TOADDR"); break; case TemplatesInsertCommand::CToName: emit insertCommand("%TONAME"); break; case TemplatesInsertCommand::CToFName: emit insertCommand("%TOFNAME"); break; diff --git a/templatesinsertcommand.h b/templatesinsertcommand.h index 867762319..a2ee1d426 100644 --- a/templatesinsertcommand.h +++ b/templatesinsertcommand.h @@ -43,7 +43,8 @@ class TemplatesInsertCommand : public QPushButton CODateEn, CODateShort, CODate, CODow, COTimeLongEn, COTimeLong, COTime, CBlank, CNop, CClear, CDebug, CDebugOff, CToFName, CToLName, CFromFName, CFromLName, COToFName, COToLName, COFromFName, COFromLName, CCursor, - CCCAddr, CCCName, CCCFName, CCCLName, COCCAddr, COCCName, COCCFName, COCCLName }; + CCCAddr, CCCName, CCCFName, CCCLName, COCCAddr, COCCName, COCCFName, COCCLName, + COAddresseesAddr }; signals: void insertCommand( TemplatesInsertCommand::Command cmd );