This is the mail archive of the
cygwin-apps
mailing list for the Cygwin project.
[PATCH setup 7/9] Fix that clicking on any column changes "Keep" to "Uninstall"
- From: Jon Turney <jon dot turney at dronecode dot org dot uk>
- To: cygwin-apps at cygwin dot com
- Cc: Jon Turney <jon dot turney at dronecode dot org dot uk>
- Date: Tue, 6 Jun 2017 12:54:30 +0100
- Subject: [PATCH setup 7/9] Fix that clicking on any column changes "Keep" to "Uninstall"
- Authentication-results: sourceware.org; auth=none
- References: <20170606115432.105020-1-jon.turney@dronecode.org.uk>
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