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

continue to create dialog box

parent bd9902ee
......@@ -151,6 +151,7 @@ set(libmessageviewer_widgets_SRCS
widgets/mailtrackingdetailsdialog.cpp
widgets/shownextmessagewidget.cpp
widgets/developertooldialog.cpp
widgets/developertoolwidget.cpp
)
......
......@@ -12,3 +12,4 @@ add_messageviewer_widget_unittest(mailtrackingwarningwidgettest.cpp)
add_messageviewer_widget_unittest(mailtrackingdetailsdialogtest.cpp)
add_messageviewer_widget_unittest(shownextmessagewidgettest.cpp)
add_messageviewer_widget_unittest(developertooldialogtest.cpp)
add_messageviewer_widget_unittest(developertoolwidgettest.cpp)
/*
Copyright (C) 2020 Laurent Montel <montel@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#include "developertoolwidgettest.h"
#include <QTest>
QTEST_MAIN(DeveloperToolWidgetTest)
DeveloperToolWidgetTest::DeveloperToolWidgetTest(QObject *parent)
: QObject(parent)
{
}
/*
Copyright (C) 2020 Laurent Montel <montel@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef DEVELOPERTOOLWIDGETTEST_H
#define DEVELOPERTOOLWIDGETTEST_H
#include <QObject>
class DeveloperToolWidgetTest : public QObject
{
Q_OBJECT
public:
explicit DeveloperToolWidgetTest(QObject *parent = nullptr);
~DeveloperToolWidgetTest() = default;
};
#endif // DEVELOPERTOOLWIDGETTEST_H
......@@ -17,6 +17,7 @@
Boston, MA 02110-1301, USA.
*/
#include "developertooldialog.h"
#include "developertoolwidget.h"
#include <QVBoxLayout>
#include <QDialogButtonBox>
#include <KLocalizedString>
......@@ -27,6 +28,10 @@ DeveloperToolDialog::DeveloperToolDialog(QWidget *parent)
QVBoxLayout *mainLayout = new QVBoxLayout(this);
mainLayout->setObjectName(QStringLiteral("mainLayout"));
mDeveloperToolWidget = new DeveloperToolWidget(this);
mDeveloperToolWidget->setObjectName(QStringLiteral("mDeveloperToolWidget"));
mainLayout->addWidget(mDeveloperToolWidget);
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Close, this);
buttonBox->setObjectName(QStringLiteral("buttonBox"));
connect(buttonBox, &QDialogButtonBox::rejected, this, &DeveloperToolDialog::reject);
......@@ -37,3 +42,8 @@ DeveloperToolDialog::~DeveloperToolDialog()
{
}
QWebEnginePage *DeveloperToolDialog::enginePage() const
{
return mDeveloperToolWidget->enginePage();
}
......@@ -22,14 +22,18 @@
#include <QDialog>
#include "messageviewer_private_export.h"
class QWebEnginePage;
namespace MessageViewer {
class DeveloperToolWidget;
class MESSAGEVIEWER_TESTS_EXPORT DeveloperToolDialog : public QDialog
{
Q_OBJECT
public:
explicit DeveloperToolDialog(QWidget *parent = nullptr);
~DeveloperToolDialog();
QWebEnginePage *enginePage() const;
private:
DeveloperToolWidget *mDeveloperToolWidget = nullptr;
};
}
#endif // DEVELOPERTOOLDIALOG_H
/*
Copyright (C) 2020 Laurent Montel <montel@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#include "developertoolwidget.h"
#include <QVBoxLayout>
#include <WebEngineViewer/WebEnginePage>
#include <WebEngineViewer/WebEngineView>
using namespace MessageViewer;
DeveloperToolWidget::DeveloperToolWidget(QWidget *parent)
: QWidget(parent)
{
QVBoxLayout *mainLayout = new QVBoxLayout(this);
mainLayout->setObjectName(QStringLiteral("mainLayout"));
mainLayout->setContentsMargins(0, 0, 0, 0);
mWebEngineView = new WebEngineViewer::WebEngineView(this);
mWebEngineView->setObjectName(QStringLiteral("mWebEngineView"));
mainLayout->addWidget(mWebEngineView);
mEnginePage = new WebEngineViewer::WebEnginePage(this);
//TODO
}
DeveloperToolWidget::~DeveloperToolWidget()
{
}
QWebEnginePage *DeveloperToolWidget::enginePage() const
{
return mEnginePage;
}
/*
Copyright (C) 2020 Laurent Montel <montel@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef DEVELOPERTOOLWIDGET_H
#define DEVELOPERTOOLWIDGET_H
#include <QWidget>
#include "messageviewer_private_export.h"
namespace WebEngineViewer {
class WebEngineView;
class WebEnginePage;
}
class QWebEnginePage;
namespace MessageViewer {
class MESSAGEVIEWER_TESTS_EXPORT DeveloperToolWidget : public QWidget
{
Q_OBJECT
public:
explicit DeveloperToolWidget(QWidget *parent = nullptr);
~DeveloperToolWidget();
QWebEnginePage *enginePage() const;
private:
WebEngineViewer::WebEngineView *mWebEngineView = nullptr;
WebEngineViewer::WebEnginePage *mEnginePage = nullptr;
};
}
#endif // DEVELOPERTOOLWIDGET_H
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