KTextAddons

translatorconfigurewidget.cpp
1/*
2 SPDX-FileCopyrightText: 2022-2024 Laurent Montel <montel@kde.org>
3
4 SPDX-License-Identifier: GPL-2.0-or-later
5*/
6
7#include "translatorconfigurewidget.h"
8#include "translatorconfigurecombowidget.h"
9#include <KLocalizedString>
10#include <KSharedConfig>
11#include <QLabel>
12#include <QVBoxLayout>
13using namespace TextTranslator;
14
15class Q_DECL_HIDDEN TextTranslator::TranslatorConfigureWidget::TranslatorConfigureWidgetPrivate
16{
17public:
18 TranslatorConfigureWidgetPrivate(TranslatorConfigureWidget *parent)
19 : mEngineConfigureComboWidget(new TranslatorConfigureComboWidget(parent))
20 {
21 }
22
23 TranslatorConfigureComboWidget *const mEngineConfigureComboWidget;
24};
25
26TranslatorConfigureWidget::TranslatorConfigureWidget(QWidget *parent)
27 : QWidget{parent}
28 , d(new TranslatorConfigureWidgetPrivate(this))
29{
30 auto mainLayout = new QVBoxLayout(this);
31 mainLayout->setObjectName(QStringLiteral("mainLayout"));
32 mainLayout->setContentsMargins({});
33
34 d->mEngineConfigureComboWidget->setObjectName(QStringLiteral("mEngineConfigureComboWidget"));
35 auto hboxLayout = new QHBoxLayout;
36 hboxLayout->setContentsMargins({});
37 mainLayout->addLayout(hboxLayout);
38
39 auto label = new QLabel(i18nc("@label:textbox", "Engine:"), this);
40 label->setObjectName(QStringLiteral("label"));
41 hboxLayout->addWidget(label);
42 hboxLayout->addWidget(d->mEngineConfigureComboWidget);
43}
44
45TranslatorConfigureWidget::~TranslatorConfigureWidget() = default;
46
47void TranslatorConfigureWidget::saveSettings()
48{
49 d->mEngineConfigureComboWidget->save();
50}
51
52void TranslatorConfigureWidget::loadSettings()
53{
54 d->mEngineConfigureComboWidget->load();
55}
56
57#include "moc_translatorconfigurewidget.cpp"
QString i18nc(const char *context, const char *text, const TYPE &arg...)
QString label(StandardShortcut id)
void setContentsMargins(const QMargins &margins)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:56:02 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.