88 |
typedef struct km_info_s *km_info_t; |
typedef struct km_info_s *km_info_t; |
89 |
|
|
90 |
/* Toolbar button structure. */ |
/* Toolbar button structure. */ |
91 |
struct mybuttons { |
struct tb_button_s { |
92 |
long icon; |
long icon; |
93 |
long command; |
long command; |
94 |
char *text; |
char *text; |
95 |
}; |
}; |
96 |
|
|
97 |
struct mybuttons myb[] = { |
/* The buttons in the toolbar. */ |
98 |
|
struct tb_button_s tbb[] = { |
99 |
{IMI_KEY_DELETE, ID_KEYMISC_DELETE, "Delete"}, |
{IMI_KEY_DELETE, ID_KEYMISC_DELETE, "Delete"}, |
100 |
{IMI_KEY_PROPS, ID_KEYMISC_PROPS, "Properties"}, |
{IMI_KEY_PROPS, ID_KEYMISC_PROPS, "Properties"}, |
101 |
{IMI_KEY_SIGN, ID_KEYMISC_SIGN, "Sign"}, |
{IMI_KEY_SIGN, ID_KEYMISC_SIGN, "Sign"}, |
224 |
{ |
{ |
225 |
WORD *buf; |
WORD *buf; |
226 |
HKEY root; |
HKEY root; |
227 |
DWORD type; |
DWORD type, size, i; |
|
DWORD size = kmi->lv->cols*sizeof (WORD), i; |
|
228 |
LONG ec; |
LONG ec; |
229 |
|
|
230 |
|
size = kmi->lv->cols*sizeof (WORD); |
231 |
ec = RegOpenKeyEx (HKEY_CURRENT_USER, "Software\\WinPT", 0, |
ec = RegOpenKeyEx (HKEY_CURRENT_USER, "Software\\WinPT", 0, |
232 |
KEY_ALL_ACCESS, &root); |
KEY_ALL_ACCESS, &root); |
233 |
if (ec != ERROR_SUCCESS) |
if (ec != ERROR_SUCCESS) |
519 |
void |
void |
520 |
update_status_bar (HWND sb, listview_ctrl_t lv) |
update_status_bar (HWND sb, listview_ctrl_t lv) |
521 |
{ |
{ |
522 |
char txt_sec[128], txt_pub[128]; |
char txt_sec[128]; |
523 |
|
char txt_pub[128]; |
524 |
int nkeys = 0, nsec = 0; |
int nkeys = 0, nsec = 0; |
|
int i; |
|
525 |
|
|
526 |
nkeys = listview_count_items (lv, 0); |
nkeys = listview_count_items (lv, 0); |
527 |
for (i = 0; i < nkeys; i++) { |
nsec = gpg_keycache_get_size (keycache_get_ctx (0)); |
528 |
if (km_check_for_seckey (lv, i, NULL)) |
|
|
nsec++; |
|
|
} |
|
529 |
_snprintf (txt_sec, sizeof (txt_sec)-1, _("%d secret keys"), nsec); |
_snprintf (txt_sec, sizeof (txt_sec)-1, _("%d secret keys"), nsec); |
530 |
_snprintf (txt_pub, sizeof (txt_pub)-1, _("%d keys"), nkeys); |
_snprintf (txt_pub, sizeof (txt_pub)-1, _("%d keys"), nkeys); |
531 |
SendMessage (sb, SB_SETTEXT, 1, (LPARAM)txt_sec); |
SendMessage (sb, SB_SETTEXT, 1, (LPARAM)txt_sec); |
537 |
separator_wnd_proc (HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) |
separator_wnd_proc (HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) |
538 |
{ |
{ |
539 |
static POINT last_mouse_pos; |
static POINT last_mouse_pos; |
540 |
|
PAINTSTRUCT ps; |
541 |
|
RECT rect; |
542 |
|
HPEN hpen; |
543 |
|
|
544 |
if (msg == WM_CREATE) |
if (msg == WM_CREATE) |
545 |
SetWindowLong (hwnd, GWL_USERDATA, |
SetWindowLong (hwnd, GWL_USERDATA, |
547 |
|
|
548 |
switch (msg) { |
switch (msg) { |
549 |
case WM_PAINT: |
case WM_PAINT: |
|
PAINTSTRUCT ps; |
|
|
RECT rect; |
|
|
HPEN hpen; |
|
|
|
|
550 |
GetClientRect (hwnd, &rect); |
GetClientRect (hwnd, &rect); |
551 |
BeginPaint (hwnd, &ps); |
BeginPaint (hwnd, &ps); |
552 |
|
|
602 |
if (wparam == MK_LBUTTON) { |
if (wparam == MK_LBUTTON) { |
603 |
struct km_info_s *kmi; |
struct km_info_s *kmi; |
604 |
POINT p; |
POINT p; |
|
RECT r; |
|
605 |
|
|
606 |
kmi = (struct km_info_s *)GetWindowLong (hwnd, GWL_USERDATA); |
kmi = (struct km_info_s *)GetWindowLong (hwnd, GWL_USERDATA); |
607 |
if (kmi == NULL) |
if (kmi == NULL) |
612 |
p.y = HIWORD (lparam); |
p.y = HIWORD (lparam); |
613 |
ClientToScreen (hwnd, &p); |
ClientToScreen (hwnd, &p); |
614 |
|
|
615 |
GetWindowRect (hwnd, &r); |
GetWindowRect (hwnd, &rect); |
616 |
r.top += (short)(p.y - last_mouse_pos.y); |
rect.top += (short)(p.y - last_mouse_pos.y); |
617 |
r.bottom += (short)(p.y - last_mouse_pos.y); |
rect.bottom += (short)(p.y - last_mouse_pos.y); |
618 |
|
|
619 |
last_mouse_pos.y = p.y; |
last_mouse_pos.y = p.y; |
620 |
|
|
621 |
/* Apply mouse movement to window. Beware the MoveWindow is relaive |
/* Apply mouse movement to window. Beware the MoveWindow is relaive |
622 |
to parent NOT screen */ |
to parent NOT screen */ |
623 |
MapWindowPoints (NULL, GetParent(hwnd), (POINT*)&r, 2); |
MapWindowPoints (NULL, GetParent(hwnd), (POINT*)&rect, 2); |
624 |
kmi->ypos_sep = r.top; |
kmi->ypos_sep = rect.top; |
625 |
kmi->ypercent_sep = 0; /* This forces do_resize_window to use abs. position */ |
kmi->ypercent_sep = 0; /* This forces do_resize_window to use abs. position */ |
626 |
do_resize_window (GetParent (hwnd), kmi); |
do_resize_window (GetParent (hwnd), kmi); |
627 |
return 0; |
return 0; |
639 |
WNDCLASS wndclass; |
WNDCLASS wndclass; |
640 |
HWND h; |
HWND h; |
641 |
|
|
642 |
|
memset (&wndclass, 0, sizeof (wndclass)); |
643 |
wndclass.style = CS_DBLCLKS | CS_HREDRAW | CS_VREDRAW; |
wndclass.style = CS_DBLCLKS | CS_HREDRAW | CS_VREDRAW; |
644 |
wndclass.lpfnWndProc = separator_wnd_proc; |
wndclass.lpfnWndProc = separator_wnd_proc; |
645 |
wndclass.cbClsExtra = 0; |
wndclass.cbClsExtra = 0; |
654 |
|
|
655 |
h = CreateWindowEx (WS_EX_WINDOWEDGE, WINDOWCLASS_SEPARATOR_CHILD, NULL, |
h = CreateWindowEx (WS_EX_WINDOWEDGE, WINDOWCLASS_SEPARATOR_CHILD, NULL, |
656 |
WS_CHILD | WS_CLIPCHILDREN | WS_VISIBLE, |
WS_CHILD | WS_CLIPCHILDREN | WS_VISIBLE, |
657 |
0, 400, 2000, 5, dlg, (HMENU) 0, glob_hinst, kmi); |
0, 400, 2000, 5, dlg, (HMENU) 0, glob_hinst, kmi); |
658 |
|
if (!h) |
659 |
|
BUG (NULL); |
660 |
ShowWindow (h, SW_SHOW); |
ShowWindow (h, SW_SHOW); |
661 |
return h; |
return h; |
662 |
} |
} |
676 |
HMENU hmenu; |
HMENU hmenu; |
677 |
int mult_resids[] = {ID_KEYMISC_PROPS, ID_KEYMISC_SIGN, ID_KEYMISC_EDITKEY, |
int mult_resids[] = {ID_KEYMISC_PROPS, ID_KEYMISC_SIGN, ID_KEYMISC_EDITKEY, |
678 |
ID_KEYMISC_CHECKSIGS, ID_KEYMISC_REVCERT, 0}; |
ID_KEYMISC_CHECKSIGS, ID_KEYMISC_REVCERT, 0}; |
679 |
int key_selected = 0; |
int key_selected; |
680 |
int key_has_sec = 0; |
int key_has_sec; |
681 |
int key_inv = 0; |
int key_inv = 0; |
682 |
int i, state=0; |
int i, state=0; |
683 |
|
|
878 |
for (i=1; i <= 3; i++) |
for (i=1; i <= 3; i++) |
879 |
partpos[i-1] = r.right/3*i; |
partpos[i-1] = r.right/3*i; |
880 |
statbar = CreateStatusWindow (WS_CHILD | WS_VISIBLE | CCS_BOTTOM, |
statbar = CreateStatusWindow (WS_CHILD | WS_VISIBLE | CCS_BOTTOM, |
881 |
"status bar", dlg, KM_SEPARATOR_ID); |
"WinPT_Status_Bar", dlg, KM_SEPARATOR_ID); |
882 |
|
if (!statbar) |
883 |
|
BUG (NULL); |
884 |
ShowWindow (statbar, SW_SHOW); |
ShowWindow (statbar, SW_SHOW); |
885 |
SendMessage (statbar, SB_SETPARTS, (WPARAM)3, (LPARAM)partpos); |
SendMessage (statbar, SB_SETPARTS, (WPARAM)3, (LPARAM)partpos); |
886 |
|
|
887 |
update_default_key_str (statbar); |
update_default_key_str (statbar); |
888 |
update_status_bar (statbar, lv); |
update_status_bar (statbar, lv); |
|
|
|
889 |
return statbar; |
return statbar; |
890 |
} |
} |
891 |
|
|
955 |
return file_exist_check (path) == 0? true : false; |
return file_exist_check (path) == 0? true : false; |
956 |
} |
} |
957 |
|
|
958 |
|
|
959 |
/* Translate all menu strings. */ |
/* Translate all menu strings. */ |
960 |
static void |
static void |
961 |
translate_menu_strings (HWND dlg) |
translate_menu_strings (HWND dlg) |
990 |
set_menu_text (menu, ID_KEYMISC_EXPORT, _("&Export...")); |
set_menu_text (menu, ID_KEYMISC_EXPORT, _("&Export...")); |
991 |
set_menu_text (menu, ID_KEYMISC_IMPORT, _("&Import...")); |
set_menu_text (menu, ID_KEYMISC_IMPORT, _("&Import...")); |
992 |
set_menu_text (menu, ID_KEYMISC_PROPS, _("&Properties")); |
set_menu_text (menu, ID_KEYMISC_PROPS, _("&Properties")); |
993 |
set_menu_text (menu, ID_KEYMISC_GPGOPT, _("Options")); |
set_menu_text (menu, ID_KEYMISC_GPGOPT, _("GPG &Options")); |
994 |
set_menu_text (menu, ID_KEYMISC_GPGPREFS, _("Preferences")); |
set_menu_text (menu, ID_KEYMISC_GPGPREFS, _("&GPG Preferences")); |
995 |
|
set_menu_text (menu, ID_KEYMISC_WINPTPREFS, _("&WinPT Preferences")); |
996 |
set_menu_text (menu, ID_KEYMISC_SENDRECV, _("Keyserver") ); |
set_menu_text (menu, ID_KEYMISC_SENDRECV, _("Keyserver") ); |
997 |
set_menu_text (menu, ID_KEYMISC_EXPORT_PRIVKEY, _("E&xport Secret Key")); |
set_menu_text (menu, ID_KEYMISC_EXPORT_PRIVKEY, _("E&xport Secret Key")); |
998 |
set_menu_text (menu, ID_KEYMISC_RECACHE, _("Re&load Key Cache")); |
set_menu_text (menu, ID_KEYMISC_RECACHE, _("Re&load Key Cache")); |
1021 |
set_menu_text (popup, ID_KEYCTX_KEYID_COPY, _("Copy Key ID to Clipboard")); |
set_menu_text (popup, ID_KEYCTX_KEYID_COPY, _("Copy Key ID to Clipboard")); |
1022 |
set_menu_text (popup, ID_KEYCTX_FPR_COPY, _("Copy Fingerprint to Clipboard")); |
set_menu_text (popup, ID_KEYCTX_FPR_COPY, _("Copy Fingerprint to Clipboard")); |
1023 |
set_menu_text (popup, ID_KEYCTX_KINFO_COPY, _("Copy Key Info to Clipboard")); |
set_menu_text (popup, ID_KEYCTX_KINFO_COPY, _("Copy Key Info to Clipboard")); |
1024 |
|
set_menu_text (popup, ID_KEYCTX_EMAIL_COPY, _("Copy E-Mail to Clipboard")); |
1025 |
set_menu_text (popup, ID_KEYCTX_COPY, _("Copy Key to Clipboard")); |
set_menu_text (popup, ID_KEYCTX_COPY, _("Copy Key to Clipboard")); |
1026 |
set_menu_text (popup, ID_KEYCTX_PASTE, _("Paste Key from Clipboard")); |
set_menu_text (popup, ID_KEYCTX_PASTE, _("Paste Key from Clipboard")); |
1027 |
set_menu_text (popup, ID_KEYCTX_RECVFROM, _("Refresh from Keyserver")); |
set_menu_text (popup, ID_KEYCTX_RECVFROM, _("Refresh from Keyserver")); |
1070 |
static int |
static int |
1071 |
find_keypos (listview_ctrl_t lv, gpgme_key_t key) |
find_keypos (listview_ctrl_t lv, gpgme_key_t key) |
1072 |
{ |
{ |
1073 |
char keyid[16+1]; |
char keyid[32+1]; |
1074 |
int i; |
int i; |
1075 |
|
|
1076 |
for (i=0; i < listview_count_items (lv, 0); i++) { |
for (i=0; i < listview_count_items (lv, 0); i++) { |
1104 |
keylist_sort (kmi->lv, kmi->keylist_sortby); |
keylist_sort (kmi->lv, kmi->keylist_sortby); |
1105 |
update_status_bar (kmi->statbar, kmi->lv); |
update_status_bar (kmi->statbar, kmi->lv); |
1106 |
keyring_check_last_access (); |
keyring_check_last_access (); |
1107 |
|
SetForegroundWindow (kmi->dlg); |
1108 |
} |
} |
1109 |
|
|
1110 |
|
|
1146 |
} |
} |
1147 |
|
|
1148 |
|
|
|
static void |
|
|
reload_keylist (struct km_info_s *kmi) |
|
|
{ |
|
|
gpg_keycache_t c; |
|
|
|
|
|
c = keycache_get_ctx (1); |
|
|
keycache_reload (kmi->dlg); |
|
|
keylist_reload (kmi->lv, c, KEYLIST_LIST, kmi->keylist_sortby); |
|
|
update_status_bar (kmi->statbar, kmi->lv); |
|
|
keyring_check_last_access (); |
|
|
} |
|
|
|
|
|
|
|
1149 |
/* Reload the entire key cache and update the listview. */ |
/* Reload the entire key cache and update the listview. */ |
1150 |
static void |
static void |
1151 |
reload_keycache (struct km_info_s *kmi) |
reload_keycache (struct km_info_s *kmi) |
1152 |
{ |
{ |
|
refresh_cache_s rcs = {0}; |
|
1153 |
gpg_keycache_t c; |
gpg_keycache_t c; |
1154 |
|
|
1155 |
rcs.kr_reload = rcs.kr_update = 1; |
keycache_reload (kmi->dlg); |
|
rcs.tr_update = 0; |
|
|
DialogBoxParam (glob_hinst, (LPCSTR)IDD_WINPT_KEYCACHE, kmi->dlg, |
|
|
keycache_dlg_proc, (LPARAM)&rcs); |
|
1156 |
c = keycache_get_ctx (1); |
c = keycache_get_ctx (1); |
1157 |
keylist_reload (kmi->lv, c, KEYLIST_LIST, kmi->keylist_sortby); |
keylist_reload (kmi->lv, c, KEYLIST_LIST, kmi->keylist_sortby); |
1158 |
update_status_bar (kmi->statbar, kmi->lv); |
update_status_bar (kmi->statbar, kmi->lv); |
1159 |
SetForegroundWindow (kmi->dlg); |
SetForegroundWindow (kmi->dlg); |
1160 |
|
keyring_check_last_access (); |
1161 |
} |
} |
1162 |
|
|
1163 |
|
|
1165 |
static void |
static void |
1166 |
km_gui_import (struct km_info_s *kmi, int cmd_id, void *param) |
km_gui_import (struct km_info_s *kmi, int cmd_id, void *param) |
1167 |
{ |
{ |
1168 |
int newkeys=0, newsks=0; |
int newkeys = 0, newsks = 0; |
1169 |
int err = 0; |
int err = 0; |
1170 |
|
|
1171 |
switch (cmd_id) { |
switch (cmd_id) { |
1190 |
if (!err && !newsks && (newkeys > 0 && newkeys < KM_PRELOAD_KEYS)) |
if (!err && !newsks && (newkeys > 0 && newkeys < KM_PRELOAD_KEYS)) |
1191 |
refresh_keylist (kmi); |
refresh_keylist (kmi); |
1192 |
else if (!err) /* avoid to spawn too much processes. */ |
else if (!err) /* avoid to spawn too much processes. */ |
1193 |
reload_keylist (kmi); |
reload_keycache (kmi); |
|
|
|
1194 |
SetForegroundWindow (kmi->dlg); |
SetForegroundWindow (kmi->dlg); |
1195 |
} |
} |
1196 |
|
|
1222 |
if (!listview_get_item_state (kmi->lv, i)) |
if (!listview_get_item_state (kmi->lv, i)) |
1223 |
continue; |
continue; |
1224 |
switch (what) { |
switch (what) { |
1225 |
|
|
1226 |
|
case ID_KEYCTX_EMAIL_COPY: |
1227 |
|
key = km_get_key_ptr (kmi->lv, i, NULL); |
1228 |
|
gpgme_data_write (out, key->uids->email, strlen (key->uids->email)); |
1229 |
|
if (!single) gpgme_data_write (out, "\r\n", 2); |
1230 |
|
break; |
1231 |
|
|
1232 |
case ID_KEYCTX_UID_COPY: |
case ID_KEYCTX_UID_COPY: |
1233 |
key = km_get_key_ptr (kmi->lv, i, &kci); |
key = km_get_key_ptr (kmi->lv, i, &kci); |
1234 |
gpgme_data_write (out, kci->uids->uid, strlen (kci->uids->uid)); |
gpgme_data_write (out, kci->uids->uid, strlen (kci->uids->uid)); |
1324 |
keylist_proc.current = (WNDPROC)keylist_subclass_proc; |
keylist_proc.current = (WNDPROC)keylist_subclass_proc; |
1325 |
keylist_proc.old = (WNDPROC)GetWindowLong(kl, GWL_WNDPROC); |
keylist_proc.old = (WNDPROC)GetWindowLong(kl, GWL_WNDPROC); |
1326 |
if (keylist_proc.old) { |
if (keylist_proc.old) { |
1327 |
if( !SetWindowLong (kl, GWL_WNDPROC, (LONG)keylist_proc.current)) { |
if (!SetWindowLong (kl, GWL_WNDPROC, (LONG)keylist_proc.current)) { |
1328 |
msg_box (dlg, _("Could not set keylist window procedure."), |
msg_box (dlg, "Could not set keylist window procedure.", |
1329 |
_("Key Manager"), MB_ERR); |
_("Key Manager"), MB_ERR); |
1330 |
BUG (NULL); |
BUG (NULL); |
1331 |
} |
} |
1342 |
restore_column_info (kmi); |
restore_column_info (kmi); |
1343 |
keylist_sort (kmi->lv, kmi->keylist_sortby); |
keylist_sort (kmi->lv, kmi->keylist_sortby); |
1344 |
|
|
1345 |
|
SendMessage (dlg, WM_SETICON, (WPARAM)ICON_SMALL, |
1346 |
|
(LPARAM)LoadIcon (glob_hinst, (LPCTSTR)IDI_WINPT)); |
1347 |
SetDlgItemText (dlg, IDC_KEYMISC_GTEXT, _("Groups")); |
SetDlgItemText (dlg, IDC_KEYMISC_GTEXT, _("Groups")); |
1348 |
SetDlgItemText (dlg, ID_GROUP_SHOW, _("&Show")); |
SetDlgItemText (dlg, ID_GROUP_SHOW, _("&Show")); |
1349 |
SetDlgItemText (dlg, ID_GROUP_NEW, _("&New...")); |
SetDlgItemText (dlg, ID_GROUP_NEW, _("&New...")); |
|
SetClassLong (dlg, GCL_HICON, (LONG)LoadIcon (glob_hinst, |
|
|
(LPCTSTR)IDI_WINPT)); |
|
1350 |
SetForegroundWindow (dlg); |
SetForegroundWindow (dlg); |
1351 |
kmi->magic = SetTimer (dlg, 1, 1000, NULL); |
kmi->magic = SetTimer (dlg, 1, 1000, NULL); |
1352 |
return TRUE; |
return TRUE; |
1353 |
|
|
1354 |
|
|
1355 |
case WM_TIMER: |
case WM_TIMER: |
1356 |
KillTimer (dlg, kmi->magic); |
KillTimer (dlg, kmi->magic); |
1378 |
set_reg_entry (HKEY_CURRENT_USER, "Software\\WinPT", "KM_Size_Height", |
set_reg_entry (HKEY_CURRENT_USER, "Software\\WinPT", "KM_Size_Height", |
1379 |
type); |
type); |
1380 |
|
|
1381 |
/* Remove runtime information. This should be the last action taken here. */ |
/* Remove runtime information. |
1382 |
|
This should be the last action taken here. */ |
1383 |
delete kmi; |
delete kmi; |
1384 |
kmi = NULL; |
kmi = NULL; |
1385 |
SetWindowLong (dlg, GWL_USERDATA, 0); |
SetWindowLong (dlg, GWL_USERDATA, 0); |
1416 |
case TBN_GETBUTTONINFO: |
case TBN_GETBUTTONINFO: |
1417 |
LPTBNOTIFY lpTbNotify; |
LPTBNOTIFY lpTbNotify; |
1418 |
lpTbNotify = (LPTBNOTIFY)lparam; |
lpTbNotify = (LPTBNOTIFY)lparam; |
1419 |
if (lpTbNotify->iItem < (sizeof(myb) / sizeof(mybuttons))) { |
if (lpTbNotify->iItem < (sizeof(tbb) / sizeof(tb_button_s))) { |
1420 |
lpTbNotify->tbButton.iBitmap = imagelist_getindex (myb[lpTbNotify->iItem].icon); |
lpTbNotify->tbButton.iBitmap = imagelist_getindex (tbb[lpTbNotify->iItem].icon); |
1421 |
lpTbNotify->tbButton.idCommand = myb[lpTbNotify->iItem].command; |
lpTbNotify->tbButton.idCommand = tbb[lpTbNotify->iItem].command; |
1422 |
lpTbNotify->tbButton.fsState = TBSTATE_ENABLED; |
lpTbNotify->tbButton.fsState = TBSTATE_ENABLED; |
1423 |
lpTbNotify->tbButton.fsStyle = TBSTYLE_BUTTON; |
lpTbNotify->tbButton.fsStyle = TBSTYLE_BUTTON; |
1424 |
lpTbNotify->tbButton.iString = 0; |
lpTbNotify->tbButton.iString = 0; |
1425 |
strncpy (lpTbNotify->pszText, myb[lpTbNotify->iItem].text, lpTbNotify->cchText); |
strncpy (lpTbNotify->pszText, tbb[lpTbNotify->iItem].text, lpTbNotify->cchText); |
1426 |
SetWindowLong(dlg, DWL_MSGRESULT, TRUE); |
SetWindowLong(dlg, DWL_MSGRESULT, TRUE); |
1427 |
} |
} |
1428 |
return TRUE; |
return TRUE; |
1503 |
break; |
break; |
1504 |
|
|
1505 |
case NM_RCLICK: |
case NM_RCLICK: |
1506 |
wait_for_progress_cb (); |
if (!wait_for_progress_cb (0)) |
1507 |
|
break; |
1508 |
if (notify->idFrom == IDC_KEYMISC_KEYLIST) { |
if (notify->idFrom == IDC_KEYMISC_KEYLIST) { |
1509 |
l_idx =listview_get_curr_pos (kmi->lv); |
l_idx =listview_get_curr_pos (kmi->lv); |
1510 |
if (l_idx == -1) |
if (l_idx == -1) |
1574 |
NMLISTVIEW *nft = (LPNMLISTVIEW) lparam; |
NMLISTVIEW *nft = (LPNMLISTVIEW) lparam; |
1575 |
int sortby = 0; |
int sortby = 0; |
1576 |
|
|
1577 |
wait_for_progress_cb (); |
if (!wait_for_progress_cb (0)) |
1578 |
|
break; |
1579 |
switch (nft->iSubItem) { |
switch (nft->iSubItem) { |
1580 |
case 0: sortby = KEY_SORT_USERID; break; |
case 0: sortby = KEY_SORT_USERID; break; |
1581 |
case 1: sortby = KEY_SORT_KEYID; break; |
case 1: sortby = KEY_SORT_KEYID; break; |
1621 |
break; |
break; |
1622 |
|
|
1623 |
case WM_INITMENUPOPUP: |
case WM_INITMENUPOPUP: |
1624 |
if ((UINT)LOWORD (lparam) == 3) { |
hm = (HMENU)wparam; |
1625 |
HMENU h = (HMENU)wparam; |
if ((UINT)LOWORD (lparam) == 3) |
1626 |
set_menu_text_bypos (h, 0, _("New")); |
set_menu_text_bypos (hm, 0, _("New")); |
1627 |
} |
else if ((UINT)LOWORD (lparam) == 1) |
1628 |
/* XXX: before we can use it, we need to find a way to |
set_menu_text_bypos (hm, 8, _("Preferences...")); |
|
update the gpg access timestamp after each operation. |
|
|
if (keyring_check_last_access ()) |
|
|
reload_keylist (kmi); |
|
|
*/ |
|
1629 |
return FALSE; |
return FALSE; |
1630 |
|
|
1631 |
case WM_COMMAND: |
case WM_COMMAND: |
1800 |
refresh_keylist (kmi); |
refresh_keylist (kmi); |
1801 |
return TRUE; |
return TRUE; |
1802 |
|
|
1803 |
|
case ID_KEYMISC_WINPTPREFS: |
1804 |
|
dialog_box_param (glob_hinst, (LPCSTR)IDD_WINPT_PREFS, |
1805 |
|
dlg, prefs_dlg_proc, 0, |
1806 |
|
_("WinPT Preferences"), 0); |
1807 |
|
break; |
1808 |
|
|
1809 |
case ID_KEYMISC_GPGPREFS: |
case ID_KEYMISC_GPGPREFS: |
1810 |
rc = dialog_box_param (glob_hinst, (LPCSTR)IDD_WINPT_GPGPREFS, |
rc = dialog_box_param (glob_hinst, (LPCSTR)IDD_WINPT_GPGPREFS, |
1811 |
dlg, gpgprefs_dlg_proc, 0, |
dlg, gpgprefs_dlg_proc, 0, |
1891 |
IDS_WINPT_ABOUT); |
IDS_WINPT_ABOUT); |
1892 |
break; |
break; |
1893 |
|
|
1894 |
|
case ID_KEYMISC_DEVWWW: |
1895 |
|
ShellExecute (dlg, "open", "http://wald.intevation.org/projects/winpt", |
1896 |
|
NULL, NULL, SW_SHOW); |
1897 |
|
break; |
1898 |
|
|
1899 |
case ID_KEYMISC_WEBSITE: |
case ID_KEYMISC_WEBSITE: |
1900 |
ShellExecute (dlg, "open", "http://www.winpt.org", |
ShellExecute (dlg, "open", "http://www.winpt.org", |
1901 |
NULL, NULL, SW_SHOW); |
NULL, NULL, SW_SHOW); |
1945 |
_("Key Manager"), MB_INFO); |
_("Key Manager"), MB_INFO); |
1946 |
listview_select_all (kmi->lv); |
listview_select_all (kmi->lv); |
1947 |
} |
} |
1948 |
km_refresh_from_keyserver (kmi->lv, dlg); |
if (!km_refresh_from_keyserver (kmi->lv, dlg)) |
1949 |
msg_box (dlg, _("Keyserver refresh finished."), |
msg_box (dlg, _("Keyserver refresh finished."), |
1950 |
_("Key Manager"), MB_OK); |
_("Key Manager"), MB_OK); |
1951 |
break; |
break; |
1952 |
|
|
1953 |
/** Context menu **/ |
/** Context menu **/ |
2022 |
case ID_KEYCTX_KEYID_COPY: |
case ID_KEYCTX_KEYID_COPY: |
2023 |
case ID_KEYCTX_FPR_COPY: |
case ID_KEYCTX_FPR_COPY: |
2024 |
case ID_KEYCTX_KINFO_COPY: |
case ID_KEYCTX_KINFO_COPY: |
2025 |
|
case ID_KEYCTX_EMAIL_COPY: |
2026 |
copy_key_info (LOWORD (wparam), kmi); |
copy_key_info (LOWORD (wparam), kmi); |
2027 |
break; |
break; |
2028 |
|
|