1 |
/* wptOwnertrust.cpp - Ownertrust im- and export |
/* wptOwnertrust.cpp - Ownertrust im- and export |
2 |
* Copyright (C) 2001, 2002, 2003, 2005, 2006 Timo Schulz |
* Copyright (C) 2001, 2002, 2003, 2005, 2006, 2007 Timo Schulz |
3 |
* Copyright (C) 2005 g10 Code GmbH |
* Copyright (C) 2005 g10 Code GmbH |
4 |
* |
* |
5 |
* This file is part of WinPT. |
* This file is part of WinPT. |
13 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
15 |
* GNU General Public License for more details. |
* GNU General Public License for more details. |
|
* |
|
|
* You should have received a copy of the GNU General Public License |
|
|
* along with WinPT; if not, write to the Free Software Foundation, |
|
|
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA |
|
16 |
*/ |
*/ |
17 |
#ifdef HAVE_CONFIG_H |
#ifdef HAVE_CONFIG_H |
18 |
#include <config.h> |
#include <config.h> |
77 |
err = gpg_manage_ownertrust (&ot_data, 0); |
err = gpg_manage_ownertrust (&ot_data, 0); |
78 |
|
|
79 |
safe_free (ot_data); |
safe_free (ot_data); |
80 |
return 0; |
return err; |
81 |
} |
} |
82 |
|
|
83 |
|
|
88 |
gpgme_error_t err; |
gpgme_error_t err; |
89 |
const char *fname; |
const char *fname; |
90 |
|
|
91 |
switch( msg ) { |
switch (msg) { |
92 |
case WM_INITDIALOG: |
case WM_INITDIALOG: |
93 |
SetWindowText (dlg, _("Ownertrust")); |
SetWindowText (dlg, _("Ownertrust")); |
94 |
SetDlgItemText (dlg, IDC_OWNERTRUST_INFO, _("File")); |
SetDlgItemText (dlg, IDC_OWNERTRUST_INFO, _("File")); |
112 |
msg_box (dlg, gpgme_strerror( err ), _("Ownertrust"), MB_ERR ); |
msg_box (dlg, gpgme_strerror( err ), _("Ownertrust"), MB_ERR ); |
113 |
return TRUE; |
return TRUE; |
114 |
} |
} |
115 |
status_box (dlg, _("Ownertrust successfully exported."), _("GnuPG Status")); |
status_box (dlg, _("Ownertrust successfully exported."), |
116 |
|
_("GnuPG Status")); |
117 |
return TRUE; |
return TRUE; |
118 |
|
|
119 |
case IDC_OWNERTRUST_IMPORT: |
case IDC_OWNERTRUST_IMPORT: |
120 |
fname = get_fileopen_dlg (dlg, _("Select File Name for Input"), NULL, NULL); |
fname = get_fileopen_dlg (dlg, _("Select File Name for Input"), |
121 |
|
NULL, NULL); |
122 |
if (!fname) |
if (!fname) |
123 |
return TRUE; |
return TRUE; |
124 |
err = gpg_import_ownertrust (fname); |
err = gpg_import_ownertrust (fname); |
126 |
msg_box (dlg, gpgme_strerror (err), _("Ownertrust"), MB_ERR); |
msg_box (dlg, gpgme_strerror (err), _("Ownertrust"), MB_ERR); |
127 |
return TRUE; |
return TRUE; |
128 |
} |
} |
129 |
status_box (dlg, _("Ownertrust successfully imported."), _("GnuPG Status")); |
status_box (dlg, _("Ownertrust successfully imported."), |
130 |
|
_("GnuPG Status")); |
131 |
return TRUE; |
return TRUE; |
132 |
|
|
133 |
case IDCANCEL: |
case IDCANCEL: |