52 |
CMD_DELKEY, |
CMD_DELKEY, |
53 |
CMD_EXPIRE, |
CMD_EXPIRE, |
54 |
CMD_SHOWPREF, |
CMD_SHOWPREF, |
55 |
//CMD_SETPREF, |
CMD_SETPREF, |
56 |
CMD_PASSWD, |
CMD_PASSWD, |
57 |
CMD_PRIMARY, |
CMD_PRIMARY, |
58 |
CMD_TRUST, |
CMD_TRUST, |
80 |
{"DELKEY", 1, CMD_DELKEY}, |
{"DELKEY", 1, CMD_DELKEY}, |
81 |
{"EXPIRE", 1, CMD_EXPIRE}, |
{"EXPIRE", 1, CMD_EXPIRE}, |
82 |
{"SHOWPREF", 0, CMD_SHOWPREF}, |
{"SHOWPREF", 0, CMD_SHOWPREF}, |
83 |
/*{"SETPREF", 1, CMD_SETPREF},*/ |
{"SETPREF", 1, CMD_SETPREF}, |
84 |
{"PASSWD", 1, CMD_PASSWD}, |
{"PASSWD", 1, CMD_PASSWD}, |
85 |
{"PRIMARY", 1, CMD_PRIMARY}, |
{"PRIMARY", 1, CMD_PRIMARY}, |
86 |
{"TRUST", 0, CMD_TRUST}, |
{"TRUST", 0, CMD_TRUST}, |
134 |
|
|
135 |
/* Key generation callback context. */ |
/* Key generation callback context. */ |
136 |
struct keygen_cb_s { |
struct keygen_cb_s { |
137 |
int bits; |
int bits; |
138 |
int algo; |
int algo; |
139 |
u32 expire; |
DWORD expire; |
140 |
char *fpr; |
char *fpr; |
141 |
char *name; |
char *name; |
142 |
char *comment; |
char *comment; |
143 |
char *email; |
char *email; |
144 |
}; |
}; |
145 |
typedef struct keygen_cb_s *keygen_cb_t; |
typedef struct keygen_cb_s *keygen_cb_t; |
146 |
|
|
151 |
static subclass_s keyedit_uid_proc; |
static subclass_s keyedit_uid_proc; |
152 |
|
|
153 |
int keygen_check_date (SYSTEMTIME *st); |
int keygen_check_date (SYSTEMTIME *st); |
154 |
void get_userid_preflist (char **r_prefs, int *r_flags); |
void get_userid_preflist (const char *old_prefs, char **r_prefs, int *r_flags); |
155 |
char* get_subkey_keyid (const char *keyid); |
char* get_subkey_keyid (const char *keyid); |
156 |
void ComboBox_AddString_utf8 (HWND cb, const char *txt); |
void ComboBox_AddString_utf8 (HWND cb, const char *txt); |
157 |
|
|
237 |
do_add_new_subkey (listview_ctrl_t lv, keygen_cb_t keygen, unsigned int flags) |
do_add_new_subkey (listview_ctrl_t lv, keygen_cb_t keygen, unsigned int flags) |
238 |
{ |
{ |
239 |
char info[128], keyid[32]; |
char info[128], keyid[32]; |
240 |
const char *expdate, *s; |
const char *expdate, *s, *kid; |
241 |
int n; |
int n; |
242 |
|
|
243 |
expdate = keygen->expire? get_key_expire_date (keygen->expire) : _("Never"); |
expdate = keygen->expire? get_key_expire_date (keygen->expire) : _("Never"); |
244 |
_snprintf (info, sizeof (info)-1, "%d-bit %s", |
_snprintf (info, sizeof (info)-1, "%d-bit %s", |
245 |
keygen->bits, |
keygen->bits, |
246 |
get_key_pubalgo ((gpgme_pubkey_algo_t)keygen->algo)); |
get_key_pubalgo ((gpgme_pubkey_algo_t)keygen->algo)); |
247 |
_snprintf (keyid, sizeof (keyid)-1, "0x%s", keygen->fpr+8); |
kid = get_keyid_from_fpr (keygen->fpr); |
248 |
|
_snprintf (keyid, sizeof (keyid)-1, "0x%s", kid); |
249 |
s = get_key_created (time (NULL)); |
s = get_key_created (time (NULL)); |
250 |
n = listview_count_items (lv, 0); |
n = listview_count_items (lv, 0); |
251 |
listview_add_item_pos (lv, n); |
listview_add_item_pos (lv, n); |
632 |
case WM_INITDIALOG: |
case WM_INITDIALOG: |
633 |
ctx = (keyedit_cb_t)lparam; |
ctx = (keyedit_cb_t)lparam; |
634 |
if (!ctx) |
if (!ctx) |
635 |
BUG (0); |
BUG (NULL); |
636 |
SetWindowText (dlg, _("Add new Subkey")); |
SetWindowText (dlg, _("Add new Subkey")); |
637 |
SetDlgItemText (dlg, IDC_ADDSUBKEY_INFALGO, _("Key type")); |
SetDlgItemText (dlg, IDC_ADDSUBKEY_INFALGO, _("Key type")); |
638 |
SetDlgItemText (dlg, IDC_ADDSUBKEY_INFSIZE, _("Size in bits")); |
SetDlgItemText (dlg, IDC_ADDSUBKEY_INFSIZE, _("Size in bits")); |
983 |
|
|
984 |
memset (&k, 0, sizeof (k)); |
memset (&k, 0, sizeof (k)); |
985 |
if (winpt_get_pubkey (keyid, &k)) |
if (winpt_get_pubkey (keyid, &k)) |
986 |
BUG (0); |
BUG (NULL); |
987 |
if (!k.is_v3) |
if (!k.is_v3) |
988 |
return 0; |
return 0; |
989 |
sym_prefs = k.ext->sym_prefs; |
sym_prefs = k.ext->sym_prefs; |
1059 |
return TRUE; |
return TRUE; |
1060 |
} |
} |
1061 |
|
|
1062 |
|
|
1063 |
/* Initialize sub key list from key @k and return |
/* Initialize sub key list from key @k and return |
1064 |
the new listview control. */ |
the new listview control. */ |
1065 |
listview_ctrl_t |
listview_ctrl_t |
1082 |
listview_ctrl_t lv; |
listview_ctrl_t lv; |
1083 |
char buf[256], tmp[128]; |
char buf[256], tmp[128]; |
1084 |
const char *t; |
const char *t; |
1085 |
int nkeys = 0, i, bits; |
int nkeys = 0, i; |
1086 |
|
|
1087 |
nkeys = count_subkeys (k->ctx); |
nkeys = count_subkeys (k->ctx); |
1088 |
if (!nkeys) |
if (!nkeys) |
1089 |
BUG (0); /* should never happen. */ |
BUG (NULL); /* should never happen. */ |
1090 |
|
|
1091 |
listview_new (&lv, GetDlgItem (dlg, IDC_KEYEDIT_KEYLIST)); |
listview_new (&lv, GetDlgItem (dlg, IDC_KEYEDIT_KEYLIST)); |
1092 |
for (i = 0; cols[i].fieldname != NULL; i++) |
for (i = 0; cols[i].fieldname != NULL; i++) |
1093 |
listview_add_column (lv, &cols[i]); |
listview_add_column (lv, &cols[i]); |
1094 |
|
|
1095 |
for (i = 0; i < nkeys; i++) { |
for (i = 0, sub = k->ctx->subkeys; i < nkeys; i++, sub = sub->next) { |
1096 |
listview_add_item (lv, ""); |
listview_add_item (lv, ""); |
1097 |
listview_add_sub_item (lv, 0, 1, ""); |
listview_add_sub_item (lv, 0, 1, ""); |
1098 |
memset (&lvi, 0, sizeof (lvi)); |
memset (&lvi, 0, sizeof (lvi)); |
1099 |
lvi.mask = LVIF_PARAM; |
lvi.mask = LVIF_PARAM; |
1100 |
lvi.lParam = (LPARAM)k->ext; |
lvi.lParam = (LPARAM)sub; |
1101 |
if (ListView_SetItem (lv->ctrl, &lvi) == FALSE) |
if (ListView_SetItem (lv->ctrl, &lvi) == FALSE) |
1102 |
BUG (0); |
BUG (NULL); |
1103 |
} |
} |
1104 |
|
|
1105 |
listview_set_ext_style( lv ); |
listview_set_ext_style (lv); |
1106 |
for( i = 0, sub = k->ctx->subkeys; i < nkeys; i++, sub = sub->next ) { |
for (i = 0, sub = k->ctx->subkeys; i < nkeys; i++, sub = sub->next) { |
1107 |
memset( buf, 0, sizeof buf ); |
_snprintf (buf, sizeof buf-1, "%d-bit %s", sub->length, |
1108 |
|
get_key_pubalgo (sub->pubkey_algo)); |
1109 |
bits = sub->length; |
listview_add_sub_item (lv, i, SUBK_COL_DESC, buf); |
|
_snprintf( tmp, sizeof tmp-1, "%d-bit ", bits ); |
|
|
strcat( buf, tmp ); |
|
|
|
|
|
_snprintf( tmp, sizeof tmp-1, "%s", get_key_pubalgo (sub->pubkey_algo)); |
|
|
strcat( buf, tmp ); |
|
|
|
|
|
listview_add_sub_item( lv, i, 0, buf ); |
|
1110 |
t = sub->keyid; |
t = sub->keyid; |
1111 |
if( !t ) |
assert (t != NULL); |
1112 |
t = "DEADBEEFDEADBEEF"; |
_snprintf (tmp, sizeof tmp-1, "0x%s", t+8); |
1113 |
_snprintf( tmp, sizeof tmp-1, "0x%s", t+8 ); |
listview_add_sub_item (lv, i, SUBK_COL_KEYID, tmp); |
|
listview_add_sub_item( lv, i, 1, tmp ); |
|
1114 |
|
|
1115 |
t = get_key_created (sub->timestamp); |
t = get_key_created (sub->timestamp); |
1116 |
if( !t ) |
if (!t) |
1117 |
t = "????" "-??" "-??"; |
t = "????" "-??" "-??"; |
1118 |
listview_add_sub_item( lv, i, 2, t ); |
listview_add_sub_item (lv, i, SUBK_COL_CREATION, t); |
1119 |
|
|
1120 |
if( sub->expires ) { |
if (sub->expires) { |
1121 |
t = get_key_created (sub->expires); |
t = get_key_created (sub->expires); |
1122 |
listview_add_sub_item( lv, i, 3, t ); |
listview_add_sub_item (lv, i, SUBK_COL_EXPIRES, t); |
1123 |
} |
} |
1124 |
else |
else |
1125 |
listview_add_sub_item( lv, i, 3, _("Never") ); |
listview_add_sub_item (lv, i, SUBK_COL_EXPIRES, _("Never")); |
1126 |
|
if (sub->expired) |
|
if( sub->expired ) |
|
1127 |
t = _("Expired"); |
t = _("Expired"); |
1128 |
else if( sub->revoked ) |
else if (sub->revoked) |
1129 |
t = _("Revoked"); |
t = _("Revoked"); |
1130 |
else |
else |
1131 |
t = _("OK"); |
t = _("OK"); |
1132 |
listview_add_sub_item( lv, i, 4, t ); |
listview_add_sub_item (lv, i, SUBK_COL_STATUS, t); |
1133 |
|
|
1134 |
if (sub->can_certify) t = "*"; else t = ""; |
if (sub->can_certify) t = "*"; else t = ""; |
1135 |
listview_add_sub_item (lv, i, 5, t); |
listview_add_sub_item (lv, i, SUBK_COL_C_FLAG, t); |
1136 |
if (sub->can_sign) t = "*"; else t = ""; |
if (sub->can_sign) t = "*"; else t = ""; |
1137 |
listview_add_sub_item( lv, i, 6, t ); |
listview_add_sub_item( lv, i, SUBK_COL_S_FLAG, t ); |
1138 |
if (sub->can_encrypt) t = "*"; else t = ""; |
if (sub->can_encrypt) t = "*"; else t = ""; |
1139 |
listview_add_sub_item( lv, i, 7, t ); |
listview_add_sub_item( lv, i, SUBK_COL_E_FLAG, t ); |
1140 |
if (sub->can_authenticate) t = "*"; else t = ""; |
if (sub->can_authenticate) t = "*"; else t = ""; |
1141 |
listview_add_sub_item (lv, i, 8, t); |
listview_add_sub_item (lv, i, SUBK_COL_A_FLAG, t); |
1142 |
} |
} |
1143 |
return lv; |
return lv; |
1144 |
} |
} |
1162 |
|
|
1163 |
nuids = count_userids (k->ctx); |
nuids = count_userids (k->ctx); |
1164 |
if (!nuids) |
if (!nuids) |
1165 |
BUG (0); /* should never happen. */ |
BUG (NULL); /* should never happen. */ |
1166 |
|
|
1167 |
listview_new (&lv, GetDlgItem (dlg, IDC_KEYEDIT_UIDLIST)); |
listview_new (&lv, GetDlgItem (dlg, IDC_KEYEDIT_UIDLIST)); |
1168 |
for (j = 0; cols[j].fieldname != NULL; j++) |
for (j = 0; cols[j].fieldname != NULL; j++) |
1227 |
case CMD_ADDKEY: |
case CMD_ADDKEY: |
1228 |
case CMD_ADDPHOTO: |
case CMD_ADDPHOTO: |
1229 |
case CMD_ADDREVOKER: |
case CMD_ADDREVOKER: |
1230 |
//case CMD_SETPREF: |
case CMD_SETPREF: |
1231 |
return 1; |
return 1; |
1232 |
} |
} |
1233 |
return 0; |
return 0; |
1238 |
static void |
static void |
1239 |
do_show_help (HWND dlg) |
do_show_help (HWND dlg) |
1240 |
{ |
{ |
1241 |
char helptext[2048]; |
const char *help; |
1242 |
|
|
1243 |
_snprintf (helptext, sizeof (helptext)-1, |
help = |
1244 |
_( |
_( |
1245 |
"ADDUID \t\tadd a user ID\r\n" |
"ADDUID add a user ID\r\n" |
1246 |
"ADDPHOTO \t\tadd a photo ID\r\n" |
"ADDPHOTO add a photo ID\r\n" |
1247 |
"DELUID \t\tdelete a user ID\r\n" |
"DELUID delete a user ID\r\n" |
1248 |
"ADDKEY \t\tadd a secondard key\r\n" |
"ADDKEY add a secondard key\r\n" |
1249 |
"DELKEY \t\tdelete a secondary key\r\n" |
"DELKEY delete a secondary key\r\n" |
1250 |
"ADDREVOKER\t\tadd a revocation key\r\n" |
"ADDREVOKER add a revocation key\r\n" |
1251 |
"EXPIRE \t\tchange the expire date\r\n" |
"EXPIRE change the expire date\r\n" |
1252 |
"SHOWPREF \t\tlist preferences (verbose)\r\n" |
"SHOWPREF list preferences (verbose)\r\n" |
1253 |
"SETPREF \t\tset preference list\r\n" |
"SETPREF set preference list\r\n" |
1254 |
"UPDPREF \t\tupdated preferences\r\n" |
"UPDPREF updated preferences\r\n" |
1255 |
"PASSWD \t\tchange the passphrase\r\n" |
"PASSWD change the passphrase\r\n" |
1256 |
"PRIMARY \t\tflag user ID as primary\r\n" |
"PRIMARY flag user ID as primary\r\n" |
1257 |
"TRUST \t\tchange the ownertrust\r\n" |
"TRUST change the ownertrust\r\n" |
1258 |
"REVUID \t\trevoke a user ID\r\n" |
"REVUID revoke a user ID\r\n" |
1259 |
"REVKEY \t\trevoke a secondary key\r\n" |
"REVKEY revoke a secondary key\r\n" |
1260 |
"DISABLE \t\tdisable a key\r\n" |
"DISABLE disable a key\r\n" |
1261 |
"ENABLE \t\tenable a key\r\n" |
"ENABLE enable a key\r\n" |
1262 |
"SIGN \t\tsign a user-id (exportable)\r\n" |
"SIGN sign a user-id (exportable)\r\n" |
1263 |
"LSIGN \t\tsign a user-id (non-exportable)\r\n" |
"LSIGN sign a user-id (non-exportable)\r\n" |
1264 |
"CLEAN \t\tremove unusable signatures from key\r\n" |
"CLEAN remove unusable signatures from key\r\n" |
1265 |
"MINIMIZE \t\tremove all signatures from key\r\n" |
"MINIMIZE remove all signatures from key\r\n" |
1266 |
)); |
); |
1267 |
msg_box (dlg, helptext, _("Key Edit Help"), MB_OK); |
msg_box (dlg, help, _("Key Edit Help"), MB_OK); |
1268 |
} |
} |
1269 |
|
|
1270 |
|
|
1524 |
static int |
static int |
1525 |
do_editkey_setpref (winpt_key_t k, HWND dlg, listview_ctrl_t lv) |
do_editkey_setpref (winpt_key_t k, HWND dlg, listview_ctrl_t lv) |
1526 |
{ |
{ |
1527 |
gpgme_error_t rc; |
gpgme_error_t err; |
1528 |
GpgKeyEdit *ke; |
GpgKeyEdit *ke; |
1529 |
char buf[256], * pass = NULL, * prefs; |
gpg_uid_info_t uidinf = NULL; |
1530 |
int j, id, cancel=0, flags=0; |
char buf[256], *pass = NULL, *prefs = NULL; |
1531 |
|
int pos, id, cancel=0, flags=0; |
1532 |
|
|
1533 |
if ((j = listview_get_curr_pos (lv)) == -1) { |
pos = listview_get_curr_pos (lv); |
1534 |
|
if (pos == -1) { |
1535 |
msg_box (dlg, _("Please select a user ID."), _("Key Edit"), MB_ERR); |
msg_box (dlg, _("Please select a user ID."), _("Key Edit"), MB_ERR); |
1536 |
return FALSE; |
return FALSE; |
1537 |
} |
} |
1538 |
listview_get_item_text (lv, j, 2, buf, sizeof buf-1); |
listview_get_item_text (lv, pos, 2, buf, sizeof buf-1); |
1539 |
id = do_find_userid (k->keyid, buf, NULL, NULL); |
id = do_find_userid (k->keyid, buf, NULL, &uidinf); |
1540 |
if (id == -1) |
if (id == -1) |
1541 |
BUG (NULL); |
BUG (NULL); |
1542 |
if (k->is_protected) { |
if (k->is_protected) { |
1543 |
pass = request_key_passphrase (k->ctx, _("Key Edit"), &cancel); |
pass = request_key_passphrase (k->ctx, _("Key Edit"), &cancel); |
1544 |
|
gpg_uid_info_release (uidinf); |
1545 |
if (cancel) |
if (cancel) |
1546 |
return FALSE; |
return FALSE; |
1547 |
} |
} |
1548 |
|
|
1549 |
|
get_userid_preflist (uidinf->prefs, &prefs, &flags); |
1550 |
|
gpg_uid_info_release (uidinf); |
1551 |
|
if (!prefs) { |
1552 |
|
sfree_if_alloc (pass); |
1553 |
|
return FALSE; |
1554 |
|
} |
1555 |
|
|
1556 |
ke = create_GpgKeyEdit (k->keyid); |
ke = create_GpgKeyEdit (k->keyid); |
1557 |
if (k->is_protected) |
if (k->is_protected) |
1558 |
ke->setPassphrase (pass); |
ke->setPassphrase (pass); |
1559 |
else |
else |
1560 |
ke->setNoPassphrase (true); |
ke->setNoPassphrase (true); |
1561 |
|
err = ke->setUseridPreferences (id, prefs); |
1562 |
get_userid_preflist (&prefs, &flags); |
if (err) |
1563 |
|
msg_box (dlg, gpgme_strerror (err), _("Set user ID preferences"), MB_ERR); |
1564 |
rc = ke->setUseridPreferences (id, prefs); |
else { |
1565 |
if (rc) |
k->update = 1; |
1566 |
msg_box (dlg, _("Could not set user ID preferences"), _("Key Edit"), MB_ERR); |
status_box (dlg, _("User ID preferences successfully updated"), _("GnuPG Status")); |
1567 |
|
} |
1568 |
|
|
1569 |
sfree_if_alloc (pass); |
sfree_if_alloc (pass); |
1570 |
free_if_alloc (prefs); |
free_if_alloc (prefs); |
1571 |
delete ke; |
delete ke; |
1572 |
return 0; |
return err? FALSE: TRUE; |
1573 |
} |
} |
1574 |
|
|
1575 |
|
|
1594 |
listview_get_item_text (lv, j, UID_COL_EMAIL, buf, sizeof (buf)-1); |
listview_get_item_text (lv, j, UID_COL_EMAIL, buf, sizeof (buf)-1); |
1595 |
id = do_find_userid (k->keyid, buf, NULL, NULL); |
id = do_find_userid (k->keyid, buf, NULL, NULL); |
1596 |
if (id == -1) |
if (id == -1) |
1597 |
BUG (0); |
BUG (NULL); |
1598 |
if (k->is_protected) { |
if (k->is_protected) { |
1599 |
pass = request_key_passphrase (k->ctx, _("Key Edit"), &cancel); |
pass = request_key_passphrase (k->ctx, _("Key Edit"), &cancel); |
1600 |
if (cancel) |
if (cancel) |
1800 |
listview_get_item_text (lv, pos, UID_COL_NAME, name, DIM (name)-1); |
listview_get_item_text (lv, pos, UID_COL_NAME, name, DIM (name)-1); |
1801 |
id = do_find_userid (k->keyid, email, name, NULL); |
id = do_find_userid (k->keyid, email, name, NULL); |
1802 |
if (id == -1) |
if (id == -1) |
1803 |
BUG (0); |
BUG (NULL); |
1804 |
|
|
1805 |
ke = create_GpgKeyEdit (k->keyid); |
ke = create_GpgKeyEdit (k->keyid); |
1806 |
err = ke->delUserid (id); |
err = ke->delUserid (id); |
2054 |
int id; |
int id; |
2055 |
|
|
2056 |
inf = km_key_get_info (key, 0); |
inf = km_key_get_info (key, 0); |
2057 |
warn = _("Your key is listed as a designated revoker for the key\n\n" |
warn = _("Your keys is listed as a designated revoker for the key\n\n" |
2058 |
"%s\n\n" |
"%s\n\n" |
2059 |
"Are you sure you want to create a revocation certificate\n" |
"Are you sure you want to create a revocation certificate\n" |
2060 |
"which allow to revoke the key listed above?"); |
"which allow to revoke the key listed above?"); |
2096 |
keyedit_subkey_proc.current = (WNDPROC)subkey_subclass_proc; |
keyedit_subkey_proc.current = (WNDPROC)subkey_subclass_proc; |
2097 |
keyedit_subkey_proc.old = (WNDPROC)GetWindowLong (item, GWL_WNDPROC); |
keyedit_subkey_proc.old = (WNDPROC)GetWindowLong (item, GWL_WNDPROC); |
2098 |
if (keyedit_subkey_proc.old) { |
if (keyedit_subkey_proc.old) { |
2099 |
if( !SetWindowLong (item, GWL_WNDPROC, |
if (!SetWindowLong (item, GWL_WNDPROC, |
2100 |
(LONG)keyedit_subkey_proc.current)) { |
(LONG)keyedit_subkey_proc.current)) { |
2101 |
msg_box (dlg, _("Could not set subkey window procedure."), |
msg_box (dlg, _("Could not set subkey window procedure."), |
2102 |
_("Key Edit"), MB_ERR); |
_("Key Edit"), MB_ERR); |
2103 |
BUG (0); |
BUG (NULL); |
2104 |
} |
} |
2105 |
} |
} |
2106 |
item = GetDlgItem (dlg, IDC_KEYEDIT_UIDLIST); |
item = GetDlgItem (dlg, IDC_KEYEDIT_UIDLIST); |
2113 |
(LONG)keyedit_uid_proc.current)) { |
(LONG)keyedit_uid_proc.current)) { |
2114 |
msg_box (dlg, _("Could not set user ID window procedure."), |
msg_box (dlg, _("Could not set user ID window procedure."), |
2115 |
_("Key Edit"), MB_ERR); |
_("Key Edit"), MB_ERR); |
2116 |
BUG (0); |
BUG (NULL); |
2117 |
} |
} |
2118 |
} |
} |
2119 |
if (k->ctx->revoked) { |
if (k->ctx->revoked) { |
2124 |
SetDlgItemText (dlg, IDCANCEL, _("&Close")); |
SetDlgItemText (dlg, IDCANCEL, _("&Close")); |
2125 |
SetDlgItemText (dlg, IDC_KEYEDIT_HELP, _("&Help")); |
SetDlgItemText (dlg, IDC_KEYEDIT_HELP, _("&Help")); |
2126 |
SetDlgItemText (dlg, IDC_KEYEDIT_REVOKE, _("&Revoke...")); |
SetDlgItemText (dlg, IDC_KEYEDIT_REVOKE, _("&Revoke...")); |
2127 |
|
SetDlgItemText (dlg, IDOK, _("&OK")); |
2128 |
if (!check_desig_rev (k)) |
if (!check_desig_rev (k)) |
2129 |
ShowWindow (GetDlgItem (dlg, IDC_KEYEDIT_REVOKE), SW_HIDE); |
ShowWindow (GetDlgItem (dlg, IDC_KEYEDIT_REVOKE), SW_HIDE); |
2130 |
SetWindowText (dlg, _("Key Edit")); |
SetWindowText (dlg, _("Key Edit")); |
2144 |
break; |
break; |
2145 |
|
|
2146 |
case WM_NOTIFY: |
case WM_NOTIFY: |
2147 |
NMHDR * notify; |
NMHDR *notify; |
2148 |
notify = (NMHDR *)lparam; |
notify = (NMHDR *)lparam; |
2149 |
if (!notify || notify->idFrom != IDC_KEYEDIT_UIDLIST) |
if (!notify || notify->idFrom != IDC_KEYEDIT_UIDLIST) |
2150 |
break; |
break; |
2151 |
if (notify->code == NM_DBLCLK) |
if (notify->code == NM_DBLCLK) |
2152 |
do_editkey_showpref (k, dlg, lvuid); |
do_editkey_showpref (k, dlg, lvuid); |
2153 |
if (notify->code == NM_RCLICK && k->key_pair) { |
else if (notify->code == NM_RCLICK && k->key_pair) { |
2154 |
HMENU hm = LoadMenu (glob_hinst, MAKEINTRESOURCE (IDR_WINPT_KEYEDIT)); |
HMENU hm = LoadMenu (glob_hinst, MAKEINTRESOURCE (IDR_WINPT_KEYEDIT)); |
2155 |
HMENU popup = GetSubMenu (hm, 0); |
HMENU popup = GetSubMenu (hm, 0); |
2156 |
POINT p; |
POINT p; |
2181 |
case CMD_ADDKEY: keyedit_add_subkey (k, dlg, lvsub); break; |
case CMD_ADDKEY: keyedit_add_subkey (k, dlg, lvsub); break; |
2182 |
case CMD_EXPIRE: do_editkey_expire (k, dlg, lvsub); break; |
case CMD_EXPIRE: do_editkey_expire (k, dlg, lvsub); break; |
2183 |
case CMD_REVKEY: do_editkey_revoke (k, dlg, lvsub); break; |
case CMD_REVKEY: do_editkey_revoke (k, dlg, lvsub); break; |
2184 |
/*case CMD_SETPREF:do_editkey_setpref( k, dlg, lvuid ); break;*/ |
case CMD_SETPREF:/*do_editkey_setpref (k, dlg, lvuid);*/ break; |
2185 |
case CMD_ADDUID: keyedit_add_userid( k, dlg, lvuid ); break; |
case CMD_ADDUID: keyedit_add_userid( k, dlg, lvuid ); break; |
2186 |
case CMD_ADDREVOKER: keyedit_add_revoker( k, dlg ); break; |
case CMD_ADDREVOKER: keyedit_add_revoker( k, dlg ); break; |
2187 |
case CMD_ADDPHOTO: keyedit_add_photo( k, dlg ); break; |
case CMD_ADDPHOTO: keyedit_add_photo( k, dlg ); break; |