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 7 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); viewSourceAction()->plug(menu);
if(mMsgView) { if(mMsgView) {
mMsgView->toggleFixFontAction()->plug(menu); mMsgView->toggleFixFontAction()->plug(menu);
mMsgView->toggleMimePartTreeAction()->plug(menu);
} }
menu->insertSeparator(); menu->insertSeparator();
mPrintAction->plug( menu ); mPrintAction->plug( menu );

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

@ -618,6 +618,11 @@ void KMReaderWin::createActions( TDEActionCollection * ac ) {
Key_X, TQT_TQOBJECT(this), TQT_SLOT(slotToggleFixedFont()), Key_X, TQT_TQOBJECT(this), TQT_SLOT(slotToggleFixedFont()),
ac, "toggle_fixedfont" ); 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), mStartIMChatAction = new TDEAction( i18n("Chat &With..."), 0, TQT_TQOBJECT(this),
TQT_SLOT(slotIMChat()), ac, "start_im_chat" ); TQT_SLOT(slotIMChat()), ac, "start_im_chat" );
} }
@ -1444,6 +1449,7 @@ int KMReaderWin::pointsToPixel(int pointSize) const
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void KMReaderWin::showHideMimeTree( bool isPlainTextTopLevel ) { void KMReaderWin::showHideMimeTree( bool isPlainTextTopLevel ) {
mIsPlainText = isPlainTextTopLevel;
if ( mMimeTreeMode == 2 || if ( mMimeTreeMode == 2 ||
( mMimeTreeMode == 1 && !isPlainTextTopLevel ) ) ( mMimeTreeMode == 1 && !isPlainTextTopLevel ) )
mMimePartTree->show(); mMimePartTree->show();
@ -1453,6 +1459,9 @@ void KMReaderWin::showHideMimeTree( bool isPlainTextTopLevel ) {
saveSplitterSizes( reader ); saveSplitterSizes( reader );
mMimePartTree->hide(); mMimePartTree->hide();
} }
if ( mToggleMimePartTreeAction->isChecked() != mMimePartTree->isVisible() ) {
mToggleMimePartTreeAction->setChecked( mMimePartTree->isVisible() );
}
} }
void KMReaderWin::displayMessage() { 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() void KMReaderWin::slotCopySelectedText()
{ {

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

Loading…
Cancel
Save