35 |
#include "wptTypes.h" |
#include "wptTypes.h" |
36 |
#include "wptVersion.h" |
#include "wptVersion.h" |
37 |
#include "wptErrors.h" |
#include "wptErrors.h" |
38 |
|
#include "wptKeyEdit.h" |
39 |
|
|
40 |
static subclass_s siglist_proc; |
static subclass_s siglist_proc; |
41 |
|
|
59 |
{ |
{ |
60 |
int pos, npos, id; |
int pos, npos, id; |
61 |
int signo=0, uidno=0; |
int signo=0, uidno=0; |
62 |
gpgme_ctx_t ctx; |
GpgKeyEdit *ke; |
63 |
gpgme_editkey_t ek; |
gpgme_error_t err; |
|
gpgme_error_t rc; |
|
64 |
|
|
65 |
npos = pos = listview_get_curr_pos (lv); |
npos = pos = listview_get_curr_pos (lv); |
66 |
if (!is_sig (lv, -1)) |
if (!is_sig (lv, -1)) |
78 |
uidno++; |
uidno++; |
79 |
|
|
80 |
/* XXX: do not allow to delete the self signature */ |
/* XXX: do not allow to delete the self signature */ |
81 |
id = log_box(_("Key Manager"), MB_YESNO, |
id = log_box (_("Key Manager"), MB_YESNO, |
82 |
_("Are you really sure you want to delete this signature from\n" |
_("Are you really sure you want to delete this signature from\n" |
83 |
" \"%s\""), key->uid); |
" \"%s\""), key->uid); |
84 |
if (id == IDNO) |
if (id == IDNO) |
85 |
return 0; |
return 0; |
86 |
rc = gpgme_new (&ctx); |
|
87 |
if (rc) |
ke = new GpgKeyEdit (key->keyid); |
88 |
BUG (0); |
if (!ke) |
89 |
rc = gpgme_editkey_new (&ek); |
BUG (NULL); |
90 |
if (rc) |
err = ke->deleteUseridSignature (uidno, signo); |
91 |
BUG (0); |
if (err) |
92 |
gpgme_editkey_delsig_set (ek, uidno, signo); |
msg_box (dlg, gpgme_strerror (err), _("Key Manager"), MB_ERR); |
|
gpgme_set_edit_ctx (ctx, ek, GPGME_EDITKEY_DELSIG); |
|
|
rc = gpgme_op_editkey (ctx, key->keyid); |
|
|
if (rc) |
|
|
msg_box (dlg, gpgme_strerror (rc), _("Key Manager"), MB_ERR); |
|
93 |
else |
else |
94 |
listview_del_item (lv, pos); |
listview_del_item (lv, pos); |
95 |
gpgme_release (ctx); |
delete ke; |
|
gpgme_editkey_release (ek); |
|
96 |
key->update = 1; /*update*/ |
key->update = 1; /*update*/ |
97 |
return 0; |
return 0; |
98 |
} |
} |
184 |
SetDlgItemText (dlg, IDC_SIGPROPS_REV, _("Revoked")); |
SetDlgItemText (dlg, IDC_SIGPROPS_REV, _("Revoked")); |
185 |
SetDlgItemText (dlg, IDC_SIGPROPS_EXPIRED, _("Expired")); |
SetDlgItemText (dlg, IDC_SIGPROPS_EXPIRED, _("Expired")); |
186 |
SetForegroundWindow (dlg); |
SetForegroundWindow (dlg); |
187 |
center_window (dlg); |
center_window (dlg, NULL); |
188 |
return TRUE; |
return TRUE; |
189 |
|
|
190 |
case WM_COMMAND: |
case WM_COMMAND: |
345 |
} |
} |
346 |
} |
} |
347 |
SetForegroundWindow (dlg); |
SetForegroundWindow (dlg); |
348 |
center_window (dlg); |
center_window (dlg, NULL); |
349 |
return TRUE; |
return TRUE; |
350 |
|
|
351 |
case WM_DESTROY: |
case WM_DESTROY: |
399 |
keycache_set_reload (1); |
keycache_set_reload (1); |
400 |
return TRUE; |
return TRUE; |
401 |
} |
} |
402 |
return FALSE; |
return TRUE; |
403 |
} |
} |
404 |
listview_get_item_text (lv, idx, 1, inf, DIM (inf)-1); |
listview_get_item_text (lv, idx, 1, inf, DIM (inf)-1); |
405 |
if (strcmp (inf, "NOKEY")) |
if (strcmp (inf, "NOKEY")) |