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

Legend:
Removed from v.35  
changed lines
  Added in v.36

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26