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>
16 /* The purpose of this file is to get the network configuration
17 information from the user. */
28 static int rb[] = { IDC_NET_IE5, IDC_NET_DIRECT, IDC_NET_PROXY, 0 };
31 check_if_enable_next (HWND h)
33 int e = 0, p = 0, pu = 0;
34 if (net_method == IDC_NET_IE5)
36 if (net_method == IDC_NET_IE5 || net_method == IDC_NET_DIRECT)
38 else if (net_method == IDC_NET_PROXY)
41 if (net_proxy_host && net_proxy_port)
44 EnableWindow (GetDlgItem (h, IDOK), e);
45 EnableWindow (GetDlgItem (h, IDC_PROXY_HOST), p);
46 EnableWindow (GetDlgItem (h, IDC_PROXY_PORT), p);
52 rbset (h, rb, net_method);
53 eset (h, IDC_PROXY_HOST, net_proxy_host);
54 if (net_proxy_port == 0)
56 eset (h, IDC_PROXY_PORT, net_proxy_port);
57 check_if_enable_next (h);
63 net_method = rbget (h, rb);
64 net_proxy_host = eget (h, IDC_PROXY_HOST, net_proxy_host);
65 net_proxy_port = eget (h, IDC_PROXY_PORT);
69 dialog_cmd (HWND h, int id, HWND hwndctl, UINT code)
80 check_if_enable_next (h);
87 case IDC_SOURCE_NETINST:
88 case IDC_SOURCE_DOWNLOAD:
95 msg ("source is default? %d\n", source);
104 case IDC_SOURCE_DOWNLOAD:
105 NEXT (IDD_LOCAL_DIR);
107 case IDC_SOURCE_NETINST:
122 dialog_proc (HWND h, UINT message, WPARAM wParam, LPARAM lParam)
130 return HANDLE_WM_COMMAND (h, wParam, lParam, dialog_cmd);
140 rv = DialogBox (h, MAKEINTRESOURCE (IDD_NET), 0, dialog_proc);
142 fatal (IDS_DIALOG_FAILED);
145 (net_method == IDC_NET_IE5) ? "IE5" :
146 (net_method == IDC_NET_DIRECT) ? "Direct" : "Proxy");