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

Diff of /trunk/Src/wptAboutDlgs.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

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

Legend:
Removed from v.32  
changed lines
  Added in v.47

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26