54 |
} |
} |
55 |
|
|
56 |
|
|
57 |
|
/* Delete the selected signature from list view @lv. The |
58 |
|
key is given in @key. */ |
59 |
static int |
static int |
60 |
do_delsig (HWND dlg, listview_ctrl_t lv, winpt_key_t key) |
do_delsig (HWND dlg, listview_ctrl_t lv, winpt_key_t key) |
61 |
{ |
{ |
96 |
listview_del_item (lv, pos); |
listview_del_item (lv, pos); |
97 |
delete ke; |
delete ke; |
98 |
key->update = 1; /*update*/ |
key->update = 1; /*update*/ |
99 |
return 0; |
return err? -1 : 0; |
100 |
} |
} |
101 |
|
|
102 |
|
|
103 |
|
/* Dialog box procedure to display the signature properties. */ |
104 |
static BOOL CALLBACK |
static BOOL CALLBACK |
105 |
sigprops_dlg_proc (HWND dlg, UINT msg, WPARAM wparam, LPARAM lparam) |
sigprops_dlg_proc (HWND dlg, UINT msg, WPARAM wparam, LPARAM lparam) |
106 |
{ |
{ |
115 |
const char * alg; |
const char * alg; |
116 |
int _class; |
int _class; |
117 |
} ctx; |
} ctx; |
118 |
const char *fmt_templ = "%s %s signature"; |
const char *fmt_templ = _("%s %s signature"); |
119 |
|
|
120 |
switch (msg) { |
switch (msg) { |
121 |
case WM_SYSCOMMAND: |
case WM_SYSCOMMAND: |
144 |
ctx.alg = "RSA"; |
ctx.alg = "RSA"; |
145 |
else |
else |
146 |
ctx.alg = "ELG"; |
ctx.alg = "ELG"; |
147 |
_snprintf (tmpbuf, DIM (tmpbuf)-1, fmt_templ, |
_snprintf (tmpbuf, DIM (tmpbuf)-1, fmt_templ, |
148 |
ctx.exportable? "Exportable" : "Non-exportable", ctx.alg); |
ctx.exportable? _("Exportable") : _("Non-exportable"), ctx.alg); |
149 |
SetDlgItemText (dlg, IDC_SIGPROPS_INFO, tmpbuf); |
SetDlgItemText (dlg, IDC_SIGPROPS_INFO, tmpbuf); |
150 |
listview_get_item_text (lv, n, 4, tmpbuf, DIM (tmpbuf)-1); |
listview_get_item_text (lv, n, 4, tmpbuf, DIM (tmpbuf)-1); |
151 |
SetDlgItemText (dlg, IDC_SIGPROPS_KEYID, tmpbuf); |
SetDlgItemText (dlg, IDC_SIGPROPS_KEYID, tmpbuf); |
186 |
SetDlgItemText (dlg, IDC_SIGPROPS_NREV, _("Non-revocably")); |
SetDlgItemText (dlg, IDC_SIGPROPS_NREV, _("Non-revocably")); |
187 |
SetDlgItemText (dlg, IDC_SIGPROPS_REV, _("Revoked")); |
SetDlgItemText (dlg, IDC_SIGPROPS_REV, _("Revoked")); |
188 |
SetDlgItemText (dlg, IDC_SIGPROPS_EXPIRED, _("Expired")); |
SetDlgItemText (dlg, IDC_SIGPROPS_EXPIRED, _("Expired")); |
189 |
|
SetWindowText (dlg, _("Signature Properties")); |
190 |
SetForegroundWindow (dlg); |
SetForegroundWindow (dlg); |
191 |
center_window (dlg, NULL); |
center_window (dlg, NULL); |
192 |
return TRUE; |
return TRUE; |
227 |
} |
} |
228 |
|
|
229 |
|
|
230 |
|
/* Return 1 if the list view @lv contains non-available keys. */ |
231 |
static int |
static int |
232 |
check_for_missing_keys (listview_ctrl_t lv) |
check_for_missing_keys (listview_ctrl_t lv) |
233 |
{ |
{ |
242 |
} |
} |
243 |
|
|
244 |
return 0; |
return 0; |
245 |
} /* check_for_missing_keys */ |
} |
246 |
|
|
247 |
|
|
248 |
|
/* Receive all missing keys marked in the list @lv. */ |
249 |
static int |
static int |
250 |
recv_missing_keys (HWND dlg, listview_ctrl_t lv) |
recv_missing_keys (HWND dlg, listview_ctrl_t lv) |
251 |
{ |
{ |
264 |
} |
} |
265 |
|
|
266 |
return rc; |
return rc; |
267 |
} /* recv_missing_keys */ |
} |
268 |
|
|
269 |
|
|
270 |
|
/* Create a mini popup with available choices. */ |
271 |
static void |
static void |
272 |
do_create_popup (HWND dlg) |
do_create_popup (HWND dlg) |
273 |
{ |
{ |
288 |
} |
} |
289 |
|
|
290 |
|
|
291 |
|
/* Load the key property dialog with the selected key from @lv. */ |
292 |
static void |
static void |
293 |
do_load_keyprops (HWND dlg, listview_ctrl_t lv) |
do_load_keyprops (HWND dlg, listview_ctrl_t lv) |
294 |
{ |
{ |
318 |
keyprops_dlg_proc, (LPARAM)&k); |
keyprops_dlg_proc, (LPARAM)&k); |
319 |
} |
} |
320 |
|
|
321 |
|
|
322 |
|
/* Dialog box procedure to list signatures. */ |
323 |
BOOL CALLBACK |
BOOL CALLBACK |
324 |
keysig_dlg_proc (HWND dlg, UINT msg, WPARAM wparam, LPARAM lparam) |
keysig_dlg_proc (HWND dlg, UINT msg, WPARAM wparam, LPARAM lparam) |
325 |
{ |
{ |
352 |
siglist_proc.old = (WNDPROC)GetWindowLong (sl, GWL_WNDPROC); |
siglist_proc.old = (WNDPROC)GetWindowLong (sl, GWL_WNDPROC); |
353 |
if (siglist_proc.old) { |
if (siglist_proc.old) { |
354 |
if (!SetWindowLong (sl, GWL_WNDPROC, (LONG)siglist_proc.current)) { |
if (!SetWindowLong (sl, GWL_WNDPROC, (LONG)siglist_proc.current)) { |
355 |
msg_box (dlg, _("Could not set keylist window procedure."), _("Key Manager"), MB_ERR); |
msg_box (dlg, _("Could not set keylist window procedure."), |
356 |
|
_("Key Manager"), MB_ERR); |
357 |
BUG (0); |
BUG (0); |
358 |
} |
} |
359 |
} |
} |
438 |
break; |
break; |
439 |
} |
} |
440 |
return FALSE; |
return FALSE; |
441 |
} /* keysig_dlg_proc */ |
} |