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

Contents of /trunk/Src/wptAboutDlgs.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 328 - (show annotations)
Fri Sep 25 16:07:38 2009 UTC (15 years, 5 months ago) by twoaday
File size: 4156 byte(s)


1 /* wptAboutDlgs.cpp - GPG and WinPT about dialogs
2 * Copyright (C) 2000-2008 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 #ifdef HAVE_CONFIG_H
17 #include <config.h>
18 #endif
19
20 #include <windows.h>
21 #include <malloc.h>
22
23 #include "resource.h"
24 #include "wptTypes.h"
25 #include "wptNLS.h"
26 #include "wptW32API.h"
27 #include "wptVersion.h"
28 #include "wptGPG.h"
29 #include "StringBuffer.h"
30
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 {
35 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 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 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
61 case IDCANCEL:
62 EndDialog (dlg, FALSE);
63 return TRUE;
64 }
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 StringBuffer s;
76
77 switch (msg) {
78 case WM_INITDIALOG:
79 SetWindowText (dlg, _("About WinPT"));
80 SetDlgItemText (dlg, IDC_ABOUT_GPLINF, _("Warranty"));
81 SetDlgItemText (dlg, IDC_ABOUT_AUTHORS,
82 _("The AUTHORS files contains a list of all contributors and co-authors."));
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://winpt.gnupt.de"));
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_FULL_VERSION);
102
103 EnableWindow (GetDlgItem (dlg, IDC_ABOUT_HELP), FALSE);
104 ShowWindow (GetDlgItem (dlg, IDC_ABOUT_HELP), SW_HIDE);
105
106 center_window (dlg, NULL);
107 SetForegroundWindow (dlg);
108 return TRUE;
109
110 case WM_COMMAND:
111 switch (LOWORD (wparam)) {
112 case IDC_ABOUT_GPG:
113 dialog_box_param (glob_hinst, (LPCSTR)IDD_WINPT_ABOUTGPG,
114 dlg, about_gpg_dlg_proc,
115 0, _("About the GNU Privacy Guard"), 0);
116 return TRUE;
117
118 case IDOK:
119 EndDialog (dlg, TRUE);
120 return TRUE;
121
122 case IDCANCEL:
123 EndDialog (dlg, FALSE);
124 return TRUE;
125 }
126 break;
127 }
128
129 return FALSE;
130 }

Properties

Name Value
svn:eol-style native

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26