Commit 4013e343 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Continue to implement openurlwith configure dialog

parent ee41cef0
Pipeline #125109 passed with stage
in 17 minutes and 24 seconds
......@@ -6,7 +6,10 @@
#include "openurlwithconfigurewidgettest.h"
#include "openurlwithconfigurewidget.h"
#include <QHeaderView>
#include <QTest>
#include <QTreeWidget>
#include <QVBoxLayout>
QTEST_MAIN(OpenUrlWithConfigureWidgetTest)
OpenUrlWithConfigureWidgetTest::OpenUrlWithConfigureWidgetTest(QObject *parent)
: QObject{parent}
......@@ -16,5 +19,13 @@ OpenUrlWithConfigureWidgetTest::OpenUrlWithConfigureWidgetTest(QObject *parent)
void OpenUrlWithConfigureWidgetTest::shouldHaveDefaultValues()
{
OpenUrlWithConfigureWidget w;
// TODO
auto mainLayout = w.findChild<QVBoxLayout *>(QStringLiteral("mainLayout"));
QVERIFY(mainLayout);
QCOMPARE(mainLayout->contentsMargins(), QMargins());
auto mTreeWidget = w.findChild<QTreeWidget *>(QStringLiteral("mTreeWidget"));
QVERIFY(mTreeWidget);
QVERIFY(mTreeWidget->rootIsDecorated());
QVERIFY(!mTreeWidget->header()->sectionsMovable());
}
......@@ -34,7 +34,7 @@ OpenUrlWithConfigureDialog::OpenUrlWithConfigureDialog(QWidget *parent)
connect(buttonBox, &QDialogButtonBox::accepted, this, &OpenUrlWithConfigureDialog::slotAccepted);
connect(buttonBox, &QDialogButtonBox::rejected, this, &OpenUrlWithConfigureDialog::reject);
// mConfigureWidget->loadSettings();
mOpenUrlWithWidget->loadSettings();
readConfig();
}
......@@ -45,6 +45,7 @@ OpenUrlWithConfigureDialog::~OpenUrlWithConfigureDialog()
void OpenUrlWithConfigureDialog::slotAccepted()
{
mOpenUrlWithWidget->writeSettings();
accept();
}
......
......@@ -6,15 +6,35 @@
#include "openurlwithconfigurewidget.h"
#include <KLocalizedString>
#include <QHeaderView>
#include <QTreeWidget>
#include <QVBoxLayout>
OpenUrlWithConfigureWidget::OpenUrlWithConfigureWidget(QWidget *parent)
: QWidget{parent}
, mTreeWidget(new QTreeWidget(this))
{
auto mainLayout = new QVBoxLayout(this);
mainLayout->setObjectName(QStringLiteral("mainLayout"));
mainLayout->setContentsMargins(QMargins());
mTreeWidget->setObjectName(QStringLiteral("mTreeWidget"));
mainLayout->addWidget(mTreeWidget);
mTreeWidget->setRootIsDecorated(false);
mTreeWidget->header()->setSectionsMovable(false);
mTreeWidget->setHeaderLabels({i18n("Domain"), i18n("Command Line")});
}
OpenUrlWithConfigureWidget::~OpenUrlWithConfigureWidget()
{
}
void OpenUrlWithConfigureWidget::loadSettings()
{
// TODO
}
void OpenUrlWithConfigureWidget::writeSettings()
{
// TODO
}
......@@ -8,11 +8,16 @@
#include "openurlwith_private_export.h"
#include <QWidget>
class QTreeWidget;
class LIBOPENURLWITHCONFIGURE_TESTS_EXPORT OpenUrlWithConfigureWidget : public QWidget
{
Q_OBJECT
public:
explicit OpenUrlWithConfigureWidget(QWidget *parent = nullptr);
~OpenUrlWithConfigureWidget() override;
void loadSettings();
void writeSettings();
private:
QTreeWidget *const mTreeWidget;
};
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