]> cygwin.com Git - cygwin-apps/setup.git/blame - other.cc
2001-11-13 Robert Collins <rbtcollins@hotmail.com>
[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
b24c88b3
RC
19#if 0
20static const char *cvsid =
21 "\n%%% $Id$\n";
22#endif
8507f105 23
23c9e63c
DD
24#include "win32.h"
25#include <shlobj.h>
26#include <stdio.h>
27#include <stdlib.h>
28#include "dialog.h"
29#include "resource.h"
30#include "state.h"
31#include "msg.h"
89b1a15b 32#include "log.h"
23c9e63c 33
ed3e8b9b
DD
34/* private shared function, from site.cc */
35void save_site_url (void);
36
23c9e63c
DD
37static void
38check_if_enable_next (HWND h)
39{
40 EnableWindow (GetDlgItem (h, IDOK), other_url ? 1 : 0);
41}
42
43static void
44load_dialog (HWND h)
45{
46 eset (h, IDC_OTHER_URL, other_url);
47 check_if_enable_next (h);
48}
49
50static void
51save_dialog (HWND h)
52{
53 other_url = eget (h, IDC_OTHER_URL, other_url);
54}
55
56static BOOL
57dialog_cmd (HWND h, int id, HWND hwndctl, UINT code)
58{
59 switch (id)
60 {
61
62 case IDC_OTHER_URL:
63 save_dialog (h);
64 check_if_enable_next (h);
65 break;
66
67 case IDOK:
1fd6d0a2 68 save_dialog (h);
ed3e8b9b 69 save_site_url ();
1fd6d0a2 70 NEXT (IDD_S_LOAD_INI);
23c9e63c
DD
71 break;
72
73 case IDC_BACK:
1fd6d0a2
DD
74 save_dialog (h);
75 NEXT (IDD_SITE);
23c9e63c
DD
76 break;
77
78 case IDCANCEL:
1fd6d0a2 79 NEXT (0);
23c9e63c
DD
80 break;
81 }
b24c88b3 82 return 0;
23c9e63c
DD
83}
84
85static BOOL CALLBACK
86dialog_proc (HWND h, UINT message, WPARAM wParam, LPARAM lParam)
87{
88 switch (message)
89 {
90 case WM_INITDIALOG:
1fd6d0a2 91 load_dialog (h);
23c9e63c
DD
92 return FALSE;
93 case WM_COMMAND:
1fd6d0a2 94 return HANDLE_WM_COMMAND (h, wParam, lParam, dialog_cmd);
23c9e63c
DD
95 }
96 return FALSE;
97}
98
99void
100do_other (HINSTANCE h)
101{
102 int rv = 0;
103 rv = DialogBox (h, MAKEINTRESOURCE (IDD_OTHER_URL), 0, dialog_proc);
104 if (rv == -1)
105 fatal (IDS_DIALOG_FAILED);
89b1a15b
DD
106
107 log (0, "site: %s", other_url);
23c9e63c 108}
This page took 0.0384910000000001 seconds and 5 git commands to generate.