diff options
author | Luke Dashjr <luke-jr+git@utopios.org> | 2018-02-02 21:36:09 +0000 |
---|---|---|
committer | TDE Gitea <gitea@mirror.git.trinitydesktop.org> | 2019-05-02 11:18:05 +0000 |
commit | c0e793908389b71c54ed0685b634609b5e1f71a3 (patch) | |
tree | 96fc00577604d84327ea96f206771d2f3e39244f /kmail/kmreaderwin.cpp | |
parent | c467da63998be9accf09949f9bb2d229aba85bb4 (diff) | |
download | tdepim-c0e793908389b71c54ed0685b634609b5e1f71a3.tar.gz tdepim-c0e793908389b71c54ed0685b634609b5e1f71a3.zip |
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>
Diffstat (limited to 'kmail/kmreaderwin.cpp')
-rw-r--r-- | kmail/kmreaderwin.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
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() ); |