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

Diff of /trunk/Src/wptFirstRunDlg.cpp

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

revision 23 by twoaday, Fri Sep 30 10:10:16 2005 UTC revision 48 by werner, Mon Oct 31 21:14:11 2005 UTC
# Line 1  Line 1 
1  /* wptFirstRunDlg.cpp - Welcome dialog  /* wptFirstRunDlg.cpp - Welcome dialog
2   *      Copyright (C) 2002-2005 Timo Schulz   *      Copyright (C) 2002-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 <config.h>
23  #include "../resource.h"  #endif
24  #include "wptW32API.h"  
25  #include "wptGPG.h"  #include <windows.h>
26  #include "wptTypes.h"  
27  #include "wptCommonCtl.h"  #include "resource.h"
28  #include "wptContext.h"  #include "wptW32API.h"
29    #include "wptGPG.h"
30    #include "wptTypes.h"
31  BOOL CALLBACK  #include "wptCommonCtl.h"
32  first_run_dlg_proc (HWND dlg, UINT msg, WPARAM wparam, LPARAM lparam)  #include "wptContext.h"
33  {  
34      static struct first_start_s * ctx;  
35    BOOL CALLBACK
36      switch (msg) {  first_run_dlg_proc (HWND dlg, UINT msg, WPARAM wparam, LPARAM lparam)
37      case WM_INITDIALOG:  {
38          ctx = (struct first_start_s *)lparam;      static struct first_start_s * ctx;
39          if (!ctx)  
40              BUG (0);      switch (msg) {
41          CheckDlgButton( dlg, IDC_FIRST_KEYGEN, BST_CHECKED );      case WM_INITDIALOG:
42          SetDlgItemText (dlg, IDC_FIRST_KEYGEN, _("&Generate a GnuPG key pair"));          ctx = (struct first_start_s *)lparam;
43          SetDlgItemText (dlg, IDC_FIRST_IMPORT, _("&Copy GnuPG keyrings from another location"));          if (!ctx)
44          SetDlgItemText (dlg, IDC_FIRST_SETUP, _("&Specify a new GnuPG home directory"));              BUG (0);
45          SetForegroundWindow (dlg);          CheckDlgButton( dlg, IDC_FIRST_KEYGEN, BST_CHECKED );
46          center_window (dlg, NULL);          SetDlgItemText (dlg, IDC_FIRST_KEYGEN, _("&Generate a GnuPG key pair"));
47          return TRUE;          SetDlgItemText (dlg, IDC_FIRST_IMPORT, _("&Copy GnuPG keyrings from another location"));
48            SetDlgItemText (dlg, IDC_FIRST_SETUP, _("&Specify a new GnuPG home directory"));
49      case WM_COMMAND:          SetForegroundWindow (dlg);
50          switch (LOWORD (wparam)) {          center_window (dlg, NULL);
51          case IDOK:          return TRUE;
52              if (IsDlgButtonChecked (dlg, IDC_FIRST_KEYGEN))  
53                  ctx->choice = SETUP_KEYGEN;      case WM_COMMAND:
54              else if (IsDlgButtonChecked (dlg, IDC_FIRST_IMPORT))          switch (LOWORD (wparam)) {
55                  ctx->choice = SETUP_IMPORT;          case IDOK:
56              else              if (IsDlgButtonChecked (dlg, IDC_FIRST_KEYGEN))
57                  ctx->choice = -1;                  ctx->choice = SETUP_KEYGEN;
58              EndDialog (dlg, TRUE);              else if (IsDlgButtonChecked (dlg, IDC_FIRST_IMPORT))
59              break;                  ctx->choice = SETUP_IMPORT;
60                else
61          case IDCANCEL:                  ctx->choice = -1;
62              ctx->choice = -1;              EndDialog (dlg, TRUE);
63              EndDialog (dlg, FALSE);              break;
64              break;  
65          }          case IDCANCEL:
66          break;              ctx->choice = -1;
67      }              EndDialog (dlg, FALSE);
68                break;
69      return FALSE;          }
70  } /* first_run_dlg_proc */          break;
71        }
72    
73        return FALSE;
74    } /* first_run_dlg_proc */

Legend:
Removed from v.23  
changed lines
  Added in v.48

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26