18 |
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA |
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA |
19 |
*/ |
*/ |
20 |
|
|
|
#ifdef HAVE_CONFIG_H |
|
|
#include <config.h> |
|
|
#endif |
|
|
|
|
|
#include <windows.h> |
|
21 |
#include <windows.h> |
#include <windows.h> |
22 |
|
|
23 |
#include "../resource.h" |
#include "../resource.h" |
33 |
#include "wptVersion.h" |
#include "wptVersion.h" |
34 |
#include "wptKeyEdit.h" |
#include "wptKeyEdit.h" |
35 |
|
|
|
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 */ |
|
|
} |
|
|
} |
|
|
|
|
36 |
|
|
37 |
/* Check that the key is not expired or revoked. */ |
/* Check that the key is not expired or revoked. */ |
38 |
static int |
static int |
50 |
static const char* |
static const char* |
51 |
ownertrust_to_string (int val) |
ownertrust_to_string (int val) |
52 |
{ |
{ |
53 |
const char * inf; |
const char *inf; |
54 |
int id = val; |
int id = val; |
55 |
|
|
56 |
switch (id) { |
switch (id) { |
57 |
case 1: inf = _("Don't know"); break; |
case 1: inf = _("Don't know"); break; |
58 |
case 2: inf = _("I do NOT trust"); break; |
case 2: inf = _("I do NOT trust"); break; |
141 |
val = key->revoked; |
val = key->revoked; |
142 |
if (val) |
if (val) |
143 |
return _("Revoked"); |
return _("Revoked"); |
144 |
|
val = key->disabled; |
145 |
|
if (val) |
146 |
|
return _("Disabled"); |
147 |
return get_key_trust2 (NULL, key->uids->validity, 0, 0); |
return get_key_trust2 (NULL, key->uids->validity, 0, 0); |
148 |
} |
} |
149 |
|
|
336 |
} |
} |
337 |
|
|
338 |
inf = ownertrust_to_string (k->callback.new_val); |
inf = ownertrust_to_string (k->callback.new_val); |
|
do_change_ownertrust (k, inf); |
|
339 |
SetDlgItemText (dlg, IDC_KEYPROPS_OT, inf); |
SetDlgItemText (dlg, IDC_KEYPROPS_OT, inf); |
340 |
msg_box (dlg, _("Ownertrust successfully changed."), |
msg_box (dlg, _("Ownertrust successfully changed."), |
341 |
_("GnuPG Status"), MB_OK); |
_("GnuPG Status"), MB_OK); |
342 |
|
|
343 |
/* reload only the keylist */ |
/* XXX: modified ownertrust values can effect the entire |
344 |
rcs.kr_reload = 1; rcs.kr_update = 1; |
WoT so we reload the cache. But this is very slow. */ |
345 |
rcs.tr_update = 0; |
memset (&rcs, 0, sizeof (rcs)); |
346 |
|
rcs.kr_reload = 1; rcs.kr_update = 1; /* reload only keylist */ |
347 |
DialogBoxParam (glob_hinst, (LPCSTR)IDD_WINPT_KEYCACHE, dlg, |
DialogBoxParam (glob_hinst, (LPCSTR)IDD_WINPT_KEYCACHE, dlg, |
348 |
keycache_dlg_proc, (LPARAM)&rcs); |
keycache_dlg_proc, (LPARAM)&rcs); |
349 |
return TRUE; |
return TRUE; |
354 |
|
|
355 |
case IDC_KEYPROPS_REVOKERS: |
case IDC_KEYPROPS_REVOKERS: |
356 |
dialog_box_param (glob_hinst, (LPCTSTR)IDD_WINPT_KEYREVOKERS, dlg, |
dialog_box_param (glob_hinst, (LPCTSTR)IDD_WINPT_KEYREVOKERS, dlg, |
357 |
key_revokers_dlg_proc, (LPARAM)key, _("Key Revokers"), |
key_revokers_dlg_proc, (LPARAM)key, |
358 |
IDS_WINPT_KEY_REVOKERS); |
_("Key Revokers"), IDS_WINPT_KEY_REVOKERS); |
359 |
break; |
break; |
360 |
} |
} |
361 |
} |
} |