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 ...@@ -225,12 +225,6 @@ void ArticleViewerWebEngine::slotWebHitFinished(const MessageViewer::WebHitTestR
popup.addSeparator(); popup.addSeparator();
popup.addAction(mActionCollection->action(QStringLiteral("copy_image_location"))); popup.addAction(mActionCollection->action(QStringLiteral("copy_image_location")));
popup.addAction(mActionCollection->action(QStringLiteral("saveas_imageurl"))); popup.addAction(mActionCollection->action(QStringLiteral("saveas_imageurl")));
#if 0
if (adblockEnabled()) {
popup.addSeparator();
popup.addAction(mActionCollection->action(QStringLiteral("adblock_image")));
}
#endif
} }
popup.addSeparator(); popup.addSeparator();
popup.addActions(viewerPluginActionList(MessageViewer::ViewerPluginInterface::NeedUrl)); popup.addActions(viewerPluginActionList(MessageViewer::ViewerPluginInterface::NeedUrl));
...@@ -255,7 +249,6 @@ void ArticleViewerWebEngine::slotWebHitFinished(const MessageViewer::WebHitTestR ...@@ -255,7 +249,6 @@ void ArticleViewerWebEngine::slotWebHitFinished(const MessageViewer::WebHitTestR
popup.addSeparator(); popup.addSeparator();
popup.addAction(ActionManager::getInstance()->action(QStringLiteral("speak_text"))); popup.addAction(ActionManager::getInstance()->action(QStringLiteral("speak_text")));
} }
popup.addActions(mNetworkAccessManager->interceptorUrlActions(result));
popup.exec(mapToGlobal(result.pos())); popup.exec(mapToGlobal(result.pos()));
} }
......
...@@ -128,11 +128,11 @@ protected: ...@@ -128,11 +128,11 @@ protected:
void contextMenuEvent(QContextMenuEvent *e) Q_DECL_OVERRIDE; void contextMenuEvent(QContextMenuEvent *e) Q_DECL_OVERRIDE;
QList<QAction *> viewerPluginActionList(MessageViewer::ViewerPluginInterface::SpecificFeatureTypes features); QList<QAction *> viewerPluginActionList(MessageViewer::ViewerPluginInterface::SpecificFeatureTypes features);
MessageViewer::NetworkAccessManagerWebEngine *mNetworkAccessManager;
private: private:
MousePressedButtonType mLastButtonClicked; MousePressedButtonType mLastButtonClicked;
MessageViewer::ViewerPluginToolManager *mViewerPluginToolManager; MessageViewer::ViewerPluginToolManager *mViewerPluginToolManager;
MessageViewer::WebEngineAccessKey *mWebEngineViewAccessKey; MessageViewer::WebEngineAccessKey *mWebEngineViewAccessKey;
MessageViewer::NetworkAccessManagerWebEngine *mNetworkAccessManager;
}; };
} }
......
...@@ -35,6 +35,8 @@ ...@@ -35,6 +35,8 @@
#include <QWebEngineHistory> #include <QWebEngineHistory>
#include <MessageViewer/WebHitTest> #include <MessageViewer/WebHitTest>
#include <MessageViewer/WebHitTestResult> #include <MessageViewer/WebHitTestResult>
#include <MessageViewer/NetworkAccessManagerWebEngine>
using namespace Akregator; using namespace Akregator;
WebEngineViewer::WebEngineViewer(KActionCollection *ac, QWidget *parent) WebEngineViewer::WebEngineViewer(KActionCollection *ac, QWidget *parent)
...@@ -94,12 +96,6 @@ void WebEngineViewer::slotWebHitFinished(const MessageViewer::WebHitTestResult & ...@@ -94,12 +96,6 @@ void WebEngineViewer::slotWebHitFinished(const MessageViewer::WebHitTestResult &
popup.addSeparator(); popup.addSeparator();
popup.addAction(mActionCollection->action(QStringLiteral("copy_image_location"))); popup.addAction(mActionCollection->action(QStringLiteral("copy_image_location")));
popup.addAction(mActionCollection->action(QStringLiteral("saveas_imageurl"))); popup.addAction(mActionCollection->action(QStringLiteral("saveas_imageurl")));
#if 0
if (adblockEnabled()) {
popup.addSeparator();
popup.addAction(mActionCollection->action(QStringLiteral("adblock_image")));
}
#endif
} }
popup.addSeparator(); popup.addSeparator();
popup.addActions(viewerPluginActionList(MessageViewer::ViewerPluginInterface::NeedUrl)); popup.addActions(viewerPluginActionList(MessageViewer::ViewerPluginInterface::NeedUrl));
...@@ -112,14 +108,13 @@ void WebEngineViewer::slotWebHitFinished(const MessageViewer::WebHitTestResult & ...@@ -112,14 +108,13 @@ void WebEngineViewer::slotWebHitFinished(const MessageViewer::WebHitTestResult &
mWebShortcutMenuManager->addWebShortcutsToMenu(&popup); mWebShortcutMenuManager->addWebShortcutsToMenu(&popup);
popup.addSeparator(); popup.addSeparator();
popup.addActions(viewerPluginActionList(MessageViewer::ViewerPluginInterface::NeedSelection)); 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) #if QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
popup.addSeparator(); popup.addSeparator();
popup.addAction(ActionManager::getInstance()->action(QStringLiteral("viewer_print"))); popup.addAction(ActionManager::getInstance()->action(QStringLiteral("viewer_print")));
popup.addAction(ActionManager::getInstance()->action(QStringLiteral("viewer_printpreview"))); popup.addAction(ActionManager::getInstance()->action(QStringLiteral("viewer_printpreview")));
#endif #endif
popup.addActions(mNetworkAccessManager->interceptorUrlActions(result));
popup.addSeparator(); popup.addSeparator();
popup.addAction(ActionManager::getInstance()->action(QStringLiteral("find_in_messages"))); popup.addAction(ActionManager::getInstance()->action(QStringLiteral("find_in_messages")));
if (KPIMTextEdit::TextToSpeech::self()->isReady()) { if (KPIMTextEdit::TextToSpeech::self()->isReady()) {
...@@ -134,16 +129,3 @@ void WebEngineViewer::displayContextMenu(const QPoint &pos) ...@@ -134,16 +129,3 @@ void WebEngineViewer::displayContextMenu(const QPoint &pos)
MessageViewer::WebHitTest *webHit = mPageEngine->hitTestContent(pos); MessageViewer::WebHitTest *webHit = mPageEngine->hitTestContent(pos);
connect(webHit, &MessageViewer::WebHitTest::finished, this, &WebEngineViewer::slotWebHitFinished); 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: ...@@ -34,7 +34,6 @@ protected:
void contextMenuEvent(QContextMenuEvent *e) Q_DECL_OVERRIDE; void contextMenuEvent(QContextMenuEvent *e) Q_DECL_OVERRIDE;
private slots: private slots:
void slotOpenBlockableItemsDialog();
void slotWebHitFinished(const MessageViewer::WebHitTestResult &result); 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