Commit 89c3f826 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Fix Bug 316519 - Pr message HTML preference

FIXED-IN: 4.11
BUG: 316519
parent c3b2b18c
......@@ -3077,6 +3077,7 @@ void KMMainWidget::showMessagePopup(const Akonadi::Item&msg ,const KUrl&url,cons
menu->addAction( mMsgActions->printAction() );
menu->addAction( mSaveAsAction );
menu->addAction( mSaveAttachmentsAction );
menu->addAction( mMsgView->saveMessageDisplayFormatAction() );
menu->addSeparator();
if ( parentCol.isValid() && CommonKernel->folderIsTrash(parentCol) ) {
......
......@@ -557,6 +557,7 @@ void KMReaderMainWin::showMessagePopup(const Akonadi::Item&msg ,const KUrl&url,c
if ( msg.isValid() ) {
menu->addSeparator();
menu->addAction( mMsgActions->createTodoAction() );
menu->addAction( mReaderWin->saveMessageDisplayFormatAction() );
}
} else {
menu->addAction( mReaderWin->toggleFixFontAction() );
......
......@@ -782,6 +782,12 @@ void KMReaderWin::contactStored( const Akonadi::Item &item )
KPIM::BroadcastStatus::instance()->setStatusMsg( i18n( "Contact modified successfully" ) );
}
KAction *KMReaderWin::saveMessageDisplayFormatAction()
{
return mViewer->saveMessageDisplayFormatAction();
}
#include "kmreaderwin.moc"
......@@ -146,6 +146,7 @@ public:
KAction *viewSourceAction();
KAction *findInMessageAction();
KAction *saveAsAction();
KAction *saveMessageDisplayFormatAction();
KAction* editContactAction() const { return mEditContactAction; }
......
......@@ -629,6 +629,13 @@ void Viewer::slotChangeDisplayMail(Viewer::ForceDisplayTo mode,bool loadExternal
}
update(Viewer::Force);
}
KAction *Viewer::saveMessageDisplayFormatAction()
{
Q_D( Viewer );
return d->mSaveMessageDisplayFormat;
}
}
#include "viewer.moc"
......
......@@ -278,6 +278,7 @@ class MESSAGEVIEWER_EXPORT Viewer: public QWidget
KAction *viewSourceAction();
KAction *findInMessageAction();
KAction *saveAsAction();
KAction *saveMessageDisplayFormatAction();
HeaderStrategy * headerStrategy() const;
......
......@@ -1712,6 +1712,11 @@ void ViewerPrivate::createActions()
//Laurent: conflict with kmail shortcut
//mSaveMessageAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_S));
mSaveMessageDisplayFormat = new KAction( i18n("&Save Display Format"), this);
ac->addAction("save_message_display_format", mSaveMessageDisplayFormat );
connect(mSaveMessageDisplayFormat, SIGNAL(triggered(bool)), SLOT(slotSaveMessageDisplayFormat()));
//
// Scroll actions
//
......@@ -3154,5 +3159,21 @@ void ViewerPrivate::slotToggleCaretBrowsing(bool toggle)
Q_UNUSED( toggle );
}
void ViewerPrivate::slotSaveMessageDisplayFormat()
{
if (mMessageItem.isValid()) {
MessageViewer::MessageDisplayFormatAttribute *attr = mMessageItem.attribute<MessageViewer::MessageDisplayFormatAttribute>( Akonadi::Entity::AddIfMissing );
attr->setRemoteContent(htmlLoadExtOverride());
if (htmlOverride())
attr->setMessageFormat(Viewer::Html);
else
attr->setMessageFormat(Viewer::Text);
}
Akonadi::ItemModifyJob *modify = new Akonadi::ItemModifyJob( mMessageItem );
modify->setIgnorePayload( true );
modify->disableRevisionCheck();
//TODO
}
#include "viewer_p.moc"
......@@ -585,6 +585,7 @@ public slots:
void slotZoomReset();
void slotSpeakText();
void slotCopyImageLocation();
void slotSaveMessageDisplayFormat();
signals:
void showStatusBarMessage( const QString &message );
void replaceMsgByUnencryptedVersion();
......@@ -640,7 +641,7 @@ public:
KAction *mCopyAction, *mCopyURLAction,
*mUrlOpenAction, *mSelectAllAction,
*mScrollUpAction, *mScrollDownAction, *mScrollUpMoreAction, *mScrollDownMoreAction,
*mViewSourceAction, *mSaveMessageAction, *mFindInMessageAction;
*mViewSourceAction, *mSaveMessageAction, *mFindInMessageAction, *mSaveMessageDisplayFormat;
KToggleAction *mHeaderOnlyAttachmentsAction;
KSelectAction *mSelectEncodingAction;
KToggleAction *mToggleFixFontAction, *mToggleDisplayModeAction;
......
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