File indexing completed on 2025-01-19 04:46:52
0001 /* 0002 SPDX-FileCopyrightText: 2020-2024 Laurent Montel <montel@kde.org> 0003 0004 SPDX-License-Identifier: GPL-2.0-or-later 0005 */ 0006 0007 #include "folderconfiguresettingspagebase.h" 0008 0009 #include <KLocalizedString> 0010 0011 #include <QGroupBox> 0012 #include <QVBoxLayout> 0013 0014 FolderConfigureSettingsPageBase::FolderConfigureSettingsPageBase(QWidget *parent) 0015 : QWidget(parent) 0016 , mMainLayout(new QVBoxLayout) 0017 , mGroupBox(new QGroupBox(i18n("Modify"), this)) 0018 { 0019 auto topLayout = new QVBoxLayout(this); 0020 topLayout->setObjectName(QLatin1StringView("topLayout")); 0021 0022 mMainLayout->setObjectName(QLatin1StringView("mMainLayout")); 0023 0024 mGroupBox->setObjectName(QLatin1StringView("mGroupBox")); 0025 mGroupBox->setCheckable(true); 0026 mGroupBox->setChecked(false); 0027 0028 mGroupBox->setLayout(mMainLayout); 0029 topLayout->addWidget(mGroupBox); 0030 connect(mGroupBox, &QGroupBox::clicked, this, &FolderConfigureSettingsPageBase::slotModifyClicked); 0031 } 0032 0033 FolderConfigureSettingsPageBase::~FolderConfigureSettingsPageBase() = default; 0034 0035 void FolderConfigureSettingsPageBase::slotModifyClicked(bool clicked) 0036 { 0037 mMainWidget->setEnabled(clicked); 0038 } 0039 0040 bool FolderConfigureSettingsPageBase::wasModified() const 0041 { 0042 return mGroupBox->isChecked(); 0043 } 0044 0045 void FolderConfigureSettingsPageBase::addMainWidget(QWidget *widget) 0046 { 0047 mMainWidget = widget; 0048 mMainLayout->addWidget(mMainWidget); 0049 mMainWidget->setEnabled(false); // Disable it directly 0050 } 0051 0052 #include "moc_folderconfiguresettingspagebase.cpp"