148 |
static gpgme_error_t |
static gpgme_error_t |
149 |
currwnd_gpg_dlg (HWND hwnd, UINT id, int *ret_set) |
currwnd_gpg_dlg (HWND hwnd, UINT id, int *ret_set) |
150 |
{ |
{ |
151 |
gpgme_error_t err; |
gpgme_error_t err = gpg_error (GPG_ERR_NO_ERROR); |
152 |
int type; |
int type; |
153 |
|
|
154 |
if (ret_set) |
if (ret_set) |
160 |
|
|
161 |
case ID_WINPT_CURRWND_ENCRYPT: |
case ID_WINPT_CURRWND_ENCRYPT: |
162 |
dialog_box_param( glob_hinst, (LPCSTR)IDD_WINPT_ENCRYPT, hwnd, |
dialog_box_param( glob_hinst, (LPCSTR)IDD_WINPT_ENCRYPT, hwnd, |
163 |
clip_encrypt_dlg_proc, NULL, |
clip_encrypt_dlg_proc, 0, |
164 |
_("Encryption"), IDS_WINPT_ENCRYPT ); |
_("Encryption"), IDS_WINPT_ENCRYPT ); |
165 |
break; |
break; |
166 |
|
|
167 |
case ID_WINPT_CURRWND_SIGNENCRYPT: |
case ID_WINPT_CURRWND_SIGNENCRYPT: |
168 |
dialog_box_param( glob_hinst, (LPCSTR)IDD_WINPT_SIGNENC, hwnd, |
dialog_box_param( glob_hinst, (LPCSTR)IDD_WINPT_SIGNENC, hwnd, |
169 |
clip_signenc_dlg_proc, NULL, |
clip_signenc_dlg_proc, 0, |
170 |
_("Sign & Encrypt"), IDS_WINPT_SIGNENC ); |
_("Sign & Encrypt"), IDS_WINPT_SIGNENC ); |
171 |
break; |
break; |
172 |
|
|
173 |
case ID_WINPT_CURRWND_SIGN: |
case ID_WINPT_CURRWND_SIGN: |
174 |
dialog_box_param( glob_hinst, (LPCSTR)IDD_WINPT_SIGN, hwnd, |
dialog_box_param( glob_hinst, (LPCSTR)IDD_WINPT_SIGN, hwnd, |
175 |
clip_sign_dlg_proc, NULL, |
clip_sign_dlg_proc, 0, |
176 |
_("Signing"), IDS_WINPT_SIGN ); |
_("Signing"), IDS_WINPT_SIGN ); |
177 |
break; |
break; |
178 |
|
|
188 |
err = clip_decrypt_dlg (hwnd); |
err = clip_decrypt_dlg (hwnd); |
189 |
if (!err && reg_prefs.use_viewer) { |
if (!err && reg_prefs.use_viewer) { |
190 |
dialog_box_param( glob_hinst, (LPCSTR)IDD_WINPT_CLIPEDIT, |
dialog_box_param( glob_hinst, (LPCSTR)IDD_WINPT_CLIPEDIT, |
191 |
GetDesktopWindow(), clip_edit_dlg_proc, NULL, |
GetDesktopWindow(), clip_edit_dlg_proc, 0, |
192 |
_("Clipboard Editor"), IDS_WINPT_CLIPEDIT); |
_("Clipboard Editor"), IDS_WINPT_CLIPEDIT); |
193 |
if (ret_set) |
if (ret_set) |
194 |
*ret_set = 0; |
*ret_set = 0; |
198 |
km_clip_import (GetDesktopWindow ()); |
km_clip_import (GetDesktopWindow ()); |
199 |
else { |
else { |
200 |
dialog_box_param( glob_hinst, (LPCSTR)IDD_WINPT_VERIFY, hwnd, |
dialog_box_param( glob_hinst, (LPCSTR)IDD_WINPT_VERIFY, hwnd, |
201 |
clip_verify_dlg_proc, NULL, |
clip_verify_dlg_proc, 0, |
202 |
_("Verify"), IDS_WINPT_VERIFY ); |
_("Verify"), IDS_WINPT_VERIFY ); |
203 |
err = gpg_error (GPG_ERR_EOF); /* make sure window is ot updated. */ |
err = gpg_error (GPG_ERR_EOF); /* make sure window is ot updated. */ |
204 |
} |
} |
214 |
{ |
{ |
215 |
gpgme_error_t err; |
gpgme_error_t err; |
216 |
int type; |
int type; |
|
size_t size = 0; |
|
217 |
|
|
218 |
if( (id == ID_WINPT_SIGN || id == ID_WINPT_SIGNENCRYPT) |
if( (id == ID_WINPT_SIGN || id == ID_WINPT_SIGNENCRYPT) |
219 |
&& gnupg_access_keyring (0) ) { |
&& gnupg_access_keyring (0) ) { |
228 |
|
|
229 |
case ID_WINPT_ENCRYPT: |
case ID_WINPT_ENCRYPT: |
230 |
dialog_box_param( glob_hinst, (LPCSTR)IDD_WINPT_ENCRYPT, hwnd, |
dialog_box_param( glob_hinst, (LPCSTR)IDD_WINPT_ENCRYPT, hwnd, |
231 |
clip_encrypt_dlg_proc, NULL, |
clip_encrypt_dlg_proc, 0, |
232 |
_("Encryption"), IDS_WINPT_ENCRYPT ); |
_("Encryption"), IDS_WINPT_ENCRYPT ); |
233 |
break; |
break; |
234 |
|
|
235 |
case ID_WINPT_SIGN: |
case ID_WINPT_SIGN: |
236 |
dialog_box_param( glob_hinst, (LPCSTR)IDD_WINPT_SIGN, hwnd, |
dialog_box_param( glob_hinst, (LPCSTR)IDD_WINPT_SIGN, hwnd, |
237 |
clip_sign_dlg_proc, NULL, |
clip_sign_dlg_proc, 0, |
238 |
_("Signing"), IDS_WINPT_SIGN ); |
_("Signing"), IDS_WINPT_SIGN ); |
239 |
break; |
break; |
240 |
|
|
241 |
case ID_WINPT_SIGNENCRYPT: |
case ID_WINPT_SIGNENCRYPT: |
242 |
dialog_box_param( glob_hinst, (LPCSTR)IDD_WINPT_SIGNENC, hwnd, |
dialog_box_param( glob_hinst, (LPCSTR)IDD_WINPT_SIGNENC, hwnd, |
243 |
clip_signenc_dlg_proc, NULL, |
clip_signenc_dlg_proc, 0, |
244 |
_("Sign & Encrypt"), IDS_WINPT_SIGNENC ); |
_("Sign & Encrypt"), IDS_WINPT_SIGNENC ); |
245 |
break; |
break; |
246 |
|
|
254 |
err = clip_decrypt_dlg (hwnd); |
err = clip_decrypt_dlg (hwnd); |
255 |
if (!err && reg_prefs.use_viewer) { |
if (!err && reg_prefs.use_viewer) { |
256 |
dialog_box_param( glob_hinst, (LPCSTR)IDD_WINPT_CLIPEDIT, |
dialog_box_param( glob_hinst, (LPCSTR)IDD_WINPT_CLIPEDIT, |
257 |
GetDesktopWindow(), clip_edit_dlg_proc, NULL, |
GetDesktopWindow(), clip_edit_dlg_proc, 0, |
258 |
_("Clipboard Editor"), IDS_WINPT_CLIPEDIT ); |
_("Clipboard Editor"), IDS_WINPT_CLIPEDIT ); |
259 |
} |
} |
260 |
} |
} |
284 |
} |
} |
285 |
else if (type & PGP_CLEARSIG) { |
else if (type & PGP_CLEARSIG) { |
286 |
dialog_box_param( glob_hinst, (LPCSTR)IDD_WINPT_VERIFY, hwnd, |
dialog_box_param( glob_hinst, (LPCSTR)IDD_WINPT_VERIFY, hwnd, |
287 |
clip_verify_dlg_proc, NULL, |
clip_verify_dlg_proc, 0, |
288 |
_("Verify"), IDS_WINPT_VERIFY ); |
_("Verify"), IDS_WINPT_VERIFY ); |
289 |
} |
} |
290 |
else if ((type & PGP_PUBKEY) || (type & PGP_SECKEY)) |
else if ((type & PGP_PUBKEY) || (type & PGP_SECKEY)) |
337 |
reminder_ctx_s ctx; |
reminder_ctx_s ctx; |
338 |
LPARAM param; |
LPARAM param; |
339 |
curr_wnd_ctx currwnd = {0}; |
curr_wnd_ctx currwnd = {0}; |
|
size_t size = 0; |
|
340 |
int rc, set_wc = 0, has_data = 0; |
int rc, set_wc = 0, has_data = 0; |
341 |
INITCOMMONCONTROLSEX cce; |
INITCOMMONCONTROLSEX cce; |
342 |
gpgme_error_t err; |
gpgme_error_t err; |
384 |
if (chk == -1) |
if (chk == -1) |
385 |
DialogBoxParam (glob_hinst, (LPCTSTR)IDD_WINPT_CONFDELCLIP, |
DialogBoxParam (glob_hinst, (LPCTSTR)IDD_WINPT_CONFDELCLIP, |
386 |
GetDesktopWindow (), confirm_delclipboard_dlg, |
GetDesktopWindow (), confirm_delclipboard_dlg, |
387 |
NULL); |
0); |
388 |
if (wipe_contents || chk) |
if (wipe_contents || chk) |
389 |
set_clip_text (NULL, " ", 1); |
set_clip_text (NULL, " ", 1); |
390 |
wipe_contents = 0; |
wipe_contents = 0; |
550 |
/** File handling **/ |
/** File handling **/ |
551 |
case ID_WINPT_FILE: |
case ID_WINPT_FILE: |
552 |
dialog_box_param( glob_hinst, (LPCSTR)IDD_WINPT_FILE, |
dialog_box_param( glob_hinst, (LPCSTR)IDD_WINPT_FILE, |
553 |
GetDesktopWindow(), file_manager_dlg_proc, NULL, |
GetDesktopWindow(), file_manager_dlg_proc, 0, |
554 |
_("File Manager (use drag & drop to add files)"), IDS_WINPT_FILE ); |
_("File Manager (use drag & drop to add files)"), IDS_WINPT_FILE ); |
555 |
break; |
break; |
556 |
|
|
571 |
|
|
572 |
case ID_WINPT_EDIT: |
case ID_WINPT_EDIT: |
573 |
dialog_box_param( glob_hinst, (LPCSTR)IDD_WINPT_CLIPEDIT, |
dialog_box_param( glob_hinst, (LPCSTR)IDD_WINPT_CLIPEDIT, |
574 |
GetDesktopWindow(), clip_edit_dlg_proc, NULL, |
GetDesktopWindow(), clip_edit_dlg_proc, 0, |
575 |
_("Clipboard Editor"), IDS_WINPT_CLIPEDIT ); |
_("Clipboard Editor"), IDS_WINPT_CLIPEDIT ); |
576 |
break; |
break; |
577 |
|
|
578 |
case ID_WINPT_ABOUT: |
case ID_WINPT_ABOUT: |
579 |
dialog_box_param( glob_hinst, (LPCSTR)IDD_WINPT_ABOUT, GetDesktopWindow(), |
dialog_box_param( glob_hinst, (LPCSTR)IDD_WINPT_ABOUT, GetDesktopWindow(), |
580 |
about_winpt_dlg_proc, NULL, |
about_winpt_dlg_proc, 0, |
581 |
_("About WinPT"), IDS_WINPT_ABOUT ); |
_("About WinPT"), IDS_WINPT_ABOUT ); |
582 |
break; |
break; |
583 |
|
|
584 |
case ID_WINPT_PREFS: |
case ID_WINPT_PREFS: |
585 |
dialog_box_param( glob_hinst, (LPCSTR)IDD_WINPT_PREFS, GetDesktopWindow(), |
dialog_box_param( glob_hinst, (LPCSTR)IDD_WINPT_PREFS, GetDesktopWindow(), |
586 |
prefs_dlg_proc, NULL, |
prefs_dlg_proc, 0, |
587 |
_("WinPT Preferences"), IDS_WINPT_PREFS ); |
_("WinPT Preferences"), IDS_WINPT_PREFS ); |
588 |
break; |
break; |
589 |
|
|
590 |
case ID_WINPT_GPGPREFS: |
case ID_WINPT_GPGPREFS: |
591 |
dialog_box_param (glob_hinst, (LPCSTR)IDD_WINPT_GPGPREFS, GetDesktopWindow(), |
dialog_box_param (glob_hinst, (LPCSTR)IDD_WINPT_GPGPREFS, GetDesktopWindow(), |
592 |
gpgprefs_dlg_proc, NULL, |
gpgprefs_dlg_proc, 0, |
593 |
_("GnuPG Preferences"), IDS_WINPT_GPGPREFS); |
_("GnuPG Preferences"), IDS_WINPT_GPGPREFS); |
594 |
break; |
break; |
595 |
|
|
596 |
case ID_WINPT_CDISKNEW: |
case ID_WINPT_CDISKNEW: |
597 |
DialogBoxParam (glob_hinst, (LPCTSTR)IDD_WINPT_CDISK_NEW, |
DialogBoxParam (glob_hinst, (LPCTSTR)IDD_WINPT_CDISK_NEW, |
598 |
GetDesktopWindow (), cryptdisk_new_dlg_proc, NULL); |
GetDesktopWindow (), cryptdisk_new_dlg_proc, 0); |
599 |
break; |
break; |
600 |
|
|
601 |
case ID_WINPT_CDISKMOUNT: |
case ID_WINPT_CDISKMOUNT: |
602 |
DialogBoxParam (glob_hinst, (LPCTSTR)IDD_WINPT_CDISK_MOUNT, |
DialogBoxParam (glob_hinst, (LPCTSTR)IDD_WINPT_CDISK_MOUNT, |
603 |
GetDesktopWindow (), cryptdisk_mount_dlg_proc, NULL); |
GetDesktopWindow (), cryptdisk_mount_dlg_proc, 0); |
604 |
break; |
break; |
605 |
|
|
606 |
case ID_WINPT_CDISKUNMOUNT: |
case ID_WINPT_CDISKUNMOUNT: |
607 |
DialogBoxParam (glob_hinst, (LPCTSTR)IDD_WINPT_CDISK_UMOUNT, |
DialogBoxParam (glob_hinst, (LPCTSTR)IDD_WINPT_CDISK_UMOUNT, |
608 |
GetDesktopWindow (), cryptdisk_umount_dlg_proc, NULL); |
GetDesktopWindow (), cryptdisk_umount_dlg_proc, 0); |
609 |
break; |
break; |
610 |
|
|
611 |
case ID_WINPT_CDISKUMOUNTALL: |
case ID_WINPT_CDISKUMOUNTALL: |