181 |
c = (fm_state_s *)lparam; |
c = (fm_state_s *)lparam; |
182 |
if (!c) |
if (!c) |
183 |
dlg_fatal_error( dlg, "Could not get dialog param!" ); |
dlg_fatal_error( dlg, "Could not get dialog param!" ); |
184 |
#ifndef LANG_DE |
#ifndef LANG_DE |
185 |
SetWindowText (dlg, _("File Import")); |
SetWindowText (dlg, _("File Import")); |
186 |
#endif |
#endif |
187 |
ShowWindow( GetDlgItem( dlg, IDC_IMPORT_KEYMNGT ), WS_DISABLED ); |
ShowWindow( GetDlgItem( dlg, IDC_IMPORT_KEYMNGT ), WS_DISABLED ); |
188 |
/* fixme: use the new code */ |
/* XXX: use the new code */ |
189 |
implist_build( &lv, GetDlgItem( dlg, IDC_IMPORT_KEYLIST ) ); |
implist_build (&lv, GetDlgItem( dlg, IDC_IMPORT_KEYLIST)); |
190 |
implist_load( lv, c->opaque, &is_revcert, &has_seckeys ); |
implist_load (lv, c->opaque, &is_revcert, &has_seckeys); |
191 |
SetForegroundWindow( dlg ); |
if (!listview_count_items (lv, 0)) { |
192 |
if( !listview_count_items( lv, 0 ) ) { |
msg_box (dlg, _("No valid OpenPGP data found."), _("File Import"), MB_ERR); |
|
msg_box( dlg, _("No valid OpenPGP data found."), _("File Import"), MB_ERR ); |
|
193 |
c->cancel = 1; |
c->cancel = 1; |
194 |
EndDialog( dlg, FALSE ); |
EndDialog (dlg, FALSE); |
195 |
} |
} |
196 |
|
else { |
197 |
|
/* XXX: add more information (public keys, secret key...) */ |
198 |
|
const char *s = "File contain(s) %d key(s)."; |
199 |
|
char *p = new char[strlen (s) + 32]; |
200 |
|
if (!p) |
201 |
|
BUG (0); |
202 |
|
sprintf (p, s, listview_count_items (lv, 0)); |
203 |
|
SetDlgItemText (dlg, IDC_IMPORT_INFO, p); |
204 |
|
free_if_alloc (p); |
205 |
|
} |
206 |
|
SetForegroundWindow (dlg); |
207 |
return TRUE; |
return TRUE; |
208 |
|
|
209 |
case WM_DESTROY: |
case WM_DESTROY: |
210 |
if( lv ) { |
if (lv) { |
211 |
listview_release( lv ); |
listview_release (lv); |
212 |
lv = NULL; |
lv = NULL; |
213 |
} |
} |
214 |
return FALSE; |
return FALSE; |