setup.exe suggestion + patch

Lewis Hyatt lhyatt@princeton.edu
Thu Sep 6 19:25:00 GMT 2007


Hello-

Firstly, thanks to everyone who has worked on setup.exe, it's really a 
very convenient program! There is just one thing that has always 
bothered me, which is that you have to click repeatedly on the package 
or category to cycle through all the available actions to find the one 
you want. The main problem is that each click causes the dependencies to 
be recalculated, which can cause annoying slowdowns if you're trying to 
do something like uninstall all packages in a large category. There is 
also the following situation which occurs often, especially when you are 
playing around with installing and uninstalling new packages:

-package A requires package B
-package A has two available versions
-package B appears before package A in the list

Now suppose A and B are both installed, and you want to uninstall them. 
Since B appears first, you click through to uninstall, no problem. Now 
you scroll down, maybe several pages away, and try to uninstall package 
A. The first time you click, though, you end up on the Prev version, 
which then calculates that it needs package A and goes back and sets 
package A to Install again. The only way to uninstall both of them is to 
uninstall B first, and then A. When there are multiple dependencies 
involved, it can quickly get impossible to get setup to do what you want.

The simplest way I could think of to correct this would be to change the 
behavior so that when you click on a Category or a Package, instead of 
simply cycling through, you get a little popup menu that asks you what 
you want to do instead. This way, you can go directly to Uninstall 
without dealing with the intervening options. This also lets you see all 
available versions at once, and avoids calculating dependencies 
unnecessarily.

I wrote a simple patch that implements this suggestion. Attached are the 
outputs of cvs diff (in diff.txt) and cvs diff -n (in diff_n.txt). (I'm 
sorry, I don't know much about CVS, is this the preferred way to submit 
a patch?). Here is a summary of the changes:

-Created new class PopupMenu in PopupMenu.{h,cc}, which makes a popup 
menu at the mouse cursor location and returns the selected item.

-Added #define to resource.h for use by PopupMenu. For now, it just 
reserves 100 IDs, supporting arbitrary popup menus with up to 100 
entries. (The number 100 is easily configurable in resource.h.)

-Modified PickCategoryLine to open the menu instead of cycling.

-Added new function select_action() to the packagemeta class, which 
implements the menu selection. For now, this is done in an extremely 
quick and dirty way that simple calls set_action() repeatedly to figure 
out which options would have been cycled through. I would be willing to 
re-do this in a more efficient way if this patch is deemed useful, but I 
don't even think that's necessary, I think it's fine to do it this way 
which reuses the already bug-tested code in set_action().

-Modified PickPackageLine to call select_action() instead of 
set_action() when the line is clicked.

-Made some minor changes to packagemeta::_action to expose the category 
strings as part of the public interface, so they could be reused in the 
popup menu.

Anyway I hope this is useful, if this patch isn't acceptable please let 
me know and I can fix it or change it. I wasn't sure about conventions 
with tabs, line endings, line lengths, etc., for one thing. In general, 
I think the problem I have described requires fixing. If you don't think 
this solution is an improvement, I can look into fixing it a different 
way also.

-Lewis
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: diff.txt
URL: <http://cygwin.com/pipermail/cygwin/attachments/20070906/0d813a64/attachment.txt>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: diff_n.txt
URL: <http://cygwin.com/pipermail/cygwin/attachments/20070906/0d813a64/attachment-0001.txt>
-------------- next part --------------
--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


More information about the Cygwin mailing list