Async KMail Reader (2/5): PartMetaData: add inProgress state and print corresponding messages (nothing sets this state yet)

svn path=/branches/kdepim/enterprise/kdepim/; revision=972549
wilder-work
Marc Mutz 17 years ago
parent 895befa54c
commit 841c8dab40
  1. 34
      objecttreeparser.cpp
  2. 4
      objecttreeparser.h
  3. 2
      partmetadata.h

@ -112,6 +112,7 @@
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include <cassert>
#include "chiasmuskeyselector.h"
namespace KMail {
@ -644,6 +645,24 @@ namespace KMail {
return bIsOpaqueSigned;
}
void ObjectTreeParser::writeDecryptionInProgressBlock() {
kdDebug(5006) << k_funcinfo << endl;
assert( mReader );
// PENDING(marc) find an animated icon here:
//const QString iconName = KGlobal::instance()->iconLoader()->iconPath( "decrypted", KIcon::Small );
const QString decryptedData = i18n("Encrypted data not shown");
PartMetaData messagePart;
messagePart.isDecryptable = true;
messagePart.isEncrypted = true;
messagePart.isSigned = false;
messagePart.inProgress = true;
htmlWriter()->queue( writeSigstatHeader( messagePart,
cryptoProtocol(),
QString() ) );
//htmlWriter()->queue( decryptedData );
htmlWriter()->queue( writeSigstatFooter( messagePart ) );
}
void ObjectTreeParser::writeDeferredDecryptionBlock() {
kdDebug(5006) << k_funcinfo << endl;
assert( mReader );
@ -2183,7 +2202,9 @@ QString ObjectTreeParser::writeSigstatHeader( PartMetaData & block,
{
htmlStr += "<table cellspacing=\"1\" "+cellPadding+" class=\"encr\">"
"<tr class=\"encrH\"><td dir=\"" + dir + "\">";
if( block.isDecryptable )
if ( block.inProgress )
htmlStr += i18n("Please wait while the message is being decrypted...");
else if ( block.isDecryptable )
htmlStr += i18n("Encrypted message");
else {
htmlStr += i18n("Encrypted message (decryption not possible)");
@ -2192,9 +2213,18 @@ QString ObjectTreeParser::writeSigstatHeader( PartMetaData & block,
}
htmlStr += "</td></tr><tr class=\"encrB\"><td>";
}
if ( block.isSigned && block.inProgress )
{
block.signClass = "signInProgress";
htmlStr += "<table cellspacing=\"1\" "+cellPadding+" class=\"signInProgress\">"
"<tr class=\"signInProgressH\"><td dir=\"" + dir + "\">";
htmlStr += i18n("Please wait while the signature is being verified...");
htmlStr += "</td></tr><tr class=\"signInProgressB\"><td>";
}
simpleHtmlStr = htmlStr;
if( block.isSigned ) {
if ( block.isSigned && !block.inProgress ) {
QStringList& blockAddrs( block.signerMailAddresses );
// note: At the moment frameColor and showKeyInfos are
// used for CMS only but not for PGP signatures

@ -197,6 +197,10 @@ namespace KMail {
but we're deferring decryption for later. */
void writeDeferredDecryptionBlock();
/** Writes out the block that we use when the node is encrypted,
but we've just kicked off async decryption. */
void writeDecryptionInProgressBlock();
/** Returns the contents of the given multipart/encrypted
object. Data is decypted. May contain body parts. */
bool okDecryptMIME( partNode& data,

@ -35,6 +35,7 @@ namespace KMail {
isGoodSignature( false ),
isEncrypted( false ),
isDecryptable( false ),
inProgress( false ),
technicalProblem( false ),
isEncapsulatedRfc822Message( false )
{
@ -56,6 +57,7 @@ namespace KMail {
bool isGoodSignature : 1;
bool isEncrypted : 1;
bool isDecryptable : 1;
bool inProgress : 1;
bool technicalProblem : 1;
bool isEncapsulatedRfc822Message : 1;
};

Loading…
Cancel
Save