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
wilder-work
Thomas McGuire 17 years ago
parent 4a6558fe93
commit 9e80500d78
  1. 12
      templateparser.cpp
  2. 22
      templatesconfiguration.cpp
  3. 2
      templatesinsertcommand.cpp
  4. 3
      templatesinsertcommand.h

@ -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" );

@ -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() {

@ -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;

@ -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 );

Loading…
Cancel
Save