Commit 113e65fc authored by Laurent Montel's avatar Laurent Montel
Browse files

Code moved in pimcommon

parent 41d67408
Pipeline #221454 passed with stage
in 12 minutes and 26 seconds
......@@ -6,10 +6,6 @@ target_sources(pimcommon_translatorplugin PRIVATE
translatorview.cpp
translatorplugin.h
translatorview.h
translatorconfiguredialog.h
translatorconfiguredialog.cpp
translatorconfigurewidget.h
translatorconfigurewidget.cpp
)
if (COMPILE_WITH_UNITY_CMAKE_SUPPORT)
......
/*
SPDX-FileCopyrightText: 2022 Laurent Montel <montel@kde.org>
SPDX-License-Identifier: GPL-2.0-or-later
*/
#include "translatorconfiguredialog.h"
#include "translatorconfigurewidget.h"
#include <KLocalizedString>
#include <QDialogButtonBox>
#include <QVBoxLayout>
TranslatorConfigureDialog::TranslatorConfigureDialog(QWidget *parent)
: QDialog(parent)
, mTranslatorConfigureWidget(new TranslatorConfigureWidget(this))
{
setWindowTitle(i18nc("@title:window", "Configure Translator"));
auto mainLayout = new QVBoxLayout(this);
mainLayout->setObjectName(QStringLiteral("mainlayout"));
mTranslatorConfigureWidget->setObjectName(QStringLiteral("mTranslatorConfigureWidget"));
auto buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this);
buttonBox->setObjectName(QStringLiteral("buttonBox"));
mainLayout->addWidget(buttonBox);
connect(buttonBox, &QDialogButtonBox::accepted, this, &TranslatorConfigureDialog::accept);
connect(buttonBox, &QDialogButtonBox::rejected, this, &TranslatorConfigureDialog::reject);
}
TranslatorConfigureDialog::~TranslatorConfigureDialog() = default;
/*
SPDX-FileCopyrightText: 2022 Laurent Montel <montel@kde.org>
SPDX-License-Identifier: GPL-2.0-or-later
*/
#pragma once
#include <QDialog>
class TranslatorConfigureWidget;
class TranslatorConfigureDialog : public QDialog
{
public:
explicit TranslatorConfigureDialog(QWidget *parent = nullptr);
~TranslatorConfigureDialog() override;
private:
TranslatorConfigureWidget *const mTranslatorConfigureWidget;
};
/*
SPDX-FileCopyrightText: 2022 Laurent Montel <montel@kde.org>
SPDX-License-Identifier: GPL-2.0-or-later
*/
#include "translatorconfigurewidget.h"
#include <KLocalizedString>
#include <QComboBox>
#include <QLabel>
#include <QVBoxLayout>
TranslatorConfigureWidget::TranslatorConfigureWidget(QWidget *parent)
: QWidget{parent}
, mEngine(new QComboBox(this))
{
auto mainLayout = new QVBoxLayout(this);
mainLayout->setObjectName(QStringLiteral("mainLayout"));
mainLayout->setContentsMargins({});
mEngine->setObjectName(QStringLiteral("mEngine"));
auto hboxLayout = new QHBoxLayout;
hboxLayout->setContentsMargins({});
mainLayout->addLayout(hboxLayout);
auto label = new QLabel(i18n("Engine:"), this);
label->setObjectName(QStringLiteral("label"));
hboxLayout->addWidget(label);
hboxLayout->addWidget(mEngine);
}
TranslatorConfigureWidget::~TranslatorConfigureWidget()
{
}
/*
SPDX-FileCopyrightText: 2022 Laurent Montel <montel@kde.org>
SPDX-License-Identifier: GPL-2.0-or-later
*/
#pragma once
#include <QWidget>
class QComboBox;
class TranslatorConfigureWidget : public QWidget
{
Q_OBJECT
public:
explicit TranslatorConfigureWidget(QWidget *parent = nullptr);
~TranslatorConfigureWidget() override;
private:
QComboBox *const mEngine;
};
......@@ -5,7 +5,6 @@
*/
#include "translatorplugin.h"
#include "translatorconfiguredialog.h"
#include "translatorview.h"
#include <KLocalizedString>
#include <KPluginFactory>
......@@ -41,8 +40,7 @@ bool TranslatorPlugin::hasConfigureDialog() const
void TranslatorPlugin::showConfigureDialog(QWidget *parent)
{
TranslatorConfigureDialog dlg(parent);
dlg.exec();
// TODO
}
#include "translatorplugin.moc"
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment