File indexing completed on 2025-01-19 04:47:00
0001 /* 0002 SPDX-FileCopyrightText: 2023-2024 Laurent Montel <montel.org> 0003 0004 SPDX-License-Identifier: GPL-2.0-or-later 0005 */ 0006 0007 #include "adblockpluginurlinterceptoraddadblocklistdialog.h" 0008 #include <KLocalizedString> 0009 #include <QDialogButtonBox> 0010 #include <QVBoxLayout> 0011 0012 AdblockPluginUrlInterceptorAddAdblockListDialog::AdblockPluginUrlInterceptorAddAdblockListDialog(QWidget *parent) 0013 : QDialog(parent) 0014 , mAddAdblockListWidget(new AdblockPluginUrlInterceptorAddAdblockListWidget(this)) 0015 { 0016 setWindowTitle(i18nc("@title:window", "Add Adblock List")); 0017 auto mainLayout = new QVBoxLayout(this); 0018 mainLayout->setObjectName(QLatin1StringView("mainLayout")); 0019 0020 mAddAdblockListWidget->setObjectName(QLatin1StringView("mAddAdblockListWidget")); 0021 mainLayout->addWidget(mAddAdblockListWidget); 0022 0023 auto buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this); 0024 buttonBox->setObjectName(QLatin1StringView("buttonBox")); 0025 mainLayout->addWidget(buttonBox); 0026 connect(buttonBox, &QDialogButtonBox::accepted, this, &AdblockPluginUrlInterceptorAddAdblockListDialog::accept); 0027 connect(buttonBox, &QDialogButtonBox::rejected, this, &AdblockPluginUrlInterceptorAddAdblockListDialog::reject); 0028 } 0029 0030 AdblockPluginUrlInterceptorAddAdblockListDialog::~AdblockPluginUrlInterceptorAddAdblockListDialog() = default; 0031 0032 AdblockPluginUrlInterceptorAddAdblockListWidget::AdBlockListInfo AdblockPluginUrlInterceptorAddAdblockListDialog::info() const 0033 { 0034 return mAddAdblockListWidget->info(); 0035 } 0036 0037 void AdblockPluginUrlInterceptorAddAdblockListDialog::setInfo(const AdblockPluginUrlInterceptorAddAdblockListWidget::AdBlockListInfo &adblockInfo) 0038 { 0039 mAddAdblockListWidget->setInfo(adblockInfo); 0040 } 0041 0042 #include "moc_adblockpluginurlinterceptoraddadblocklistdialog.cpp"