File indexing completed on 2025-01-19 04:46:45
0001 /* 0002 SPDX-FileCopyrightText: 2021-2024 Laurent Montel <montel@kde.org> 0003 0004 SPDX-License-Identifier: GPL-2.0-only 0005 */ 0006 0007 #include "mailmergepreviewdialog.h" 0008 #include <KLocalizedString> 0009 #include <QDialogButtonBox> 0010 #include <QPushButton> 0011 #include <QVBoxLayout> 0012 0013 MailMergePreviewDialog::MailMergePreviewDialog(QWidget *parent) 0014 : QDialog(parent) 0015 { 0016 setWindowTitle(i18nc("@title:window", "Attachment")); 0017 auto mainLayout = new QVBoxLayout(this); 0018 mainLayout->setObjectName(QLatin1StringView("mainLayout")); 0019 0020 auto buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this); 0021 buttonBox->setObjectName(QLatin1StringView("buttonBox")); 0022 0023 mainLayout->addWidget(buttonBox); 0024 QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok); 0025 okButton->setDefault(true); 0026 okButton->setShortcut(Qt::CTRL | Qt::Key_Return); 0027 connect(buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept); 0028 connect(buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject); 0029 } 0030 0031 MailMergePreviewDialog::~MailMergePreviewDialog() = default; 0032 0033 #include "moc_mailmergepreviewdialog.cpp"