/[winpt]/trunk/Src/wptAboutDlgs.cpp
ViewVC logotype

Contents of /trunk/Src/wptAboutDlgs.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 30 - (show annotations)
Sat Oct 22 10:17:59 2005 UTC (19 years, 4 months ago) by twoaday
File size: 4263 byte(s)
Sync with old SVN repository.

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

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26