Commit 2ee4cae9 authored by Laurent Montel's avatar Laurent Montel 😁

We will use plugin for adblock

parent f2be2806
......@@ -225,12 +225,6 @@ void ArticleViewerWebEngine::slotWebHitFinished(const MessageViewer::WebHitTestR
popup.addSeparator();
popup.addAction(mActionCollection->action(QStringLiteral("copy_image_location")));
popup.addAction(mActionCollection->action(QStringLiteral("saveas_imageurl")));
#if 0
if (adblockEnabled()) {
popup.addSeparator();
popup.addAction(mActionCollection->action(QStringLiteral("adblock_image")));
}
#endif
}
popup.addSeparator();
popup.addActions(viewerPluginActionList(MessageViewer::ViewerPluginInterface::NeedUrl));
......@@ -255,7 +249,6 @@ void ArticleViewerWebEngine::slotWebHitFinished(const MessageViewer::WebHitTestR
popup.addSeparator();
popup.addAction(ActionManager::getInstance()->action(QStringLiteral("speak_text")));
}
popup.addActions(mNetworkAccessManager->interceptorUrlActions(result));
popup.exec(mapToGlobal(result.pos()));
}
......
......@@ -128,11 +128,11 @@ protected:
void contextMenuEvent(QContextMenuEvent *e) Q_DECL_OVERRIDE;
QList<QAction *> viewerPluginActionList(MessageViewer::ViewerPluginInterface::SpecificFeatureTypes features);
MessageViewer::NetworkAccessManagerWebEngine *mNetworkAccessManager;
private:
MousePressedButtonType mLastButtonClicked;
MessageViewer::ViewerPluginToolManager *mViewerPluginToolManager;
MessageViewer::WebEngineAccessKey *mWebEngineViewAccessKey;
MessageViewer::NetworkAccessManagerWebEngine *mNetworkAccessManager;
};
}
......
......@@ -35,6 +35,8 @@
#include <QWebEngineHistory>
#include <MessageViewer/WebHitTest>
#include <MessageViewer/WebHitTestResult>
#include <MessageViewer/NetworkAccessManagerWebEngine>
using namespace Akregator;
WebEngineViewer::WebEngineViewer(KActionCollection *ac, QWidget *parent)
......@@ -94,12 +96,6 @@ void WebEngineViewer::slotWebHitFinished(const MessageViewer::WebHitTestResult &
popup.addSeparator();
popup.addAction(mActionCollection->action(QStringLiteral("copy_image_location")));
popup.addAction(mActionCollection->action(QStringLiteral("saveas_imageurl")));
#if 0
if (adblockEnabled()) {
popup.addSeparator();
popup.addAction(mActionCollection->action(QStringLiteral("adblock_image")));
}
#endif
}
popup.addSeparator();
popup.addActions(viewerPluginActionList(MessageViewer::ViewerPluginInterface::NeedUrl));
......@@ -112,14 +108,13 @@ void WebEngineViewer::slotWebHitFinished(const MessageViewer::WebHitTestResult &
mWebShortcutMenuManager->addWebShortcutsToMenu(&popup);
popup.addSeparator();
popup.addActions(viewerPluginActionList(MessageViewer::ViewerPluginInterface::NeedSelection));
popup.addSeparator();
popup.addAction(i18n("Open Ad Block settings"), this, SLOT(slotOpenBlockableItemsDialog()));
}
#if QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
popup.addSeparator();
popup.addAction(ActionManager::getInstance()->action(QStringLiteral("viewer_print")));
popup.addAction(ActionManager::getInstance()->action(QStringLiteral("viewer_printpreview")));
#endif
popup.addActions(mNetworkAccessManager->interceptorUrlActions(result));
popup.addSeparator();
popup.addAction(ActionManager::getInstance()->action(QStringLiteral("find_in_messages")));
if (KPIMTextEdit::TextToSpeech::self()->isReady()) {
......@@ -134,16 +129,3 @@ void WebEngineViewer::displayContextMenu(const QPoint &pos)
MessageViewer::WebHitTest *webHit = mPageEngine->hitTestContent(pos);
connect(webHit, &MessageViewer::WebHitTest::finished, this, &WebEngineViewer::slotWebHitFinished);
}
void WebEngineViewer::slotOpenBlockableItemsDialog()
{
#if 0
QPointer<MessageViewer::AdBlockBlockableItemsDialog> dlg = new MessageViewer::AdBlockBlockableItemsDialog(this);
dlg->setWebFrame(page()->mainFrame());
if (dlg->exec()) {
dlg->saveFilters();
}
delete dlg;
#endif
}
......@@ -34,7 +34,6 @@ protected:
void contextMenuEvent(QContextMenuEvent *e) Q_DECL_OVERRIDE;
private slots:
void slotOpenBlockableItemsDialog();
void slotWebHitFinished(const MessageViewer::WebHitTestResult &result);
};
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment