Commit bd317328 authored by Ingo Klöcker's avatar Ingo Klöcker
Browse files

Move WizardPage to file of its own

The "empty" cpp makes automoc work.

GnuPG-bug-id: 5969
parent 9eca382d
......@@ -276,6 +276,7 @@ set(_kleopatra_SRCS
newcertificatewizard/listwidget.cpp
newcertificatewizard/newcertificatewizard.cpp
newcertificatewizard/wizardpage.cpp
smartcard/readerstatus.cpp
smartcard/card.cpp
......
......@@ -21,6 +21,7 @@
#include "ui_resultpage.h"
#include "ui_advancedsettingsdialog.h"
#include "wizardpage_p.h"
#ifdef QGPGME_SUPPORTS_SECRET_KEY_EXPORT
# include "commands/exportsecretkeycommand.h"
......@@ -319,75 +320,6 @@ QDate defaultExpirationDate(OnUnlimitedValidity onUnlimitedValidity)
}
Q_DECLARE_METATYPE(GpgME::Subkey::PubkeyAlgo)
namespace Kleo
{
namespace NewCertificateUi
{
class WizardPage : public QWizardPage
{
Q_OBJECT
protected:
explicit WizardPage(QWidget *parent = nullptr)
: QWizardPage(parent) {}
NewCertificateWizard *wizard() const
{
Q_ASSERT(static_cast<NewCertificateWizard *>(QWizardPage::wizard()) == qobject_cast<NewCertificateWizard *>(QWizardPage::wizard()));
return static_cast<NewCertificateWizard *>(QWizardPage::wizard());
}
void resetProtocol()
{
wizard()->resetProtocol();
}
void restartAtEnterDetailsPage()
{
wizard()->restartAtEnterDetailsPage();
}
QDir tmpDir() const;
protected:
#define FIELD(type, name) type name() const { return field( QStringLiteral(#name) ).value<type>(); }
FIELD(bool, pgp)
FIELD(bool, signingAllowed)
FIELD(bool, encryptionAllowed)
FIELD(bool, certificationAllowed)
FIELD(bool, authenticationAllowed)
FIELD(QString, name)
FIELD(QString, email)
FIELD(QString, dn)
FIELD(bool, protectedKey)
FIELD(Subkey::PubkeyAlgo, keyType)
FIELD(int, keyStrength)
FIELD(QString, keyCurve)
FIELD(Subkey::PubkeyAlgo, subkeyType)
FIELD(int, subkeyStrength)
FIELD(QString, subkeyCurve)
FIELD(QDate, expiryDate)
FIELD(QStringList, additionalUserIDs)
FIELD(QStringList, additionalEMailAddresses)
FIELD(QStringList, dnsNames)
FIELD(QStringList, uris)
FIELD(QString, url)
FIELD(QString, error)
FIELD(QString, result)
FIELD(QString, fingerprint)
#undef FIELD
};
} // namespace NewCertificateUi
} // namespace Kleo
using namespace Kleo::NewCertificateUi;
namespace
{
......
/* -*- mode: c++; c-basic-offset:4 -*-
newcertificatewizard/wizardpage.cpp
This file is part of Kleopatra, the KDE keymanager
SPDX-FileCopyrightText: 2022 g10 Code GmbH
SPDX-FileContributor: Ingo Klöcker <dev@ingo-kloecker.de>
SPDX-License-Identifier: GPL-2.0-or-later
*/
#include "wizardpage_p.h"
/* -*- mode: c++; c-basic-offset:4 -*-
newcertificatewizard/wizardpage_p.h
This file is part of Kleopatra, the KDE keymanager
SPDX-FileCopyrightText: 2008 Klarälvdalens Datakonsult AB
SPDX-FileCopyrightText: 2016, 2017 Bundesamt für Sicherheit in der Informationstechnik
SPDX-FileContributor: Intevation GmbH
SPDX-License-Identifier: GPL-2.0-or-later
*/
#pragma once
#include "newcertificatewizard.h"
#include "utils/metatypes_for_gpgmepp_key.h"
#include <QDate>
#include <QDir>
#include <QVariant>
#include <QWizardPage>
#include <gpgme++/key.h>
namespace Kleo
{
namespace NewCertificateUi
{
class WizardPage : public QWizardPage
{
Q_OBJECT
protected:
explicit WizardPage(QWidget *parent = nullptr)
: QWizardPage(parent) {}
NewCertificateWizard *wizard() const
{
Q_ASSERT(static_cast<NewCertificateWizard *>(QWizardPage::wizard()) == qobject_cast<NewCertificateWizard *>(QWizardPage::wizard()));
return static_cast<NewCertificateWizard *>(QWizardPage::wizard());
}
void resetProtocol()
{
wizard()->resetProtocol();
}
void restartAtEnterDetailsPage()
{
wizard()->restartAtEnterDetailsPage();
}
QDir tmpDir() const;
protected:
#define FIELD(type, name) type name() const { return field( QStringLiteral(#name) ).value<type>(); }
FIELD(bool, pgp)
FIELD(bool, signingAllowed)
FIELD(bool, encryptionAllowed)
FIELD(bool, certificationAllowed)
FIELD(bool, authenticationAllowed)
FIELD(QString, name)
FIELD(QString, email)
FIELD(QString, dn)
FIELD(bool, protectedKey)
FIELD(GpgME::Subkey::PubkeyAlgo, keyType)
FIELD(int, keyStrength)
FIELD(QString, keyCurve)
FIELD(GpgME::Subkey::PubkeyAlgo, subkeyType)
FIELD(int, subkeyStrength)
FIELD(QString, subkeyCurve)
FIELD(QDate, expiryDate)
FIELD(QStringList, additionalUserIDs)
FIELD(QStringList, additionalEMailAddresses)
FIELD(QStringList, dnsNames)
FIELD(QStringList, uris)
FIELD(QString, url)
FIELD(QString, error)
FIELD(QString, result)
FIELD(QString, fingerprint)
#undef FIELD
};
} // namespace NewCertificateUi
} // namespace Kleo
/* -*- mode: c++; c-basic-offset:4 -*-
utils/metatypes_for_gpgmepp_key.h
This file is part of Kleopatra, the KDE keymanager
SPDX-FileCopyrightText: 2022 g10 Code GmbH
SPDX-FileContributor: Ingo Klöcker <dev@ingo-kloecker.de>
SPDX-License-Identifier: GPL-2.0-or-later
*/
#pragma once
#include <QMetaType>
#include <gpgme++/key.h>
Q_DECLARE_METATYPE(GpgME::Subkey::PubkeyAlgo)
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