It starts checked if all_site_list contains a site that is not a cygwin.com mirror. Such a site would have to come from the "last-mirror" user setting, indicating that the user used a non-mirror on the last run. Introduce a new function check_for_user_urls() to help with this. --- site.cc | 26 ++++++++++++++++++++++++++ site.h | 1 + 2 files changed, 27 insertions(+)
diff --git a/site.cc b/site.cc index 4fbf30d..dbb07d4 100644 --- a/site.cc +++ b/site.cc @@ -241,6 +241,23 @@ save_dialog (HWND h) } } +// Does the_site_list contain any sites that are not mirrors (possibly stale)? +static void +check_for_user_urls () +{ + for (SiteList::const_iterator i = all_site_list.begin (); + i != all_site_list.end (); i++) + { + if (!i->from_mirrors_lst + && (find (cached_site_list.begin (), cached_site_list.end (), *i) + == cached_site_list.end ())) + { + allow_user_url = true; + return; + } + } +} + // This is called only for lists of mirrors that came (now or in a // previous setup run) from mirrors.lst. void @@ -365,6 +382,8 @@ get_site_list (HINSTANCE h, HWND owner) delete[] theMirrorString; delete[] theCachedString; + check_for_user_urls (); + return 0; } @@ -568,6 +587,13 @@ bool SitePage::Create () return PropertyPage::Create (IDD_SITE); } +void +SitePage::OnInit () +{ + int a = allow_user_url ? BST_CHECKED : BST_UNCHECKED; + CheckDlgButton (GetHWND (), IDC_ALLOW_USER_URL, a); +} + long SitePage::OnNext () { diff --git a/site.h b/site.h index d16db8e..c517ac2 100644 --- a/site.h +++ b/site.h @@ -31,6 +31,7 @@ public: bool Create (); + virtual void OnInit (); virtual void OnActivate (); virtual long OnNext (); virtual long OnBack (); -- 2.15.1