Changeset View
Changeset View
Standalone View
Standalone View
src/crypto/signencryptfilescontroller.cpp
Context not available. | |||||
143 | { | 143 | { | ||
---|---|---|---|---|---|
144 | const bool signDisallowed = (op & SignMask) == SignDisallowed; | 144 | const bool signDisallowed = (op & SignMask) == SignDisallowed; | ||
145 | const bool encryptDisallowed = (op & EncryptMask) == EncryptDisallowed; | 145 | const bool encryptDisallowed = (op & EncryptMask) == EncryptDisallowed; | ||
146 | const bool archiveForced = (op & ArchiveMask) == ArchiveForced; | 146 | const bool archiveSelected = (op & ArchiveMask) == ArchiveSelected; | ||
147 | 147 | | |||
148 | kleo_assert(!signDisallowed || !encryptDisallowed); | 148 | kleo_assert(!signDisallowed || !encryptDisallowed); | ||
149 | 149 | | |||
150 | if (!signDisallowed && encryptDisallowed) { | 150 | if (!signDisallowed && encryptDisallowed) { | ||
151 | if (archiveForced) { | 151 | if (archiveSelected) { | ||
152 | return i18n("Archive and Sign Files"); | 152 | return i18n("Archive and Sign Files"); | ||
153 | } else { | 153 | } else { | ||
154 | return i18n("Sign Files"); | 154 | return i18n("Sign Files"); | ||
Context not available. | |||||
156 | } | 156 | } | ||
157 | 157 | | |||
158 | if (signDisallowed && !encryptDisallowed) { | 158 | if (signDisallowed && !encryptDisallowed) { | ||
159 | if (archiveForced) { | 159 | if (archiveSelected) { | ||
160 | return i18n("Archive and Encrypt Files"); | 160 | return i18n("Archive and Encrypt Files"); | ||
161 | } else { | 161 | } else { | ||
162 | return i18n("Encrypt Files"); | 162 | return i18n("Encrypt Files"); | ||
163 | } | 163 | } | ||
164 | } | 164 | } | ||
165 | 165 | | |||
166 | if (archiveForced) { | 166 | if (archiveSelected) { | ||
167 | return i18n("Archive and Sign/Encrypt Files"); | 167 | return i18n("Archive and Sign/Encrypt Files"); | ||
168 | } else { | 168 | } else { | ||
169 | return i18n("Sign/Encrypt Files"); | 169 | return i18n("Sign/Encrypt Files"); | ||
Context not available. | |||||
210 | { | 210 | { | ||
211 | kleo_assert((op & SignMask) == SignDisallowed || | 211 | kleo_assert((op & SignMask) == SignDisallowed || | ||
212 | (op & SignMask) == SignAllowed || | 212 | (op & SignMask) == SignAllowed || | ||
213 | (op & SignMask) == SignForced); | 213 | (op & SignMask) == SignSelected); | ||
214 | kleo_assert((op & EncryptMask) == EncryptDisallowed || | 214 | kleo_assert((op & EncryptMask) == EncryptDisallowed || | ||
215 | (op & EncryptMask) == EncryptAllowed || | 215 | (op & EncryptMask) == EncryptAllowed || | ||
216 | (op & EncryptMask) == EncryptForced); | 216 | (op & EncryptMask) == EncryptSelected); | ||
217 | kleo_assert((op & ArchiveMask) == ArchiveDisallowed || | 217 | kleo_assert((op & ArchiveMask) == ArchiveDisallowed || | ||
218 | (op & ArchiveMask) == ArchiveAllowed || | 218 | (op & ArchiveMask) == ArchiveAllowed || | ||
219 | (op & ArchiveMask) == ArchiveForced); | 219 | (op & ArchiveMask) == ArchiveSelected); | ||
220 | kleo_assert((op & ~(SignMask | EncryptMask | ArchiveMask)) == 0); | 220 | kleo_assert((op & ~(SignMask | EncryptMask | ArchiveMask)) == 0); | ||
221 | } | 221 | } | ||
222 | 222 | | |||
Context not available. | |||||
224 | { | 224 | { | ||
225 | Private::assertValidOperation(mode); | 225 | Private::assertValidOperation(mode); | ||
226 | if (contains_dir(d->files)) { | 226 | if (contains_dir(d->files)) { | ||
227 | mode = (mode & ~ArchiveMask) | ArchiveForced; | 227 | mode = (mode & ~ArchiveMask) | ArchiveSelected; | ||
228 | } | 228 | } | ||
229 | d->operation = mode; | 229 | d->operation = mode; | ||
230 | d->updateWizardMode(); | 230 | d->updateWizardMode(); | ||
Context not available. | |||||
247 | wizard->setSigningUserMutable(true); | 247 | wizard->setSigningUserMutable(true); | ||
248 | wizard->setSigningPreset(false); | 248 | wizard->setSigningPreset(false); | ||
249 | 249 | | |||
250 | if (signOp == SignForced) { | 250 | if (signOp == SignSelected) { | ||
251 | wizard->setSigningPreset(true); | 251 | wizard->setSigningPreset(true); | ||
252 | } | 252 | } | ||
253 | } | 253 | } | ||
Context not available. | |||||
259 | wizard->setEncryptionUserMutable(true); | 259 | wizard->setEncryptionUserMutable(true); | ||
260 | wizard->setEncryptionPreset(false); | 260 | wizard->setEncryptionPreset(false); | ||
261 | 261 | | |||
262 | if (encrOp == EncryptForced) { | 262 | if (encrOp == EncryptSelected) { | ||
263 | wizard->setEncryptionPreset(true); | 263 | wizard->setEncryptionPreset(true); | ||
264 | } | 264 | } | ||
265 | } | 265 | } | ||
Context not available. | |||||
271 | wizard->setCreateArchiveUserMutable(true); | 271 | wizard->setCreateArchiveUserMutable(true); | ||
272 | wizard->setCreateArchivePreset(false); | 272 | wizard->setCreateArchivePreset(false); | ||
273 | 273 | | |||
274 | if (archOp == ArchiveForced) { | 274 | if (archOp == ArchiveSelected) { | ||
275 | wizard->setCreateArchivePreset(true); | 275 | wizard->setCreateArchivePreset(true); | ||
276 | } | 276 | } | ||
277 | } | 277 | } | ||
Context not available. | |||||
287 | kleo_assert(!files.empty()); | 287 | kleo_assert(!files.empty()); | ||
288 | d->files = files; | 288 | d->files = files; | ||
289 | if (contains_dir(files)) { | 289 | if (contains_dir(files)) { | ||
290 | setOperationMode((operationMode() & ~ArchiveMask) | ArchiveForced); | 290 | setOperationMode((operationMode() & ~ArchiveMask) | ArchiveSelected); | ||
291 | } | 291 | } | ||
292 | d->ensureWizardCreated(); | 292 | d->ensureWizardCreated(); | ||
293 | d->wizard->setFiles(files); | 293 | d->wizard->setFiles(files); | ||
Context not available. |