From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 76561 invoked by alias); 10 Nov 2017 14:43:55 -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 76283 invoked by uid 89); 10 Nov 2017 14:43:54 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.4 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: limerock04.mail.cornell.edu Received: from limerock04.mail.cornell.edu (HELO limerock04.mail.cornell.edu) (128.84.13.244) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 10 Nov 2017 14:43:53 +0000 X-CornellRouted: This message has been Routed already. Received: from authusersmtp.mail.cornell.edu (granite4.serverfarm.cornell.edu [10.16.197.9]) by limerock04.mail.cornell.edu (8.14.4/8.14.4_cu) with ESMTP id vAAEhoCI029544; Fri, 10 Nov 2017 09:43:51 -0500 Received: from nothing.nyroc.rr.com (mta-68-175-129-7.twcny.rr.com [68.175.129.7] (may be forged)) (authenticated bits=0) by authusersmtp.mail.cornell.edu (8.14.4/8.12.10) with ESMTP id vAAEheGW015853 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 10 Nov 2017 09:43:50 -0500 From: Ken Brown To: cygwin-apps@cygwin.com Subject: [PATCH setup 5/5] Limit the number of packages shown in the IDD_DOWNLOAD_ERROR listbox Date: Fri, 10 Nov 2017 14:43:00 -0000 Message-Id: <20171110144339.12616-6-kbrown@cornell.edu> In-Reply-To: <20171110144339.12616-1-kbrown@cornell.edu> References: <20171110144339.12616-1-kbrown@cornell.edu> X-PMX-Cornell-Gauge: Gauge=XXXXX X-PMX-CORNELL-AUTH-RESULTS: dkim-out=none; X-IsSubscribed: yes X-SW-Source: 2017-11/txt/msg00042.txt.bz2 --- download.cc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/download.cc b/download.cc index b059bf5..6e6d6e8 100644 --- a/download.cc +++ b/download.cc @@ -188,6 +188,7 @@ download_one (packagesource & pkgsource, HWND owner) static std::vector download_failures; static std::string download_warn_pkgs; +static const int max_pkgs = 20; static INT_PTR CALLBACK download_error_proc (HWND h, UINT message, WPARAM wParam, LPARAM lParam) @@ -224,12 +225,19 @@ query_download_errors (HINSTANCE h, HWND owner) { download_warn_pkgs = ""; Log (LOG_PLAIN) << "The following package(s) had download errors:" << endLog; + int count = 0; for (std::vector ::const_iterator i = download_failures.begin (); i != download_failures.end (); i++) { packageversion pv = *i; std::string pvs = pv.Name () + "-" + pv.Canonical_version (); Log (LOG_PLAIN) << " " << pvs << endLog; - download_warn_pkgs += pvs + "\r\n"; + if (count < max_pkgs) + download_warn_pkgs += pvs + "\r\n"; + else if (count == max_pkgs) + download_warn_pkgs += "...and " + + std::to_string (download_failures.size () - max_pkgs) + + " more."; + count++; } return DialogBox (h, MAKEINTRESOURCE (IDD_DOWNLOAD_ERROR), owner, download_error_proc); -- 2.15.0