From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 61582 invoked by alias); 1 Aug 2019 16:05:49 -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 61569 invoked by uid 89); 1 Aug 2019 16:05:47 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-16.1 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 spammy=columns, popup, HContent-Transfer-Encoding:8bit X-HELO: rgout08.bt.lon5.cpcloud.co.uk Received: from rgout08.bt.lon5.cpcloud.co.uk (HELO rgout08.bt.lon5.cpcloud.co.uk) (65.20.0.185) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 01 Aug 2019 16:05:46 +0000 X-OWM-Source-IP: 31.51.206.148 (GB) X-OWM-Env-Sender: jonturney@btinternet.com X-VadeSecure-score: verdict=clean score=0/300, class=clean X-SNCR-VADESECURE: CLEAN Received: from localhost.localdomain (31.51.206.148) by rgout08.bt.lon5.cpcloud.co.uk (9.0.019.26-1) (authenticated as jonturney@btinternet.com) id 5BC47A871A4DE6DC; Thu, 1 Aug 2019 17:05:45 +0100 From: Jon Turney To: cygwin-apps@cygwin.com Cc: Jon Turney Subject: [PATCH setup 01/11] Remove 'Bin?' column Date: Thu, 01 Aug 2019 16:05:00 -0000 Message-Id: <20190801160519.32745-2-jon.turney@dronecode.org.uk> In-Reply-To: <20190801160519.32745-1-jon.turney@dronecode.org.uk> References: <20190801160519.32745-1-jon.turney@dronecode.org.uk> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SW-Source: 2019-08/txt/msg00001.txt.bz2 The only use this column appears to have now is that unticking it is the same as selecting 'uninstall'. Future work: Make 'Src?' column more independent, rather than interacting with the 'New' (action) column in non-obvious ways. We should be able to choose to install source irrespective of the state of the binary package. (That should also take into account the '--include-source' option) --- PickPackageLine.cc | 32 ++------------------------------ PickView.cc | 3 +-- PickView.h | 10 +++++----- choose.cc | 1 - 4 files changed, 8 insertions(+), 38 deletions(-) diff --git a/PickPackageLine.cc b/PickPackageLine.cc index 685d632..f64c101 100644 --- a/PickPackageLine.cc +++ b/PickPackageLine.cc @@ -32,20 +32,6 @@ PickPackageLine::get_text(int col_num) const { return pkg.action_caption (); } - else if (col_num == bintick_col) - { - const char *bintick = "?"; - if (/* uninstall or skip */ !pkg.desired || - /* current version */ pkg.desired == pkg.installed || - /* no source */ !pkg.desired.accessible()) - bintick = "n/a"; - else if (pkg.picked()) - bintick = "yes"; - else - bintick = "no"; - - return bintick; - } else if (col_num == srctick_col) { const char *srctick = "?"; @@ -118,25 +104,11 @@ PickPackageLine::do_action(int col_num, int action_id) pkg.select_action(action_id, theView.deftrust); return 1; } - if (col_num == bintick_col) - { - if (pkg.desired.accessible ()) - pkg.pick (!pkg.picked ()); - } - else if (col_num == srctick_col) + + if (col_num == srctick_col) { if (pkg.desired.sourcePackage ().accessible ()) pkg.srcpick (!pkg.srcpicked ()); - } - - /* 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 ((col_num == bintick_col) || (col_num == srctick_col)) - { - if (!pkg.picked () && !pkg.srcpicked ()) - pkg.desired = packageversion (); return 1; } diff --git a/PickView.cc b/PickView.cc index 8412282..6d7d83d 100644 --- a/PickView.cc +++ b/PickView.cc @@ -236,9 +236,8 @@ PickView::init_headers (void) { listview->noteColumnWidthStart(); - // widths of the 'bin' and 'src' checkbox columns just need to accommodate the + // width of the 'src' checkbox column just needs to accommodate the // column name - listview->noteColumnWidth (bintick_col, ""); listview->noteColumnWidth (srctick_col, ""); // (In category view) accommodate the width of each category name diff --git a/PickView.h b/PickView.h index 3715d93..9443a78 100644 --- a/PickView.h +++ b/PickView.h @@ -71,16 +71,16 @@ private: void insert_category (CategoryTree *); }; +// column numbers, must match index into pkg_headers[] enum { pkgname_col = 0, // package/category name current_col = 1, new_col = 2, // action - bintick_col = 3, - srctick_col = 4, - cat_col = 5, - size_col = 6, - pkg_col = 7, // desc + srctick_col = 3, + cat_col = 4, + size_col = 5, + pkg_col = 6 // desc }; bool isObsolete (std::set &categories); diff --git a/choose.cc b/choose.cc index 2b5e465..c4b8773 100644 --- a/choose.cc +++ b/choose.cc @@ -133,7 +133,6 @@ static ListView::Header pkg_headers[] = { {"Package", LVCFMT_LEFT, ListView::ControlType::text}, {"Current", LVCFMT_LEFT, ListView::ControlType::text}, {"New", LVCFMT_LEFT, ListView::ControlType::popup}, - {"Bin?", LVCFMT_LEFT, ListView::ControlType::checkbox}, {"Src?", LVCFMT_LEFT, ListView::ControlType::checkbox}, {"Categories", LVCFMT_LEFT, ListView::ControlType::text}, {"Size", LVCFMT_RIGHT, ListView::ControlType::text}, -- 2.21.0