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 |
|
|
|
21 |
|
|
#ifdef HAVE_CONFIG_H |
22 |
|
|
#include <config.h> |
23 |
|
|
#endif |
24 |
|
|
|
25 |
|
|
#include <windows.h> |
26 |
|
|
#include <windows.h> |
27 |
|
|
#include <malloc.h> |
28 |
|
|
|
29 |
|
|
#include "../resource.h" |
30 |
|
|
#include "wptTypes.h" |
31 |
|
|
#include "wptNLS.h" |
32 |
|
|
#include "wptW32API.h" |
33 |
|
|
#include "wptVersion.h" |
34 |
|
|
#include "wptGPG.h" |
35 |
|
|
|
36 |
|
|
|
37 |
|
|
/* Dialog procedure to show 'gpg --version' information. */ |
38 |
|
|
static BOOL CALLBACK |
39 |
|
|
about_gpg_dlg_proc (HWND dlg, UINT msg, WPARAM wparam, LPARAM lparam) |
40 |
|
|
{ |
41 |
|
|
char *gpg_version; |
42 |
|
|
gpgme_error_t rc; |
43 |
|
|
|
44 |
|
|
switch (msg) { |
45 |
|
|
case WM_INITDIALOG: |
46 |
|
|
SetWindowText (dlg, _("About the GNU Privacy Guard")); |
47 |
|
|
|
48 |
|
|
rc = gpg_get_version (&gpg_version); |
49 |
|
|
if (rc || !gpg_version) { |
50 |
|
|
msg_box (dlg, gpgme_strerror (rc), _("About GnuPG"), MB_ERR); |
51 |
|
|
return FALSE; |
52 |
|
|
} |
53 |
|
|
SetDlgItemText (dlg, IDC_ABOUTGPG_INFO, gpg_version); |
54 |
|
|
free (gpg_version); |
55 |
|
|
center_window (dlg, NULL); |
56 |
|
|
SetForegroundWindow (dlg); |
57 |
|
|
return TRUE; |
58 |
|
|
|
59 |
|
|
case WM_SYSCOMMAND: |
60 |
|
|
if (LOWORD (wparam) == SC_CLOSE) |
61 |
|
|
EndDialog (dlg, TRUE); |
62 |
|
|
return FALSE; |
63 |
|
|
|
64 |
|
|
case WM_COMMAND: |
65 |
|
|
switch (LOWORD (wparam)) { |
66 |
|
|
case IDOK: |
67 |
|
|
EndDialog (dlg, TRUE); |
68 |
|
|
return TRUE; |
69 |
|
|
} |
70 |
|
|
break; |
71 |
|
|
} |
72 |
|
|
|
73 |
|
|
return FALSE; |
74 |
|
|
} |
75 |
|
|
|
76 |
|
|
|
77 |
|
|
/* Dialog procedure to show the WinPT about information. */ |
78 |
|
|
BOOL CALLBACK |
79 |
|
|
about_winpt_dlg_proc (HWND dlg, UINT msg, WPARAM wparam, LPARAM lparam) |
80 |
|
|
{ |
81 |
|
|
switch (msg) { |
82 |
|
|
case WM_INITDIALOG: |
83 |
|
|
SetWindowText (dlg, _("About WinPT")); |
84 |
|
|
SetDlgItemText (dlg, IDC_ABOUT_INFO, |
85 |
|
|
_("A free open source privacy tray for Windows based on GnuPG.")); |
86 |
|
|
SetDlgItemText (dlg, IDC_ABOUT_URL, |
87 |
|
|
_("For more information you can visit the homepage: http://www.winpt.org")); |
88 |
|
|
SetDlgItemText (dlg, IDC_ABOUT_BUGS, |
89 |
|
|
_("Please report any BUGS or suggestions for WinPT to <[email protected]>")); |
90 |
|
|
SetDlgItemText (dlg, IDC_ABOUT_GPL1, |
91 |
|
|
_("WinPT is free software; you can redistribute it and/or modify it under " |
92 |
|
|
"the terms of the GNU General Public License as published by the Free " |
93 |
|
|
"Software Foundation; either Version 2 of the License, or " |
94 |
|
|
"(at your option) any later version.")); |
95 |
|
|
SetDlgItemText (dlg, IDC_ABOUT_GPL2, |
96 |
|
|
_("WinPT is distributed in the hope that it will be useful, but WITHOUT " |
97 |
|
|
"ANY WARRANTY; without even the implied warranty of MERCHANTABLITY or " |
98 |
|
|
"FITNESS FOR A PARTICULAR PURPOSE. See the General Public License for " |
99 |
|
|
"more details. ")); |
100 |
|
|
SetDlgItemText (dlg, IDC_ABOUT_GPG, _("&About GPG...")); |
101 |
|
|
SetDlgItemText (dlg, IDC_ABOUT_HELP, _("&Help")); |
102 |
|
|
SetDlgItemText (dlg, IDC_WINPT_VERSION, PACKAGE_VERSION); |
103 |
|
|
|
104 |
|
|
center_window (dlg, NULL); |
105 |
|
|
SetForegroundWindow (dlg); |
106 |
|
|
return TRUE; |
107 |
|
|
|
108 |
|
|
case WM_SYSCOMMAND: |
109 |
|
|
if (LOWORD (wparam) == SC_CLOSE) |
110 |
|
|
EndDialog (dlg, TRUE); |
111 |
|
|
return FALSE; |
112 |
|
|
|
113 |
|
|
case WM_COMMAND: |
114 |
|
|
switch (LOWORD (wparam)) { |
115 |
|
|
case IDC_ABOUT_GPG: |
116 |
|
|
DialogBoxParam (glob_hinst, (LPCSTR)IDD_WINPT_ABOUTGPG, GetDesktopWindow(), |
117 |
|
|
about_gpg_dlg_proc, NULL); |
118 |
|
|
return TRUE; |
119 |
|
|
|
120 |
|
|
case IDC_ABOUT_HELP: |
121 |
|
|
ShellExecute (dlg, "open", "winpt.chm", NULL, NULL, SW_SHOW); |
122 |
|
|
break; |
123 |
|
|
|
124 |
|
|
case IDOK: |
125 |
|
|
EndDialog( dlg, TRUE ); |
126 |
|
|
return TRUE; |
127 |
|
|
} |
128 |
|
|
break; |
129 |
|
|
} |
130 |
|
|
|
131 |
|
|
return FALSE; |
132 |
|
|
} |