95 |
switch (msg) { |
switch (msg) { |
96 |
case WM_INITDIALOG: |
case WM_INITDIALOG: |
97 |
SetWindowText (dlg, _("Delete Clipboard Contents")); |
SetWindowText (dlg, _("Delete Clipboard Contents")); |
98 |
SetDlgItemText (dlg, IDC_CONFDELCLIP_BRAIN, _("&Remember the answer")); |
SetDlgItemText (dlg, IDC_CONFDELCLIP_BRAIN, |
99 |
SetDlgItemText (dlg, IDC_CONFDELCLIP_INFO, _("Do you want to delete the contents from the clipboard?")); |
_("&Remember the answer")); |
100 |
|
SetDlgItemText (dlg, IDC_CONFDELCLIP_INFO, |
101 |
|
_("Do you want to delete the contents from the clipboard?")); |
102 |
SetDlgItemText (dlg, IDYES, _("&Yes")); |
SetDlgItemText (dlg, IDYES, _("&Yes")); |
103 |
SetDlgItemText (dlg, IDNO, _("&No")); |
SetDlgItemText (dlg, IDNO, _("&No")); |
104 |
center_window (dlg, NULL); |
center_window (dlg, NULL); |
137 |
*ret_set = 1; |
*ret_set = 1; |
138 |
switch (id) { |
switch (id) { |
139 |
case ID_WINPT_CURRWND_SYMENC: |
case ID_WINPT_CURRWND_SYMENC: |
140 |
gpg_encrypt_symmetric (); |
gpg_clip_sym_encrypt (); |
141 |
break; |
break; |
142 |
|
|
143 |
case ID_WINPT_CURRWND_ENCRYPT: |
case ID_WINPT_CURRWND_ENCRYPT: |
164 |
msg_box (hwnd, gpgme_strerror (err), _("Clipboard"), MB_ERR); |
msg_box (hwnd, gpgme_strerror (err), _("Clipboard"), MB_ERR); |
165 |
break; |
break; |
166 |
} |
} |
167 |
if( (type & PGP_MESSAGE) && !(type & PGP_CLEARSIG) ) { |
if ((type & PGP_MESSAGE) && !(type & PGP_CLEARSIG)) { |
168 |
/* It makes only sense to insert the data in the window if it's |
/* It makes only sense to insert the data in the window if it's |
169 |
really a ciphertext. Verfied data doesn't need this. */ |
really a ciphertext. Verfied data doesn't need this. */ |
170 |
err = clip_decrypt_dlg (hwnd); |
err = clip_decrypt_dlg (hwnd, reg_prefs.use_viewer); |
171 |
if (!err && reg_prefs.use_viewer) { |
if (!err && ret_set) |
172 |
dialog_box_param( glob_hinst, (LPCSTR)IDD_WINPT_CLIPEDIT, |
*ret_set = 0; |
|
GetDesktopWindow(), clip_edit_dlg_proc, 0, |
|
|
_("Clipboard Editor"), IDS_WINPT_CLIPEDIT); |
|
|
if (ret_set) |
|
|
*ret_set = 0; |
|
|
} |
|
173 |
} |
} |
174 |
else if ((type & PGP_PUBKEY) && !(type & PGP_CLEARSIG)) |
else if ((type & PGP_PUBKEY) && !(type & PGP_CLEARSIG)) |
175 |
km_clip_import (GetDesktopWindow (), NULL, NULL); |
km_clip_import (GetDesktopWindow (), NULL, NULL); |
200 |
|
|
201 |
switch( id ) { |
switch( id ) { |
202 |
case ID_WINPT_SYMENC: |
case ID_WINPT_SYMENC: |
203 |
gpg_encrypt_symmetric (); |
gpg_clip_sym_encrypt (); |
204 |
break; |
break; |
205 |
|
|
206 |
case ID_WINPT_ENCRYPT: |
case ID_WINPT_ENCRYPT: |
227 |
msg_box( hwnd, gpgme_strerror( err ), _("Clipboard"), MB_ERR ); |
msg_box( hwnd, gpgme_strerror( err ), _("Clipboard"), MB_ERR ); |
228 |
break; |
break; |
229 |
} |
} |
230 |
if( (type & PGP_MESSAGE) && !(type & PGP_CLEARSIG) ) { |
if((type & PGP_MESSAGE) && !(type & PGP_CLEARSIG)) |
231 |
err = clip_decrypt_dlg (hwnd); |
err = clip_decrypt_dlg (hwnd, reg_prefs.use_viewer); |
232 |
if (!err && reg_prefs.use_viewer) { |
else if ((type & PGP_SIG) && !(type & PGP_CLEARSIG)) { |
|
dialog_box_param( glob_hinst, (LPCSTR)IDD_WINPT_CLIPEDIT, |
|
|
GetDesktopWindow(), clip_edit_dlg_proc, 0, |
|
|
_("Clipboard Editor"), IDS_WINPT_CLIPEDIT ); |
|
|
} |
|
|
} |
|
|
else if( (type & PGP_SIG) && !(type & PGP_CLEARSIG) ) { |
|
233 |
text_input_s input; |
text_input_s input; |
234 |
gpgme_data_t sig; |
gpgme_data_t sig; |
235 |
|
|
301 |
} |
} |
302 |
|
|
303 |
|
|
304 |
|
/* Initialize all needed common controls. */ |
305 |
static void |
static void |
306 |
init_common_controls (void) |
init_common_controls (void) |
307 |
{ |
{ |
390 |
|
|
391 |
gpg_read_only = gpg_check_permissions (0) == 0? 0 : 1; |
gpg_read_only = gpg_check_permissions (0) == 0? 0 : 1; |
392 |
|
|
393 |
|
wait_for_progress_cb (); |
394 |
SetForegroundWindow (hwnd); |
SetForegroundWindow (hwnd); |
395 |
GetCursorPos (&p); |
GetCursorPos (&p); |
396 |
hm = LoadMenu (glob_hinst, MAKEINTRESOURCE (IDR_WINPT)); |
hm = LoadMenu (glob_hinst, MAKEINTRESOURCE (IDR_WINPT)); |
414 |
set_menu_text (popup, ID_WINPT_CURRWND_SIGNENCRYPT, _("Sign && Encrypt")); |
set_menu_text (popup, ID_WINPT_CURRWND_SIGNENCRYPT, _("Sign && Encrypt")); |
415 |
set_menu_text (popup, ID_WINPT_CURRWND_DECRYPT_VERIFY, _("Decrypt/Verify")); |
set_menu_text (popup, ID_WINPT_CURRWND_DECRYPT_VERIFY, _("Decrypt/Verify")); |
416 |
set_menu_text (popup, ID_WINPT_CURRWND_SIGN, _("Sign")); |
set_menu_text (popup, ID_WINPT_CURRWND_SIGN, _("Sign")); |
417 |
|
set_menu_text (popup, ID_WINPT_CURRWND_SYMENC, _("Symmetric")); |
418 |
if (!secret_key_available ()) { |
if (!secret_key_available ()) { |
419 |
set_menu_state (popup, ID_WINPT_SIGN, MF_DISABLED|MF_GRAYED); |
set_menu_state (popup, ID_WINPT_SIGN, MF_DISABLED|MF_GRAYED); |
420 |
set_menu_state (popup, ID_WINPT_CURRWND_SIGN, MF_DISABLED|MF_GRAYED); |
set_menu_state (popup, ID_WINPT_CURRWND_SIGN, MF_DISABLED|MF_GRAYED); |
433 |
break; |
break; |
434 |
|
|
435 |
case WM_LBUTTONDBLCLK: |
case WM_LBUTTONDBLCLK: |
436 |
|
wait_for_progress_cb (); |
437 |
gpg_read_only = gpg_check_permissions (0) == 0? 0 : 1; |
gpg_read_only = gpg_check_permissions (0) == 0? 0 : 1; |
438 |
SendMessage (hwnd, WM_COMMAND, ID_WINPT_KEY, 0); |
SendMessage (hwnd, WM_COMMAND, ID_WINPT_KEY, 0); |
439 |
break; |
break; |
442 |
|
|
443 |
case WM_HOTKEY: |
case WM_HOTKEY: |
444 |
cmd = 0; |
cmd = 0; |
445 |
switch( wparam ) { |
switch (wparam) { |
446 |
case WPT_CLIP_ENCRYPT_ID: |
case WPT_CLIP_ENCRYPT_ID: |
447 |
SendMessage( hwnd, WM_COMMAND, ID_WINPT_ENCRYPT, 0 ); |
SendMessage( hwnd, WM_COMMAND, ID_WINPT_ENCRYPT, 0 ); |
448 |
break; |
break; |