Commit 1d02fd1a authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

We need to show preview

parent 95e8909c
Pipeline #51545 passed with stage
in 54 minutes and 25 seconds
......@@ -32,8 +32,16 @@ MailMergeDialog::MailMergeDialog(QWidget *parent)
connect(buttonBox, &QDialogButtonBox::accepted, this, &MailMergeDialog::accept);
connect(buttonBox, &QDialogButtonBox::rejected, this, &MailMergeDialog::reject);
mainLayout->addWidget(buttonBox);
mPreview = new QPushButton(i18n("Preview"), this);
buttonBox->addButton(mPreview, QDialogButtonBox::ActionRole);
connect(mPreview, &QPushButton::clicked, this, &MailMergeDialog::slotPreview);
}
MailMergeDialog::~MailMergeDialog()
{
}
void MailMergeDialog::slotPreview()
{
// TODO show generated email
}
......@@ -8,6 +8,7 @@
#define MAILMERGEDIALOG_H
#include "mailmerge_export.h"
#include <QDialog>
class QPushButton;
namespace MailMerge
{
class MailMergeWidget;
......@@ -19,7 +20,9 @@ public:
~MailMergeDialog() override;
private:
void slotPreview();
MailMergeWidget *const mMailMergeWidget;
QPushButton *mPreview = nullptr;
};
}
......
......@@ -4,6 +4,7 @@
SPDX-License-Identifier: GPL-2.0-only
*/
#include "addressbookwidget.h"
#include <KLocalizedString>
#include <QHBoxLayout>
using namespace MailMerge;
......
......@@ -27,10 +27,10 @@ MailMergeWidget::MailMergeWidget(QWidget *parent)
, mCsvWidget(new MailMerge::CsvWidget(this))
, mAddressbookWidget(new MailMerge::AddressBookWidget(this))
{
QVBoxLayout *vbox = new QVBoxLayout(this);
QVBoxLayout *mainLayout = new QVBoxLayout(this);
QHBoxLayout *hbox = new QHBoxLayout;
vbox->addLayout(hbox);
mainLayout->addLayout(hbox);
QLabel *lab = new QLabel(i18n("Source:"), this);
hbox->addWidget(lab);
......@@ -44,7 +44,7 @@ MailMergeWidget::MailMergeWidget(QWidget *parent)
hbox->addWidget(mSource);
mStackedWidget->setObjectName(QStringLiteral("stackedwidget"));
vbox->addWidget(mStackedWidget);
mainLayout->addWidget(mStackedWidget);
mAddressbookWidget->setObjectName(QStringLiteral("addressbookwidget"));
mStackedWidget->addWidget(mAddressbookWidget);
......@@ -54,15 +54,15 @@ MailMergeWidget::MailMergeWidget(QWidget *parent)
mStackedWidget->addWidget(mCsvWidget);
lab = new QLabel(i18n("Attachment:"), this);
vbox->addWidget(lab);
mainLayout->addWidget(lab);
PimCommon::SimpleStringListEditor::ButtonCode buttonCode = static_cast<PimCommon::SimpleStringListEditor::ButtonCode>(
PimCommon::SimpleStringListEditor::Add | PimCommon::SimpleStringListEditor::Remove | PimCommon::SimpleStringListEditor::Modify);
mAttachment = new AttachmentListWidget(this, buttonCode, i18n("A&dd..."), i18n("Re&move"), i18n("Mod&ify..."));
mAttachment->setObjectName(QStringLiteral("attachment-list"));
vbox->addWidget(mAttachment);
vbox->addStretch();
mainLayout->addWidget(mAttachment);
mainLayout->addStretch();
}
MailMergeWidget::~MailMergeWidget()
......
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