Commit ccff69b8 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Move tracking widget in webengineviewer

parent 0b0379a1
Pipeline #55850 canceled with stage
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
set(PIM_VERSION "5.17.44")
set(PIM_VERSION "5.17.45")
if (POLICY CMP0053)
cmake_policy(SET CMP0053 NEW)
......
......@@ -150,8 +150,6 @@ set(libmessageviewer_widgets_SRCS
widgets/opensavedfilefolderwidget.cpp
widgets/mailsourceviewtextbrowserwidget.cpp
widgets/submittedformwarningwidget.cpp
widgets/trackingwarningwidget.cpp
widgets/trackingdetailsdialog.cpp
widgets/shownextmessagewidget.cpp
widgets/developertooldialog.cpp
widgets/developertoolwidget.cpp
......
......@@ -127,12 +127,12 @@
#include <AkonadiCore/agentmanager.h>
#include <AkonadiCore/collectionfetchscope.h>
#include "widgets/trackingwarningwidget.h"
#include <KJobWidgets/KJobWidgets>
#include <KPIMTextEdit/TextToSpeechWidget>
#include <QApplication>
#include <QStandardPaths>
#include <QWebEngineSettings>
#include <WebEngineViewer/TrackingWarningWidget>
#include <WebEngineViewer/ZoomActionMenu>
#include <boost/bind.hpp>
#include <header/headerstyleplugin.h>
......@@ -929,7 +929,7 @@ void ViewerPrivate::initHtmlWidget()
connect(mViewer, &MailWebEngineView::wheelZoomChanged, this, &ViewerPrivate::slotWheelZoomChanged);
connect(mViewer, &MailWebEngineView::messageMayBeAScam, this, &ViewerPrivate::slotMessageMayBeAScam);
connect(mViewer, &MailWebEngineView::formSubmittedForbidden, mSubmittedFormWarning, &SubmittedFormWarningWidget::showWarning);
connect(mViewer, &MailWebEngineView::mailTrackingFound, mMailTrackingWarning, &TrackingWarningWidget::addTracker);
connect(mViewer, &MailWebEngineView::mailTrackingFound, mMailTrackingWarning, &WebEngineViewer::TrackingWarningWidget::addTracker);
connect(mScamDetectionWarning, &ScamDetectionWarningWidget::showDetails, mViewer, &MailWebEngineView::slotShowDetails);
connect(mScamDetectionWarning, &ScamDetectionWarningWidget::moveMessageToTrash, this, &ViewerPrivate::moveMessageToTrash);
connect(mScamDetectionWarning, &ScamDetectionWarningWidget::messageIsNotAScam, this, &ViewerPrivate::slotMessageIsNotAScam);
......@@ -1391,7 +1391,7 @@ void ViewerPrivate::createWidgets()
mSubmittedFormWarning->setObjectName(QStringLiteral("submittedformwarning"));
readerBoxVBoxLayout->addWidget(mSubmittedFormWarning);
mMailTrackingWarning = new TrackingWarningWidget(readerBox);
mMailTrackingWarning = new WebEngineViewer::TrackingWarningWidget(readerBox);
mMailTrackingWarning->setObjectName(QStringLiteral("mailtrackingwarning"));
readerBoxVBoxLayout->addWidget(mMailTrackingWarning);
......
......@@ -73,6 +73,7 @@ class WebHitTestResult;
class FindBarWebEngineView;
class ZoomActionMenu;
class LocalDataBaseManager;
class TrackingWarningWidget;
}
namespace MessageViewer
{
......@@ -90,7 +91,6 @@ class HeaderStyleMenuManager;
class ViewerPluginToolManager;
class SubmittedFormWarningWidget;
class MailSourceWebEngineViewer;
class TrackingWarningWidget;
class ShowNextMessageWidget;
class DeveloperToolDialog;
class RemoteContentMenu;
......@@ -693,7 +693,7 @@ public:
MessageViewer::ScamDetectionWarningWidget *mScamDetectionWarning = nullptr;
MessageViewer::OpenSavedFileFolderWidget *mOpenSavedFileFolderWidget = nullptr;
MessageViewer::SubmittedFormWarningWidget *mSubmittedFormWarning = nullptr;
MessageViewer::TrackingWarningWidget *mMailTrackingWarning = nullptr;
WebEngineViewer::TrackingWarningWidget *mMailTrackingWarning = nullptr;
KPIMTextEdit::TextToSpeechWidget *mTextToSpeechWidget = nullptr;
Viewer::DisplayFormatMessage mDisplayFormatMessageOverwrite;
KPIMTextEdit::SlideContainer *mSliderContainer = nullptr;
......
......@@ -8,8 +8,6 @@ macro(add_messageviewer_widget_unittest _source)
)
endmacro ()
add_messageviewer_widget_unittest(trackingwarningwidgettest.cpp)
add_messageviewer_widget_unittest(trackingdetailsdialogtest.cpp)
add_messageviewer_widget_unittest(shownextmessagewidgettest.cpp)
add_messageviewer_widget_unittest(developertooldialogtest.cpp)
add_messageviewer_widget_unittest(developertoolwidgettest.cpp)
......@@ -10,6 +10,7 @@ if(BUILD_TESTING)
add_subdirectory(checkphishingurl/autotests/)
add_subdirectory(checkphishingurl/tests/)
add_subdirectory(urlinterceptor/blockexternalresourcesurlinterceptor/autotests)
add_subdirectory(widgets/tracking/autotests/)
endif()
......@@ -71,6 +72,11 @@ set(libwebengineviewer_widgets_SRCS
widgets/zoomactionmenu.cpp
)
set(libwebengineviewer_tracking_SRCS
widgets/tracking/trackingdetailsdialog.cpp
widgets/tracking/trackingwarningwidget.cpp
)
set(libwebengineviewer_SRCS
${libwebengineviewer_checkphishingurl_SRCS}
${libwebengineviewer_interceptor_SRCS}
......@@ -79,6 +85,7 @@ set(libwebengineviewer_SRCS
${libwebengineviewer_widgets_SRCS}
${libwebengineviewer_print_SRCS}
${libwebengineviewer_accesskey_SRCS}
${libwebengineviewer_tracking_SRCS}
)
ecm_qt_declare_logging_category(libwebengineviewer_webengine_SRCS HEADER webengineviewer_debug.h IDENTIFIER WEBENGINEVIEWER_LOG CATEGORY_NAME org.kde.pim.webengineviewer
......@@ -102,6 +109,7 @@ target_link_libraries(KF5WebEngineViewer
PUBLIC
Qt5::WebEngineWidgets
KF5::PimCommon
KF5::PimTextEdit
PRIVATE
KF5::CoreAddons
KF5::XmlGui
......@@ -226,6 +234,15 @@ ecm_generate_headers(WebEngineViewer_Camelblockexternalresourcesurlinterceptor_H
)
ecm_generate_headers(WebEngineViewer_Cameltracking_HEADERS
HEADER_NAMES
TrackingWarningWidget
REQUIRED_HEADERS WebEngineViewer_tracking_HEADERS
PREFIX WebEngineViewer
RELATIVE widgets/tracking/
)
ecm_generate_pri_file(BASE_NAME WebEngineViewer
LIB_NAME KF5WebEngineViewer
DEPS "webenginewidgets PimCommon" FILENAME_VAR PRI_FILENAME INCLUDE_INSTALL_DIR ${KDE_INSTALL_INCLUDEDIR_KF5}/WebEngineViewer
......@@ -233,6 +250,7 @@ ecm_generate_pri_file(BASE_NAME WebEngineViewer
install(FILES
${WebEngineViewer_Cameltracking_HEADERS}
${WebEngineViewer_Camelblockexternalresourcesurlinterceptor_HEADERS}
${WebEngineViewer_Camelloadexternalreferencesurlinterceptor_HEADERS}
${WebEngineViewer_Camelblocktrackingurlinterceptor_HEADERS}
......@@ -249,6 +267,7 @@ install(FILES
)
install(FILES
${WebEngineViewer_tracking_HEADERS}
${WebEngineViewer_blockexternalresourcesurlinterceptor_HEADERS}
${WebEngineViewer_loadexternalreferencesurlinterceptor_HEADERS}
${WebEngineViewer_blocktrackingurlinterceptor_HEADERS}
......
macro(add_webengine_widget_unittest _source)
get_filename_component(_name ${_source} NAME_WE)
ecm_add_test(${_source}
TEST_NAME ${_name}
NAME_PREFIX "webengineviewer-"
LINK_LIBRARIES KF5::WebEngineViewer Qt5::Test
)
endmacro ()
add_webengine_widget_unittest(trackingwarningwidgettest.cpp)
add_webengine_widget_unittest(trackingdetailsdialogtest.cpp)
......@@ -5,7 +5,7 @@
*/
#include "trackingdetailsdialogtest.h"
#include "widgets/trackingdetailsdialog.h"
#include "widgets/tracking/trackingdetailsdialog.h"
#include <QStandardPaths>
#include <QTest>
......@@ -19,5 +19,6 @@ TrackingDetailsDialogTest::TrackingDetailsDialogTest(QObject *parent)
void TrackingDetailsDialogTest::shouldHaveDefaultValue()
{
// TOOD
WebEngineViewer::TrackingDetailsDialog d;
// TODO
}
......@@ -5,7 +5,7 @@
*/
#include "trackingwarningwidgettest.h"
#include "widgets/trackingwarningwidget.h"
#include "widgets/tracking/trackingwarningwidget.h"
#include <QTest>
QTEST_MAIN(TrackingWarningWidgetTest)
......@@ -17,7 +17,7 @@ TrackingWarningWidgetTest::TrackingWarningWidgetTest(QObject *parent)
void TrackingWarningWidgetTest::shouldHaveDefaultValues()
{
MessageViewer::TrackingWarningWidget w;
WebEngineViewer::TrackingWarningWidget w;
QVERIFY(!w.isVisible());
QVERIFY(!w.isCloseButtonVisible());
QVERIFY(w.wordWrap());
......
......@@ -13,7 +13,7 @@
#include <QPushButton>
#include <QVBoxLayout>
using namespace MessageViewer;
using namespace WebEngineViewer;
namespace
{
static const char myMailTrackingDetailsDialogConfigGroupName[] = "MailTrackingDetailsDialog";
......
......@@ -6,7 +6,7 @@
#pragma once
#include "messageviewer_private_export.h"
#include "webengineviewer_export.h"
#include <QDialog>
namespace KPIMTextEdit
......@@ -14,9 +14,9 @@ namespace KPIMTextEdit
class RichTextEditorWidget;
}
namespace MessageViewer
namespace WebEngineViewer
{
class MESSAGEVIEWER_TESTS_EXPORT TrackingDetailsDialog : public QDialog
class WEBENGINEVIEWER_EXPORT TrackingDetailsDialog : public QDialog
{
Q_OBJECT
public:
......
......@@ -8,7 +8,7 @@
#include "trackingdetailsdialog.h"
#include <KLocalizedString>
using namespace MessageViewer;
using namespace WebEngineViewer;
TrackingWarningWidget::TrackingWarningWidget(QWidget *parent)
: KMessageWidget(parent)
{
......@@ -29,7 +29,7 @@ void TrackingWarningWidget::slotShowDetails(const QString &content)
{
if (content == QLatin1String("mailtrackingdetails")) {
if (!mMailTrackingDetailDialog) {
mMailTrackingDetailDialog = new MessageViewer::TrackingDetailsDialog;
mMailTrackingDetailDialog = new WebEngineViewer::TrackingDetailsDialog;
}
mMailTrackingDetailDialog->setDetails(generateDetails());
mMailTrackingDetailDialog->show();
......
......@@ -8,17 +8,17 @@
#include <KMessageWidget>
#include "messageviewer_private_export.h"
#include "webengineviewer_export.h"
#include <QMap>
#include <QPointer>
#include <WebEngineViewer/BlockTrackingUrlInterceptor>
namespace MessageViewer
namespace WebEngineViewer
{
class TrackingDetailsDialog;
class MESSAGEVIEWER_TESTS_EXPORT TrackingWarningWidget : public KMessageWidget
class WEBENGINEVIEWER_EXPORT TrackingWarningWidget : public KMessageWidget
{
Q_OBJECT
public:
......
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