From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 124567 invoked by alias); 7 Nov 2017 18:17:42 -0000 Mailing-List: contact cygwin-apps-help@cygwin.com; run by ezmlm Precedence: bulk Sender: cygwin-apps-owner@cygwin.com List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Mail-Followup-To: cygwin-apps@cygwin.com Received: (qmail 124485 invoked by uid 89); 7 Nov 2017 18:17:42 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-23.9 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 spammy=xxx X-HELO: rgout02.bt.lon5.cpcloud.co.uk Received: from rgout0202.bt.lon5.cpcloud.co.uk (HELO rgout02.bt.lon5.cpcloud.co.uk) (65.20.0.201) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 07 Nov 2017 18:17:41 +0000 X-OWM-Source-IP: 86.162.230.154 (GB) X-OWM-Env-Sender: jonturney@btinternet.com X-Junkmail-Premium-Raw: score=7/50,refid=2.7.2:2017.11.7.174516:17:7.944,ip=,rules=__HAS_FROM, __TO_MALFORMED_2, __TO_NO_NAME, __HAS_CC_HDR, __CC_NAME, __CC_NAME_DIFF_FROM_ACC, __HAS_MSGID, __SANE_MSGID, __HAS_X_MAILER, __IN_REP_TO, __REFERENCES, __FROM_DOMAIN_IN_ANY_CC1, __NO_HTML_TAG_RAW, BODYTEXTP_SIZE_3000_LESS, BODY_SIZE_2000_2999, __MIME_TEXT_P1, __MIME_TEXT_ONLY, HTML_00_01, HTML_00_10, BODY_SIZE_5000_LESS, IN_REP_TO, MSG_THREAD, __FROM_DOMAIN_IN_RCPT, __CC_REAL_NAMES, MULTIPLE_REAL_RCPTS, LEGITIMATE_SIGNS, NO_URI_FOUND, NO_CTA_URI_FOUND, __MIME_TEXT_P, REFERENCES, NO_URI_HTTPS, BODY_SIZE_7000_LESS Received: from localhost.localdomain (86.162.230.154) by rgout02.bt.lon5.cpcloud.co.uk (9.0.019.13-1) (authenticated as jonturney@btinternet.com) id 59D91D94034C79CE; Tue, 7 Nov 2017 18:17:40 +0000 From: Jon Turney To: cygwin-apps@cygwin.com Cc: Jon Turney Subject: [PATCH setup 2/5] Simplify LocalDirPage::OnNext() Date: Tue, 07 Nov 2017 18:17:00 -0000 Message-Id: <20171107181703.51016-2-jon.turney@dronecode.org.uk> In-Reply-To: <20171107181703.51016-1-jon.turney@dronecode.org.uk> References: <20171107181703.51016-1-jon.turney@dronecode.org.uk> X-SW-Source: 2017-11/txt/msg00021.txt.bz2 Never go directly to IDD_CHOOSE from LocalDirPage::OnNext(), go to IDD_INSTATUS with WM_APP_START_SETUP_INI_DOWNLOAD (if source == IDC_SOURCE_LOCALDIR), otherwise IDD_NET (which eventually leads there) --- localdir.cc | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/localdir.cc b/localdir.cc index 4a7ce2a..0561a30 100644 --- a/localdir.cc +++ b/localdir.cc @@ -266,21 +266,18 @@ LocalDirPage::OnNext () { if (source == IDC_SOURCE_LOCALDIR) { - if (do_from_local_dir (GetInstance (), GetHWND (), local_dir)) - { - Progress.SetActivateTask (WM_APP_START_SETUP_INI_DOWNLOAD); - return IDD_INSTATUS; - } - return IDD_CHOOSE; + do_from_local_dir (GetInstance (), GetHWND (), local_dir); + Progress.SetActivateTask (WM_APP_START_SETUP_INI_DOWNLOAD); + return IDD_INSTATUS; } } else if (attr == INVALID_FILE_ATTRIBUTES && (GetLastError () == ERROR_FILE_NOT_FOUND || GetLastError () == ERROR_PATH_NOT_FOUND)) { - if (source == IDC_SOURCE_LOCALDIR && unattended_mode) - return IDD_CHOOSE; - else if (source == IDC_SOURCE_LOCALDIR) + if (source == IDC_SOURCE_LOCALDIR) + { + if (!unattended_mode) { // Check the user really wants only to uninstall. char msgText[1000]; @@ -290,8 +287,12 @@ LocalDirPage::OnNext () snprintf (msg, sizeof (msg), msgText, local_dir.c_str (), is_64bit ? "x86_64" : "x86"); int ret = MessageBox (h, msg, 0, MB_ICONEXCLAMATION | MB_OKCANCEL); - return (ret == IDOK) ? IDD_CHOOSE : -1; + if (ret == IDCANCEL) + return -1; } + Progress.SetActivateTask (WM_APP_START_SETUP_INI_DOWNLOAD); + return IDD_INSTATUS; + } else if (offer_to_create (GetHWND (), local_dir.c_str ())) return -1; tryLocalDir = true; @@ -322,10 +323,12 @@ LocalDirPage::OnNext () return -1; else tryLocalDir = (ret == IDRETRY); + // XXX: On IDIGNORE we drop through to IDD_NET, which is wrong in + // the source == IDC_SOURCE_LOCALDIR case? } } - return 0; + return 0; // IDD_NET } long -- 2.15.0