142 |
s = _("Key(s) successfully received but nothing was changed."); |
s = _("Key(s) successfully received but nothing was changed."); |
143 |
else |
else |
144 |
s = _("Key(s) sucessfully received and imported."); |
s = _("Key(s) sucessfully received and imported."); |
145 |
|
// nice to have the amount of new signatures... |
146 |
gpgme_data_write (msg, s, strlen (s)); |
gpgme_data_write (msg, s, strlen (s)); |
147 |
gpgme_data_write (msg, "\n\n", 2); |
gpgme_data_write (msg, "\n\n", 2); |
148 |
|
|
152 |
gpgme_data_write (msg, s, strlen (s)); |
gpgme_data_write (msg, s, strlen (s)); |
153 |
gpgme_data_write (msg, "\n", 1); |
gpgme_data_write (msg, "\n", 1); |
154 |
gpgme_key_release (key); |
gpgme_key_release (key); |
155 |
free (uid); |
safe_free (uid); |
156 |
} |
} |
157 |
} |
} |
158 |
gpgme_data_write (msg, "\0", 1); |
gpgme_data_write (msg, "\0", 1); |
211 |
|
|
212 |
if (!strstr (rawkey, "BEGIN PGP PUBLIC KEY BLOCK")) { |
if (!strstr (rawkey, "BEGIN PGP PUBLIC KEY BLOCK")) { |
213 |
msg_box (dlg, _("This is not a valid OpenPGP key."), |
msg_box (dlg, _("This is not a valid OpenPGP key."), |
214 |
_("Keyserver"), MB_ERR); |
_("Keyserver"), MB_ERR); |
215 |
goto leave; |
goto leave; |
216 |
} |
} |
217 |
if (gpgme_new (&ctx)) |
if (gpgme_new (&ctx)) |
325 |
{ |
{ |
326 |
char buf[16]; |
char buf[16]; |
327 |
|
|
328 |
listview_get_item_text (lv, kserver_get_pos (lv), KS_COL_PORT, buf, 15); |
listview_get_item_text (lv, kserver_get_pos (lv), |
329 |
|
KS_COL_PORT, buf, sizeof (buf)-1); |
330 |
return (WORD)strtoul (buf, NULL, 10); |
return (WORD)strtoul (buf, NULL, 10); |
331 |
} |
} |
332 |
|
|
334 |
static void |
static void |
335 |
set_default_ks (listview_ctrl_t lv) |
set_default_ks (listview_ctrl_t lv) |
336 |
{ |
{ |
337 |
char *p, buf[200]; |
char *p, buf[128]; |
338 |
int i; |
int i; |
339 |
|
|
340 |
p = get_reg_entry_keyserver ("Default"); |
p = get_reg_entry_keyserver ("Default"); |
342 |
return; |
return; |
343 |
for (i=0; i < listview_count_items (lv, 0); i++) { |
for (i=0; i < listview_count_items (lv, 0); i++) { |
344 |
listview_get_item_text (lv, i, KS_COL_NAME, buf, sizeof (buf)-1); |
listview_get_item_text (lv, i, KS_COL_NAME, buf, sizeof (buf)-1); |
345 |
if (!stricmp (buf, p)) { |
if (!stricmp (buf, p)) { |
346 |
listview_select_one (lv, i); |
listview_select_one (lv, i); |
347 |
break; |
break; |
348 |
} |
} |
360 |
|
|
361 |
idx = listview_get_curr_pos (lv); |
idx = listview_get_curr_pos (lv); |
362 |
if (idx == -1) { |
if (idx == -1) { |
363 |
msg_box (NULL, _("Please select one of the servers."), _("Keyserver"), MB_ERR); |
msg_box (NULL, _("Please select one of the servers."), |
364 |
|
_("Keyserver"), MB_ERR); |
365 |
return -1; |
return -1; |
366 |
} |
} |
367 |
listview_get_item_text (lv, idx, KS_COL_NAME, buf, sizeof (buf)-1); |
listview_get_item_text (lv, idx, KS_COL_NAME, buf, sizeof (buf)-1); |
368 |
if (strnicmp (buf, "http", 4) && strnicmp (buf, "hkp", 3)) { |
if (strnicmp (buf, "http", 4) && strnicmp (buf, "hkp", 3)) { |
369 |
msg_box (NULL, _("Only HTTP keyserver can be used."), |
msg_box (NULL, _("Only HKP keyserver can be used."), |
370 |
_("Keyserver"), MB_ERR); |
_("Keyserver"), MB_ERR); |
371 |
return -1; |
return -1; |
372 |
} |
} |
397 |
for (j=0; keyserver[j].fieldname; j++) |
for (j=0; keyserver[j].fieldname; j++) |
398 |
listview_add_column (lv, &keyserver[j]); |
listview_add_column (lv, &keyserver[j]); |
399 |
listview_set_image_list (lv, 16, 16, ico, 1); |
listview_set_image_list (lv, 16, 16, ico, 1); |
400 |
for (j = 0; j<MAX_KEYSERVERS; j++) { |
for (j = 0; j < MAX_KEYSERVERS; j++) { |
401 |
if (!server[j].used) |
if (!server[j].used) |
402 |
continue; |
continue; |
403 |
listview_add_item_image (lv, " ", 0); |
listview_add_item_image (lv, " ", 0); |
726 |
|
|
727 |
case IDC_KEYSERVER_DEFAULT: |
case IDC_KEYSERVER_DEFAULT: |
728 |
save_default_ks (lv); |
save_default_ks (lv); |
729 |
break; |
return TRUE; |
730 |
|
|
731 |
case ID_KSERVCTX_ADD: |
case ID_KSERVCTX_ADD: |
732 |
memset (&edit, 0, sizeof (edit)); |
memset (&edit, 0, sizeof (edit)); |
764 |
|
|
765 |
case IDCANCEL: |
case IDCANCEL: |
766 |
EndDialog (dlg, FALSE); |
EndDialog (dlg, FALSE); |
767 |
return FALSE; |
return TRUE; |
768 |
} |
} |
769 |
break; |
break; |
770 |
} |
} |