Commit 22719ea9 authored by Sean Engelhardt's avatar Sean Engelhardt Committed by Andre Heinecke

Fix preselection of sign/encrypt action for files

Previously the actions asked for by GpgEX were not
preslected in the ui server.

Maniphest Tasks: T2132

Commit mesage amended by Andre Heinecke <aheinecke@intevation.de>
parent 773e045f
......@@ -239,45 +239,42 @@ void SignEncryptFilesController::Private::updateWizardMode()
const unsigned int signOp = (operation & SignMask);
const unsigned int encrOp = (operation & EncryptMask);
const unsigned int archOp = (operation & ArchiveMask);
switch (signOp) {
case SignForced:
case SignDisallowed:
wizard->setSigningPreset(signOp == SignForced);
if (signOp == SignDisallowed) {
wizard->setSigningUserMutable(false);
break;
default:
assert(!"Should not happen");
case SignAllowed:
wizard->setSigningPreset(encrOp == EncryptDisallowed);
wizard->setSigningPreset(false);
} else {
wizard->setSigningUserMutable(true);
break;
wizard->setSigningPreset(false);
if (signOp == SignForced) {
wizard->setSigningPreset(true);
}
}
switch (encrOp) {
case EncryptForced:
case EncryptDisallowed:
wizard->setEncryptionPreset(encrOp == EncryptForced);
if (encrOp == EncryptDisallowed) {
wizard->setEncryptionPreset(false);
wizard->setEncryptionUserMutable(false);
break;
default:
assert(!"Should not happen");
case EncryptAllowed:
wizard->setEncryptionPreset(true);
} else {
wizard->setEncryptionUserMutable(true);
break;
wizard->setEncryptionPreset(false);
if (encrOp == EncryptForced) {
wizard->setEncryptionPreset(true);
}
}
switch (archOp) {
case ArchiveForced:
case ArchiveDisallowed:
wizard->setCreateArchivePreset(archOp == ArchiveForced);
if (archOp == ArchiveDisallowed) {
wizard->setCreateArchivePreset(false);
wizard->setCreateArchiveUserMutable(false);
break;
default:
assert(!"Shouldn't happen");
case ArchiveAllowed:
} else {
wizard->setCreateArchiveUserMutable(true);
wizard->setCreateArchivePreset(false);
wizard->setEncryptionUserMutable(true);
break;
};
if (archOp == ArchiveForced) {
wizard->setCreateArchivePreset(true);
}
}
}
unsigned int SignEncryptFilesController::operationMode() const
......
......@@ -64,7 +64,7 @@ protected:
private:
virtual unsigned int operation() const
{
return SignAllowed | EncryptAllowed;
return SignForced | EncryptForced;
}
private:
int doStart() Q_DECL_OVERRIDE;
......
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