/[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 36 by werner, Thu Oct 27 15:25:13 2005 UTC revision 167 by twoaday, Thu Jan 26 10:17:17 2006 UTC
# Line 1  Line 1 
1  /* wptFirstRunDlg.cpp - Welcome dialog  /* wptFirstRunDlg.cpp - Welcome dialog
2   *      Copyright (C) 2002-2005 Timo Schulz   *      Copyright (C) 2002-2006 Timo Schulz
3   *   *
4   * This file is part of WinPT.   * This file is part of WinPT.
5   *   *
# Line 17  Line 17 
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  #ifdef HAVE_CONFIG_H
21  #include <config.h>  #include <config.h>
22  #endif  #endif
23    
24  #include <windows.h>  #include <windows.h>
 #include <windows.h>  
25    
26  #include "../resource.h"  #include "resource.h"
27  #include "wptW32API.h"  #include "wptW32API.h"
28  #include "wptGPG.h"  #include "wptGPG.h"
29  #include "wptTypes.h"  #include "wptTypes.h"
# Line 33  Line 31 
31  #include "wptContext.h"  #include "wptContext.h"
32    
33    
34    /* Dialog box procedure which is executed on the first time WinPT
35       is started. */
36  BOOL CALLBACK  BOOL CALLBACK
37  first_run_dlg_proc (HWND dlg, UINT msg, WPARAM wparam, LPARAM lparam)  first_run_dlg_proc (HWND dlg, UINT msg, WPARAM wparam, LPARAM lparam)
38  {  {
39      static struct first_start_s * ctx;      int choice = 0;
   
40      switch (msg) {      switch (msg) {
41      case WM_INITDIALOG:      case WM_INITDIALOG:
         ctx = (struct first_start_s *)lparam;  
         if (!ctx)  
             BUG (0);  
42          CheckDlgButton( dlg, IDC_FIRST_KEYGEN, BST_CHECKED );          CheckDlgButton( dlg, IDC_FIRST_KEYGEN, BST_CHECKED );
43          SetDlgItemText (dlg, IDC_FIRST_KEYGEN, _("&Generate a GnuPG key pair"));          SetDlgItemText (dlg, IDC_FIRST_KEYGEN,
44          SetDlgItemText (dlg, IDC_FIRST_IMPORT, _("&Copy GnuPG keyrings from another location"));                          _("&Generate a GnuPG key pair"));
45          SetDlgItemText (dlg, IDC_FIRST_SETUP, _("&Specify a new GnuPG home directory"));          SetDlgItemText (dlg, IDC_FIRST_IMPORT,
46                            _("&Copy GnuPG keyrings from another location"));
47            SetDlgItemText (dlg, IDCANCEL, _("&Cancel"));
48            SetWindowText (dlg, _("WinPT First Start"));
49          SetForegroundWindow (dlg);          SetForegroundWindow (dlg);
50          center_window (dlg, NULL);          center_window (dlg, NULL);
51          return TRUE;          return TRUE;
# Line 55  first_run_dlg_proc (HWND dlg, UINT msg, Line 54  first_run_dlg_proc (HWND dlg, UINT msg,
54          switch (LOWORD (wparam)) {          switch (LOWORD (wparam)) {
55          case IDOK:          case IDOK:
56              if (IsDlgButtonChecked (dlg, IDC_FIRST_KEYGEN))              if (IsDlgButtonChecked (dlg, IDC_FIRST_KEYGEN))
57                  ctx->choice = SETUP_KEYGEN;                  choice = SETUP_KEYGEN;
58              else if (IsDlgButtonChecked (dlg, IDC_FIRST_IMPORT))              else if (IsDlgButtonChecked (dlg, IDC_FIRST_IMPORT))
59                  ctx->choice = SETUP_IMPORT;                  choice = SETUP_IMPORT;
60              else              else
61                  ctx->choice = -1;                  choice = 0;
62              EndDialog (dlg, TRUE);              EndDialog (dlg, choice);
63              break;              break;
64    
65          case IDCANCEL:          case IDCANCEL:
66              ctx->choice = -1;              EndDialog (dlg, 0);
             EndDialog (dlg, FALSE);  
67              break;              break;
68          }          }
69          break;          break;
70      }      }
71    
72      return FALSE;      return FALSE;
73  } /* first_run_dlg_proc */  }

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

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26