Start to implement image save/copy url

CCBUG:41738
wilder-work
Montel Laurent 14 years ago
parent cf347db24c
commit 91d2717610
  1. 14
      kmmainwidget.cpp
  2. 2
      kmmainwidget.h
  3. 6
      kmreadermainwin.cpp
  4. 2
      kmreadermainwin.h
  5. 5
      kmreaderwin.cpp
  6. 1
      kmreaderwin.h

@ -1070,8 +1070,8 @@ void KMMainWidget::createWidgets()
}
connect( mMsgView->viewer(), SIGNAL(replaceMsgByUnencryptedVersion()),
this, SLOT(slotReplaceMsgByUnencryptedVersion()) );
connect( mMsgView->viewer(), SIGNAL(popupMenu(Akonadi::Item,KUrl,QPoint)),
this, SLOT(slotMessagePopup(Akonadi::Item,KUrl,QPoint)) );
connect( mMsgView->viewer(), SIGNAL(popupMenu(Akonadi::Item,KUrl,KUrl,QPoint)),
this, SLOT(slotMessagePopup(Akonadi::Item,KUrl,KUrl,QPoint)) );
}
else {
if ( mMsgActions ) {
@ -2953,7 +2953,7 @@ void KMMainWidget::slotMarkAll()
updateMessageActions();
}
void KMMainWidget::slotMessagePopup(const Akonadi::Item&msg ,const KUrl&aUrl,const QPoint& aPoint)
void KMMainWidget::slotMessagePopup(const Akonadi::Item&msg ,const KUrl&aUrl,const KUrl &imageUrl,const QPoint& aPoint)
{
updateMessageMenu();
mUrlCurrent = aUrl;
@ -2964,6 +2964,7 @@ void KMMainWidget::slotMessagePopup(const Akonadi::Item&msg ,const KUrl&aUrl,con
job->setQuery( Akonadi::ContactSearchJob::Email, email, Akonadi::ContactSearchJob::ExactMatch );
job->setProperty( "msg", QVariant::fromValue( msg ) );
job->setProperty( "point", aPoint );
job->setProperty( "imageUrl", imageUrl );
connect( job, SIGNAL(result(KJob*)), SLOT(slotDelayedMessagePopup(KJob*)) );
}
@ -2985,7 +2986,8 @@ void KMMainWidget::slotDelayedMessagePopup( KJob *job )
const Akonadi::Item msg = job->property( "msg" ).value<Akonadi::Item>();
const QPoint aPoint = job->property( "point" ).toPoint();
const KUrl iUrl = job->property("imageUrl").value<KUrl>();
qDebug()<<" iUrl "<<iUrl;
KMenu *menu = new KMenu;
bool urlMenuAdded = false;
@ -3011,6 +3013,10 @@ void KMMainWidget::slotDelayedMessagePopup( KJob *job )
menu->addAction( mMsgView->addBookmarksAction() );
menu->addAction( mMsgView->urlSaveAsAction() );
menu->addAction( mMsgView->copyURLAction() );
if(!iUrl.isEmpty()) {
menu->addSeparator();
menu->addAction( mMsgView->copyImageLocation());
}
}
urlMenuAdded = true;

@ -371,7 +371,7 @@ class KMAIL_EXPORT KMMainWidget : public QWidget
void slotSendQueuedVia( QAction* item );
void slotOnlineStatus();
void slotUpdateOnlineStatus( GlobalSettings::EnumNetworkState::type );
void slotMessagePopup(const Akonadi::Item& ,const KUrl&,const QPoint& );
void slotMessagePopup(const Akonadi::Item& ,const KUrl&,const KUrl &imageUrl,const QPoint& );
void slotDelayedMessagePopup( KJob *job );
void slotMarkAll();
void slotFocusQuickSearch();

@ -352,8 +352,8 @@ void KMReaderMainWin::setupAccel()
SLOT(slotSizeAction(int)) );
connect( mReaderWin->viewer(), SIGNAL(popupMenu(Akonadi::Item,KUrl,QPoint)),
this, SLOT(slotMessagePopup(Akonadi::Item,KUrl,QPoint)) );
connect( mReaderWin->viewer(), SIGNAL(popupMenu(Akonadi::Item,KUrl,KUrl,QPixmap,QPoint)),
this, SLOT(slotMessagePopup(Akonadi::Item,KUrl,KUrl,QPixmap,QPoint)) );
setStandardToolBarMenuEnabled(true);
KStandardAction::configureToolbars(this, SLOT(slotEditToolbars()), actionCollection());
@ -404,7 +404,7 @@ void KMReaderMainWin::slotCopyResult( KJob * job )
}
}
void KMReaderMainWin::slotMessagePopup(const Akonadi::Item&aMsg ,const KUrl&aUrl,const QPoint& aPoint)
void KMReaderMainWin::slotMessagePopup(const Akonadi::Item&aMsg , const KUrl&aUrl, const KUrl&imageUrl, const QPoint& aPoint)
{
mUrl = aUrl;
mMsg = aMsg;

@ -53,7 +53,7 @@ public:
void showMessage( const QString & encoding, KMime::Message::Ptr message);
private slots:
void slotMessagePopup(const Akonadi::Item& ,const KUrl&,const QPoint& );
void slotMessagePopup(const Akonadi::Item& , const KUrl&, const KUrl &imageUrl, const QPoint& );
void slotDelayedMessagePopup( KJob* );
void slotTrashMsg();
void slotForwardInlineMsg();

@ -546,6 +546,11 @@ KAction *KMReaderWin::copyURLAction()
return mViewer->copyURLAction();
}
KAction *KMReaderWin::copyImageLocation()
{
return mViewer->copyImageLocation();
}
KAction *KMReaderWin::copyAction()
{
return mViewer->copyAction();

@ -135,6 +135,7 @@ public:
KAction *copyAction();
KAction *selectAllAction();
KAction *copyURLAction();
KAction *copyImageLocation();
KAction *urlOpenAction();
KAction *urlSaveAsAction() { return mUrlSaveAsAction; }
KAction *addBookmarksAction() { return mAddBookmarksAction;}

Loading…
Cancel
Save