From cc29364f06178f8f6b457384f2ec37a042bd9d43 Mon Sep 17 00:00:00 2001 From: tpearson Date: Wed, 1 Sep 2010 00:37:02 +0000 Subject: * Massive set of changes to bring in all fixes and enhancements from the Enterprise PIM branch * Ensured that the Trinity changes were applied on top of those enhancements, and any redundancy removed * Added journal read support to the CalDAV resource * Fixed CalDAV resource to use events URL for tasks and journals when separate URL checkbox unchecked git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1170461 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kmail/kmreadermainwin.cpp | 78 +++++++++++++++++++++++++++++++++++------------ 1 file changed, 58 insertions(+), 20 deletions(-) (limited to 'kmail/kmreadermainwin.cpp') diff --git a/kmail/kmreadermainwin.cpp b/kmail/kmreadermainwin.cpp index 8e77ad9d7..2f5227cde 100644 --- a/kmail/kmreadermainwin.cpp +++ b/kmail/kmreadermainwin.cpp @@ -140,10 +140,15 @@ void KMReaderMainWin::setUseFixedFont( bool useFixedFont ) } //----------------------------------------------------------------------------- -void KMReaderMainWin::showMsg( const TQString & encoding, KMMessage *msg ) +void KMReaderMainWin::showMsg( const TQString & encoding, KMMessage *msg, + unsigned long serNumOfOriginalMessage, int nodeIdOffset ) { mReaderWin->setOverrideEncoding( encoding ); mReaderWin->setMsg( msg, true ); + if ( serNumOfOriginalMessage != 0 ) { + Q_ASSERT( nodeIdOffset != -1 ); + mReaderWin->setOriginalMsg( serNumOfOriginalMessage, nodeIdOffset ); + } mReaderWin->slotTouchMessage(); setCaption( msg->subject() ); mMsg = msg; @@ -163,6 +168,13 @@ void KMReaderMainWin::slotFolderRemoved( TQObject* folderPtr ) mMsg->setParent( 0 ); } +void KMReaderMainWin::slotReplyOrForwardFinished() +{ + if ( GlobalSettings::self()->closeAfterReplyOrForward() ) { + close(); + } +} + //----------------------------------------------------------------------------- void KMReaderMainWin::slotTrashMsg() { @@ -212,6 +224,7 @@ void KMReaderMainWin::slotMarkAll() void KMReaderMainWin::slotPrintMsg() { KMPrintCommand *command = new KMPrintCommand( this, mReaderWin->message(), + mReaderWin->headerStyle(), mReaderWin->headerStrategy(), mReaderWin->htmlOverride(), mReaderWin->htmlLoadExtOverride(), mReaderWin->isFixedFont(), mReaderWin->overrideEncoding() ); command->setOverrideFont( mReaderWin->cssHelper()->bodyFont( mReaderWin->isFixedFont(), true /*printing*/ ) ); @@ -228,6 +241,8 @@ void KMReaderMainWin::slotForwardInlineMsg() } else { command = new KMForwardInlineCommand( this, mReaderWin->message() ); } + connect( command, TQT_SIGNAL( completed( KMCommand * ) ), + this, TQT_SLOT( slotReplyOrForwardFinished() ) ); command->start(); } @@ -241,6 +256,8 @@ void KMReaderMainWin::slotForwardAttachedMsg() } else { command = new KMForwardAttachedCommand( this, mReaderWin->message() ); } + connect( command, TQT_SIGNAL( completed( KMCommand * ) ), + this, TQT_SLOT( slotReplyOrForwardFinished() ) ); command->start(); } @@ -254,6 +271,8 @@ void KMReaderMainWin::slotForwardDigestMsg() } else { command = new KMForwardDigestCommand( this, mReaderWin->message() ); } + connect( command, TQT_SIGNAL( completed( KMCommand * ) ), + this, TQT_SLOT( slotReplyOrForwardFinished() ) ); command->start(); } @@ -261,6 +280,8 @@ void KMReaderMainWin::slotForwardDigestMsg() void KMReaderMainWin::slotRedirectMsg() { KMCommand *command = new KMRedirectCommand( this, mReaderWin->message() ); + connect( command, TQT_SIGNAL( completed( KMCommand * ) ), + this, TQT_SLOT( slotReplyOrForwardFinished() ) ); command->start(); } @@ -275,10 +296,37 @@ void KMReaderMainWin::slotShowMsgSrc() command->start(); } +//----------------------------------------------------------------------------- +void KMReaderMainWin::setupForwardActions() +{ + disconnect( mForwardActionMenu, TQT_SIGNAL( activated() ), 0, 0 ); + mForwardActionMenu->remove( mForwardInlineAction ); + mForwardActionMenu->remove( mForwardAttachedAction ); + + if ( GlobalSettings::self()->forwardingInlineByDefault() ) { + mForwardActionMenu->insert( mForwardInlineAction, 0 ); + mForwardActionMenu->insert( mForwardAttachedAction, 1 ); + mForwardInlineAction->setShortcut( Key_F ); + mForwardAttachedAction->setShortcut( SHIFT+Key_F ); + connect( mForwardActionMenu, TQT_SIGNAL(activated()), this, + TQT_SLOT(slotForwardInlineMsg()) ); + + } else { + mForwardActionMenu->insert( mForwardAttachedAction, 0 ); + mForwardActionMenu->insert( mForwardInlineAction, 1 ); + mForwardInlineAction->setShortcut( SHIFT+Key_F ); + mForwardAttachedAction->setShortcut( Key_F ); + connect( mForwardActionMenu, TQT_SIGNAL(activated()), this, + TQT_SLOT(slotForwardAttachedMsg()) ); + } +} + //----------------------------------------------------------------------------- void KMReaderMainWin::slotConfigChanged() { //readConfig(); + setupForwardActions(); + setupForwardingActionsList(); } void KMReaderMainWin::setupAccel() @@ -288,6 +336,9 @@ void KMReaderMainWin::setupAccel() mMsgActions = new KMail::MessageActions( actionCollection(), this ); mMsgActions->setMessageView( mReaderWin ); + connect( mMsgActions, TQT_SIGNAL( replyActionFinished() ), + this, TQT_SLOT( slotReplyOrForwardFinished() ) ); + //----- File Menu //mOpenAction = KStdAction::open( this, TQT_SLOT( slotOpenMsg() ), // actionCollection() ); @@ -351,21 +402,7 @@ void KMReaderMainWin::setupAccel() actionCollection(), "message_forward_redirect" ); - if ( GlobalSettings::self()->forwardingInlineByDefault() ) { - mForwardActionMenu->insert( mForwardInlineAction ); - mForwardActionMenu->insert( mForwardAttachedAction ); - mForwardInlineAction->setShortcut( Key_F ); - mForwardAttachedAction->setShortcut( SHIFT+Key_F ); - connect( mForwardActionMenu, TQT_SIGNAL(activated()), this, - TQT_SLOT(slotForwardInlineMsg()) ); - } else { - mForwardActionMenu->insert( mForwardAttachedAction ); - mForwardActionMenu->insert( mForwardInlineAction ); - mForwardInlineAction->setShortcut( SHIFT+Key_F ); - mForwardAttachedAction->setShortcut( Key_F ); - connect( mForwardActionMenu, TQT_SIGNAL(activated()), this, - TQT_SLOT(slotForwardAttachedMsg()) ); - } + setupForwardActions(); mForwardActionMenu->insert( mForwardDigestAction ); mForwardActionMenu->insert( mRedirectAction ); @@ -408,7 +445,7 @@ void KMReaderMainWin::slotMsgPopup(KMMessage &aMsg, const KURL &aUrl, const TQPo mUrl = aUrl; mMsg = &aMsg; bool urlMenuAdded=false; - + bool copyAdded = false; if (!aUrl.isEmpty()) { if (aUrl.protocol() == "mailto") { @@ -421,7 +458,8 @@ void KMReaderMainWin::slotMsgPopup(KMMessage &aMsg, const KURL &aUrl, const TQPo } mReaderWin->addAddrBookAction()->plug( menu ); mReaderWin->openAddrBookAction()->plug( menu ); - mReaderWin->copyAction()->plug( menu ); + mReaderWin->copyURLAction()->plug( menu ); + copyAdded = true; } else { // popup on a not-mailto URL mReaderWin->urlOpenAction()->plug( menu ); @@ -436,8 +474,8 @@ void KMReaderMainWin::slotMsgPopup(KMMessage &aMsg, const KURL &aUrl, const TQPo menu->insertSeparator(); mMsgActions->replyMenu()->plug( menu ); menu->insertSeparator(); - - mReaderWin->copyAction()->plug( menu ); + if( !copyAdded ) + mReaderWin->copyAction()->plug( menu ); mReaderWin->selectAllAction()->plug( menu ); } else if ( !urlMenuAdded ) { -- cgit v1.2.1