]> cygwin.com Git - cygwin-apps/setup.git/blame - other.cc
* net.cc (do_net): Default to direct download.
[cygwin-apps/setup.git] / other.cc
CommitLineData
23c9e63c
DD
1/*
2 * Copyright (c) 2000, Red Hat, Inc.
3 *
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.
8 *
9 * A copy of the GNU General Public License can be found at
10 * http://www.gnu.org/
11 *
12 * Written by DJ Delorie <dj@cygnus.com>
13 *
14 */
15
16/* This handles the "other URL" option from the mirror site
17 selection. */
18
8507f105
DD
19static char *cvsid = "\n%%% $Id$\n";
20
23c9e63c
DD
21#include "win32.h"
22#include <shlobj.h>
23#include <stdio.h>
24#include <stdlib.h>
25#include "dialog.h"
26#include "resource.h"
27#include "state.h"
28#include "msg.h"
89b1a15b 29#include "log.h"
23c9e63c 30
ed3e8b9b
DD
31/* private shared function, from site.cc */
32void save_site_url (void);
33
23c9e63c
DD
34static void
35check_if_enable_next (HWND h)
36{
37 EnableWindow (GetDlgItem (h, IDOK), other_url ? 1 : 0);
38}
39
40static void
41load_dialog (HWND h)
42{
43 eset (h, IDC_OTHER_URL, other_url);
44 check_if_enable_next (h);
45}
46
47static void
48save_dialog (HWND h)
49{
50 other_url = eget (h, IDC_OTHER_URL, other_url);
51}
52
53static BOOL
54dialog_cmd (HWND h, int id, HWND hwndctl, UINT code)
55{
56 switch (id)
57 {
58
59 case IDC_OTHER_URL:
60 save_dialog (h);
61 check_if_enable_next (h);
62 break;
63
64 case IDOK:
1fd6d0a2 65 save_dialog (h);
ed3e8b9b 66 save_site_url ();
1fd6d0a2 67 NEXT (IDD_S_LOAD_INI);
23c9e63c
DD
68 break;
69
70 case IDC_BACK:
1fd6d0a2
DD
71 save_dialog (h);
72 NEXT (IDD_SITE);
23c9e63c
DD
73 break;
74
75 case IDCANCEL:
1fd6d0a2 76 NEXT (0);
23c9e63c
DD
77 break;
78 }
79}
80
81static BOOL CALLBACK
82dialog_proc (HWND h, UINT message, WPARAM wParam, LPARAM lParam)
83{
84 switch (message)
85 {
86 case WM_INITDIALOG:
1fd6d0a2 87 load_dialog (h);
23c9e63c
DD
88 return FALSE;
89 case WM_COMMAND:
1fd6d0a2 90 return HANDLE_WM_COMMAND (h, wParam, lParam, dialog_cmd);
23c9e63c
DD
91 }
92 return FALSE;
93}
94
95void
96do_other (HINSTANCE h)
97{
98 int rv = 0;
99 rv = DialogBox (h, MAKEINTRESOURCE (IDD_OTHER_URL), 0, dialog_proc);
100 if (rv == -1)
101 fatal (IDS_DIALOG_FAILED);
89b1a15b
DD
102
103 log (0, "site: %s", other_url);
23c9e63c
DD
104}
105
This page took 0.032635 seconds and 5 git commands to generate.