1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
|
/*
SPDX-FileCopyrightText: 2022-2026 Laurent Montel <montel@kde.org>
SPDX-License-Identifier: GPL-2.0-or-later
*/
#include "translatorconfigurewidget.h"
using namespace Qt::Literals::StringLiterals;
#include "translatorconfigurecombowidget.h"
#include <KLocalizedString>
#include <KSharedConfig>
#include <QLabel>
#include <QVBoxLayout>
using namespace TextTranslator;
class Q_DECL_HIDDEN TextTranslator::TranslatorConfigureWidget::TranslatorConfigureWidgetPrivate
{
public:
TranslatorConfigureWidgetPrivate(TranslatorConfigureWidget *parent)
: mEngineConfigureComboWidget(new TranslatorConfigureComboWidget(parent))
{
}
TranslatorConfigureComboWidget *const mEngineConfigureComboWidget;
};
TranslatorConfigureWidget::TranslatorConfigureWidget(QWidget *parent)
: QWidget{parent}
, d(new TranslatorConfigureWidgetPrivate(this))
{
auto mainLayout = new QVBoxLayout(this);
mainLayout->setObjectName(u"mainLayout"_s);
mainLayout->setContentsMargins({});
d->mEngineConfigureComboWidget->setObjectName(u"mEngineConfigureComboWidget"_s);
auto hboxLayout = new QHBoxLayout;
hboxLayout->setContentsMargins({});
mainLayout->addLayout(hboxLayout);
auto label = new QLabel(i18nc("@label:textbox", "Engine:"), this);
label->setObjectName(u"label"_s);
label->setTextFormat(Qt::PlainText);
hboxLayout->addWidget(label);
hboxLayout->addWidget(d->mEngineConfigureComboWidget);
}
TranslatorConfigureWidget::~TranslatorConfigureWidget() = default;
void TranslatorConfigureWidget::saveSettings()
{
d->mEngineConfigureComboWidget->save();
}
void TranslatorConfigureWidget::loadSettings()
{
d->mEngineConfigureComboWidget->load();
}
#include "moc_translatorconfigurewidget.cpp"
|