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

Create UI of Choose Protocol page in code

GnuPG-bug-id: 5969
parent 3e64320a
......@@ -325,7 +325,6 @@ ki18n_wrap_ui(_kleopatra_SRCS
dialogs/trustchainwidget.ui
dialogs/subkeyswidget.ui
newcertificatewizard/listwidget.ui
newcertificatewizard/chooseprotocolpage.ui
newcertificatewizard/enterdetailspage.ui
newcertificatewizard/keycreationpage.ui
newcertificatewizard/resultpage.ui
......
<ui version="4.0" >
<class>Kleo::NewCertificateUi::ChooseProtocolPage</class>
<widget class="QWizardPage" name="Kleo::NewCertificateUi::ChooseProtocolPage" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>692</width>
<height>294</height>
</rect>
</property>
<property name="title" >
<string comment="@title" >Choose Type of Key Pair</string>
</property>
<property name="subTitle" >
<string>Please choose which type of key pair you want to create.</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout" >
<property name="sizeConstraint" >
<enum>QLayout::SetMinimumSize</enum>
</property>
<item>
<widget class="QCommandLinkButton" name="pgpCLB" >
<property name="text" >
<string>Create a personal OpenPGP key pair</string>
</property>
<property name="checkable" >
<bool>true</bool>
</property>
<property name="autoExclusive" >
<bool>true</bool>
</property>
<property name="description" >
<string>OpenPGP key pairs are certified by confirming the fingerprint of the public key.</string>
</property>
</widget>
</item>
<item>
<widget class="QCommandLinkButton" name="x509CLB" >
<property name="text" >
<string>Create a personal X.509 key pair and certification request</string>
</property>
<property name="checkable" >
<bool>true</bool>
</property>
<property name="autoExclusive" >
<bool>true</bool>
</property>
<property name="description" >
<string>X.509 key pairs are certified by a certification authority (CA). The generated request needs to be sent to a CA to finalize creation.</string>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections/>
<slots>
<slot>slotPgpClicked()</slot>
<slot>slotX509Clicked()</slot>
</slots>
</ui>
......@@ -16,7 +16,6 @@
#include <settings.h>
#include "ui_chooseprotocolpage.h"
#include "ui_enterdetailspage.h"
#include "ui_keycreationpage.h"
#include "ui_resultpage.h"
......@@ -62,6 +61,7 @@
#include <KMessageBox>
#include <QIcon>
#include <QCommandLinkButton>
#include <QRegularExpressionValidator>
#include <QLineEdit>
#include <QMetaProperty>
......@@ -793,15 +793,45 @@ private:
class ChooseProtocolPage : public WizardPage
{
Q_OBJECT
struct {
QCommandLinkButton *pgpCLB;
QCommandLinkButton *x509CLB;
void setupUi(QWizardPage *parent)
{
parent->setTitle(i18nc("@title", "Choose Type of Key Pair"));
parent->setSubTitle(i18n("Please choose which type of key pair you want to create."));
auto mainLayout = new QVBoxLayout{parent};
pgpCLB = new QCommandLinkButton{parent};
pgpCLB->setText(i18n("Create a personal OpenPGP key pair"));
pgpCLB->setDescription(i18n("OpenPGP key pairs are certified by confirming the fingerprint of the public key."));
pgpCLB->setAccessibleDescription(pgpCLB->description());
pgpCLB->setCheckable(true);
pgpCLB->setAutoExclusive(true);
mainLayout->addWidget(pgpCLB);
x509CLB = new QCommandLinkButton{parent};
x509CLB->setText(i18n("Create a personal X.509 key pair and certification request"));
x509CLB->setDescription(i18n("X.509 key pairs are certified by a certification authority (CA). The generated request needs to be sent to a CA to finalize creation."));
x509CLB->setAccessibleDescription(x509CLB->description());
x509CLB->setCheckable(true);
x509CLB->setAutoExclusive(true);
mainLayout->addWidget(x509CLB);
}
} ui;
public:
explicit ChooseProtocolPage(QWidget *p = nullptr)
: WizardPage(p),
initialized(false),
ui()
: WizardPage{p}
, ui{}
{
setObjectName(QStringLiteral("Kleo__NewCertificateUi__ChooseProtocolPage"));
ui.setupUi(this);
ui.pgpCLB->setAccessibleDescription(ui.pgpCLB->description());
ui.x509CLB->setAccessibleDescription(ui.x509CLB->description());
registerField(QStringLiteral("pgp"), ui.pgpCLB);
}
......@@ -839,8 +869,7 @@ public:
}
private:
bool initialized : 1;
Ui_ChooseProtocolPage ui;
bool initialized = false;
};
struct Line {
......
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