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

Create the widgets in the correct order

Create the widgets in the same order as they appear on screen. This
fixes the wrong tab order of the user id table and a few S/MIME-related
labels.

GnuPG-bug-id: 5843
parent 01301103
......@@ -172,6 +172,47 @@ private:
{
gridLayout_2 = new QGridLayout(parent);
gridLayout_2->setContentsMargins(0, 0, 0, 0);
int row = 0;
label = new QLabel(i18n("You can use this certificate to secure communication with the following email addresses:"), parent);
label->setWordWrap(true);
gridLayout_2->addWidget(label, row, 0, 1, 3);
row++;
smimeOwnerLbl = new QLabel(i18n("Owner:"), parent);
gridLayout_2->addWidget(smimeOwnerLbl, row, 0, 1, 1);
smimeOwner = new QLabel(parent);
smimeOwner->setWordWrap(true);
smimeOwner->setTextInteractionFlags(Qt::TextBrowserInteraction);
gridLayout_2->addWidget(smimeOwner, row, 1, 1, 2);
row++;
smimeRelatedAddresses = new QLabel(i18n("Related addresses:"), parent);
QFont font;
font.setBold(true);
font.setWeight(75);
smimeRelatedAddresses->setFont(font);
gridLayout_2->addWidget(smimeRelatedAddresses, row, 0, 1, 1);
row++;
userIDTable = new QTreeWidget(parent);
QTreeWidgetItem *__qtreewidgetitem = new QTreeWidgetItem();
__qtreewidgetitem->setText(0, QString::fromUtf8("1"));
userIDTable->setHeaderItem(__qtreewidgetitem);
userIDTable->setEditTriggers(QAbstractItemView::NoEditTriggers);
userIDTable->setSelectionMode(QAbstractItemView::SingleSelection);
userIDTable->setRootIsDecorated(false);
userIDTable->setUniformRowHeights(true);
userIDTable->setAllColumnsShowFocus(true);
gridLayout_2->addWidget(userIDTable, row, 0, 1, 3);
row++;
hboxLayout_1 = new QHBoxLayout();
addUserIDBtn = new QPushButton(i18nc("@action:button", "Add User ID"), parent);
......@@ -204,179 +245,146 @@ private:
hboxLayout_1->addWidget(certifyBtn);
gridLayout_2->addLayout(hboxLayout_1, 4, 0, 1, 3);
gridLayout_2->addLayout(hboxLayout_1, row, 0, 1, 3);
row++;
groupBox = new QGroupBox(i18n("Certificate Details"), parent);
groupBox->setFlat(false);
gridLayout = new QGridLayout(groupBox);
int row = 0;
validFromLbl = new QLabel(i18n("Valid from:"), groupBox);
gridLayout->addWidget(validFromLbl, row, 0, 1, 1);
validFrom = new QLabel(groupBox);
validFrom->setTextInteractionFlags(Qt::TextSelectableByMouse);
gridLayout->addWidget(validFrom, row, 1, 1, 1);
horizontalSpacer_3 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
gridLayout->addItem(horizontalSpacer_3, row, 2, 1, 1);
row++;
expiresLbl = new QLabel(i18n("Expires:"), groupBox);
gridLayout->addWidget(expiresLbl, row, 0, 1, 1);
horizontalLayout_3 = new QHBoxLayout();
expires = new QLabel(groupBox);
expires->setTextInteractionFlags(Qt::TextSelectableByMouse);
horizontalLayout_3->addWidget(expires);
changeExpirationBtn = new QPushButton(groupBox);
changeExpirationBtn->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
changeExpirationBtn->setIcon(QIcon::fromTheme(QStringLiteral("editor")));
changeExpirationBtn->setToolTip(i18nc("@info:tooltip", "Change the expiration date"));
{
gridLayout = new QGridLayout(groupBox);
int boxRow = 0;
validFromLbl = new QLabel(i18n("Valid from:"), groupBox);
horizontalLayout_3->addWidget(changeExpirationBtn);
gridLayout->addWidget(validFromLbl, boxRow, 0, 1, 1);
gridLayout->addLayout(horizontalLayout_3, row, 1, 1, 1);
row++;
validFrom = new QLabel(groupBox);
validFrom->setTextInteractionFlags(Qt::TextSelectableByMouse);
typeLbl = new QLabel(i18n("Type:"), groupBox);
gridLayout->addWidget(validFrom, boxRow, 1, 1, 1);
gridLayout->addWidget(typeLbl, row, 0, 1, 1);
horizontalSpacer_3 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
type = new QLabel(groupBox);
type->setTextInteractionFlags(Qt::TextSelectableByMouse);
gridLayout->addItem(horizontalSpacer_3, boxRow, 2, 1, 1);
gridLayout->addWidget(type, row, 1, 1, 1);
row++;
boxRow++;
expiresLbl = new QLabel(i18n("Expires:"), groupBox);
fingerprintLbl = new QLabel(i18n("Fingerprint:"), groupBox);
gridLayout->addWidget(expiresLbl, boxRow, 0, 1, 1);
gridLayout->addWidget(fingerprintLbl, row, 0, 1, 1);
horizontalLayout_3 = new QHBoxLayout();
expires = new QLabel(groupBox);
expires->setTextInteractionFlags(Qt::TextSelectableByMouse);
{
auto hbox = new QHBoxLayout;
fingerprint = new QLabel{groupBox};
fingerprint->setTextInteractionFlags(Qt::TextSelectableByMouse);
hbox->addWidget(fingerprint);
copyFingerprintBtn = new QPushButton{groupBox};
copyFingerprintBtn->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
copyFingerprintBtn->setIcon(QIcon::fromTheme(QStringLiteral("edit-copy")));
copyFingerprintBtn->setToolTip(i18nc("@info:tooltip", "Copy the fingerprint to the clipboard"));
copyFingerprintBtn->setVisible(QGuiApplication::clipboard());
hbox->addWidget(copyFingerprintBtn);
hbox->addStretch();
gridLayout->addLayout(hbox, row, 1, 1, 2);
}
row++;
horizontalLayout_3->addWidget(expires);
publishingLbl = new QLabel(i18n("Publishing:"), groupBox);
changeExpirationBtn = new QPushButton(groupBox);
changeExpirationBtn->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
changeExpirationBtn->setIcon(QIcon::fromTheme(QStringLiteral("editor")));
changeExpirationBtn->setToolTip(i18nc("@info:tooltip", "Change the expiration date"));
gridLayout->addWidget(publishingLbl, row, 0, 1, 1);
horizontalLayout_3->addWidget(changeExpirationBtn);
publishing = new QPushButton(i18nc("@action:button", "Publish Certificate"), groupBox);
gridLayout->addLayout(horizontalLayout_3, boxRow, 1, 1, 1);
gridLayout->addWidget(publishing, row, 1, 1, 1);
row++;
boxRow++;
typeLbl = new QLabel(i18n("Type:"), groupBox);
smimeIssuerLbl = new QLabel(i18n("Issuer:"), groupBox);
gridLayout->addWidget(typeLbl, boxRow, 0, 1, 1);
gridLayout->addWidget(smimeIssuerLbl, row, 0, 1, 1);
type = new QLabel(groupBox);
type->setTextInteractionFlags(Qt::TextSelectableByMouse);
smimeIssuer = new QLabel(groupBox);
smimeIssuer->setWordWrap(true);
smimeIssuer->setTextInteractionFlags(Qt::TextBrowserInteraction);
gridLayout->addWidget(type, boxRow, 1, 1, 1);
gridLayout->addWidget(smimeIssuer, row, 1, 1, 2);
row++;
boxRow++;
fingerprintLbl = new QLabel(i18n("Fingerprint:"), groupBox);
compliance = new QLabel(i18n("Compliance:"), groupBox);
compliance->setWordWrap(true);
compliance->setTextInteractionFlags(Qt::TextBrowserInteraction);
gridLayout->addWidget(fingerprintLbl, boxRow, 0, 1, 1);
gridLayout->addWidget(compliance, row, 0, 1, 1);
{
auto hbox = new QHBoxLayout;
fingerprint = new QLabel{groupBox};
fingerprint->setTextInteractionFlags(Qt::TextSelectableByMouse);
hbox->addWidget(fingerprint);
copyFingerprintBtn = new QPushButton{groupBox};
copyFingerprintBtn->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
copyFingerprintBtn->setIcon(QIcon::fromTheme(QStringLiteral("edit-copy")));
copyFingerprintBtn->setToolTip(i18nc("@info:tooltip", "Copy the fingerprint to the clipboard"));
copyFingerprintBtn->setVisible(QGuiApplication::clipboard());
hbox->addWidget(copyFingerprintBtn);
hbox->addStretch();
complianceLbl = new QLabel(groupBox);
complianceLbl->setWordWrap(true);
complianceLbl->setTextInteractionFlags(Qt::TextBrowserInteraction);
gridLayout->addLayout(hbox, boxRow, 1, 1, 2);
}
gridLayout->addWidget(complianceLbl, row, 1, 1, 2);
row++;
boxRow++;
publishingLbl = new QLabel(i18n("Publishing:"), groupBox);
trustedIntroducerLbl = new QLabel(i18n("Trusted introducer for:"), groupBox);
trustedIntroducerLbl->setToolTip(i18n("See certifications for details."));
trustedIntroducerLbl->setTextInteractionFlags(Qt::TextBrowserInteraction);
gridLayout->addWidget(publishingLbl, boxRow, 0, 1, 1);
gridLayout->addWidget(trustedIntroducerLbl, row, 0, 1, 1);
publishing = new QPushButton(i18nc("@action:button", "Publish Certificate"), groupBox);
trustedIntroducer = new QLabel(groupBox);
trustedIntroducer->setWordWrap(true);
trustedIntroducer->setToolTip(i18n("See certifications for details."));
trustedIntroducer->setTextInteractionFlags(Qt::TextBrowserInteraction);
gridLayout->addWidget(publishing, boxRow, 1, 1, 1);
gridLayout->addWidget(trustedIntroducer, row, 1, 1, 2);
row++;
boxRow++;
smimeIssuerLbl = new QLabel(i18n("Issuer:"), groupBox);
horizontalLayout = new QHBoxLayout();
moreDetailsBtn = new QPushButton(i18nc("@action:button", "More Details..."), groupBox);
gridLayout->addWidget(smimeIssuerLbl, boxRow, 0, 1, 1);
horizontalLayout->addWidget(moreDetailsBtn);
smimeIssuer = new QLabel(groupBox);
smimeIssuer->setWordWrap(true);
smimeIssuer->setTextInteractionFlags(Qt::TextBrowserInteraction);
exportBtn = new QPushButton(i18nc("@action:button", "Export..."), groupBox);
gridLayout->addWidget(smimeIssuer, boxRow, 1, 1, 2);
horizontalLayout->addWidget(exportBtn);
boxRow++;
compliance = new QLabel(i18n("Compliance:"), groupBox);
compliance->setWordWrap(true);
compliance->setTextInteractionFlags(Qt::TextBrowserInteraction);
webOfTrustBtn = new QPushButton(i18nc("@action:button", "Certifications..."), groupBox);
gridLayout->addWidget(compliance, boxRow, 0, 1, 1);
horizontalLayout->addWidget(webOfTrustBtn);
complianceLbl = new QLabel(groupBox);
complianceLbl->setWordWrap(true);
complianceLbl->setTextInteractionFlags(Qt::TextBrowserInteraction);
horizontalSpacer = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
gridLayout->addWidget(complianceLbl, boxRow, 1, 1, 2);
horizontalLayout->addItem(horizontalSpacer);
boxRow++;
trustedIntroducerLbl = new QLabel(i18n("Trusted introducer for:"), groupBox);
trustedIntroducerLbl->setToolTip(i18n("See certifications for details."));
trustedIntroducerLbl->setTextInteractionFlags(Qt::TextBrowserInteraction);
gridLayout->addLayout(horizontalLayout, row, 0, 1, 3);
gridLayout->addWidget(trustedIntroducerLbl, boxRow, 0, 1, 1);
gridLayout_2->addWidget(groupBox, 6, 0, 1, 3);
trustedIntroducer = new QLabel(groupBox);
trustedIntroducer->setWordWrap(true);
trustedIntroducer->setToolTip(i18n("See certifications for details."));
trustedIntroducer->setTextInteractionFlags(Qt::TextBrowserInteraction);
userIDTable = new QTreeWidget(parent);
QTreeWidgetItem *__qtreewidgetitem = new QTreeWidgetItem();
__qtreewidgetitem->setText(0, QString::fromUtf8("1"));
userIDTable->setHeaderItem(__qtreewidgetitem);
userIDTable->setEditTriggers(QAbstractItemView::NoEditTriggers);
userIDTable->setSelectionMode(QAbstractItemView::SingleSelection);
userIDTable->setRootIsDecorated(false);
userIDTable->setUniformRowHeights(true);
userIDTable->setAllColumnsShowFocus(true);
gridLayout->addWidget(trustedIntroducer, boxRow, 1, 1, 2);
gridLayout_2->addWidget(userIDTable, 3, 0, 1, 3);
boxRow++;
horizontalLayout = new QHBoxLayout();
moreDetailsBtn = new QPushButton(i18nc("@action:button", "More Details..."), groupBox);
label = new QLabel(i18n("You can use this certificate to secure communication with the following email addresses:"), parent);
label->setWordWrap(true);
horizontalLayout->addWidget(moreDetailsBtn);
gridLayout_2->addWidget(label, 0, 0, 1, 3);
exportBtn = new QPushButton(i18nc("@action:button", "Export..."), groupBox);
smimeOwnerLbl = new QLabel(i18n("Owner:"), parent);
horizontalLayout->addWidget(exportBtn);
gridLayout_2->addWidget(smimeOwnerLbl, 1, 0, 1, 1);
webOfTrustBtn = new QPushButton(i18nc("@action:button", "Certifications..."), groupBox);
smimeRelatedAddresses = new QLabel(i18n("Related addresses:"), parent);
QFont font;
font.setBold(true);
font.setWeight(75);
smimeRelatedAddresses->setFont(font);
horizontalLayout->addWidget(webOfTrustBtn);
gridLayout_2->addWidget(smimeRelatedAddresses, 2, 0, 1, 1);
horizontalSpacer = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
smimeOwner = new QLabel(parent);
smimeOwner->setWordWrap(true);
smimeOwner->setTextInteractionFlags(Qt::TextBrowserInteraction);
horizontalLayout->addItem(horizontalSpacer);
gridLayout_2->addWidget(smimeOwner, 1, 1, 1, 2);
gridLayout->addLayout(horizontalLayout, boxRow, 0, 1, 3);
}
gridLayout_2->addWidget(groupBox, row, 0, 1, 3);
}
} ui;
};
......
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