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

Manually specify shortcuts for all checkboxes

Note: Qt automatically assigns shortcuts if one presses and holds the Alt
key, but for documentation purposes and better accessibility we explicitly
set shortcuts.

GnuPG-bug-id: 5544
parent aa59b873
......@@ -68,6 +68,14 @@ public:
setTitle(i18nc("@title", "Sign / Encrypt Files"));
auto vLay = new QVBoxLayout(this);
vLay->setContentsMargins(0, 0, 0, 0);
mWidget->setSignAsText(i18nc("@option:check on SignEncryptPage",
"&Sign as:"));
mWidget->setEncryptForMeText(i18nc("@option:check on SignEncryptPage",
"Encrypt for &me:"));
mWidget->setEncryptForOthersText(i18nc("@option:check on SignEncryptPage",
"Encrypt for &others:"));
mWidget->setEncryptWithPasswordText(i18nc("@option:check on SignEncryptPage",
"Encrypt with &password. Anyone you share the password with can read the data."));
vLay->addWidget(mWidget);
connect(mWidget, &SignEncryptWidget::operationChanged, this,
&SigEncPage::updateCommitButton);
......@@ -81,7 +89,8 @@ public:
mPlaceholderWidget = new QLabel(i18n("Please select an action."));
mOutLayout->addWidget(mPlaceholderWidget);
mUseOutputDirChk = new QCheckBox(i18n("Encrypt / Sign each file separately."));
mUseOutputDirChk = new QCheckBox(i18nc("@option:check on SignEncryptPage",
"Encrypt / Sign &each file separately."));
mUseOutputDirChk->setToolTip(i18nc("@info",
"Keep each file separate instead of creating an archive for all."));
......
......@@ -221,6 +221,26 @@ SignEncryptWidget::SignEncryptWidget(QWidget *parent, bool sigEncExclusive)
updateOp();
}
void SignEncryptWidget::setSignAsText(const QString &text)
{
mSigChk->setText(text);
}
void SignEncryptWidget::setEncryptForMeText(const QString &text)
{
mEncSelfChk->setText(text);
}
void SignEncryptWidget::setEncryptForOthersText(const QString &text)
{
mEncOtherChk->setText(text);
}
void SignEncryptWidget::setEncryptWithPasswordText(const QString& text)
{
mSymmetric->setText(text);
}
CertificateLineEdit *SignEncryptWidget::addRecipientWidget()
{
auto certSel = new CertificateLineEdit(mModel, this,
......
......@@ -31,6 +31,13 @@ public:
* done only either as sign or as encrypt */
explicit SignEncryptWidget(QWidget *parent = nullptr, bool cmsSigEncExclusive = false);
/** Overwrite default text with custom text, e.g. with a character marked
* as shortcut key. */
void setSignAsText(const QString &text);
void setEncryptForMeText(const QString &text);
void setEncryptForOthersText(const QString &text);
void setEncryptWithPasswordText(const QString &text);
/** Returns the list of recipients selected in the dialog
* or an empty list if encryption is disabled */
std::vector<GpgME::Key> recipients() const;
......
Markdown is supported
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