--- trunk/Src/wptFirstRunDlg.cpp 2005/10/27 15:25:13 36 +++ trunk/Src/wptFirstRunDlg.cpp 2006/08/16 10:01:30 260 @@ -1,5 +1,5 @@ /* wptFirstRunDlg.cpp - Welcome dialog - * Copyright (C) 2002-2005 Timo Schulz + * Copyright (C) 2002-2006 Timo Schulz * * This file is part of WinPT. * @@ -17,15 +17,13 @@ * along with WinPT; if not, write to the Free Software Foundation, * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ - #ifdef HAVE_CONFIG_H #include #endif #include -#include -#include "../resource.h" +#include "resource.h" #include "wptW32API.h" #include "wptGPG.h" #include "wptTypes.h" @@ -33,20 +31,21 @@ #include "wptContext.h" +/* Dialog box procedure which is executed on the first time WinPT + is started. */ BOOL CALLBACK first_run_dlg_proc (HWND dlg, UINT msg, WPARAM wparam, LPARAM lparam) { - static struct first_start_s * ctx; - + int choice = 0; switch (msg) { case WM_INITDIALOG: - ctx = (struct first_start_s *)lparam; - if (!ctx) - BUG (0); - CheckDlgButton( dlg, IDC_FIRST_KEYGEN, BST_CHECKED ); - SetDlgItemText (dlg, IDC_FIRST_KEYGEN, _("&Generate a GnuPG key pair")); - SetDlgItemText (dlg, IDC_FIRST_IMPORT, _("&Copy GnuPG keyrings from another location")); - SetDlgItemText (dlg, IDC_FIRST_SETUP, _("&Specify a new GnuPG home directory")); + CheckDlgButton (dlg, IDC_FIRST_KEYGEN, BST_CHECKED); + SetDlgItemText (dlg, IDC_FIRST_KEYGEN, + _("&Generate a GnuPG key pair")); + SetDlgItemText (dlg, IDC_FIRST_IMPORT, + _("&Copy GnuPG keyrings from another location")); + SetDlgItemText (dlg, IDCANCEL, _("&Cancel")); + SetWindowText (dlg, _("WinPT First Start")); SetForegroundWindow (dlg); center_window (dlg, NULL); return TRUE; @@ -55,21 +54,22 @@ switch (LOWORD (wparam)) { case IDOK: if (IsDlgButtonChecked (dlg, IDC_FIRST_KEYGEN)) - ctx->choice = SETUP_KEYGEN; + choice = SETUP_KEYGEN; else if (IsDlgButtonChecked (dlg, IDC_FIRST_IMPORT)) - ctx->choice = SETUP_IMPORT; + choice = SETUP_IMPORT; + else if (IsDlgButtonChecked (dlg, IDC_FIRST_CARDGEN)) + choice = SETUP_CARDGEN; else - ctx->choice = -1; - EndDialog (dlg, TRUE); + choice = 0; + EndDialog (dlg, choice); break; case IDCANCEL: - ctx->choice = -1; - EndDialog (dlg, FALSE); + EndDialog (dlg, 0); break; } break; } return FALSE; -} /* first_run_dlg_proc */ +}