File indexing completed on 2025-01-05 04:49:28
0001 /* 0002 SPDX-FileCopyrightText: 2017-2024 Laurent Montel <montel@kde.org> 0003 0004 SPDX-License-Identifier: GPL-2.0-or-later 0005 */ 0006 0007 #include "insertshorturlconfiguredialog.h" 0008 #include "insertshorturlconfigurewidget.h" 0009 #include <QDialogButtonBox> 0010 #include <QVBoxLayout> 0011 0012 InsertShorturlConfigureDialog::InsertShorturlConfigureDialog(QWidget *parent) 0013 : QDialog(parent) 0014 , mInsertShortUrlWidget(new InsertShorturlConfigureWidget(this)) 0015 { 0016 auto mainLayout = new QVBoxLayout(this); 0017 0018 mInsertShortUrlWidget->setObjectName(QLatin1StringView("insertshorturlwidget")); 0019 mainLayout->addWidget(mInsertShortUrlWidget); 0020 0021 auto buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this); 0022 buttonBox->setObjectName(QLatin1StringView("buttonbox")); 0023 connect(buttonBox, &QDialogButtonBox::accepted, this, &InsertShorturlConfigureDialog::accept); 0024 connect(buttonBox, &QDialogButtonBox::rejected, this, &InsertShorturlConfigureDialog::reject); 0025 mainLayout->addWidget(buttonBox); 0026 } 0027 0028 InsertShorturlConfigureDialog::~InsertShorturlConfigureDialog() = default; 0029 0030 void InsertShorturlConfigureDialog::accept() 0031 { 0032 mInsertShortUrlWidget->writeConfig(); 0033 QDialog::accept(); 0034 } 0035 0036 #include "moc_insertshorturlconfiguredialog.cpp"