1 |
/* wptAboutDlgs.cpp - GPG and WinPT about dialogs |
/* wptAboutDlgs.cpp - GPG and WinPT about dialogs |
2 |
* Copyright (C) 2000-2005 Timo Schulz |
* Copyright (C) 2000-2008 Timo Schulz |
3 |
* |
* |
4 |
* This file is part of WinPT. |
* This file is part of WinPT. |
5 |
* |
* |
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
14 |
* GNU General Public License for more details. |
* GNU General Public License for more details. |
|
* |
|
|
* You should have received a copy of the GNU General Public License |
|
|
* along with WinPT; if not, write to the Free Software Foundation, |
|
|
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA |
|
15 |
*/ |
*/ |
16 |
#ifdef HAVE_CONFIG_H |
#ifdef HAVE_CONFIG_H |
17 |
#include <config.h> |
#include <config.h> |
26 |
#include "wptW32API.h" |
#include "wptW32API.h" |
27 |
#include "wptVersion.h" |
#include "wptVersion.h" |
28 |
#include "wptGPG.h" |
#include "wptGPG.h" |
29 |
|
#include "StringBuffer.h" |
|
#ifdef _MSC_VER |
|
|
#include "winpt_header.h" |
|
|
|
|
|
static DWORD help_arr[] = { |
|
|
IDC_ABOUT_HELP, WPT_ABOUT_HELP, |
|
|
IDC_ABOUT_GPG, WPT_ABOUT_GPG, |
|
|
IDOK, WPT_ABOUT_OK, |
|
|
0, 0}; |
|
|
#endif |
|
30 |
|
|
31 |
/* Dialog procedure to show 'gpg --version' information. */ |
/* Dialog procedure to show 'gpg --version' information. */ |
32 |
static BOOL CALLBACK |
static BOOL CALLBACK |
40 |
SetWindowText (dlg, _("About the GNU Privacy Guard")); |
SetWindowText (dlg, _("About the GNU Privacy Guard")); |
41 |
|
|
42 |
rc = gpg_get_version (&gpg_version); |
rc = gpg_get_version (&gpg_version); |
43 |
if (rc || !gpg_version) { |
if (rc || gpg_version==NULL) { |
44 |
msg_box (dlg, gpgme_strerror (rc), _("About GnuPG"), MB_ERR); |
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; |
return FALSE; |
48 |
} |
} |
49 |
SetDlgItemText (dlg, IDC_ABOUTGPG_INFO, gpg_version); |
SetDlgItemText (dlg, IDC_ABOUTGPG_INFO, gpg_version); |
68 |
return FALSE; |
return FALSE; |
69 |
} |
} |
70 |
|
|
|
|
|
71 |
/* Dialog procedure to show the WinPT about information. */ |
/* Dialog procedure to show the WinPT about information. */ |
72 |
BOOL CALLBACK |
BOOL CALLBACK |
73 |
about_winpt_dlg_proc (HWND dlg, UINT msg, WPARAM wparam, LPARAM lparam) |
about_winpt_dlg_proc (HWND dlg, UINT msg, WPARAM wparam, LPARAM lparam) |
74 |
{ |
{ |
75 |
|
StringBuffer s; |
76 |
|
|
77 |
switch (msg) { |
switch (msg) { |
78 |
case WM_INITDIALOG: |
case WM_INITDIALOG: |
79 |
SetWindowText (dlg, _("About WinPT")); |
SetWindowText (dlg, _("About WinPT")); |
83 |
SetDlgItemText (dlg, IDC_ABOUT_INFO, |
SetDlgItemText (dlg, IDC_ABOUT_INFO, |
84 |
_("A free open source privacy tray for Windows based on GnuPG.")); |
_("A free open source privacy tray for Windows based on GnuPG.")); |
85 |
SetDlgItemText (dlg, IDC_ABOUT_URL, |
SetDlgItemText (dlg, IDC_ABOUT_URL, |
86 |
_("For more information you can visit the homepage: http://www.winpt.eu")); |
_("For more information you can visit the homepage: http://winpt.gnupt.de")); |
87 |
SetDlgItemText (dlg, IDC_ABOUT_BUGS, |
SetDlgItemText (dlg, IDC_ABOUT_BUGS, |
88 |
_("Please report any BUGS or suggestions for WinPT to <[email protected]>")); |
_("Please report any BUGS or suggestions for WinPT to <[email protected]>")); |
89 |
SetDlgItemText (dlg, IDC_ABOUT_GPL1, |
SetDlgItemText (dlg, IDC_ABOUT_GPL1, |
90 |
_("WinPT is free software; you can redistribute it and/or modify it under " |
_("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 " |
"the terms of the GNU General Public License as published by the Free " |
100 |
SetDlgItemText (dlg, IDC_ABOUT_HELP, _("&Help")); |
SetDlgItemText (dlg, IDC_ABOUT_HELP, _("&Help")); |
101 |
SetDlgItemText (dlg, IDC_WINPT_VERSION, PACKAGE_FULL_VERSION); |
SetDlgItemText (dlg, IDC_WINPT_VERSION, PACKAGE_FULL_VERSION); |
102 |
|
|
103 |
/* XXX provide full CHM help file. */ |
EnableWindow (GetDlgItem (dlg, IDC_ABOUT_HELP), FALSE); |
|
//EnableWindow (GetDlgItem (dlg, IDC_ABOUT_HELP), FALSE); |
|
104 |
ShowWindow (GetDlgItem (dlg, IDC_ABOUT_HELP), SW_HIDE); |
ShowWindow (GetDlgItem (dlg, IDC_ABOUT_HELP), SW_HIDE); |
105 |
|
|
106 |
center_window (dlg, NULL); |
center_window (dlg, NULL); |
107 |
SetForegroundWindow (dlg); |
SetForegroundWindow (dlg); |
108 |
return TRUE; |
return TRUE; |
|
|
|
|
case WM_HELP: |
|
|
html_help_dispatch (lparam, "winpt.chm::winpt_texts.txt", help_arr); |
|
|
break; |
|
109 |
|
|
110 |
case WM_COMMAND: |
case WM_COMMAND: |
111 |
switch (LOWORD (wparam)) { |
switch (LOWORD (wparam)) { |
115 |
0, _("About the GNU Privacy Guard"), 0); |
0, _("About the GNU Privacy Guard"), 0); |
116 |
return TRUE; |
return TRUE; |
117 |
|
|
|
case IDC_ABOUT_HELP: |
|
|
ShellExecute (dlg, "open", "winpt.chm", NULL, NULL, SW_SHOW); |
|
|
break; |
|
|
|
|
118 |
case IDOK: |
case IDOK: |
119 |
EndDialog (dlg, TRUE); |
EndDialog (dlg, TRUE); |
120 |
return TRUE; |
return TRUE; |