diff options
Diffstat (limited to 'kmail')
-rw-r--r-- | kmail/kmmainwidget.cpp | 1 | ||||
-rw-r--r-- | kmail/kmreadermainwin.cpp | 1 | ||||
-rw-r--r-- | kmail/kmreaderwin.cpp | 20 | ||||
-rw-r--r-- | kmail/kmreaderwin.h | 5 |
4 files changed, 27 insertions, 0 deletions
diff --git a/kmail/kmmainwidget.cpp b/kmail/kmmainwidget.cpp index 0d845225b..1d2661f58 100644 --- a/kmail/kmmainwidget.cpp +++ b/kmail/kmmainwidget.cpp @@ -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 ); diff --git a/kmail/kmreadermainwin.cpp b/kmail/kmreadermainwin.cpp index 6694ba3fd..6257ba938 100644 --- a/kmail/kmreadermainwin.cpp +++ b/kmail/kmreadermainwin.cpp @@ -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 ); diff --git a/kmail/kmreaderwin.cpp b/kmail/kmreaderwin.cpp index b3c435703..1b6ca4874 100644 --- a/kmail/kmreaderwin.cpp +++ b/kmail/kmreaderwin.cpp @@ -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() { @@ -2135,6 +2144,17 @@ void KMReaderWin::slotToggleFixedFont() //----------------------------------------------------------------------------- +void KMReaderWin::slotToggleMimePartTree() +{ + if ( mToggleMimePartTreeAction->isChecked() ) { + mMimeTreeMode = 2; // always + } else { + mMimeTreeMode = 0; // never + } + showHideMimeTree(); +} + +//----------------------------------------------------------------------------- void KMReaderWin::slotCopySelectedText() { kapp->clipboard()->setText( mViewer->selectedText() ); diff --git a/kmail/kmreaderwin.h b/kmail/kmreaderwin.h index 81256e8c5..0495041b6 100644 --- a/kmail/kmreaderwin.h +++ b/kmail/kmreaderwin.h @@ -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; |