From: Jon Turney <jon.turney@dronecode.org.uk>
To: cygwin-apps@cygwin.com
Cc: Jon Turney <jon.turney@dronecode.org.uk>
Subject: [PATCH setup 01/11] Remove 'Bin?' column
Date: Thu, 01 Aug 2019 16:05:00 -0000 [thread overview]
Message-ID: <20190801160519.32745-2-jon.turney@dronecode.org.uk> (raw)
In-Reply-To: <20190801160519.32745-1-jon.turney@dronecode.org.uk>
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 <std::string, casecompare_lt_op> &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
next prev parent reply other threads:[~2019-08-01 16:05 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-01 16:05 [PATCH setup 00/11] Improve handling of specifying an obsolete package to be installed on the command line Jon Turney
2019-08-01 16:05 ` [PATCH setup 02/11] Remove unused packagemeta::key Jon Turney
2019-08-01 16:05 ` Jon Turney [this message]
2019-08-01 16:06 ` [PATCH setup 03/11] Make packagemeta::message private Jon Turney
2019-08-01 16:07 ` [PATCH setup 04/11] Rename 'Default' packagemeta action to 'NoChange' for clarity Jon Turney
2019-08-01 16:07 ` [PATCH setup 06/11] Use packagemeta::set_action() to update action Jon Turney
2019-08-01 16:07 ` [PATCH setup 05/11] Store the requested action in packagemeta::set_action() Jon Turney
2019-08-01 16:08 ` [PATCH setup 07/11] Use stored action in setting up solver Jon Turney
2019-08-01 16:08 ` [PATCH setup 08/11] Allow better handling of an obsolete package specified on command line Jon Turney
2019-08-01 16:08 ` [PATCH setup 09/11] Use stored action in packagemeta::list_actions() Jon Turney
2019-08-01 16:09 ` [PATCH setup 10/11] Use stored action in packagemeta::action_caption() Jon Turney
2019-08-01 16:10 ` [PATCH setup 11/11] Ensure we only set user_picked when appropriate Jon Turney
2019-12-01 19:32 ` [PATCH setup 00/11] Improve handling of specifying an obsolete package to be installed on the command line Ken Brown
2019-12-03 20:44 ` Jon Turney
2019-12-03 21:16 ` Ken Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190801160519.32745-2-jon.turney@dronecode.org.uk \
--to=jon.turney@dronecode.org.uk \
--cc=cygwin-apps@cygwin.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).