]>
cygwin.com Git - cygwin-apps/setup.git/blob - localdir.cc
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. */
21 static char *cvsid
= "\n%%% $Id$\n";
38 check_if_enable_next (HWND h
)
40 EnableWindow (GetDlgItem (h
, IDOK
), local_dir
!= 0);
46 eset (h
, IDC_LOCAL_DIR
, local_dir
);
47 check_if_enable_next (h
);
53 local_dir
= eget (h
, IDC_LOCAL_DIR
, local_dir
);
58 browse_cb (HWND h
, UINT msg
, LPARAM lp
, LPARAM data
)
62 case BFFM_INITIALIZED
:
64 SendMessage (h
, BFFM_SETSELECTION
, TRUE
, (LPARAM
)local_dir
);
76 memset (&bi
, 0, sizeof (bi
));
78 bi
.pszDisplayName
= name
;
79 bi
.lpszTitle
= "Select download directory";
80 bi
.ulFlags
= BIF_RETURNONLYFSDIRS
;
82 pidl
= SHBrowseForFolder (&bi
);
85 if (SHGetPathFromIDList (pidl
, name
))
86 eset (h
, IDC_LOCAL_DIR
, name
);
92 dialog_cmd (HWND h
, int id
, HWND hwndctl
, UINT code
)
99 check_if_enable_next (h
);
102 case IDC_LOCAL_DIR_BROWSE
:
108 if (SetCurrentDirectoryA (local_dir
))
112 case IDC_SOURCE_DOWNLOAD
:
115 case IDC_SOURCE_NETINST
:
125 note (IDS_ERR_CHDIR
, local_dir
);
141 dialog_proc (HWND h
, UINT message
, WPARAM wParam
, LPARAM lParam
)
149 return HANDLE_WM_COMMAND (h
, wParam
, lParam
, dialog_cmd
);
154 extern char cwd
[_MAX_PATH
];
157 do_local_dir (HINSTANCE h
)
160 rv
= DialogBox (h
, MAKEINTRESOURCE (IDD_LOCAL_DIR
), 0, dialog_proc
);
162 fatal (IDS_DIALOG_FAILED
);
164 log (0, "Selected local directory: %s", local_dir
);
This page took 0.045272 seconds and 5 git commands to generate.