KMail: Menu options to toggle "Show Message Structure"

Subtly different from the same feature in KDE:
KDE's menu items toggle the default behaviour between always/never, and the menu item is disabled if smart is set.
For Trinity, the option is always available, and only toggles visibility of the structure for the current session.

Signed-off-by: Luke Dashjr <luke-jr+git@utopios.org>
pull/29/head
Luke Dashjr 6 years ago committed by TDE Gitea
parent c467da6399
commit c0e7939083

@ -2438,6 +2438,7 @@ void KMMainWidget::slotMsgPopup(KMMessage&, const KURL &aUrl, const TQPoint& aPo
viewSourceAction()->plug(menu);
if(mMsgView) {
mMsgView->toggleFixFontAction()->plug(menu);
mMsgView->toggleMimePartTreeAction()->plug(menu);
}
menu->insertSeparator();
mPrintAction->plug( menu );

@ -509,6 +509,7 @@ void KMReaderMainWin::slotMsgPopup(KMMessage &aMsg, const KURL &aUrl, const TQPo
menu->insertSeparator();
mViewSourceAction->plug( menu );
mReaderWin->toggleFixFontAction()->plug( menu );
mReaderWin->toggleMimePartTreeAction()->plug( menu );
menu->insertSeparator();
mPrintAction->plug( menu );
mSaveAsAction->plug( menu );

@ -618,6 +618,11 @@ void KMReaderWin::createActions( TDEActionCollection * ac ) {
Key_X, TQT_TQOBJECT(this), TQT_SLOT(slotToggleFixedFont()),
ac, "toggle_fixedfont" );
mToggleMimePartTreeAction = new TDEToggleAction( i18n("Show Message Structure"),
0, ac, "toggle_mimeparttree" );
connect(mToggleMimePartTreeAction, TQT_SIGNAL(toggled(bool)),
TQT_TQOBJECT(this), TQT_SLOT(slotToggleMimePartTree()));
mStartIMChatAction = new TDEAction( i18n("Chat &With..."), 0, TQT_TQOBJECT(this),
TQT_SLOT(slotIMChat()), ac, "start_im_chat" );
}
@ -1444,6 +1449,7 @@ int KMReaderWin::pointsToPixel(int pointSize) const
//-----------------------------------------------------------------------------
void KMReaderWin::showHideMimeTree( bool isPlainTextTopLevel ) {
mIsPlainText = isPlainTextTopLevel;
if ( mMimeTreeMode == 2 ||
( mMimeTreeMode == 1 && !isPlainTextTopLevel ) )
mMimePartTree->show();
@ -1453,6 +1459,9 @@ void KMReaderWin::showHideMimeTree( bool isPlainTextTopLevel ) {
saveSplitterSizes( reader );
mMimePartTree->hide();
}
if ( mToggleMimePartTreeAction->isChecked() != mMimePartTree->isVisible() ) {
mToggleMimePartTreeAction->setChecked( mMimePartTree->isVisible() );
}
}
void KMReaderWin::displayMessage() {
@ -2134,6 +2143,17 @@ void KMReaderWin::slotToggleFixedFont()
}
//-----------------------------------------------------------------------------
void KMReaderWin::slotToggleMimePartTree()
{
if ( mToggleMimePartTreeAction->isChecked() ) {
mMimeTreeMode = 2; // always
} else {
mMimeTreeMode = 0; // never
}
showHideMimeTree();
}
//-----------------------------------------------------------------------------
void KMReaderWin::slotCopySelectedText()
{

@ -5,6 +5,7 @@
#ifndef KMREADERWIN_H
#define KMREADERWIN_H
#include <tdeactionclasses.h>
#include <tqwidget.h>
#include <tqtimer.h>
#include <tqstringlist.h>
@ -256,6 +257,7 @@ public:
TDEAction *urlOpenAction() { return mUrlOpenAction; }
TDEAction *urlSaveAsAction() { return mUrlSaveAsAction; }
TDEAction *addBookmarksAction() { return mAddBookmarksAction;}
TDEAction *toggleMimePartTreeAction() { return mToggleMimePartTreeAction; }
TDEAction *startImChatAction() { return mStartIMChatAction; }
// This function returns the complete data that were in this
// message parts - *after* all encryption has been removed that
@ -398,6 +400,8 @@ public slots:
/** The user toggled the "Fixed Font" flag from the view menu. */
void slotToggleFixedFont();
void slotToggleMimePartTree();
/** Copy the selected text to the clipboard */
void slotCopySelectedText();
@ -594,6 +598,7 @@ private:
TDEToggleAction *mHeaderOnlyAttachmentsAction;
TDESelectAction *mSelectEncodingAction;
TDEToggleAction *mToggleFixFontAction;
TDEToggleAction *mToggleMimePartTreeAction;
KURL mHoveredUrl;
KURL mClickedUrl;

Loading…
Cancel
Save