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 |
* |
* |
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. |
|
* |
|
|
* You should have received a copy of the GNU General Public License |
|
|
* along with WinPT; if not, write to the Free Software Foundation, |
|
|
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA |
|
15 |
*/ |
*/ |
|
|
|
16 |
#ifdef HAVE_CONFIG_H |
#ifdef HAVE_CONFIG_H |
17 |
#include <config.h> |
#include <config.h> |
18 |
#endif |
#endif |
27 |
#include "wptContext.h" |
#include "wptContext.h" |
28 |
|
|
29 |
|
|
30 |
|
/* Dialog box procedure which is executed on the first time WinPT |
31 |
|
is started. */ |
32 |
BOOL CALLBACK |
BOOL CALLBACK |
33 |
first_run_dlg_proc (HWND dlg, UINT msg, WPARAM wparam, LPARAM lparam) |
first_run_dlg_proc (HWND dlg, UINT msg, WPARAM wparam, LPARAM lparam) |
34 |
{ |
{ |
35 |
static struct first_start_s * ctx; |
int choice = 0; |
|
|
|
36 |
switch (msg) { |
switch (msg) { |
37 |
case WM_INITDIALOG: |
case WM_INITDIALOG: |
38 |
ctx = (struct first_start_s *)lparam; |
CheckDlgButton (dlg, IDC_FIRST_KEYGEN, BST_CHECKED); |
39 |
if (!ctx) |
SetDlgItemText (dlg, IDC_FIRST_KEYGEN, |
40 |
BUG (0); |
_("&Generate a GnuPG key pair")); |
41 |
CheckDlgButton( dlg, IDC_FIRST_KEYGEN, BST_CHECKED ); |
SetDlgItemText (dlg, IDC_FIRST_IMPORT, |
42 |
SetDlgItemText (dlg, IDC_FIRST_KEYGEN, _("&Generate a GnuPG key pair")); |
_("&Copy GnuPG keyrings from another location")); |
43 |
SetDlgItemText (dlg, IDC_FIRST_IMPORT, _("&Copy GnuPG keyrings from another location")); |
SetDlgItemText (dlg, IDCANCEL, _("&Cancel")); |
44 |
SetDlgItemText (dlg, IDC_FIRST_SETUP, _("&Specify a new GnuPG home directory")); |
SetWindowText (dlg, _("WinPT First Start")); |
45 |
SetForegroundWindow (dlg); |
SetForegroundWindow (dlg); |
46 |
center_window (dlg, NULL); |
center_window (dlg, NULL); |
47 |
return TRUE; |
return TRUE; |
50 |
switch (LOWORD (wparam)) { |
switch (LOWORD (wparam)) { |
51 |
case IDOK: |
case IDOK: |
52 |
if (IsDlgButtonChecked (dlg, IDC_FIRST_KEYGEN)) |
if (IsDlgButtonChecked (dlg, IDC_FIRST_KEYGEN)) |
53 |
ctx->choice = SETUP_KEYGEN; |
choice = SETUP_KEYGEN; |
54 |
else if (IsDlgButtonChecked (dlg, IDC_FIRST_IMPORT)) |
else if (IsDlgButtonChecked (dlg, IDC_FIRST_IMPORT)) |
55 |
ctx->choice = SETUP_IMPORT; |
choice = SETUP_IMPORT; |
56 |
|
else if (IsDlgButtonChecked (dlg, IDC_FIRST_IMPORTKEY)) |
57 |
|
choice = SETUP_EXISTING; |
58 |
else |
else |
59 |
ctx->choice = -1; |
choice = 0; |
60 |
EndDialog (dlg, TRUE); |
EndDialog (dlg, choice); |
61 |
break; |
break; |
62 |
|
|
63 |
case IDCANCEL: |
case IDCANCEL: |
64 |
ctx->choice = -1; |
EndDialog (dlg, 0); |
|
EndDialog (dlg, FALSE); |
|
65 |
break; |
break; |
66 |
} |
} |
67 |
break; |
break; |
68 |
} |
} |
69 |
|
|
70 |
return FALSE; |
return FALSE; |
71 |
} /* first_run_dlg_proc */ |
} |