KTextAddons

libretranslateengineconfiguredialog.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 "libretranslateengineconfiguredialog.h"
8#include "libretranslateengineconfigurewidget.h"
9#include <KLocalizedString>
10#include <QDialogButtonBox>
11#include <QVBoxLayout>
12
13LibreTranslateEngineConfigureDialog::LibreTranslateEngineConfigureDialog(QWidget *parent)
14 : QDialog(parent)
15 , mConfigureWidget(new LibreTranslateEngineConfigureWidget(this))
16{
17 setWindowTitle(i18nc("@title:window", "Configure Engine"));
18
19 mConfigureWidget->setObjectName(QStringLiteral("mConfigureWidget"));
20
21 auto mainLayout = new QVBoxLayout(this);
22 mainLayout->setObjectName(QStringLiteral("mainLayout"));
23 mainLayout->addWidget(mConfigureWidget);
24
26 buttonBox->setObjectName(QStringLiteral("buttonBox"));
27 mainLayout->addWidget(buttonBox);
30}
31
32LibreTranslateEngineConfigureDialog::~LibreTranslateEngineConfigureDialog() = default;
33
34QString LibreTranslateEngineConfigureDialog::serverUrl() const
35{
36 return mConfigureWidget->serverUrl();
37}
38
39void LibreTranslateEngineConfigureDialog::setServerUrl(const QString &serverUrl)
40{
41 mConfigureWidget->setServerUrl(serverUrl);
42}
43
44QString LibreTranslateEngineConfigureDialog::apiKey() const
45{
46 return mConfigureWidget->apiKey();
47}
48
49void LibreTranslateEngineConfigureDialog::setApiKey(const QString &key)
50{
51 mConfigureWidget->setApiKey(key);
52}
53
54bool LibreTranslateEngineConfigureDialog::serverRequiredApiKey() const
55{
56 return mConfigureWidget->serverRequiredApiKey();
57}
58
59void LibreTranslateEngineConfigureDialog::setServerRequiredApiKey(bool state)
60{
61 mConfigureWidget->setServerRequiredApiKey(state);
62}
63
64#include "moc_libretranslateengineconfiguredialog.cpp"
QString i18nc(const char *context, const char *text, const TYPE &arg...)
virtual void accept()
virtual void reject()
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 Fri Dec 20 2024 11:49:44 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.