/[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 2 by twoaday, Mon Jan 31 11:02:21 2005 UTC revision 105 by twoaday, Wed Nov 30 10:22:00 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    #ifdef HAVE_CONFIG_H
21  #include <windows.h>  #include <config.h>
22    #endif
23  #include "../resource.h"  
24  #include "wptW32API.h"  #include <windows.h>
25  #include "wptGPG.h"  
26  #include "wptTypes.h"  #include "resource.h"
27  #include "wptCommonCtl.h"  #include "wptW32API.h"
28  #include "wptContext.h"  #include "wptGPG.h"
29    #include "wptTypes.h"
30    #include "wptCommonCtl.h"
31  BOOL CALLBACK  #include "wptContext.h"
32  first_run_dlg_proc (HWND dlg, UINT msg, WPARAM wparam, LPARAM lparam)  
33  {  
34      static struct key_wizard_s * ctx;  /* Dialog box procedure which is executed on the first time WinPT
35       is started. */
36      switch (msg) {  BOOL CALLBACK
37      case WM_INITDIALOG:  first_run_dlg_proc (HWND dlg, UINT msg, WPARAM wparam, LPARAM lparam)
38          ctx = (struct key_wizard_s *)lparam;  {
39          if (!ctx)      static struct first_start_s * ctx;
40              BUG (0);  
41          CheckDlgButton( dlg, IDC_FIRST_KEYGEN, BST_CHECKED );      switch (msg) {
42          SetDlgItemText (dlg, IDC_FIRST_KEYGEN, _("&Generate a GnuPG key pair"));      case WM_INITDIALOG:
43          SetDlgItemText (dlg, IDC_FIRST_IMPORT, _("&Copy GnuPG keyrings from another location"));          ctx = (struct first_start_s *)lparam;
44          SetDlgItemText (dlg, IDC_FIRST_SETUP, _("&Specify a new GnuPG home directory"));          if (!ctx)
45          SetForegroundWindow (dlg);              BUG (0);
46          center_window (dlg);          CheckDlgButton( dlg, IDC_FIRST_KEYGEN, BST_CHECKED );
47          return TRUE;          SetDlgItemText (dlg, IDC_FIRST_KEYGEN, _("&Generate a GnuPG key pair"));
48            SetDlgItemText (dlg, IDC_FIRST_IMPORT, _("&Copy GnuPG keyrings from another location"));
49      case WM_COMMAND:          SetDlgItemText (dlg, IDC_FIRST_SETUP, _("&Specify a new GnuPG home directory"));
50          switch (LOWORD (wparam)) {          SetDlgItemText (dlg, IDCANCEL, _("&Cancel"));
51          case IDOK:          SetForegroundWindow (dlg);
52              if (IsDlgButtonChecked (dlg, IDC_FIRST_KEYGEN))          center_window (dlg, NULL);
53                  ctx->interactive = SETUP_KEYGEN;          return TRUE;
54              else if (IsDlgButtonChecked (dlg, IDC_FIRST_IMPORT))  
55                  ctx->interactive = SETUP_IMPORT;      case WM_COMMAND:
56              else if (IsDlgButtonChecked (dlg, IDC_FIRST_SETUP))          switch (LOWORD (wparam)) {
57                  ctx->interactive = SETUP_EXISTING;          case IDOK:
58              else              if (IsDlgButtonChecked (dlg, IDC_FIRST_KEYGEN))
59                  ctx->interactive = -1;                  ctx->choice = SETUP_KEYGEN;
60              EndDialog (dlg, TRUE);              else if (IsDlgButtonChecked (dlg, IDC_FIRST_IMPORT))
61              break;                  ctx->choice = SETUP_IMPORT;
62                else
63          case IDCANCEL:                  ctx->choice = -1;
64              ctx->interactive = -1;              EndDialog (dlg, TRUE);
65              EndDialog (dlg, FALSE);              break;
66              break;  
67          }          case IDCANCEL:
68          break;              ctx->choice = -1;
69      }              EndDialog (dlg, FALSE);
70                break;
71      return FALSE;          }
72  } /* first_run_dlg_proc */          break;
73        }
74    
75        return FALSE;
76    }
77    

Legend:
Removed from v.2  
changed lines
  Added in v.105

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26