1 |
werner |
36 |
/* wptAboutDlgs.cpp - GPG and WinPT about dialogs |
2 |
twoaday |
328 |
* Copyright (C) 2000-2008 Timo Schulz |
3 |
werner |
36 |
* |
4 |
|
|
* This file is part of WinPT. |
5 |
|
|
* |
6 |
|
|
* WinPT is free software; you can redistribute it and/or modify |
7 |
|
|
* it under the terms of the GNU General Public License as published by |
8 |
|
|
* the Free Software Foundation; either version 2 of the License, or |
9 |
|
|
* (at your option) any later version. |
10 |
|
|
* |
11 |
|
|
* WinPT is distributed in the hope that it will be useful, |
12 |
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 |
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
14 |
|
|
* GNU General Public License for more details. |
15 |
|
|
*/ |
16 |
|
|
#ifdef HAVE_CONFIG_H |
17 |
|
|
#include <config.h> |
18 |
|
|
#endif |
19 |
|
|
|
20 |
|
|
#include <windows.h> |
21 |
|
|
#include <malloc.h> |
22 |
|
|
|
23 |
werner |
47 |
#include "resource.h" |
24 |
werner |
36 |
#include "wptTypes.h" |
25 |
|
|
#include "wptNLS.h" |
26 |
|
|
#include "wptW32API.h" |
27 |
|
|
#include "wptVersion.h" |
28 |
|
|
#include "wptGPG.h" |
29 |
twoaday |
328 |
#include "StringBuffer.h" |
30 |
werner |
36 |
|
31 |
|
|
/* Dialog procedure to show 'gpg --version' information. */ |
32 |
|
|
static BOOL CALLBACK |
33 |
|
|
about_gpg_dlg_proc (HWND dlg, UINT msg, WPARAM wparam, LPARAM lparam) |
34 |
twoaday |
80 |
{ |
35 |
werner |
36 |
char *gpg_version; |
36 |
|
|
gpgme_error_t rc; |
37 |
|
|
|
38 |
|
|
switch (msg) { |
39 |
|
|
case WM_INITDIALOG: |
40 |
|
|
SetWindowText (dlg, _("About the GNU Privacy Guard")); |
41 |
|
|
|
42 |
|
|
rc = gpg_get_version (&gpg_version); |
43 |
twoaday |
328 |
if (rc || gpg_version==NULL) { |
44 |
|
|
StringBuffer s = "Error while executing GPG:"; |
45 |
|
|
s = s + (char*)gpgme_strerror(rc); |
46 |
|
|
msg_box (dlg, s.getBuffer(), _("About GnuPG"), MB_ERR); |
47 |
werner |
36 |
return FALSE; |
48 |
|
|
} |
49 |
|
|
SetDlgItemText (dlg, IDC_ABOUTGPG_INFO, gpg_version); |
50 |
|
|
free (gpg_version); |
51 |
|
|
center_window (dlg, NULL); |
52 |
|
|
SetForegroundWindow (dlg); |
53 |
|
|
return TRUE; |
54 |
|
|
|
55 |
|
|
case WM_COMMAND: |
56 |
|
|
switch (LOWORD (wparam)) { |
57 |
|
|
case IDOK: |
58 |
|
|
EndDialog (dlg, TRUE); |
59 |
|
|
return TRUE; |
60 |
twoaday |
147 |
|
61 |
twoaday |
130 |
case IDCANCEL: |
62 |
|
|
EndDialog (dlg, FALSE); |
63 |
|
|
return TRUE; |
64 |
werner |
36 |
} |
65 |
|
|
break; |
66 |
|
|
} |
67 |
|
|
|
68 |
|
|
return FALSE; |
69 |
|
|
} |
70 |
|
|
|
71 |
|
|
/* Dialog procedure to show the WinPT about information. */ |
72 |
|
|
BOOL CALLBACK |
73 |
|
|
about_winpt_dlg_proc (HWND dlg, UINT msg, WPARAM wparam, LPARAM lparam) |
74 |
|
|
{ |
75 |
twoaday |
328 |
StringBuffer s; |
76 |
|
|
|
77 |
werner |
36 |
switch (msg) { |
78 |
|
|
case WM_INITDIALOG: |
79 |
|
|
SetWindowText (dlg, _("About WinPT")); |
80 |
twoaday |
129 |
SetDlgItemText (dlg, IDC_ABOUT_GPLINF, _("Warranty")); |
81 |
twoaday |
228 |
SetDlgItemText (dlg, IDC_ABOUT_AUTHORS, |
82 |
|
|
_("The AUTHORS files contains a list of all contributors and co-authors.")); |
83 |
werner |
36 |
SetDlgItemText (dlg, IDC_ABOUT_INFO, |
84 |
|
|
_("A free open source privacy tray for Windows based on GnuPG.")); |
85 |
|
|
SetDlgItemText (dlg, IDC_ABOUT_URL, |
86 |
twoaday |
328 |
_("For more information you can visit the homepage: http://winpt.gnupt.de")); |
87 |
werner |
36 |
SetDlgItemText (dlg, IDC_ABOUT_BUGS, |
88 |
twoaday |
328 |
_("Please report any BUGS or suggestions for WinPT to <[email protected]>")); |
89 |
werner |
36 |
SetDlgItemText (dlg, IDC_ABOUT_GPL1, |
90 |
|
|
_("WinPT is free software; you can redistribute it and/or modify it under " |
91 |
|
|
"the terms of the GNU General Public License as published by the Free " |
92 |
|
|
"Software Foundation; either Version 2 of the License, or " |
93 |
|
|
"(at your option) any later version.")); |
94 |
|
|
SetDlgItemText (dlg, IDC_ABOUT_GPL2, |
95 |
|
|
_("WinPT is distributed in the hope that it will be useful, but WITHOUT " |
96 |
|
|
"ANY WARRANTY; without even the implied warranty of MERCHANTABLITY or " |
97 |
|
|
"FITNESS FOR A PARTICULAR PURPOSE. See the General Public License for " |
98 |
|
|
"more details. ")); |
99 |
|
|
SetDlgItemText (dlg, IDC_ABOUT_GPG, _("&About GPG...")); |
100 |
|
|
SetDlgItemText (dlg, IDC_ABOUT_HELP, _("&Help")); |
101 |
twoaday |
99 |
SetDlgItemText (dlg, IDC_WINPT_VERSION, PACKAGE_FULL_VERSION); |
102 |
twoaday |
185 |
|
103 |
twoaday |
328 |
EnableWindow (GetDlgItem (dlg, IDC_ABOUT_HELP), FALSE); |
104 |
twoaday |
185 |
ShowWindow (GetDlgItem (dlg, IDC_ABOUT_HELP), SW_HIDE); |
105 |
werner |
36 |
|
106 |
|
|
center_window (dlg, NULL); |
107 |
|
|
SetForegroundWindow (dlg); |
108 |
|
|
return TRUE; |
109 |
twoaday |
80 |
|
110 |
werner |
36 |
case WM_COMMAND: |
111 |
|
|
switch (LOWORD (wparam)) { |
112 |
|
|
case IDC_ABOUT_GPG: |
113 |
twoaday |
147 |
dialog_box_param (glob_hinst, (LPCSTR)IDD_WINPT_ABOUTGPG, |
114 |
twoaday |
185 |
dlg, about_gpg_dlg_proc, |
115 |
twoaday |
147 |
0, _("About the GNU Privacy Guard"), 0); |
116 |
werner |
36 |
return TRUE; |
117 |
|
|
|
118 |
|
|
case IDOK: |
119 |
twoaday |
80 |
EndDialog (dlg, TRUE); |
120 |
werner |
36 |
return TRUE; |
121 |
twoaday |
147 |
|
122 |
twoaday |
130 |
case IDCANCEL: |
123 |
|
|
EndDialog (dlg, FALSE); |
124 |
|
|
return TRUE; |
125 |
werner |
36 |
} |
126 |
|
|
break; |
127 |
|
|
} |
128 |
|
|
|
129 |
|
|
return FALSE; |
130 |
|
|
} |