59 |
gpgme_key_t key; |
gpgme_key_t key; |
60 |
char tmp[128+64+1]; |
char tmp[128+64+1]; |
61 |
|
|
62 |
switch( msg ) { |
switch (msg) { |
63 |
case WM_INITDIALOG: |
case WM_INITDIALOG: |
64 |
pc = keycache_get_ctx (1); |
pc = keycache_get_ctx (1); |
65 |
while (!gpg_keycache_next_key (pc, 0, &key)) { |
while (!gpg_keycache_next_key (pc, 0, &key)) { |
292 |
else |
else |
293 |
msg_box (hwnd, _("Unknown OpenPGP type."), _("Clipboard"), MB_ERR); |
msg_box (hwnd, _("Unknown OpenPGP type."), _("Clipboard"), MB_ERR); |
294 |
} |
} |
295 |
} /* clip_gpg_dlg */ |
} |
296 |
|
|
297 |
|
|
298 |
|
static bool |
299 |
|
secret_key_available (void) |
300 |
|
{ |
301 |
|
gpg_keycache_t sec = keycache_get_ctx (0); |
302 |
|
if (!sec || gpg_keycache_get_size (sec) == 0) |
303 |
|
return false; |
304 |
|
return true; |
305 |
|
} |
306 |
|
|
307 |
|
|
308 |
/* Load the Card Manager with the current card. */ |
/* Load the Card Manager with the current card. */ |
404 |
Shell_NotifyIcon (NIM_DELETE, &NID); |
Shell_NotifyIcon (NIM_DELETE, &NID); |
405 |
PostQuitMessage (0); |
PostQuitMessage (0); |
406 |
ExitProcess (0); |
ExitProcess (0); |
407 |
return 0; |
break; |
408 |
|
|
409 |
case WM_USER: |
case WM_USER: |
410 |
switch (lparam) { |
switch (lparam) { |
418 |
GetCursorPos (&p); |
GetCursorPos (&p); |
419 |
hm = LoadMenu (glob_hinst, MAKEINTRESOURCE (IDR_WINPT)); |
hm = LoadMenu (glob_hinst, MAKEINTRESOURCE (IDR_WINPT)); |
420 |
popup = GetSubMenu (hm, 0); |
popup = GetSubMenu (hm, 0); |
421 |
#ifndef LANG_DE |
|
422 |
set_menu_text( popup, ID_WINPT_FILE, _("File Manager") ); |
set_menu_text( popup, ID_WINPT_FILE, _("File Manager") ); |
423 |
set_menu_text( popup, ID_WINPT_KEY, _("Key Manager") ); |
set_menu_text( popup, ID_WINPT_KEY, _("Key Manager") ); |
424 |
set_menu_text( popup, ID_WINPT_CARD, _("Card Manager") ); |
set_menu_text( popup, ID_WINPT_CARD, _("Card Manager") ); |
435 |
set_menu_text (popup, ID_WINPT_QUIT, _("Exit")); |
set_menu_text (popup, ID_WINPT_QUIT, _("Exit")); |
436 |
set_menu_text (popup, ID_WINPT_SYMENC, _("Symmetric")); |
set_menu_text (popup, ID_WINPT_SYMENC, _("Symmetric")); |
437 |
set_menu_text (popup, ID_WINPT_ENCRYPT, _("Encrypt")); |
set_menu_text (popup, ID_WINPT_ENCRYPT, _("Encrypt")); |
438 |
|
set_menu_text (popup, ID_WINPT_SIGN, _("Sign")); |
439 |
set_menu_text (popup, ID_WINPT_SIGNENCRYPT, _("Sign && Encrypt")); |
set_menu_text (popup, ID_WINPT_SIGNENCRYPT, _("Sign && Encrypt")); |
440 |
set_menu_text (popup, ID_WINPT_DECRYPT, _("Decrypt/Verify")); |
set_menu_text (popup, ID_WINPT_DECRYPT, _("Decrypt/Verify")); |
441 |
set_menu_text (popup, ID_WINPT_VERIFY, _("Verify")); |
set_menu_text (popup, ID_WINPT_VERIFY, _("Verify")); |
443 |
set_menu_text (popup, ID_WINPT_CURRWND_SIGNENCRYPT, _("Sign && Encrypt")); |
set_menu_text (popup, ID_WINPT_CURRWND_SIGNENCRYPT, _("Sign && Encrypt")); |
444 |
set_menu_text (popup, ID_WINPT_CURRWND_DECRYPT_VERIFY, _("Decrypt/Verify")); |
set_menu_text (popup, ID_WINPT_CURRWND_DECRYPT_VERIFY, _("Decrypt/Verify")); |
445 |
set_menu_text (popup, ID_WINPT_CURRWND_SIGN, _("Sign")); |
set_menu_text (popup, ID_WINPT_CURRWND_SIGN, _("Sign")); |
446 |
|
if (!secret_key_available ()) { |
447 |
|
set_menu_state (popup, ID_WINPT_SIGN, MF_DISABLED|MF_GRAYED); |
448 |
|
set_menu_state (popup, ID_WINPT_CURRWND_SIGN, MF_DISABLED|MF_GRAYED); |
449 |
|
set_menu_state (popup, ID_WINPT_SIGNENCRYPT, MF_DISABLED|MF_GRAYED); |
450 |
|
set_menu_state (popup, ID_WINPT_CURRWND_SIGNENCRYPT, MF_DISABLED|MF_GRAYED); |
451 |
|
} |
452 |
/* change popup texts */ |
/* change popup texts */ |
453 |
set_menu_text_bypos (popup, 6, _("Clipboard")); |
set_menu_text_bypos (popup, 6, _("Clipboard")); |
454 |
set_menu_text_bypos (popup, 7, _("Current Window")); |
set_menu_text_bypos (popup, 7, _("Current Window")); |
455 |
set_menu_text_bypos (popup, 9, _("Preferences")); |
set_menu_text_bypos (popup, 9, _("Preferences")); |
456 |
|
|
457 |
#endif |
TrackPopupMenu (popup, TPM_RIGHTALIGN, p.x, p.y, 0, hwnd, NULL); |
458 |
TrackPopupMenu( popup, TPM_RIGHTALIGN, p.x, p.y, 0, hwnd, NULL ); |
PostMessage (hwnd, WM_USER, 0, 0); |
459 |
PostMessage( hwnd, WM_USER, 0, 0 ); |
DestroyMenu (popup); |
460 |
DestroyMenu( popup ); |
DestroyMenu (hm); |
|
DestroyMenu( hm ); |
|
461 |
break; |
break; |
462 |
|
|
463 |
case WM_LBUTTONDBLCLK: |
case WM_LBUTTONDBLCLK: |