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

Continue to implement dialogbox

parent 96644d6a
Pipeline #46303 passed with stage
in 45 minutes and 34 seconds
......@@ -6,7 +6,10 @@
#include "remotecontentconfiguredialogtest.h"
#include "remote-content/remotecontentconfiguredialog.h"
#include "remote-content/remotecontentconfigurewidget.h"
#include <QDialogButtonBox>
#include <QTest>
#include <QVBoxLayout>
QTEST_MAIN(RemoteContentConfigureDialogTest)
RemoteContentConfigureDialogTest::RemoteContentConfigureDialogTest(QObject *parent)
: QObject(parent)
......@@ -16,6 +19,17 @@ RemoteContentConfigureDialogTest::RemoteContentConfigureDialogTest(QObject *pare
void RemoteContentConfigureDialogTest::shouldHaveDefaultValues()
{
MessageViewer::RemoteContentConfigureDialog d;
//TODO
MessageViewer::RemoteContentConfigureDialog w;
QVERIFY(!w.windowTitle().isEmpty());
auto mainLayout = w.findChild<QVBoxLayout *>(QStringLiteral("mainLayout"));
QVERIFY(mainLayout);
auto mRemoteContentConfigureWidget = w.findChild<MessageViewer::RemoteContentConfigureWidget *>(QStringLiteral("mRemoteContentConfigureWidget"));
QVERIFY(mRemoteContentConfigureWidget);
auto buttonBox = w.findChild<QDialogButtonBox *>(QStringLiteral("buttonBox"));
QVERIFY(buttonBox);
QCOMPARE(buttonBox->standardButtons(), {QDialogButtonBox::Ok | QDialogButtonBox::Cancel});
}
......@@ -5,6 +5,7 @@
*/
#include "remotecontentconfiguredialog.h"
#include "remotecontentconfigurewidget.h"
#include <KLocalizedString>
#include <QVBoxLayout>
#include <QDialogButtonBox>
......@@ -18,12 +19,17 @@ static const char myRemoteContentConfigureConfigGroupName[] = "RemoteContentConf
using namespace MessageViewer;
RemoteContentConfigureDialog::RemoteContentConfigureDialog(QWidget *parent)
: QDialog(parent)
, mRemoteContentConfigureWidget(new RemoteContentConfigureWidget(this))
{
setWindowTitle(i18nc("@title:window", "Details"));
setAttribute(Qt::WA_DeleteOnClose);
auto mainLayout = new QVBoxLayout(this);
mainLayout->setObjectName(QStringLiteral("mainLayout"));
mRemoteContentConfigureWidget->setObjectName(QStringLiteral("mRemoteContentConfigureWidget"));
mainLayout->addWidget(mRemoteContentConfigureWidget);
auto buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this);
buttonBox->setObjectName(QStringLiteral("buttonBox"));
connect(buttonBox, &QDialogButtonBox::accepted, this, &RemoteContentConfigureDialog::accept);
connect(buttonBox, &QDialogButtonBox::rejected, this, &RemoteContentConfigureDialog::reject);
mainLayout->addWidget(buttonBox);
......
......@@ -10,6 +10,7 @@
#include <QDialog>
#include "messageviewer_private_export.h"
namespace MessageViewer {
class RemoteContentConfigureWidget;
class MESSAGEVIEWER_TESTS_EXPORT RemoteContentConfigureDialog : public QDialog
{
Q_OBJECT
......@@ -20,6 +21,7 @@ public:
private:
void readConfig();
void writeConfig();
RemoteContentConfigureWidget *const mRemoteContentConfigureWidget;
};
}
......
......@@ -6,11 +6,15 @@
#include "remotecontentconfigurewidget.h"
#include <KLocalizedString>
#include <QVBoxLayout>
using namespace MessageViewer;
RemoteContentConfigureWidget::RemoteContentConfigureWidget(QWidget *parent)
: QWidget(parent)
{
auto vboxLayout = new QVBoxLayout(this);
vboxLayout->setObjectName(QStringLiteral("vboxLayout"));
vboxLayout->setContentsMargins({});
}
RemoteContentConfigureWidget::~RemoteContentConfigureWidget()
......
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