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 DJ Delorie <dj@cygnus.com>
14 * Sync'ed with cinstall 2001-10-16
17 /* The purpose of this file is to get the network configuration
18 information from the user. */
29 static int rb[] = { IDC_NET_IE5, IDC_NET_DIRECT, IDC_NET_PROXY, 0 };
32 check_if_enable_next (HWND h)
34 int e = 0, p = 0, pu = 0;
35 if (net_method == IDC_NET_IE5)
37 if (net_method == IDC_NET_IE5 || net_method == IDC_NET_DIRECT)
39 else if (net_method == IDC_NET_PROXY)
42 if (net_proxy_host && net_proxy_port)
45 EnableWindow (GetDlgItem (h, IDOK), e);
46 EnableWindow (GetDlgItem (h, IDC_PROXY_HOST), p);
47 EnableWindow (GetDlgItem (h, IDC_PROXY_PORT), p);
53 rbset (h, rb, net_method);
54 eset (h, IDC_PROXY_HOST, net_proxy_host);
55 if (net_proxy_port == 0)
57 eset (h, IDC_PROXY_PORT, net_proxy_port);
58 check_if_enable_next (h);
64 net_method = rbget (h, rb);
65 net_proxy_host = eget (h, IDC_PROXY_HOST, net_proxy_host);
66 net_proxy_port = eget (h, IDC_PROXY_PORT);
70 dialog_cmd (HWND h, int id, HWND hwndctl, UINT code)
81 check_if_enable_next (h);
88 case IDC_SOURCE_NETINST:
89 case IDC_SOURCE_DOWNLOAD:
96 msg ("source is default? %d\n", source);
105 case IDC_SOURCE_DOWNLOAD:
106 NEXT (IDD_LOCAL_DIR);
108 case IDC_SOURCE_NETINST:
122 dialog_proc (HWND h, UINT message, WPARAM wParam, LPARAM lParam)
129 // Check to see if any radio buttons are selected. If not, select a default.
130 if ((!SendMessage(GetDlgItem (h, IDC_NET_IE5), BM_GETCHECK, 0, 0) == BST_CHECKED)
131 && (!SendMessage(GetDlgItem (h, IDC_NET_PROXY), BM_GETCHECK, 0, 0) == BST_CHECKED))
133 SendMessage(GetDlgItem (h, IDC_NET_DIRECT), BM_CLICK, 0, 0);
137 return HANDLE_WM_COMMAND (h, wParam, lParam, dialog_cmd);
147 net_method = IDC_NET_DIRECT;
148 rv = DialogBox (h, MAKEINTRESOURCE (IDD_NET), 0, dialog_proc);
150 fatal (IDS_DIALOG_FAILED);
153 (net_method == IDC_NET_IE5) ? "IE5" :
154 (net_method == IDC_NET_DIRECT) ? "Direct" : "Proxy");