139 |
currwnd_gpg_dlg (HWND hwnd, UINT id, int *ret_set) |
currwnd_gpg_dlg (HWND hwnd, UINT id, int *ret_set) |
140 |
{ |
{ |
141 |
gpgme_error_t err; |
gpgme_error_t err; |
142 |
gpgme_cliptype_t type; |
gpgme_pgptype_t type; |
143 |
int rc = 0; |
int rc = 0; |
144 |
|
|
145 |
if( ret_set ) |
if( ret_set ) |
173 |
msg_box( hwnd, gpgme_strerror( err ), _("Clipboard"), MB_ERR ); |
msg_box( hwnd, gpgme_strerror( err ), _("Clipboard"), MB_ERR ); |
174 |
break; |
break; |
175 |
} |
} |
176 |
if( (type & GPGME_CLIP_MESSAGE) && !(type & GPGME_CLIP_CLEARSIG) ) { |
if( (type & GPGME_PGP_MESSAGE) && !(type & GPGME_PGP_CLEARSIG) ) { |
177 |
/* 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 |
178 |
really a ciphertext. Verfied data doesn't need this. */ |
really a ciphertext. Verfied data doesn't need this. */ |
179 |
rc = clip_decrypt_dlg( hwnd ); |
rc = clip_decrypt_dlg( hwnd ); |
185 |
*ret_set = 0; |
*ret_set = 0; |
186 |
} |
} |
187 |
} |
} |
188 |
else if ((type & GPGME_CLIP_PUBKEY) && !(type & GPGME_CLIP_CLEARSIG)) |
else if ((type & GPGME_PGP_PUBKEY) && !(type & GPGME_PGP_CLEARSIG)) |
189 |
km_clip_import (GetDesktopWindow ()); |
km_clip_import (GetDesktopWindow ()); |
190 |
else { |
else { |
191 |
dialog_box_param( glob_hinst, (LPCSTR)IDD_WINPT_VERIFY, hwnd, |
dialog_box_param( glob_hinst, (LPCSTR)IDD_WINPT_VERIFY, hwnd, |
204 |
clip_gpg_dlg( HWND hwnd, UINT id ) |
clip_gpg_dlg( HWND hwnd, UINT id ) |
205 |
{ |
{ |
206 |
gpgme_error_t ec; |
gpgme_error_t ec; |
207 |
gpgme_cliptype_t type; |
gpgme_pgptype_t type; |
208 |
size_t size = 0; |
size_t size = 0; |
209 |
int rc; |
int rc; |
210 |
|
|
243 |
msg_box( hwnd, gpgme_strerror( ec ), _("Clipboard"), MB_ERR ); |
msg_box( hwnd, gpgme_strerror( ec ), _("Clipboard"), MB_ERR ); |
244 |
break; |
break; |
245 |
} |
} |
246 |
if( (type & GPGME_CLIP_MESSAGE) && !(type & GPGME_CLIP_CLEARSIG) ) { |
if( (type & GPGME_PGP_MESSAGE) && !(type & GPGME_PGP_CLEARSIG) ) { |
247 |
rc = clip_decrypt_dlg (hwnd); |
rc = clip_decrypt_dlg (hwnd); |
248 |
if (!rc && reg_prefs.use_viewer) { |
if (!rc && reg_prefs.use_viewer) { |
249 |
dialog_box_param( glob_hinst, (LPCSTR)IDD_WINPT_CLIPEDIT, |
dialog_box_param( glob_hinst, (LPCSTR)IDD_WINPT_CLIPEDIT, |
251 |
_("Clipboard Editor"), IDS_WINPT_CLIPEDIT ); |
_("Clipboard Editor"), IDS_WINPT_CLIPEDIT ); |
252 |
} |
} |
253 |
} |
} |
254 |
else if( (type & GPGME_CLIP_SIG) && !(type & GPGME_CLIP_CLEARSIG) ) { |
else if( (type & GPGME_PGP_SIG) && !(type & GPGME_PGP_CLEARSIG) ) { |
255 |
text_input_s input; |
text_input_s input; |
256 |
gpgme_data_t sig; |
gpgme_data_t sig; |
257 |
|
|
275 |
free_if_alloc( input.data ); |
free_if_alloc( input.data ); |
276 |
} |
} |
277 |
} |
} |
278 |
else if( type & GPGME_CLIP_CLEARSIG ) { |
else if (type & GPGME_PGP_CLEARSIG) { |
279 |
dialog_box_param( glob_hinst, (LPCSTR)IDD_WINPT_VERIFY, hwnd, |
dialog_box_param( glob_hinst, (LPCSTR)IDD_WINPT_VERIFY, hwnd, |
280 |
clip_verify_dlg_proc, NULL, |
clip_verify_dlg_proc, NULL, |
281 |
_("Verify"), IDS_WINPT_VERIFY ); |
_("Verify"), IDS_WINPT_VERIFY ); |
282 |
} |
} |
283 |
else if ((type & GPGME_CLIP_PUBKEY) || (type & GPGME_CLIP_SECKEY)) |
else if ((type & GPGME_PGP_PUBKEY) || (type & GPGME_PGP_SECKEY)) |
284 |
km_clip_import (GetDesktopWindow ()); |
km_clip_import (GetDesktopWindow ()); |
285 |
else |
else |
286 |
msg_box (hwnd, _("Unknown OpenPGP type."), _("Clipboard"), MB_ERR); |
msg_box (hwnd, _("Unknown OpenPGP type."), _("Clipboard"), MB_ERR); |