Commit 0c1377a5 authored by Laurent Montel's avatar Laurent Montel 😁

Don't show "show details" when we print email

parent 226facc1
......@@ -177,7 +177,8 @@ ObjectTreeParser::ObjectTreeParser( ObjectTreeSourceIf *source,
mHasPendingAsyncJobs( false ),
mAllowAsync( false ),
mShowRawToltecMail( false ),
mAttachmentStrategy( strategy )
mAttachmentStrategy( strategy ),
mPrinting(false)
{
init();
}
......@@ -266,6 +267,11 @@ void ObjectTreeParser::parseObjectTree( KMime::Content * node )
parseObjectTreeInternal( node );
}
void ObjectTreeParser::setPrinting(bool printing)
{
mPrinting = printing;
}
void ObjectTreeParser::parseObjectTreeInternal( KMime::Content * node )
{
if ( !node )
......@@ -2400,7 +2406,7 @@ QString ObjectTreeParser::sigStatusToString( const Kleo::CryptoBackend::Protocol
}
static QString writeSimpleSigstatHeader( const PartMetaData &block )
static QString writeSimpleSigstatHeader( const PartMetaData &block, bool printing )
{
QString html;
html += QLatin1String("<table cellspacing=\"0\" cellpadding=\"0\" width=\"100%\"><tr><td>");
......@@ -2430,10 +2436,14 @@ static QString writeSimpleSigstatHeader( const PartMetaData &block )
// should not happen
html += i18n( "Unknown signature state" );
}
html += QLatin1String("</td><td align=\"right\">");
html += QLatin1String("<a href=\"kmail:showSignatureDetails\">");
html += i18n( "Show Details" );
html += QLatin1String("</a></td></tr></table>");
html += QLatin1String("</td>");
if (!printing) {
html +=QLatin1String("<td align=\"right\">");
html += QLatin1String("<a href=\"kmail:showSignatureDetails\">");
html += i18n( "Show Details" );
html += QLatin1String("</a></td>");
}
html += QLatin1String("</tr></table>");
return html;
}
......@@ -2677,7 +2687,7 @@ QString ObjectTreeParser::writeSigstatHeader( PartMetaData & block,
"<tr class=\"") + block.signClass + QLatin1String("H\"><td dir=\"") + dir + QLatin1String("\">");
htmlStr += frame + beginVerboseSigstatHeader();
simpleHtmlStr += frame;
simpleHtmlStr += writeSimpleSigstatHeader( block );
simpleHtmlStr += writeSimpleSigstatHeader( block, mPrinting );
if( block.technicalProblem ) {
htmlStr += block.errorText;
}
......@@ -2763,7 +2773,7 @@ QString ObjectTreeParser::writeSigstatHeader( PartMetaData & block,
"<tr class=\"") + block.signClass + QLatin1String("H\"><td dir=\"" )+ dir + QLatin1String("\">");
htmlStr += frame + beginVerboseSigstatHeader();
simpleHtmlStr += frame;
simpleHtmlStr += writeSimpleSigstatHeader( block );
simpleHtmlStr += writeSimpleSigstatHeader( block, mPrinting );
if( block.technicalProblem ) {
htmlStr += block.errorText;
}
......@@ -2811,7 +2821,7 @@ QString ObjectTreeParser::writeSigstatHeader( PartMetaData & block,
"<tr class=\"") + block.signClass + QLatin1String("H\"><td dir=\"") + dir + QLatin1String("\">");
htmlStr += frame + beginVerboseSigstatHeader();
simpleHtmlStr += frame;
simpleHtmlStr += writeSimpleSigstatHeader( block );
simpleHtmlStr += writeSimpleSigstatHeader( block, mPrinting );
if( !block.keyId.isEmpty() )
htmlStr += i18n( "Message was signed by %2 (Key ID: %1).",
keyWithWithoutURL,
......@@ -2855,7 +2865,7 @@ QString ObjectTreeParser::writeSigstatHeader( PartMetaData & block,
"<tr class=\"") + block.signClass + QLatin1String("H\"><td dir=\"") + dir + QLatin1String("\">");
htmlStr += frame + beginVerboseSigstatHeader();
simpleHtmlStr += frame;
simpleHtmlStr += writeSimpleSigstatHeader( block );
simpleHtmlStr += writeSimpleSigstatHeader( block, mPrinting );
if( !block.keyId.isEmpty() )
htmlStr += i18n( "Message was signed by %2 (Key ID: %1).",
keyWithWithoutURL,
......
......@@ -409,6 +409,8 @@ public:
the children of that node and it's next sibling. */
void parseObjectTree( KMime::Content * node );
void setPrinting(bool printing);
private:
void extractNodeInfos( KMime::Content *curNode, bool isFirstTextPart );
......@@ -611,7 +613,7 @@ private:
QString mCollapseIcon;
QString mExpandIcon;
bool mDeleteNodeHelper;
bool mPrinting;
};
}
......
......@@ -986,6 +986,7 @@ void ViewerPrivate::parseContent( KMime::Content *content )
MailViewerSource otpSource( this );
ObjectTreeParser otp( &otpSource, mNodeHelper, 0, mMessage.get() != content /* show only single node */ );
otp.setAllowAsync( !mPrinting );
otp.setPrinting( mPrinting );
otp.setShowRawToltecMail( mShowRawToltecMail );
otp.parseObjectTree( content );
......
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