KTextAddons

translatorconfiguredialog.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 "translatorconfiguredialog.h"
8#include "translatorconfigurewidget.h"
9#include <KLocalizedString>
10#include <QDialogButtonBox>
11#include <QVBoxLayout>
12
13using namespace TextTranslator;
14TranslatorConfigureDialog::TranslatorConfigureDialog(QWidget *parent)
15 : QDialog(parent)
16 , mTranslatorConfigureWidget(new TranslatorConfigureWidget(this))
17{
18 setWindowTitle(i18nc("@title:window", "Configure Translator"));
19 auto mainLayout = new QVBoxLayout(this);
20 mainLayout->setObjectName(QStringLiteral("mainLayout"));
21
22 mTranslatorConfigureWidget->setObjectName(QStringLiteral("mTranslatorConfigureWidget"));
23 mainLayout->addWidget(mTranslatorConfigureWidget);
24 mainLayout->addStretch();
25
27 buttonBox->setObjectName(QStringLiteral("buttonBox"));
28 mainLayout->addWidget(buttonBox);
29
30 connect(buttonBox, &QDialogButtonBox::accepted, this, &TranslatorConfigureDialog::slotAccept);
31 connect(buttonBox, &QDialogButtonBox::rejected, this, &TranslatorConfigureDialog::reject);
32 mTranslatorConfigureWidget->loadSettings();
33}
34
35TranslatorConfigureDialog::~TranslatorConfigureDialog() = default;
36
37void TranslatorConfigureDialog::slotAccept()
38{
39 mTranslatorConfigureWidget->saveSettings();
40 accept();
41}
QString i18nc(const char *context, const char *text, const TYPE &arg...)
virtual void accept()
QFuture< ArgsType< Signal > > connect(Sender *sender, Signal signal)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:19:49 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.