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 89d7ae2a authored by Laurent Montel's avatar Laurent Montel 😁

Continue to implement vacationmailactionwidget

parent f675d22a
......@@ -8,6 +8,7 @@ macro( add_vacation_test _source )
../vacationscriptextractor.cpp
../vacationutils.cpp
../vacationeditwidget.cpp
../vacationmailactionwidget.cpp
)
configure_file(../../settings/sieve-editor.kcfg.cmake ${CMAKE_CURRENT_BINARY_DIR}/sieve-editor.kcfg)
kconfig_add_kcfg_files(_test ../../settings/sieve-vacation.kcfgc ../../settings/sieve-editor.kcfgc)
......
......@@ -18,6 +18,9 @@
*/
#include "vacationmailactionwidgettest.h"
#include "../vacationmailactionwidget.h"
#include <QHBoxLayout>
#include <QStackedWidget>
#include <QTest>
QTEST_MAIN(VacationMailActionWidgetTest)
......@@ -27,3 +30,15 @@ VacationMailActionWidgetTest::VacationMailActionWidgetTest(QObject *parent)
{
}
void VacationMailActionWidgetTest::shouldHaveDefaultValue()
{
KSieveUi::VacationMailActionWidget w;
QHBoxLayout *mainLayout = w.findChild<QHBoxLayout *>(QStringLiteral("mainlayout"));
QVERIFY(mainLayout);
QCOMPARE(mainLayout->margin(), 0);
QStackedWidget *mStackedWidget = w.findChild<QStackedWidget *>(QStringLiteral("stackedWidget"));
QVERIFY(mStackedWidget);
}
......@@ -28,6 +28,8 @@ class VacationMailActionWidgetTest : public QObject
public:
explicit VacationMailActionWidgetTest(QObject *parent = nullptr);
~VacationMailActionWidgetTest() = default;
private Q_SLOTS:
void shouldHaveDefaultValue();
};
#endif // VACATIONMAILACTIONWIDGETTEST_H
......@@ -19,12 +19,23 @@
#include "vacationmailactionwidget.h"
#include <QStackedWidget>
#include <QHBoxLayout>
using namespace KSieveUi;
VacationMailActionWidget::VacationMailActionWidget(QWidget *parent)
: QWidget(parent)
{
QHBoxLayout *mainLayout = new QHBoxLayout(this);
mainLayout->setObjectName(QStringLiteral("mainlayout"));
mainLayout->setMargin(0);
mStackedWidget = new QStackedWidget(this);
mStackedWidget->setObjectName(QStringLiteral("stackedWidget"));
mainLayout->addWidget(mStackedWidget);
}
......
......@@ -21,6 +21,7 @@
#define VACATIONMAILACTIONWIDGET_H
#include <QWidget>
class QStackedWidget;
namespace KSieveUi {
class VacationMailActionWidget : public QWidget
{
......@@ -28,6 +29,8 @@ class VacationMailActionWidget : public QWidget
public:
explicit VacationMailActionWidget(QWidget *parent = nullptr);
~VacationMailActionWidget();
private:
QStackedWidget *mStackedWidget;
};
}
......
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