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

Reset protocol when going back to "Choose Protocol" page

Resetting the protocol unchecks the button of the current protocol. This
allows the user to switch between the protocols without immediately going
to the "Enter Details" page again.

GnuPG-bug-id: 5832
parent dd1afa8b
......@@ -350,6 +350,11 @@ protected:
}
}
void resetProtocol()
{
wizard()->resetProtocol();
}
QDir tmpDir() const;
protected Q_SLOTS:
......@@ -824,6 +829,8 @@ public:
}
void cleanupPage() override {
saveValues();
// reset protocol when navigating back to "Choose Protocol" page
resetProtocol();
}
private:
......@@ -1253,6 +1260,7 @@ public:
}
private:
GpgME::Protocol initialProtocol = GpgME::UnknownProtocol;
QTemporaryDir tmp;
struct Ui {
ChooseProtocolPage chooseProtocolPage;
......@@ -1295,6 +1303,7 @@ NewCertificateWizard::~NewCertificateWizard() {}
void NewCertificateWizard::setProtocol(Protocol proto)
{
d->initialProtocol = proto;
d->ui.chooseProtocolPage.setProtocol(proto);
setStartId(proto == UnknownProtocol ? ChooseProtocolPageId : EnterDetailsPageId);
}
......@@ -1304,6 +1313,11 @@ Protocol NewCertificateWizard::protocol() const
return d->ui.chooseProtocolPage.protocol();
}
void NewCertificateWizard::resetProtocol()
{
d->ui.chooseProtocolPage.setProtocol(d->initialProtocol);
}
static QString pgpLabel(const QString &attr)
{
if (attr == QLatin1String("NAME")) {
......
......@@ -43,6 +43,9 @@ public:
NumPages
};
private:
void resetProtocol();
private:
class Private;
kdtools::pimpl_ptr<Private> d;
......
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