This is the mail archive of the cygwin-apps mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH setup 7/9] Fix that clicking on any column changes "Keep" to "Uninstall"


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]