If an invitation is opened in a secondary window, close that window when

the handlers are invoked. Otherwise the user is confused, and the mail
underneath moves away, while the secondary window remains open and the
user can invoke the handlers again. While that is not strictly a
problem, this way is more intuitive, I believe.
(See: https://intevation.de/roundup/kolab/issue859)

svn path=/branches/KDE/3.5/kdepim/; revision=439559
wilder-work
Till Adam 21 years ago
parent 6cad61b525
commit 776682a1a3
  1. 12
      callback.cpp
  2. 7
      callback.h
  3. 2
      kmreaderwin.h
  4. 2
      urlhandlermanager.cpp

@ -38,6 +38,8 @@
#include <libkpimidentities/identitymanager.h>
#include "kmmainwin.h"
#include "composer.h"
#include "kmreaderwin.h"
#include "secondarywindow.h"
#include <mimelib/enum.h>
@ -48,7 +50,8 @@
using namespace KMail;
Callback::Callback( KMMessage* msg ) : mMsg( msg ), mReceiverSet( false )
Callback::Callback( KMMessage* msg, KMReaderWin* readerWin )
: mMsg( msg ), mReaderWin( readerWin ), mReceiverSet( false )
{
}
@ -139,3 +142,10 @@ QString Callback::receiver() const
return mReceiver;
}
void Callback::closeIfSecondaryWindow() const
{
KMail::SecondaryWindow *window = dynamic_cast<KMail::SecondaryWindow*>( mReaderWin->mainWindow() );
if ( window )
window->close();
}

@ -36,6 +36,7 @@
#include <qstring.h>
class KMMessage;
class KMReaderWin;
#include <kdepimmacros.h>
@ -49,7 +50,7 @@ namespace KMail {
for the plugins. */
class KDE_EXPORT Callback {
public:
Callback( KMMessage* msg );
Callback( KMMessage* msg, KMReaderWin* readerWin );
/** Get the full message */
KMMessage* getMsg() const { return mMsg; }
@ -61,8 +62,12 @@ public:
/** Get the receiver of the mail */
QString receiver() const;
/** Close the main window showing this message, if it's a secondary window. */
void closeIfSecondaryWindow() const;
private:
KMMessage* mMsg;
KMReaderWin* mReaderWin;
mutable QString mReceiver;
mutable bool mReceiverSet;
};

@ -268,6 +268,8 @@ public:
* waiting for. Used to discard updates for already deselected messages. */
void setWaitingForSerNum( unsigned long serNum ) { mWaitingForSerNum = serNum; }
QWidget* mainWindow() { return mMainWindow; }
signals:
/** Emitted after parsing of a message to have it stored
in unencrypted state in it's folder. */

@ -213,7 +213,7 @@ bool KMail::URLHandlerManager::BodyPartURLHandlerManager::handleClick( const KUR
return false;
KMMessage *msg = w->message();
if ( !msg ) return false;
Callback callback( msg );
Callback callback( msg, w );
KMail::PartNodeBodyPart part( *node, w->overrideCodec() );
for ( BodyPartHandlerList::const_iterator it = mHandlers.begin() ; it != mHandlers.end() ; ++it )
if ( (*it)->handleClick( &part, path, callback ) )

Loading…
Cancel
Save