Commit 4555f104 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Create dialogbox

parent 82f828ab
......@@ -20,7 +20,10 @@
#include "sieveinfodialogtest.h"
#include "editor/sieveinfodialog.h"
#include "editor/sieveinfowidget.h"
#include <QDialogButtonBox>
#include <QTest>
#include <QVBoxLayout>
QTEST_MAIN(SieveInfoDialogTest)
SieveInfoDialogTest::SieveInfoDialogTest(QObject *parent)
: QObject(parent)
......@@ -31,5 +34,13 @@ SieveInfoDialogTest::SieveInfoDialogTest(QObject *parent)
void SieveInfoDialogTest::shouldHaveDefaultValues()
{
KSieveUi::SieveInfoDialog dlg;
//TODO
auto *mainLayout = dlg.findChild<QVBoxLayout *>(QStringLiteral("mainLayout"));
QVERIFY(mainLayout);
KSieveUi::SieveInfoWidget *mSieveInfoWidget = dlg.findChild<KSieveUi::SieveInfoWidget *>(QStringLiteral("mSieveInfoWidget"));
QVERIFY(mSieveInfoWidget);
QDialogButtonBox *button = dlg.findChild<QDialogButtonBox *>(QStringLiteral("button"));
QVERIFY(button);
}
......@@ -19,14 +19,27 @@
*/
#include "sieveinfodialog.h"
#include "sieveinfowidget.h"
#include <QHBoxLayout>
#include <KLocalizedString>
#include <QDialogButtonBox>
using namespace KSieveUi;
SieveInfoDialog::SieveInfoDialog(QWidget *parent)
: QDialog(parent)
{
setWindowTitle(i18nc("@title:window", "Sieve Server Support"));
auto *mainLayout = new QVBoxLayout(this);
mainLayout->setObjectName(QStringLiteral("mainLayout"));
mSieveInfoWidget = new SieveInfoWidget(this);
mSieveInfoWidget->setObjectName(QStringLiteral("mSieveInfoWidget"));
mainLayout->addWidget(mSieveInfoWidget);
QDialogButtonBox *button = new QDialogButtonBox(QDialogButtonBox::Close, this);
button->setObjectName(QStringLiteral("button"));
mainLayout->addWidget(button);
connect(button, &QDialogButtonBox::accepted, this, &SieveInfoDialog::accept);
}
SieveInfoDialog::~SieveInfoDialog()
......
......@@ -24,12 +24,15 @@
#include <QDialog>
#include "ksieveui_export.h"
namespace KSieveUi {
class SieveInfoWidget;
class KSIEVEUI_EXPORT SieveInfoDialog : public QDialog
{
Q_OBJECT
public:
explicit SieveInfoDialog(QWidget *parent = nullptr);
~SieveInfoDialog();
private:
SieveInfoWidget *mSieveInfoWidget = nullptr;
};
}
......
......@@ -19,11 +19,11 @@
#define SIEVEINFOWIDGET_H
#include <QWidget>
#include "ksieveui_export.h"
class QTextEdit;
namespace KSieveUi {
class SieveInfoWidget : public QWidget
class KSIEVEUI_EXPORT SieveInfoWidget : public QWidget
{
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