38 |
#include "wptVersion.h" |
#include "wptVersion.h" |
39 |
#include "wptKeyEdit.h" |
#include "wptKeyEdit.h" |
40 |
|
|
|
static void |
|
|
do_change_ownertrust (winpt_key_t k, const char *s) |
|
|
{ |
|
|
char ot[64]; |
|
|
|
|
|
if( strstr( s, "ultimate" ) ) { |
|
|
listview_get_item_text (k->callback.ctl, k->callback.idx, 5, ot, DIM (ot)-1); |
|
|
strcpy (ot, "Ultimate"); |
|
|
listview_add_sub_item (k->callback.ctl, k->callback.idx, 5, ot); |
|
|
/* fixme: If we switch back from Ultimate to a lower level */ |
|
|
} |
|
|
} |
|
|
|
|
41 |
|
|
42 |
/* Check that the key is not expired or revoked. */ |
/* Check that the key is not expired or revoked. */ |
43 |
static int |
static int |
55 |
static const char* |
static const char* |
56 |
ownertrust_to_string (int val) |
ownertrust_to_string (int val) |
57 |
{ |
{ |
58 |
const char * inf; |
const char *inf; |
59 |
int id = val; |
int id = val; |
60 |
|
|
61 |
switch (id) { |
switch (id) { |
62 |
case 1: inf = _("Don't know"); break; |
case 1: inf = _("Don't know"); break; |
63 |
case 2: inf = _("I do NOT trust"); break; |
case 2: inf = _("I do NOT trust"); break; |
146 |
val = key->revoked; |
val = key->revoked; |
147 |
if (val) |
if (val) |
148 |
return _("Revoked"); |
return _("Revoked"); |
149 |
|
val = key->disabled; |
150 |
|
if (val) |
151 |
|
return _("Disabled"); |
152 |
return get_key_trust2 (NULL, key->uids->validity, 0, 0); |
return get_key_trust2 (NULL, key->uids->validity, 0, 0); |
153 |
} |
} |
154 |
|
|
341 |
} |
} |
342 |
|
|
343 |
inf = ownertrust_to_string (k->callback.new_val); |
inf = ownertrust_to_string (k->callback.new_val); |
|
do_change_ownertrust (k, inf); |
|
344 |
SetDlgItemText (dlg, IDC_KEYPROPS_OT, inf); |
SetDlgItemText (dlg, IDC_KEYPROPS_OT, inf); |
345 |
msg_box (dlg, _("Ownertrust successfully changed."), |
msg_box (dlg, _("Ownertrust successfully changed."), |
346 |
_("GnuPG Status"), MB_OK); |
_("GnuPG Status"), MB_OK); |
347 |
|
|
348 |
/* reload only the keylist */ |
/* XXX: modified ownertrust values can effect the entire |
349 |
rcs.kr_reload = 1; rcs.kr_update = 1; |
WoT so we reload the cache. But this is very slow. */ |
350 |
rcs.tr_update = 0; |
memset (&rcs, 0, sizeof (rcs)); |
351 |
|
rcs.kr_reload = 1; rcs.kr_update = 1; /* reload only keylist */ |
352 |
DialogBoxParam (glob_hinst, (LPCSTR)IDD_WINPT_KEYCACHE, dlg, |
DialogBoxParam (glob_hinst, (LPCSTR)IDD_WINPT_KEYCACHE, dlg, |
353 |
keycache_dlg_proc, (LPARAM)&rcs); |
keycache_dlg_proc, (LPARAM)&rcs); |
354 |
return TRUE; |
return TRUE; |
359 |
|
|
360 |
case IDC_KEYPROPS_REVOKERS: |
case IDC_KEYPROPS_REVOKERS: |
361 |
dialog_box_param (glob_hinst, (LPCTSTR)IDD_WINPT_KEYREVOKERS, dlg, |
dialog_box_param (glob_hinst, (LPCTSTR)IDD_WINPT_KEYREVOKERS, dlg, |
362 |
key_revokers_dlg_proc, (LPARAM)key, _("Key Revokers"), |
key_revokers_dlg_proc, (LPARAM)key, |
363 |
IDS_WINPT_KEY_REVOKERS); |
_("Key Revokers"), IDS_WINPT_KEY_REVOKERS); |
364 |
break; |
break; |
365 |
} |
} |
366 |
} |
} |