From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 117103 invoked by alias); 6 Jun 2017 11:55:10 -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 116895 invoked by uid 89); 6 Jun 2017 11:55:09 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.8 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=click X-HELO: rgout06.bt.lon5.cpcloud.co.uk Received: from rgout0607.bt.lon5.cpcloud.co.uk (HELO rgout06.bt.lon5.cpcloud.co.uk) (65.20.0.134) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 06 Jun 2017 11:55:07 +0000 X-OWM-Source-IP: 86.141.128.130 (GB) X-OWM-Env-Sender: jonturney@btinternet.com X-Junkmail-Premium-Raw: score=8/50,refid=2.7.2:2017.6.2.221216:17:8.707,ip=,rules=NO_URI_FOUND, NO_CTA_URI_FOUND, NO_MESSAGE_ID, NO_URI_HTTPS, TO_MALFORMED Received: from localhost.localdomain (86.141.128.130) by rgout06.bt.lon5.cpcloud.co.uk (9.0.019.13-1) (authenticated as jonturney@btinternet.com) id 58F7952B052246E2; Tue, 6 Jun 2017 12:55:11 +0100 From: Jon Turney To: cygwin-apps@cygwin.com Cc: Jon Turney Subject: [PATCH setup 7/9] Fix that clicking on any column changes "Keep" to "Uninstall" Date: Tue, 06 Jun 2017 11:55:00 -0000 Message-Id: <20170606115432.105020-8-jon.turney@dronecode.org.uk> In-Reply-To: <20170606115432.105020-1-jon.turney@dronecode.org.uk> References: <20170606115432.105020-1-jon.turney@dronecode.org.uk> X-SW-Source: 2017-06/txt/msg00015.txt.bz2 A package's status is only changed by clicking on the "New" column, with one exception: If the status is "Keep", it is changed to "Uninstall" after a click (even accidental) on any other column. "Keep" means desired == installed, picked = false. Only run the code which is supposed to detect both "src?" and "bin?" unchecked when clicking on those columns. Addresses: https://cygwin.com/ml/cygwin/2017-05/msg00525.html --- PickPackageLine.cc | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/PickPackageLine.cc b/PickPackageLine.cc index 60ece7f..a158966 100644 --- a/PickPackageLine.cc +++ b/PickPackageLine.cc @@ -142,12 +142,20 @@ PickPackageLine::click (int const myrow, int const ClickedRow, int const x) pkg.desired.sourcePackage ().pick ( !pkg.desired.sourcePackage ().picked (), NULL); } + /* Unchecking binary while source is unchecked or vice versa is equivalent to uninstalling. It's essential to set desired correctly, otherwise the package gets uninstalled without visual feedback to the user. The package will not even show up in the "Pending" view! */ - if (!pkg.desired.picked () && !pkg.desired.sourcePackage ().picked ()) - pkg.desired = packageversion (); + if ((x >= theView.headers[theView.bintick_col].x - HMARGIN / 2 + && x <= theView.headers[theView.bintick_col + 1].x - HMARGIN / 2) || + (x >= theView.headers[theView.srctick_col].x - HMARGIN / 2 + && x <= theView.headers[theView.srctick_col + 1].x - HMARGIN / 2)) + { + if (!pkg.desired.picked () && !pkg.desired.sourcePackage ().picked ()) + pkg.desired = packageversion (); + } + return 0; } -- 2.12.3