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

Annotation of /trunk/Src/wptAboutDlgs.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 30 - (hide 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 twoaday 2 /* wptAboutDlgs.cpp - GPG and WinPT about dialogs
2 twoaday 4 * Copyright (C) 2000-2005 Timo Schulz
3 twoaday 2 *
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 twoaday 23 /* Dialog procedure to show 'gpg --version' information. */
33 twoaday 2 static BOOL CALLBACK
34 twoaday 4 about_gpg_dlg_proc (HWND dlg, UINT msg, WPARAM wparam, LPARAM lparam)
35 twoaday 2 {
36 twoaday 23 char *gpg_version;
37 twoaday 2 gpgme_error_t rc;
38    
39 twoaday 23 switch (msg) {
40 twoaday 2 case WM_INITDIALOG:
41 twoaday 23 #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 twoaday 2 return FALSE;
48     }
49 twoaday 23 SetDlgItemText (dlg, IDC_ABOUTGPG_INFO, gpg_version);
50     free (gpg_version);
51     center_window (dlg, NULL);
52     SetForegroundWindow (dlg);
53 twoaday 2 return TRUE;
54    
55     case WM_SYSCOMMAND:
56 twoaday 23 if (LOWORD (wparam) == SC_CLOSE)
57     EndDialog (dlg, TRUE);
58 twoaday 2 return FALSE;
59    
60     case WM_COMMAND:
61 twoaday 23 switch (LOWORD (wparam)) {
62 twoaday 2 case IDOK:
63     EndDialog (dlg, TRUE);
64     return TRUE;
65     }
66     break;
67     }
68    
69     return FALSE;
70 twoaday 23 }
71 twoaday 2
72    
73 twoaday 23 /* Dialog procedure to show the WinPT about information. */
74 twoaday 2 BOOL CALLBACK
75 twoaday 23 about_winpt_dlg_proc (HWND dlg, UINT msg, WPARAM wparam, LPARAM lparam)
76 twoaday 2 {
77 twoaday 30 switch (msg) {
78 twoaday 2 case WM_INITDIALOG:
79 twoaday 30 #ifndef LANG_DE
80 twoaday 4 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 twoaday 2 _("For more information you can visit the homepage: http://www.winpt.org"));
85 twoaday 4 SetDlgItemText (dlg, IDC_ABOUT_BUGS,
86 twoaday 2 _("Please report any BUGS or suggestions for WinPT to <[email protected]>"));
87 twoaday 4 SetDlgItemText (dlg, IDC_ABOUT_GPL1,
88 twoaday 2 _("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 twoaday 30 SetDlgItemText (dlg, IDC_ABOUT_GPL2,
93 twoaday 2 _("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 twoaday 30 SetDlgItemText (dlg, IDC_ABOUT_GPG, _("&About GPG..."));
98     SetDlgItemText (dlg, IDC_ABOUT_HELP, _("&Help"));
99 twoaday 23 SetDlgItemText (dlg, IDC_WINPT_VERSION, PACKAGE_VERSION);
100 twoaday 30 #endif
101 twoaday 23 center_window (dlg, NULL);
102 twoaday 30 SetForegroundWindow (dlg);
103 twoaday 2 return TRUE;
104    
105     case WM_SYSCOMMAND:
106 twoaday 25 if (LOWORD (wparam) == SC_CLOSE)
107     EndDialog (dlg, TRUE);
108 twoaday 2 return FALSE;
109    
110     case WM_COMMAND:
111 twoaday 23 switch (LOWORD (wparam)) {
112 twoaday 2 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 twoaday 23 }

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26