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 |
* |
* |
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" |
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; |
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 */ |
} |