Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PIM
Kleopatra
Commits
5b170051
Commit
5b170051
authored
Oct 18, 2021
by
Ingo Klöcker
Browse files
Update the encryption checkboxes if symmetric only is en-/disabled
GnuPG-bug-id: 5661
parent
bfadfb38
Pipeline
#89589
passed with stage
in 14 minutes and 33 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/crypto/gui/signencryptwidget.cpp
View file @
5b170051
...
...
@@ -13,6 +13,7 @@
#include
"certificatelineedit.h"
#include
"fileoperationspreferences.h"
#include
"kleopatraapplication.h"
#include
"settings.h"
#include
"unknownrecipientwidget.h"
...
...
@@ -227,14 +228,9 @@ SignEncryptWidget::SignEncryptWidget(QWidget *parent, bool sigEncExclusive)
lay
->
addWidget
(
encBox
);
connect
(
KeyCache
::
instance
().
get
(),
&
Kleo
::
KeyCache
::
keysMayHaveChanged
,
this
,
[
this
]()
{
const
bool
haveSecretKeys
=
!
KeyCache
::
instance
()
->
secretKeys
().
empty
();
const
bool
havePublicKeys
=
!
KeyCache
::
instance
()
->
keys
().
empty
();
const
bool
symmetricOnly
=
FileOperationsPreferences
().
symmetricEncryptionOnly
();
mSigChk
->
setEnabled
(
haveSecretKeys
);
mEncSelfChk
->
setEnabled
(
haveSecretKeys
&&
!
symmetricOnly
);
mEncOtherChk
->
setEnabled
(
havePublicKeys
&&
!
symmetricOnly
);
});
this
,
&
SignEncryptWidget
::
updateCheckBoxes
);
connect
(
KleopatraApplication
::
instance
(),
&
KleopatraApplication
::
configurationChanged
,
this
,
&
SignEncryptWidget
::
updateCheckBoxes
);
loadKeys
();
onProtocolChanged
();
...
...
@@ -651,3 +647,18 @@ bool SignEncryptWidget::validate()
}
return
unresolvedRecipients
.
isEmpty
();
}
void
SignEncryptWidget
::
updateCheckBoxes
()
{
const
bool
haveSecretKeys
=
!
KeyCache
::
instance
()
->
secretKeys
().
empty
();
const
bool
havePublicKeys
=
!
KeyCache
::
instance
()
->
keys
().
empty
();
const
bool
symmetricOnly
=
FileOperationsPreferences
().
symmetricEncryptionOnly
();
mSigChk
->
setEnabled
(
haveSecretKeys
);
mEncSelfChk
->
setEnabled
(
haveSecretKeys
&&
!
symmetricOnly
);
mEncOtherChk
->
setEnabled
(
havePublicKeys
&&
!
symmetricOnly
);
if
(
symmetricOnly
)
{
mEncSelfChk
->
setChecked
(
false
);
mEncOtherChk
->
setChecked
(
false
);
mSymmetric
->
setChecked
(
true
);
}
}
src/crypto/gui/signencryptwidget.h
View file @
5b170051
...
...
@@ -117,6 +117,7 @@ Q_SIGNALS:
private:
CertificateLineEdit
*
addRecipientWidget
();
void
onProtocolChanged
();
void
updateCheckBoxes
();
private:
KeySelectionCombo
*
mSigSelect
=
nullptr
;
...
...
src/kleopatraapplication.cpp
View file @
5b170051
...
...
@@ -115,14 +115,24 @@ public:
private:
void
connectConfigureDialog
()
{
if
(
configureDialog
&&
q
->
mainWindow
())
{
connect
(
configureDialog
,
SIGNAL
(
configCommitted
()),
q
->
mainWindow
(),
SLOT
(
slotConfigCommitted
()));
if
(
configureDialog
)
{
if
(
q
->
mainWindow
())
{
connect
(
configureDialog
,
SIGNAL
(
configCommitted
()),
q
->
mainWindow
(),
SLOT
(
slotConfigCommitted
()));
}
connect
(
configureDialog
,
&
ConfigureDialog
::
configCommitted
,
q
,
&
KleopatraApplication
::
configurationChanged
);
}
}
void
disconnectConfigureDialog
()
{
if
(
configureDialog
&&
q
->
mainWindow
())
{
disconnect
(
configureDialog
,
SIGNAL
(
configCommitted
()),
q
->
mainWindow
(),
SLOT
(
slotConfigCommitted
()));
if
(
configureDialog
)
{
if
(
q
->
mainWindow
())
{
disconnect
(
configureDialog
,
SIGNAL
(
configCommitted
()),
q
->
mainWindow
(),
SLOT
(
slotConfigCommitted
()));
}
disconnect
(
configureDialog
,
&
ConfigureDialog
::
configCommitted
,
q
,
&
KleopatraApplication
::
configurationChanged
);
}
}
...
...
src/kleopatraapplication.h
View file @
5b170051
...
...
@@ -95,6 +95,8 @@ Q_SIGNALS:
* correct exitValue */
void
setExitValue
(
int
value
);
void
configurationChanged
();
private:
class
Private
;
kdtools
::
pimpl_ptr
<
Private
>
d
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment