* When there are selected text on a message reader and rigthclick on a url, show

url context menu, instead of the copy menu.
BUGS:103493

svn path=/trunk/kdepim/; revision=404300
wilder-work
Mario Teijeiro Otero 21 years ago
parent 30c7c427d1
commit 622f5c1717
  1. 19
      kmmainwidget.cpp
  2. 21
      kmreadermainwin.cpp

@ -2077,10 +2077,10 @@ void KMMainWidget::slotMsgPopup(KMMessage&, const KURL &aUrl, const QPoint& aPoi
KPopupMenu * menu = new KPopupMenu;
updateMessageMenu();
mUrlCurrent = aUrl;
if(mMsgView && !mMsgView->copyText().isEmpty()) {
mMsgView->copyAction()->plug( menu );
mMsgView->selectAllAction()->plug( menu );
} else if (!aUrl.isEmpty())
bool urlMenuAdded = false;
if (!aUrl.isEmpty())
{
if (aUrl.protocol() == "mailto")
{
@ -2110,9 +2110,18 @@ void KMMainWidget::slotMsgPopup(KMMessage&, const KURL &aUrl, const QPoint& aPoi
// only be present if it is.
mMsgView->startImChatAction()->plug( menu );
}
urlMenuAdded=true;
kdDebug( 0 ) << k_funcinfo << " URL is: " << aUrl << endl;
}
else
if(mMsgView && !mMsgView->copyText().isEmpty()) {
if ( urlMenuAdded )
menu->insertSeparator();
mMsgView->copyAction()->plug( menu );
mMsgView->selectAllAction()->plug( menu );
} else if ( !urlMenuAdded )
{
// popup somewhere else (i.e., not a URL) on the message

@ -33,7 +33,7 @@
#include <kwin.h>
#include <kaction.h>
#include <kiconloader.h>
#include <kdebug.h>
#include "kmcommands.h"
#include "kmenubar.h"
#include "kpopupmenu.h"
@ -311,11 +311,10 @@ void KMReaderMainWin::slotMsgPopup(KMMessage &aMsg, const KURL &aUrl, const QPoi
KPopupMenu * menu = new KPopupMenu;
mUrl = aUrl;
mMsg = &aMsg;
if(mReaderWin && !mReaderWin->copyText().isEmpty()) {
mReaderWin->copyAction()->plug( menu );
mReaderWin->selectAllAction()->plug( menu );
} else if (!aUrl.isEmpty()) {
bool urlMenuAdded=false;
if (!aUrl.isEmpty())
{
if (aUrl.protocol() == "mailto") {
// popup on a mailto URL
mReaderWin->mailToComposeAction()->plug( menu );
@ -334,7 +333,15 @@ void KMReaderMainWin::slotMsgPopup(KMMessage &aMsg, const KURL &aUrl, const QPoi
mReaderWin->copyURLAction()->plug( menu );
mReaderWin->addBookmarksAction()->plug( menu );
}
} else {
urlMenuAdded=true;
}
if(mReaderWin && !mReaderWin->copyText().isEmpty()) {
if ( urlMenuAdded )
menu->insertSeparator();
mReaderWin->copyAction()->plug( menu );
mReaderWin->selectAllAction()->plug( menu );
} else if ( !urlMenuAdded )
{
// popup somewhere else (i.e., not a URL) on the message
if (!mMsg) // no message

Loading…
Cancel
Save