Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change the "download" keyboard shortcut (Ctrl+S) handling, in GENERIC/CHROME builds, to utilize the EventBus (issue 11657); add a new "openfile" keyboard shortcut (Ctrl+O), in GENERIC builds #11826

Merged
merged 2 commits into from
Apr 20, 2020

Conversation

Snuffleupagus
Copy link
Collaborator

  • Change the "download" keyboard shortcut (Ctrl+S) handling, in GENERIC/CHROME builds, to utilize the EventBus (issue 11657)

    This improves the consistency of the "download" handling, in the default viewer, such that the Toolbar/SecondaryToolbar buttons and the keyboard shortcut are now handled in the same way (using the EventBus).

    Given that the "download" keyboard shortcut handling is limited to GENERIC/CHROME builds and that the issue does raise a valid point about only being able to observe some downloads, these changes seem acceptable in this particular case.

    Finally the pre-processor condition is adjusted to explicitly, rather than implicitly, list the affected build targets.

    Fixes No event bus used for Ctrl+S #11657

  • Add a new "openfile" keyboard shortcut (Ctrl+O), in GENERIC builds

    Somewhat surprisingly, despite the GENERIC viewer implementing "openfile" support, there's never been a keyboard shortcut available. Similar to the previous patch, this utilizes the EventBus for consistency with the Toolbar/SecondaryToolbar buttons.


Please note: This patch should NOT be construed as carte blanche to simply convert all of the code in webViewerKeyDown, or elsewhere, to make use of the EventBus instead of direct function calls.
Any further changes, along the lines in this patch, would need to be evaluated on a case-by-case basis to determine if they are actually wanted, given that many/most existing cases in webViewerKeyDown should already be indirectly observable through the EventBus instance.

…/CHROME builds, to utilize the `EventBus` (issue 11657)

This improves the consistency of the "download" handling, in the default viewer, such that the `Toolbar`/`SecondaryToolbar` buttons *and* the keyboard shortcut are now handled in the same way (using the `EventBus`).

Given that the "download" keyboard shortcut handling is limited to GENERIC/CHROME builds and that the issue does raise a valid point about only being able to observe *some* downloads, these changes seem acceptable in this particular case.

Finally the pre-processor condition is adjusted to *explicitly*, rather than implicitly, list the affected build targets.

*Please note:* This patch should NOT be construed as carte blanche to simply convert all of the code in `webViewerKeyDown`, or elsewhere, to make use of the `EventBus` instead of direct function calls.
Any further changes, along the lines in this patch, would need to be evaluated on a case-by-case basis to determine if they are actually wanted, given that many/most existing cases in `webViewerKeyDown` should already be *indirectly* observable through the `EventBus` instance.
Somewhat surprisingly, despite the GENERIC viewer implementing "openfile" support, there's never been a keyboard shortcut available. Similar to the previous patch, this utilizes the `EventBus` for consistency with the `Toolbar`/`SecondaryToolbar` buttons.

*Please note:* This patch should NOT be construed as carte blanche to simply convert all of the code in `webViewerKeyDown`, or elsewhere, to make use of the `EventBus` instead of direct function calls.
Any further changes, along the lines in this patch, would need to be evaluated on a case-by-case basis to determine if they are actually wanted, given that many/most existing cases in `webViewerKeyDown` should already be *indirectly* observable through the `EventBus` instance.
@timvandermeij
Copy link
Contributor

/botio-linux preview

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Received

Command cmd_preview from @timvandermeij received. Current queue size: 0

Live output at: http://54.67.70.0:8877/17f1446f236cc6e/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Success

Full output at http://54.67.70.0:8877/17f1446f236cc6e/output.txt

Total script time: 2.55 mins

Published

@timvandermeij timvandermeij merged commit f243f05 into mozilla:master Apr 20, 2020
@timvandermeij
Copy link
Contributor

Looks like a good improvement; thanks!

@Snuffleupagus Snuffleupagus deleted the issue-11657 branch April 20, 2020 22:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

No event bus used for Ctrl+S
3 participants