Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 4c16b292 authored by Laurent Montel's avatar Laurent Montel 😁

Continue to implement it

parent 1b6322b2
......@@ -18,6 +18,11 @@
*/
#include "checkbeforesendupdatesmtpdialogtest.h"
#include "checkbeforesendupdatesmtpdialog.h"
#include <QCheckBox>
#include <QDialogButtonBox>
#include <QHBoxLayout>
#include <QLabel>
#include <QTest>
QTEST_MAIN(CheckBeforeSendUpdateSmtpDialogTest)
......@@ -26,3 +31,21 @@ CheckBeforeSendUpdateSmtpDialogTest::CheckBeforeSendUpdateSmtpDialogTest(QObject
{
}
void CheckBeforeSendUpdateSmtpDialogTest::shouldHaveDefaultValue()
{
CheckBeforeSendUpdateSmtpDialog w;
QVBoxLayout *mainLayout = w.findChild<QVBoxLayout *>(QStringLiteral("mainlayout"));
QVERIFY(mainLayout);
QLabel *lab = w.findChild<QLabel *>(QStringLiteral("label"));
QVERIFY(lab);
QVERIFY(!lab->text().isEmpty());
QCheckBox *mChangeSmtp = w.findChild<QCheckBox *>(QStringLiteral("changesmtp"));
QVERIFY(mChangeSmtp);
QVERIFY(!mChangeSmtp->isChecked());
QDialogButtonBox *buttonBox = w.findChild<QDialogButtonBox *>(QStringLiteral("buttonbox"));
QVERIFY(buttonBox);
}
......@@ -28,6 +28,8 @@ class CheckBeforeSendUpdateSmtpDialogTest : public QObject
public:
explicit CheckBeforeSendUpdateSmtpDialogTest(QObject *parent = nullptr);
~CheckBeforeSendUpdateSmtpDialogTest() = default;
private Q_SLOTS:
void shouldHaveDefaultValue();
};
#endif // CHECKBEFORESENDUPDATESMTPDIALOGTEST_H
......@@ -22,10 +22,27 @@
#include <KLocalizedString>
#include <QVBoxLayout>
#include <QDialogButtonBox>
#include <QLabel>
#include <QCheckBox>
CheckBeforeSendUpdateSmtpDialog::CheckBeforeSendUpdateSmtpDialog(QWidget *parent)
: QDialog(parent)
{
QVBoxLayout *mainLayout = new QVBoxLayout(this);
mainLayout->setObjectName(QStringLiteral("mainlayout"));
QLabel *lab = new QLabel(i18n(""), this);
lab->setObjectName(QStringLiteral("label"));
mainLayout->addWidget(lab);
QCheckBox *mChangeSmtp = new QCheckBox(i18n("..."), this);
mChangeSmtp->setObjectName(QStringLiteral("changesmtp"));
mChangeSmtp->setChecked(false);
mainLayout->addWidget(mChangeSmtp);
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Yes | QDialogButtonBox::No, this);
buttonBox->setObjectName(QStringLiteral("buttonbox"));
mainLayout->addWidget(buttonBox);
}
......@@ -33,3 +50,4 @@ CheckBeforeSendUpdateSmtpDialog::~CheckBeforeSendUpdateSmtpDialog()
{
}
......@@ -21,13 +21,15 @@
#define CHECKBEFORESENDUPDATESMTPDIALOG_H
#include <QDialog>
class QCheckBox;
class CheckBeforeSendUpdateSmtpDialog : public QDialog
{
Q_OBJECT
public:
explicit CheckBeforeSendUpdateSmtpDialog(QWidget *parent = nullptr);
~CheckBeforeSendUpdateSmtpDialog();
private:
QCheckBox *mChangeSmtp;
};
#endif // CHECKBEFORESENDUPDATESMTPDIALOG_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