From: Jon Turney <jon.turney@dronecode.org.uk>
To: "cygwin-apps@cygwin.com" <cygwin-apps@cygwin.com>,
Christian Franke <Christian.Franke@t-online.de>
Subject: Re: [PATCH setup] Keyboard accelerators for install/reinstall/uninstall
Date: Fri, 26 Aug 2022 14:33:14 +0100 [thread overview]
Message-ID: <00d3c57f-ce4e-7b11-8be4-3c18829938f7@dronecode.org.uk> (raw)
In-Reply-To: <f5f6167b-70e9-d742-77cb-a3b1652cc1e9@t-online.de>
On 23/08/2022 17:44, Christian Franke wrote:
> Jon Turney wrote:
>> On 22/08/2022 16:29, Christian Franke wrote:
>>> Jon Turney wrote:
>>>> On 14/08/2022 12:57, Christian Franke wrote:
>>>>> This eases state changes of a selected sequence of packages.
>>>>
>>>> Nice! The keyboard control of the package chooser was a bit of an
>>>> after-thought, which it really shouldn't be.
>>>
>>> Thanks - revised patch is attached.
>>>
>>
>> Thanks. This looks good. Please apply.
>
> Thanks. Applied.
>
>
>>
>>>>> Ctrl+U is in particular useful to cleanup installations in
>>>>> conjunction with "unneeded" view:
>>>>> https://sourceware.org/pipermail/cygwin-apps/2022-August/042185.html
>>>>>
>>>>> Open issue: Add some visual clue (tooltip?) to make this
>>>>> functionality more obvious.
>>>>
>>>> Yeah. These shortcuts should also be accelerators for the package
>>>> action selection popup menu, which would make them more discoverable?
>>>
>>> Handling these in the popup menu is possibly tricky. According to
>>> documentation of TrackPopupMenu(), hWndListView "receives all
>>> messages from the menu" which is apparently not the case.
>>
>> Confused. I don't think that matters (we could probably be using
>> TPM_NONOTIFY), because we use TPM_RETURNCMD.
>>
>> If we mark accelerators in the menu:
>>
>> --- a/res/en/res.rc
>> +++ b/res/en/res.rc
>> @@ -573,11 +573,11 @@ BEGIN
>> IDS_PROGRESS_POSTINSTALL "Running..."
>> IDS_PROGRESS_SOLVING "Solving dependencies..."
>> IDS_ACTION_DEFAULT "Default"
>> - IDS_ACTION_INSTALL "Install"
>> - IDS_ACTION_UNINSTALL "Uninstall"
>> + IDS_ACTION_INSTALL "&Install"
>> + IDS_ACTION_UNINSTALL "&Uninstall"
>> IDS_ACTION_SKIP "Skip"
>> IDS_ACTION_KEEP "Keep"
>> - IDS_ACTION_REINSTALL "Reinstall"
>> + IDS_ACTION_REINSTALL "&Reinstall"
>> IDS_ACTION_RETRIEVE "Retrieve"
>> IDS_ACTION_UNKNOWN "Unknown"
>> IDS_ACTION_SOURCE "Source"
>>
>> They appear when the menu is opened by pressing the menu key (or
>> always, if "Underline access keys when available" is on in
>> ease-of-access settings), and menu items can be chosen using them.
>>
>> It's not quite that straightforward because we need to remove the '&'
>> when those strings are used elsewhere (e.g. in the action column), but
>> I think it can be done...
>
> Using plain letters (without Ctrl) or first digit of version number
> already work in the popup menu. But it is possibly tricky to also
> interpret Ctrl+I/R/U in the popup menu.
>
I think we might be talking at cross-purposes here.
I don't think we need to do anything specific to make accelerators work
in that menu, because TrackMenuPopup() is running it's own modal message
loop which does TranslateAccelerator() for it...
>>>>> @@ -670,6 +670,10 @@ packagemeta::set_action (_actions action,
>>>>> packageversion const &default_version,
>>>>> else if (action == Uninstall_action)
>>>>> {
>>>>> desired = packageversion ();
>>>>> + pick (false);
>>>>> + srcpick (false);
>>>>> + if (!installed)
>>>>> + action = NoChange_action;
>>>>
>>>> Hmm... why is adding this needed?
>>>
>>> Otherwise a strange state change would occur at least in the GUI when
>>> an install request is undone:
>>>
>>> "Skip" == Ctrl+I ==> "3.2-1" == Ctrl+U ==> "Uninstall"
>>>
>>> The new patch includes another addition which prevents this on
>>> installs from local directory when the current default version is not
>>> yet downloaded:
>>>
>>> "Skip" == Ctrl+I ==> "" (empty)
>>
>> I see. But these work correctly when chosen via the action menu
>> dropdown?
>
> These state changes are not offered by the popup menu. For example for
> not installed packages the popup menu does not contain a selection which
> returns Uninstall_action. Undoing an install request is done via
> re-selection of "Skip" which returns NoChange_action.
>
> The design alternatives were either to emulate this in
> PickPackageLine::map_key_to_action() or to complete the (hidden) state
> machine in packagemeta::set_action(). I decided to use the latter.
Ok, that makes perfect sense. Thanks!
prev parent reply other threads:[~2022-08-26 13:33 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-14 11:57 Christian Franke
2022-08-15 17:49 ` Jon Turney
2022-08-22 15:29 ` Christian Franke
2022-08-23 15:16 ` Jon Turney
2022-08-23 16:44 ` Christian Franke
2022-08-26 13:33 ` Jon Turney [this message]
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=00d3c57f-ce4e-7b11-8be4-3c18829938f7@dronecode.org.uk \
--to=jon.turney@dronecode.org.uk \
--cc=Christian.Franke@t-online.de \
--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).