1 |
/* 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 <malloc.h> |
27 |
|
28 |
#include "resource.h" |
29 |
#include "wptTypes.h" |
30 |
#include "wptNLS.h" |
31 |
#include "wptW32API.h" |
32 |
#include "wptVersion.h" |
33 |
#include "wptGPG.h" |
34 |
|
35 |
|
36 |
/* Dialog procedure to show 'gpg --version' information. */ |
37 |
static BOOL CALLBACK |
38 |
about_gpg_dlg_proc (HWND dlg, UINT msg, WPARAM wparam, LPARAM lparam) |
39 |
{ |
40 |
char *gpg_version; |
41 |
gpgme_error_t rc; |
42 |
|
43 |
switch (msg) { |
44 |
case WM_INITDIALOG: |
45 |
SetWindowText (dlg, _("About the GNU Privacy Guard")); |
46 |
|
47 |
rc = gpg_get_version (&gpg_version); |
48 |
if (rc || !gpg_version) { |
49 |
msg_box (dlg, gpgme_strerror (rc), _("About GnuPG"), MB_ERR); |
50 |
return FALSE; |
51 |
} |
52 |
SetDlgItemText (dlg, IDC_ABOUTGPG_INFO, gpg_version); |
53 |
free (gpg_version); |
54 |
center_window (dlg, NULL); |
55 |
SetForegroundWindow (dlg); |
56 |
return TRUE; |
57 |
|
58 |
case WM_SYSCOMMAND: |
59 |
if (LOWORD (wparam) == SC_CLOSE) |
60 |
EndDialog (dlg, TRUE); |
61 |
return FALSE; |
62 |
|
63 |
case WM_COMMAND: |
64 |
switch (LOWORD (wparam)) { |
65 |
case IDOK: |
66 |
EndDialog (dlg, TRUE); |
67 |
return TRUE; |
68 |
} |
69 |
break; |
70 |
} |
71 |
|
72 |
return FALSE; |
73 |
} |
74 |
|
75 |
|
76 |
/* Dialog procedure to show the WinPT about information. */ |
77 |
BOOL CALLBACK |
78 |
about_winpt_dlg_proc (HWND dlg, UINT msg, WPARAM wparam, LPARAM lparam) |
79 |
{ |
80 |
switch (msg) { |
81 |
case WM_INITDIALOG: |
82 |
SetWindowText (dlg, _("About WinPT")); |
83 |
SetDlgItemText (dlg, IDC_ABOUT_INFO, |
84 |
_("A free open source privacy tray for Windows based on GnuPG.")); |
85 |
SetDlgItemText (dlg, IDC_ABOUT_URL, |
86 |
_("For more information you can visit the homepage: http://www.winpt.org")); |
87 |
SetDlgItemText (dlg, IDC_ABOUT_BUGS, |
88 |
_("Please report any BUGS or suggestions for WinPT to <[email protected]>")); |
89 |
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 |
SetDlgItemText (dlg, IDC_WINPT_VERSION, PACKAGE_VERSION); |
102 |
|
103 |
center_window (dlg, NULL); |
104 |
SetForegroundWindow (dlg); |
105 |
return TRUE; |
106 |
|
107 |
case WM_SYSCOMMAND: |
108 |
if (LOWORD (wparam) == SC_CLOSE) |
109 |
EndDialog (dlg, TRUE); |
110 |
return FALSE; |
111 |
|
112 |
case WM_COMMAND: |
113 |
switch (LOWORD (wparam)) { |
114 |
case IDC_ABOUT_GPG: |
115 |
DialogBoxParam (glob_hinst, (LPCSTR)IDD_WINPT_ABOUTGPG, GetDesktopWindow(), |
116 |
about_gpg_dlg_proc, NULL); |
117 |
return TRUE; |
118 |
|
119 |
case IDC_ABOUT_HELP: |
120 |
ShellExecute (dlg, "open", "winpt.chm", NULL, NULL, SW_SHOW); |
121 |
break; |
122 |
|
123 |
case IDOK: |
124 |
EndDialog( dlg, TRUE ); |
125 |
return TRUE; |
126 |
} |
127 |
break; |
128 |
} |
129 |
|
130 |
return FALSE; |
131 |
} |