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