]>
cygwin.com Git - cygwin-apps/setup.git/blob - source.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 DJ Delorie <dj@cygnus.com>
16 /* The purpose of this file is to manage the dialog box that lets the
17 user choose the source of the install - from the net, from the
18 current directory, or to just download files. */
21 static const char *cvsid
=
32 #include "package_db.h"
36 #include "getopt++/BoolOption.h"
38 static BoolOption
DownloadOption (false, 'D', "download", "Download from internet");
39 static BoolOption
LocalOption (false, 'L', "local-install", "Install from local directory");
42 { IDC_SOURCE_NETINST
, IDC_SOURCE_DOWNLOAD
, IDC_SOURCE_CWD
, 0 };
47 rbset (h
, rb
, source
);
53 source
= rbget (h
, rb
);
56 source
== IDC_SOURCE_DOWNLOAD
? PackageDB_Download
: PackageDB_Install
;
60 dialog_cmd (HWND h
, int id
, HWND hwndctl
, UINT code
)
65 case IDC_SOURCE_DOWNLOAD
:
66 case IDC_SOURCE_NETINST
:
80 return PropertyPage::Create (NULL
, dialog_cmd
, IDD_SOURCE
);
84 SourcePage::OnActivate ()
89 source
= IDC_SOURCE_DOWNLOAD
;
91 source
= IDC_SOURCE_CWD
;
93 source
= IDC_SOURCE_NETINST
;
96 load_dialog (GetHWND ());
97 // Check to see if any radio buttons are selected. If not, select a default.
99 (GetDlgItem (IDC_SOURCE_DOWNLOAD
), BM_GETCHECK
, 0,
101 && (!SendMessage (GetDlgItem (IDC_SOURCE_CWD
), BM_GETCHECK
, 0, 0)
104 SendMessage (GetDlgItem (IDC_SOURCE_NETINST
), BM_SETCHECK
,
110 SourcePage::OnNext ()
115 if (source
== IDC_SOURCE_DOWNLOAD
)
117 // If all we're doing is downloading,skip the root directory page
118 return IDD_LOCAL_DIR
;
125 SourcePage::OnBack ()
127 save_dialog (GetHWND ());
132 SourcePage::OnDeactivate ()
134 log (LOG_PLAIN
, String ("source: ") +
135 ((source
== IDC_SOURCE_DOWNLOAD
) ? "download" :
136 (source
== IDC_SOURCE_NETINST
) ? "network install" : "from cwd"));
140 SourcePage::OnUnattended ()
This page took 0.180515 seconds and 5 git commands to generate.