1 |
werner |
36 |
/* wptFirstRunDlg.cpp - Welcome dialog |
2 |
twoaday |
133 |
* Copyright (C) 2002-2006 Timo Schulz |
3 |
werner |
36 |
* |
4 |
|
|
* This file is part of WinPT. |
5 |
|
|
* |
6 |
|
|
* 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 |
8 |
|
|
* the Free Software Foundation; either version 2 of the License, or |
9 |
|
|
* (at your option) any later version. |
10 |
|
|
* |
11 |
|
|
* WinPT is distributed in the hope that it will be useful, |
12 |
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 |
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
14 |
|
|
* GNU General Public License for more details. |
15 |
|
|
*/ |
16 |
|
|
#ifdef HAVE_CONFIG_H |
17 |
|
|
#include <config.h> |
18 |
|
|
#endif |
19 |
|
|
|
20 |
|
|
#include <windows.h> |
21 |
|
|
|
22 |
werner |
47 |
#include "resource.h" |
23 |
werner |
36 |
#include "wptW32API.h" |
24 |
|
|
#include "wptGPG.h" |
25 |
|
|
#include "wptTypes.h" |
26 |
|
|
#include "wptCommonCtl.h" |
27 |
|
|
#include "wptContext.h" |
28 |
|
|
|
29 |
|
|
|
30 |
twoaday |
105 |
/* Dialog box procedure which is executed on the first time WinPT |
31 |
|
|
is started. */ |
32 |
werner |
36 |
BOOL CALLBACK |
33 |
|
|
first_run_dlg_proc (HWND dlg, UINT msg, WPARAM wparam, LPARAM lparam) |
34 |
|
|
{ |
35 |
twoaday |
167 |
int choice = 0; |
36 |
werner |
36 |
switch (msg) { |
37 |
|
|
case WM_INITDIALOG: |
38 |
twoaday |
256 |
CheckDlgButton (dlg, IDC_FIRST_KEYGEN, BST_CHECKED); |
39 |
twoaday |
133 |
SetDlgItemText (dlg, IDC_FIRST_KEYGEN, |
40 |
|
|
_("&Generate a GnuPG key pair")); |
41 |
|
|
SetDlgItemText (dlg, IDC_FIRST_IMPORT, |
42 |
|
|
_("&Copy GnuPG keyrings from another location")); |
43 |
twoaday |
105 |
SetDlgItemText (dlg, IDCANCEL, _("&Cancel")); |
44 |
twoaday |
133 |
SetWindowText (dlg, _("WinPT First Start")); |
45 |
werner |
36 |
SetForegroundWindow (dlg); |
46 |
|
|
center_window (dlg, NULL); |
47 |
|
|
return TRUE; |
48 |
|
|
|
49 |
|
|
case WM_COMMAND: |
50 |
|
|
switch (LOWORD (wparam)) { |
51 |
|
|
case IDOK: |
52 |
|
|
if (IsDlgButtonChecked (dlg, IDC_FIRST_KEYGEN)) |
53 |
twoaday |
167 |
choice = SETUP_KEYGEN; |
54 |
werner |
36 |
else if (IsDlgButtonChecked (dlg, IDC_FIRST_IMPORT)) |
55 |
twoaday |
167 |
choice = SETUP_IMPORT; |
56 |
werner |
36 |
else |
57 |
twoaday |
167 |
choice = 0; |
58 |
|
|
EndDialog (dlg, choice); |
59 |
werner |
36 |
break; |
60 |
|
|
|
61 |
|
|
case IDCANCEL: |
62 |
twoaday |
167 |
EndDialog (dlg, 0); |
63 |
werner |
36 |
break; |
64 |
|
|
} |
65 |
|
|
break; |
66 |
|
|
} |
67 |
|
|
|
68 |
|
|
return FALSE; |
69 |
twoaday |
105 |
} |