1 |
werner |
36 |
/* wptAboutDlgs.cpp - GPG and WinPT about dialogs |
2 |
|
|
* Copyright (C) 2000-2005 Timo Schulz |
3 |
|
|
* |
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 |
|
|
* You should have received a copy of the GNU General Public License |
17 |
|
|
* along with WinPT; if not, write to the Free Software Foundation, |
18 |
|
|
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA |
19 |
|
|
*/ |
20 |
|
|
#ifdef HAVE_CONFIG_H |
21 |
|
|
#include <config.h> |
22 |
|
|
#endif |
23 |
|
|
|
24 |
|
|
#include <windows.h> |
25 |
|
|
#include <malloc.h> |
26 |
|
|
|
27 |
werner |
47 |
#include "resource.h" |
28 |
werner |
36 |
#include "wptTypes.h" |
29 |
|
|
#include "wptNLS.h" |
30 |
|
|
#include "wptW32API.h" |
31 |
|
|
#include "wptVersion.h" |
32 |
|
|
#include "wptGPG.h" |
33 |
|
|
|
34 |
twoaday |
80 |
#ifdef _MSC_VER |
35 |
|
|
#include "winpt_header.h" |
36 |
werner |
36 |
|
37 |
twoaday |
120 |
static DWORD help_arr[] = { |
38 |
twoaday |
80 |
IDC_ABOUT_HELP, WPT_ABOUT_HELP, |
39 |
twoaday |
147 |
IDC_ABOUT_GPG, WPT_ABOUT_GPG, |
40 |
|
|
IDOK, WPT_ABOUT_OK, |
41 |
twoaday |
80 |
0, 0}; |
42 |
|
|
#endif |
43 |
|
|
|
44 |
werner |
36 |
/* Dialog procedure to show 'gpg --version' information. */ |
45 |
|
|
static BOOL CALLBACK |
46 |
|
|
about_gpg_dlg_proc (HWND dlg, UINT msg, WPARAM wparam, LPARAM lparam) |
47 |
twoaday |
80 |
{ |
48 |
werner |
36 |
char *gpg_version; |
49 |
|
|
gpgme_error_t rc; |
50 |
|
|
|
51 |
|
|
switch (msg) { |
52 |
|
|
case WM_INITDIALOG: |
53 |
|
|
SetWindowText (dlg, _("About the GNU Privacy Guard")); |
54 |
|
|
|
55 |
|
|
rc = gpg_get_version (&gpg_version); |
56 |
|
|
if (rc || !gpg_version) { |
57 |
|
|
msg_box (dlg, gpgme_strerror (rc), _("About GnuPG"), MB_ERR); |
58 |
|
|
return FALSE; |
59 |
|
|
} |
60 |
|
|
SetDlgItemText (dlg, IDC_ABOUTGPG_INFO, gpg_version); |
61 |
|
|
free (gpg_version); |
62 |
|
|
center_window (dlg, NULL); |
63 |
|
|
SetForegroundWindow (dlg); |
64 |
|
|
return TRUE; |
65 |
|
|
|
66 |
|
|
case WM_SYSCOMMAND: |
67 |
|
|
if (LOWORD (wparam) == SC_CLOSE) |
68 |
|
|
EndDialog (dlg, TRUE); |
69 |
|
|
return FALSE; |
70 |
|
|
|
71 |
|
|
case WM_COMMAND: |
72 |
|
|
switch (LOWORD (wparam)) { |
73 |
|
|
case IDOK: |
74 |
|
|
EndDialog (dlg, TRUE); |
75 |
|
|
return TRUE; |
76 |
twoaday |
147 |
|
77 |
twoaday |
130 |
case IDCANCEL: |
78 |
|
|
EndDialog (dlg, FALSE); |
79 |
|
|
return TRUE; |
80 |
werner |
36 |
} |
81 |
|
|
break; |
82 |
|
|
} |
83 |
|
|
|
84 |
|
|
return FALSE; |
85 |
|
|
} |
86 |
|
|
|
87 |
|
|
|
88 |
|
|
/* Dialog procedure to show the WinPT about information. */ |
89 |
|
|
BOOL CALLBACK |
90 |
|
|
about_winpt_dlg_proc (HWND dlg, UINT msg, WPARAM wparam, LPARAM lparam) |
91 |
|
|
{ |
92 |
twoaday |
80 |
static DWORD cookie = 0; |
93 |
|
|
|
94 |
werner |
36 |
switch (msg) { |
95 |
|
|
case WM_INITDIALOG: |
96 |
twoaday |
80 |
html_help_init (&cookie); |
97 |
werner |
36 |
SetWindowText (dlg, _("About WinPT")); |
98 |
twoaday |
129 |
SetDlgItemText (dlg, IDC_ABOUT_GPLINF, _("Warranty")); |
99 |
werner |
36 |
SetDlgItemText (dlg, IDC_ABOUT_INFO, |
100 |
|
|
_("A free open source privacy tray for Windows based on GnuPG.")); |
101 |
|
|
SetDlgItemText (dlg, IDC_ABOUT_URL, |
102 |
|
|
_("For more information you can visit the homepage: http://www.winpt.org")); |
103 |
|
|
SetDlgItemText (dlg, IDC_ABOUT_BUGS, |
104 |
|
|
_("Please report any BUGS or suggestions for WinPT to <[email protected]>")); |
105 |
|
|
SetDlgItemText (dlg, IDC_ABOUT_GPL1, |
106 |
|
|
_("WinPT is free software; you can redistribute it and/or modify it under " |
107 |
|
|
"the terms of the GNU General Public License as published by the Free " |
108 |
|
|
"Software Foundation; either Version 2 of the License, or " |
109 |
|
|
"(at your option) any later version.")); |
110 |
|
|
SetDlgItemText (dlg, IDC_ABOUT_GPL2, |
111 |
|
|
_("WinPT is distributed in the hope that it will be useful, but WITHOUT " |
112 |
|
|
"ANY WARRANTY; without even the implied warranty of MERCHANTABLITY or " |
113 |
|
|
"FITNESS FOR A PARTICULAR PURPOSE. See the General Public License for " |
114 |
|
|
"more details. ")); |
115 |
|
|
SetDlgItemText (dlg, IDC_ABOUT_GPG, _("&About GPG...")); |
116 |
|
|
SetDlgItemText (dlg, IDC_ABOUT_HELP, _("&Help")); |
117 |
twoaday |
99 |
SetDlgItemText (dlg, IDC_WINPT_VERSION, PACKAGE_FULL_VERSION); |
118 |
twoaday |
147 |
/* XXX provide full CHM help file. */ |
119 |
|
|
EnableWindow (GetDlgItem (dlg, IDC_ABOUT_HELP), FALSE); |
120 |
werner |
36 |
|
121 |
|
|
center_window (dlg, NULL); |
122 |
|
|
SetForegroundWindow (dlg); |
123 |
|
|
return TRUE; |
124 |
|
|
|
125 |
twoaday |
80 |
case WM_DESTROY: |
126 |
|
|
html_help_deinit (); |
127 |
|
|
break; |
128 |
|
|
|
129 |
|
|
case WM_HELP: |
130 |
twoaday |
120 |
html_help_dispatch (lparam, "winpt.chm::winpt_texts.txt", help_arr); |
131 |
twoaday |
80 |
break; |
132 |
|
|
|
133 |
werner |
36 |
case WM_SYSCOMMAND: |
134 |
|
|
if (LOWORD (wparam) == SC_CLOSE) |
135 |
|
|
EndDialog (dlg, TRUE); |
136 |
|
|
return FALSE; |
137 |
|
|
|
138 |
|
|
case WM_COMMAND: |
139 |
|
|
switch (LOWORD (wparam)) { |
140 |
|
|
case IDC_ABOUT_GPG: |
141 |
twoaday |
147 |
dialog_box_param (glob_hinst, (LPCSTR)IDD_WINPT_ABOUTGPG, |
142 |
|
|
GetDesktopWindow(), about_gpg_dlg_proc, |
143 |
|
|
0, _("About the GNU Privacy Guard"), 0); |
144 |
werner |
36 |
return TRUE; |
145 |
|
|
|
146 |
|
|
case IDC_ABOUT_HELP: |
147 |
|
|
ShellExecute (dlg, "open", "winpt.chm", NULL, NULL, SW_SHOW); |
148 |
|
|
break; |
149 |
|
|
|
150 |
|
|
case IDOK: |
151 |
twoaday |
80 |
EndDialog (dlg, TRUE); |
152 |
werner |
36 |
return TRUE; |
153 |
twoaday |
147 |
|
154 |
twoaday |
130 |
case IDCANCEL: |
155 |
|
|
EndDialog (dlg, FALSE); |
156 |
|
|
return TRUE; |
157 |
werner |
36 |
} |
158 |
|
|
break; |
159 |
|
|
} |
160 |
|
|
|
161 |
|
|
return FALSE; |
162 |
|
|
} |