This is the mail archive of the cygwin-apps mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH setup v4 1/6] Use the IDD_SITE dialog for cygwin.com mirrors only


Change wording in the dialog template to make it clear that this
dialog is intended for mirrors only.

Add a checkbox IDC_ALLOW_USER_URL; checking this sets a new boolean
variable allow_user_url.  In a future commit, this will enable a new
page where the user can enter URLs for non-mirror package
repositories.
---
 res.rc     | 20 +++++++++++---------
 resource.h |  1 +
 site.cc    |  7 +++++++
 3 files changed, 19 insertions(+), 9 deletions(-)

diff --git a/res.rc b/res.rc
index 901cf76..5ea4c8b 100644
--- a/res.rc
+++ b/res.rc
@@ -131,25 +131,27 @@ IDD_SITE DIALOG DISCARDABLE  0, 0, SETUP_STANDARD_DIALOG_DIMS
 STYLE DS_MODALFRAME | DS_3DLOOK | DS_CENTER | WS_CHILD | WS_VISIBLE | 
     WS_CAPTION | WS_SYSMENU
 EXSTYLE WS_EX_CONTROLPARENT
-CAPTION "Cygwin Setup - Choose Download Site(s)"
+CAPTION "Cygwin Setup - Choose Mirror(s)"
 FONT 8, "MS Shell Dlg"
 BEGIN
     ICON            IDI_CYGWIN,IDC_HEADICON,SETUP_HEADICON_X,0,21,20
-    LISTBOX         IDC_URL_LIST,66,45,185,110,LBS_NOINTEGRALHEIGHT | 
+    LISTBOX         IDC_URL_LIST,66,41,183,109,LBS_NOINTEGRALHEIGHT |
                     LBS_EXTENDEDSEL | WS_VSCROLL | WS_HSCROLL | WS_GROUP | 
                     WS_TABSTOP
-    LTEXT           "Available Download Sites:",IDC_STATIC,66,34,183,8,NOT 
+    LTEXT           "Known Mirrors:",IDC_STATIC,66,30,183,8,NOT
                     WS_GROUP
-    CONTROL         "",IDC_HEADSEPARATOR,"Static",SS_BLACKFRAME | SS_SUNKEN,0,28,
+    CONTROL         "",IDC_HEADSEPARATOR,"Static",SS_BLACKFRAME | SS_SUNKEN,0,25,
                     SETUP_STANDARD_DIALOG_W,1
-    LTEXT           "Choose a site from this list, or add your own sites to the list",
+    LTEXT           "Choose a cygwin.com mirror from this list, or add your own mirrors to the list",
                     IDC_STATIC,21,9,239,16,NOT WS_GROUP
-    LTEXT           "Choose A Download Site",IDC_STATIC_HEADER_TITLE,7,0,258,
+    LTEXT           "Choose A Mirror",IDC_STATIC_HEADER_TITLE,7,0,258,
                     8,NOT WS_GROUP
-    EDITTEXT        IDC_EDIT_USER_URL,65,160,185,14,ES_AUTOHSCROLL | 
+    EDITTEXT        IDC_EDIT_USER_URL,65,153,185,14,ES_AUTOHSCROLL |
                     WS_GROUP
-    LTEXT           "User URL:",IDC_SITE_USERURL,15,162,45,8,NOT WS_GROUP
-    PUSHBUTTON      "Add",IDC_BUTTON_ADD_URL,255,160,50,14
+    LTEXT           "Mirror URL:",IDC_SITE_USERURL,15,155,45,8,NOT WS_GROUP
+    PUSHBUTTON      "Add",IDC_BUTTON_ADD_URL,255,153,50,14
+    CONTROL         "Allow download sites that are not cygwin.com mirrors (to be chosen on the next page)",
+                    IDC_ALLOW_USER_URL,"Button",BS_AUTOCHECKBOX,15,171,350,8
 END
 
 IDD_NET DIALOG DISCARDABLE  0, 0, SETUP_STANDARD_DIALOG_DIMS
diff --git a/resource.h b/resource.h
index 79b876d..ed4f605 100644
--- a/resource.h
+++ b/resource.h
@@ -178,3 +178,4 @@
 #define IDC_NET_DIRECT_LEGACY             593
 #define IDC_DOWNLOAD_EDIT                 594
 #define IDC_CHOOSE_DO_SEARCH              595
+#define IDC_ALLOW_USER_URL                596
diff --git a/site.cc b/site.cc
index a945d28..c0ce487 100644
--- a/site.cc
+++ b/site.cc
@@ -64,6 +64,7 @@ static ControlAdjuster::ControlInfo SiteControlsInfo[] = {
   {IDC_EDIT_USER_URL,		CP_STRETCH, CP_BOTTOM},
   {IDC_BUTTON_ADD_URL,		CP_RIGHT,   CP_BOTTOM},
   {IDC_SITE_USERURL,            CP_LEFT,    CP_BOTTOM},
+  {IDC_ALLOW_USER_URL,          CP_LEFT,    CP_BOTTOM},
   {0, CP_LEFT, CP_TOP}
 };
 
@@ -78,6 +79,7 @@ SitePage::SitePage ()
 
 using namespace std;
 
+bool allow_user_url;
 bool cache_is_usable;
 bool cache_needs_writing;
 string cache_warn_urls;
@@ -720,6 +722,11 @@ bool SitePage::OnMessageCmd (int id, HWND hwndctl, UINT code)
 	    eset (GetHWND (), IDC_EDIT_USER_URL, "");
 	    }
 	  }
+      }
+    case IDC_ALLOW_USER_URL:
+      {
+	if (code == BN_CLICKED)
+	  allow_user_url = IsButtonChecked (IDC_ALLOW_USER_URL);
 	break;
       }
     default:
-- 
2.15.1


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]