]>
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 "AntiVirus.h"
38 #include "getopt++/BoolOption.h"
40 static BoolOption
DownloadOption (false, 'D', "download", "Download from internet");
41 static BoolOption
LocalOption (false, 'L', "local-install", "Install from local directory");
44 { IDC_SOURCE_NETINST
, IDC_SOURCE_DOWNLOAD
, IDC_SOURCE_CWD
, 0 };
49 rbset (h
, rb
, source
);
55 source
= rbget (h
, rb
);
58 source
== IDC_SOURCE_DOWNLOAD
? PackageDB_Download
: PackageDB_Install
;
62 dialog_cmd (HWND h
, int id
, HWND hwndctl
, UINT code
)
67 case IDC_SOURCE_DOWNLOAD
:
68 case IDC_SOURCE_NETINST
:
82 return PropertyPage::Create (NULL
, dialog_cmd
, IDD_SOURCE
);
86 SourcePage::OnActivate ()
91 source
= IDC_SOURCE_DOWNLOAD
;
93 source
= IDC_SOURCE_CWD
;
95 source
= IDC_SOURCE_NETINST
;
98 load_dialog (GetHWND ());
99 // Check to see if any radio buttons are selected. If not, select a default.
101 (GetDlgItem (IDC_SOURCE_DOWNLOAD
), BM_GETCHECK
, 0,
103 && (!SendMessage (GetDlgItem (IDC_SOURCE_CWD
), BM_GETCHECK
, 0, 0)
106 SendMessage (GetDlgItem (IDC_SOURCE_NETINST
), BM_SETCHECK
,
112 SourcePage::OnNext ()
117 if (source
== IDC_SOURCE_DOWNLOAD
)
119 // If all we're doing is downloading,skip the root directory page
120 return IDD_LOCAL_DIR
;
127 SourcePage::OnBack ()
129 save_dialog (GetHWND ());
130 if (!AntiVirus::Show())
136 SourcePage::OnDeactivate ()
138 log (LOG_PLAIN
, String ("source: ") +
139 ((source
== IDC_SOURCE_DOWNLOAD
) ? "download" :
140 (source
== IDC_SOURCE_NETINST
) ? "network install" : "from cwd"));
144 SourcePage::OnUnattended ()
This page took 0.041696 seconds and 5 git commands to generate.