Commit 176b1363 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Improve filter name dialog

parent 41a3280f
Pipeline #65269 passed with stage
in 42 minutes and 7 seconds
......@@ -5,6 +5,7 @@
*/
#include "filternamedialog.h"
#include "filternamewidget.h"
#include <KLocalizedString>
#include <QDialogButtonBox>
#include <QVBoxLayout>
......@@ -12,7 +13,18 @@
using namespace MessageList::Core;
FilterNameDialog::FilterNameDialog(QWidget *parent)
: QDialog(parent)
, mFilterNameWidget(new FilterNameWidget(this))
{
auto mainLayout = new QVBoxLayout(this);
mainLayout->setObjectName(QStringLiteral("mainLayout"));
mFilterNameWidget->setObjectName(QStringLiteral("mFilterNameWidget"));
mainLayout->addWidget(mFilterNameWidget);
auto button = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this);
mainLayout->addWidget(button);
connect(button, &QDialogButtonBox::accepted, this, &FilterNameDialog::accept);
connect(button, &QDialogButtonBox::rejected, this, &FilterNameDialog::reject);
}
FilterNameDialog::~FilterNameDialog()
......
......@@ -13,12 +13,16 @@ namespace MessageList
{
namespace Core
{
class FilterNameWidget;
class MESSAGELIST_TESTS_EXPORT FilterNameDialog : public QDialog
{
Q_OBJECT
public:
explicit FilterNameDialog(QWidget *parent = nullptr);
~FilterNameDialog() override;
private:
FilterNameWidget *const mFilterNameWidget;
};
}
}
......@@ -6,12 +6,17 @@
#include "filternamewidget.h"
#include <KLocalizedString>
#include <QLabel>
#include <QLineEdit>
#include <QVBoxLayout>
using namespace MessageList::Core;
FilterNameWidget::FilterNameWidget(QWidget *parent)
: QWidget(parent)
{
auto mainLayout = new QVBoxLayout(this);
mainLayout->setObjectName(QStringLiteral("mainLayout"));
mainLayout->setContentsMargins({});
}
FilterNameWidget::~FilterNameWidget()
......
......@@ -18,6 +18,8 @@ class MESSAGELIST_TESTS_EXPORT FilterNameWidget : public QWidget
public:
explicit FilterNameWidget(QWidget *parent = nullptr);
~FilterNameWidget() override;
Q_SIGNALS:
void updateOkButton(bool enabled);
};
}
}
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