2 * Copyright (c) 2000, Red Hat, Inc.
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * A copy of the GNU General Public License can be found at
12 * Written by Andrej Borsenkow <Andrej.Borsenkow@mow.siemens.ru>
13 * based on work and suggestions of DJ Delorie
17 /* The purpose of this file is to ask the user where they want the
18 root of the installation to be, and to ask whether the user prefers
19 text or binary mounts. */
35 check_if_enable_next (HWND h)
37 EnableWindow (GetDlgItem (h, IDOK), local_dir != 0);
43 eset (h, IDC_LOCAL_DIR, local_dir);
44 check_if_enable_next (h);
50 local_dir = eget (h, IDC_LOCAL_DIR, local_dir);
55 browse_cb (HWND h, UINT m, LPARAM lp, LPARAM data)
59 case BFFM_INITIALIZED:
61 SendMessage (h, BFFM_SETSELECTION, TRUE, (LPARAM)local_dir);
73 memset (&bi, 0, sizeof (bi));
75 bi.pszDisplayName = name;
76 bi.lpszTitle = "Select download directory";
77 bi.ulFlags = BIF_RETURNONLYFSDIRS;
79 pidl = SHBrowseForFolder (&bi);
82 if (SHGetPathFromIDList (pidl, name))
83 eset (h, IDC_LOCAL_DIR, name);
89 dialog_cmd (HWND h, int id, HWND hwndctl, UINT code)
96 check_if_enable_next (h);
99 case IDC_LOCAL_DIR_BROWSE:
105 if (SetCurrentDirectoryA (local_dir))
109 case IDC_SOURCE_DOWNLOAD:
112 case IDC_SOURCE_NETINST:
122 note (IDS_ERR_CHDIR, local_dir);
139 dialog_proc (HWND h, UINT message, WPARAM wParam, LPARAM lParam)
147 return HANDLE_WM_COMMAND (h, wParam, lParam, dialog_cmd);
152 extern char cwd[_MAX_PATH];
155 do_local_dir (HINSTANCE h)
158 rv = DialogBox (h, MAKEINTRESOURCE (IDD_LOCAL_DIR), 0, dialog_proc);
160 fatal (IDS_DIALOG_FAILED);
162 log (0, "Selected local directory: %s", local_dir);