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

Move developertool in webengineviewer directly

parent 47c15d81
Pipeline #55878 passed with stage
in 42 minutes and 32 seconds
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
set(PIM_VERSION "5.17.45")
set(PIM_VERSION "5.17.46")
if (POLICY CMP0053)
cmake_policy(SET CMP0053 NEW)
......
......@@ -151,8 +151,6 @@ set(libmessageviewer_widgets_SRCS
widgets/mailsourceviewtextbrowserwidget.cpp
widgets/submittedformwarningwidget.cpp
widgets/shownextmessagewidget.cpp
widgets/developertooldialog.cpp
widgets/developertoolwidget.cpp
)
......
......@@ -23,7 +23,6 @@
#include "messageviewer/headerstrategy.h"
#include "messageviewer/headerstyle.h"
#include "widgets/developertooldialog.h"
#include <KPIMTextEdit/SlideContainer>
#include "job/modifymessagedisplayformatjob.h"
......@@ -132,6 +131,7 @@
#include <QApplication>
#include <QStandardPaths>
#include <QWebEngineSettings>
#include <WebEngineViewer/DeveloperToolDialog>
#include <WebEngineViewer/TrackingWarningWidget>
#include <WebEngineViewer/ZoomActionMenu>
#include <boost/bind.hpp>
......@@ -1651,10 +1651,13 @@ void ViewerPrivate::createActions()
void ViewerPrivate::slotShowDevelopmentTools()
{
if (!mDeveloperToolDialog) {
mDeveloperToolDialog = new DeveloperToolDialog(nullptr);
mDeveloperToolDialog = new WebEngineViewer::DeveloperToolDialog(nullptr);
mViewer->page()->setDevToolsPage(mDeveloperToolDialog->enginePage());
mViewer->page()->triggerAction(QWebEnginePage::InspectElement);
connect(mDeveloperToolDialog, &DeveloperToolDialog::rejected, mDeveloperToolDialog, &DeveloperToolDialog::deleteLater);
connect(mDeveloperToolDialog,
&WebEngineViewer::DeveloperToolDialog::rejected,
mDeveloperToolDialog,
&WebEngineViewer::DeveloperToolDialog::deleteLater);
}
if (mDeveloperToolDialog->isHidden()) {
mDeveloperToolDialog->show();
......
......@@ -74,6 +74,7 @@ class FindBarWebEngineView;
class ZoomActionMenu;
class LocalDataBaseManager;
class TrackingWarningWidget;
class DeveloperToolDialog;
}
namespace MessageViewer
{
......@@ -92,7 +93,6 @@ class ViewerPluginToolManager;
class SubmittedFormWarningWidget;
class MailSourceWebEngineViewer;
class ShowNextMessageWidget;
class DeveloperToolDialog;
class RemoteContentMenu;
/**
\brief Private class for the Viewer, the main widget in the messageviewer library.
......@@ -667,7 +667,7 @@ public:
/** Used only to be able to connect and disconnect finished() signal
in printMsg() and slotPrintMsg() since mHtmlWriter points only to abstract non-QObject class. */
QPointer<WebEnginePartHtmlWriter> mPartHtmlWriter;
QPointer<DeveloperToolDialog> mDeveloperToolDialog;
QPointer<WebEngineViewer::DeveloperToolDialog> mDeveloperToolDialog;
int mLevelQuote;
bool mDecrytMessageOverwrite = false;
......
......@@ -9,5 +9,3 @@ macro(add_messageviewer_widget_unittest _source)
endmacro ()
add_messageviewer_widget_unittest(shownextmessagewidgettest.cpp)
add_messageviewer_widget_unittest(developertooldialogtest.cpp)
add_messageviewer_widget_unittest(developertoolwidgettest.cpp)
......@@ -11,6 +11,7 @@ if(BUILD_TESTING)
add_subdirectory(checkphishingurl/tests/)
add_subdirectory(urlinterceptor/blockexternalresourcesurlinterceptor/autotests)
add_subdirectory(widgets/tracking/autotests/)
add_subdirectory(developertool/autotests)
endif()
......@@ -77,7 +78,14 @@ set(libwebengineviewer_tracking_SRCS
widgets/tracking/trackingwarningwidget.cpp
)
set(libwebengineviewer_developertool_SRCS
developertool/developertoolwidget.cpp
developertool/developertooldialog.cpp
)
set(libwebengineviewer_SRCS
${libwebengineviewer_developertool_SRCS}
${libwebengineviewer_checkphishingurl_SRCS}
${libwebengineviewer_interceptor_SRCS}
${libwebengineviewer_webengine_SRCS}
......@@ -243,6 +251,15 @@ ecm_generate_headers(WebEngineViewer_Cameltracking_HEADERS
RELATIVE widgets/tracking/
)
ecm_generate_headers(WebEngineViewer_Cameldevelopertool_HEADERS
HEADER_NAMES
DeveloperToolDialog
REQUIRED_HEADERS WebEngineViewer_developertool_HEADERS
PREFIX WebEngineViewer
RELATIVE developertool/
)
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
......@@ -250,6 +267,7 @@ ecm_generate_pri_file(BASE_NAME WebEngineViewer
install(FILES
${WebEngineViewer_Cameldevelopertool_HEADERS}
${WebEngineViewer_Cameltracking_HEADERS}
${WebEngineViewer_Camelblockexternalresourcesurlinterceptor_HEADERS}
${WebEngineViewer_Camelloadexternalreferencesurlinterceptor_HEADERS}
......@@ -267,6 +285,7 @@ install(FILES
)
install(FILES
${WebEngineViewer_developertool_HEADERS}
${WebEngineViewer_tracking_HEADERS}
${WebEngineViewer_blockexternalresourcesurlinterceptor_HEADERS}
${WebEngineViewer_loadexternalreferencesurlinterceptor_HEADERS}
......
macro(add_webengineviewer_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_webengineviewer_widget_unittest(developertooldialogtest.cpp)
add_webengineviewer_widget_unittest(developertoolwidgettest.cpp)
......@@ -5,8 +5,8 @@
*/
#include "developertooldialogtest.h"
#include "widgets/developertooldialog.h"
#include "widgets/developertoolwidget.h"
#include "developertool/developertooldialog.h"
#include "developertool/developertoolwidget.h"
#include <QDialogButtonBox>
#include <QStandardPaths>
#include <QTest>
......@@ -20,11 +20,11 @@ DeveloperToolDialogTest::DeveloperToolDialogTest(QObject *parent)
void DeveloperToolDialogTest::shouldHaveDefaultValues()
{
MessageViewer::DeveloperToolDialog d;
WebEngineViewer::DeveloperToolDialog d;
auto mainLayout = d.findChild<QVBoxLayout *>(QStringLiteral("mainLayout"));
QVERIFY(mainLayout);
auto mDeveloperToolWidget = d.findChild<MessageViewer::DeveloperToolWidget *>(QStringLiteral("mDeveloperToolWidget"));
auto mDeveloperToolWidget = d.findChild<WebEngineViewer::DeveloperToolWidget *>(QStringLiteral("mDeveloperToolWidget"));
QVERIFY(mDeveloperToolWidget);
auto buttonBox = d.findChild<QDialogButtonBox *>(QStringLiteral("buttonBox"));
......
......@@ -5,7 +5,7 @@
*/
#include "developertoolwidgettest.h"
#include "widgets/developertoolwidget.h"
#include "developertool/developertoolwidget.h"
#include <QTest>
#include <QVBoxLayout>
#include <QWebEngineSettings>
......@@ -18,7 +18,7 @@ DeveloperToolWidgetTest::DeveloperToolWidgetTest(QObject *parent)
void DeveloperToolWidgetTest::shouldHaveDefaultValues()
{
MessageViewer::DeveloperToolWidget w;
WebEngineViewer::DeveloperToolWidget w;
auto mainLayout = w.findChild<QVBoxLayout *>(QStringLiteral("mainLayout"));
QVERIFY(mainLayout);
QCOMPARE(mainLayout->contentsMargins(), QMargins(0, 0, 0, 0));
......
......@@ -15,7 +15,7 @@ namespace
static const char myDeveloperToolDialogConfigGroupName[] = "DeveloperToolDialog";
}
using namespace MessageViewer;
using namespace WebEngineViewer;
DeveloperToolDialog::DeveloperToolDialog(QWidget *parent)
: QDialog(parent)
{
......
......@@ -6,13 +6,13 @@
#pragma once
#include "messageviewer_private_export.h"
#include "webengineviewer_export.h"
#include <QDialog>
class QWebEnginePage;
namespace MessageViewer
namespace WebEngineViewer
{
class DeveloperToolWidget;
class MESSAGEVIEWER_TESTS_EXPORT DeveloperToolDialog : public QDialog
class WEBENGINEVIEWER_EXPORT DeveloperToolDialog : public QDialog
{
Q_OBJECT
public:
......
......@@ -9,7 +9,7 @@
#include <QWebEnginePage>
#include <QWebEngineSettings>
#include <QWebEngineView>
using namespace MessageViewer;
using namespace WebEngineViewer;
DeveloperToolWidget::DeveloperToolWidget(QWidget *parent)
: QWidget(parent)
{
......
......@@ -6,13 +6,13 @@
#pragma once
#include "messageviewer_private_export.h"
#include "webengineviewer_private_export.h"
#include <QWidget>
class QWebEnginePage;
class QWebEngineView;
namespace MessageViewer
namespace WebEngineViewer
{
class MESSAGEVIEWER_TESTS_EXPORT DeveloperToolWidget : public QWidget
class WEBENGINEVIEWER_TESTS_EXPORT DeveloperToolWidget : public QWidget
{
Q_OBJECT
public:
......@@ -25,4 +25,3 @@ private:
QWebEnginePage *mEnginePage = nullptr;
};
}
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