88 |
ownertrust_dlg_proc (HWND dlg, UINT msg, WPARAM wparam, LPARAM lparam) |
ownertrust_dlg_proc (HWND dlg, UINT msg, WPARAM wparam, LPARAM lparam) |
89 |
{ |
{ |
90 |
gpgme_error_t err; |
gpgme_error_t err; |
91 |
char fname[256]; |
const char *fname; |
92 |
|
|
93 |
switch( msg ) { |
switch( msg ) { |
94 |
case WM_INITDIALOG: |
case WM_INITDIALOG: |
105 |
return TRUE; |
return TRUE; |
106 |
|
|
107 |
case WM_SYSCOMMAND: |
case WM_SYSCOMMAND: |
108 |
if( LOWORD (wparam) == SC_CLOSE ) |
if (LOWORD (wparam) == SC_CLOSE) |
109 |
EndDialog( dlg, TRUE ); |
EndDialog (dlg, TRUE); |
110 |
return FALSE; |
return TRUE; |
111 |
|
|
112 |
case WM_COMMAND: |
case WM_COMMAND: |
113 |
switch ( LOWORD( wparam ) ) { |
switch (LOWORD (wparam)) { |
|
case IDC_OWNERTRUST_SELFILE: |
|
|
const char * s; |
|
|
s = get_filename_dlg (dlg, 1, _("Please select a filename"), NULL, NULL); |
|
|
if (s && *s) |
|
|
SetDlgItemText (dlg, IDC_OWNERTRUST_FILE, s); |
|
|
break; |
|
|
|
|
114 |
case IDC_OWNERTRUST_EXPORT: |
case IDC_OWNERTRUST_EXPORT: |
115 |
if( !GetDlgItemText( dlg, IDC_OWNERTRUST_FILE, fname, sizeof fname -1 ) ) { |
fname = get_filesave_dlg (dlg, _("Select file name for output"), NULL, NULL); |
116 |
msg_box( dlg, _("Please enter the filename."), _("Ownertrust"), MB_ERR ); |
if (!fname) |
117 |
return FALSE; |
return TRUE; |
|
} |
|
118 |
err = gpg_export_ownertrust (fname); |
err = gpg_export_ownertrust (fname); |
119 |
if( err ) { |
if (err) { |
120 |
msg_box( dlg, gpgme_strerror( err ), _("Ownertrust"), MB_ERR ); |
msg_box (dlg, gpgme_strerror( err ), _("Ownertrust"), MB_ERR ); |
121 |
return FALSE; |
return TRUE; |
122 |
} |
} |
123 |
status_box( dlg, _("Ownertrust successfully exported."), _("GnuPG Status") ); |
status_box (dlg, _("Ownertrust successfully exported."), _("GnuPG Status")); |
|
EndDialog( dlg, TRUE ); |
|
124 |
return TRUE; |
return TRUE; |
125 |
|
|
126 |
case IDC_OWNERTRUST_IMPORT: |
case IDC_OWNERTRUST_IMPORT: |
127 |
if( !GetDlgItemText( dlg, IDC_OWNERTRUST_FILE, fname, sizeof fname-1 ) ) { |
fname = get_fileopen_dlg (dlg, _("Select file name for input"), NULL, NULL); |
128 |
msg_box( dlg, _("Please enter the filename."), _("Ownertrust"), MB_ERR ); |
if (!fname) |
129 |
return FALSE; |
return TRUE; |
130 |
|
err = gpg_import_ownertrust (fname); |
131 |
|
if (err) { |
132 |
|
msg_box (dlg, gpgme_strerror (err), _("Ownertrust"), MB_ERR); |
133 |
|
return TRUE; |
134 |
} |
} |
135 |
err = gpg_import_ownertrust( fname ); |
status_box (dlg, _("Ownertrust succefully imported."), _("GnuPG Status")); |
|
if( err ) { |
|
|
msg_box( dlg, gpgme_strerror( err ), _("Ownertrust"), MB_ERR ); |
|
|
return FALSE; |
|
|
} |
|
|
status_box( dlg, _("Ownertrust succefully imported."), _("GnuPG Status") ); |
|
|
EndDialog( dlg, TRUE ); |
|
136 |
return TRUE; |
return TRUE; |
137 |
|
|
138 |
case IDCANCEL: |
case IDCANCEL: |
139 |
EndDialog( dlg, FALSE ); |
EndDialog (dlg, FALSE); |
140 |
return FALSE; |
return TRUE; |
141 |
} |
} |
142 |
break; |
break; |
143 |
} |
} |
144 |
|
|
145 |
return FALSE; |
return FALSE; |
146 |
} |
} |
|
|
|