Skip to content

#1875 #2008

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

Open
wants to merge 152 commits into
base: master
Choose a base branch
from
Open

Conversation

spica198
Copy link
Collaborator

@spica198 spica198 commented Apr 10, 2024

Prerequisites

  • Reviewed the checklist

  • Reviewed feedback from the "Sonar Cloud" bot. Note that you have to wait
    for the "CI / Unit Tests") to complete first. Failed Unit tests can be
    debugged by adding the label "verbose logging" to the GitHub PR.

Description of the Change

In the Data Access View, map keyboard shortcuts to templates. Default is from ctrl-1 to ctrl-5 and after that user can provide shortcut of their choice

Alternate Designs

Why Should This Be In Core?

Benefits

Possible Drawbacks

Verification Process

  1. Save a template in Data acccess view with keyboard shortcut
  2. Should be able to load template by pressing keyboard shortcut

Applicable Issues

#1875

@spica198 spica198 linked an issue Apr 10, 2024 that may be closed by this pull request
1 task
@spica198 spica198 requested a review from OrionsGuardian April 10, 2024 00:01
@OrionsGuardian
Copy link
Collaborator

image
Each new template that I save has a Ctrl 1 prefix attached to it.
How do we set a differently numbered shortcut when saving the template ?
Pressing Ctrl 1 does correctly activate the first entry that has Ctrl 1 as it's prefix.

@spica198
Copy link
Collaborator Author

image Each new template that I save has a Ctrl 1 prefix attached to it. How do we set a differently numbered shortcut when saving the template ? Pressing Ctrl 1 does correctly activate the first entry that has Ctrl 1 as it's prefix.

@spica198 spica198 closed this Apr 16, 2024
@spica198 spica198 reopened this Apr 16, 2024
@OrionsGuardian
Copy link
Collaborator

The Additional Information section of ticket #1875 suggests the functionality should allow the user to assign the shortcuts to the templates they want to use.
Currently, it will assign shortcuts (1 through to 5) to the first 5 templates saved.
Saving future templates won't assign any further shortcuts until one of the previous templates are deleted.

The functionality should allow the user to select a shortcut number when saving a template, and also reassign/remove shortcut numbers when loading templates.

@OrionsGuardian
Copy link
Collaborator

The core functionality now seems to be working fine, but it feels like too many popup dialogs appearing to achieve this.
I've mocked up a sample alternative layout:

image

So you can optionally set a shortcut, where it pops up the dialog to get the keystroke, then returns to this Saving dialog.
Use a warning symbol (!) to indicate that the chosen Shortcut is already being used.
The orange warning message can either be shown as a line in the dialog, or set as a tooltip for the warning symbol.
Then, when you click OK it uses the shortcut (if one was chosen), and removes the shortcut from any old template that was using it.

@OrionsGuardian OrionsGuardian added the verbose-logging test code in CI with verbose output label Jul 17, 2024
spica198 added 2 commits July 8, 2025 11:00
unittest fixes
@andromeda-224
Copy link
Collaborator

Save Templates dialogs are now modal, can we make Load Templates modal too?

spica198 added 3 commits July 8, 2025 12:07
fix code smells
look and feel fix
@spica198
Copy link
Collaborator Author

spica198 commented Jul 9, 2025

Save Templates dialogs are now modal, can we make Load Templates modal too?

Would be good to address this in a separate ticket for Load Template.
Created #2330

check for file exists with same name
review fixes
@spica198 spica198 requested a review from Delphinus8821 July 9, 2025 22:06
Copy link
Collaborator

@Delphinus8821 Delphinus8821 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image
Is it not possible to save a template with one of the default keyboard shortcuts if you manually set it to them?

@spica198
Copy link
Collaborator Author

image Is it not possible to save a template with one of the default keyboard shortcuts if you manually set it to them?

No. If manually setup shortcut is already been used in system/application, it shouldn't be allowed to be mapped to the template here. Otherwise, it will overwrite the action of already mapped keyboard shortcut within the system/application. You can see which action is already been mapped to the entered shortcut when you hover over the error icon next to the keyboard shortcut label.

@spica198 spica198 requested a review from Delphinus8821 July 10, 2025 03:11
@Delphinus8821
Copy link
Collaborator

image Is it not possible to save a template with one of the default keyboard shortcuts if you manually set it to them?

No. If manually setup shortcut is already been used in system/application, it shouldn't be allowed to be mapped to the template here. Otherwise, it will overwrite the action of already mapped keyboard shortcut within the system/application. You can see which action is already been mapped to the entered shortcut when you hover over the error icon next to the keyboard shortcut label.

On the help information you've provided it suggests that Ctrl + 1 through to Ctrl + 5 are the default shortcuts, which sounds like that means they are the shortcuts you are meant to use for these templates but when I tried to use one of them it said they weren't available. When I first open the Save Template dialog it suggests using Ctrl + Alt + Shift + 1 which is complicated shortcut to assign. Originally the Ctrl + a number shortcuts were the suggested ones for this ticket.

Currently it looks like the Ctrl + a number shortcuts are assigned to the Named Selections View which would mean they wouldn't do anything in the Data Access View. I think shortcuts that are specific to a single view shouldn't be unusable here as the views handle the shortcuts themselves.

@Quasar985
Copy link
Collaborator

I've found a bug.
If you create a shortcut with no name (e.g ctrl + alt + shift + 1) then override it that same shortcut, also with no name, then pressing ctrl + alt + shift + 1 will use the first created template.

For example, if I overrode the template with the 2nd configuration below, then pressed ctrl + alt + shift + 1, the 1st configuration would appear.
TemplateBug

@spica198
Copy link
Collaborator Author

image Is it not possible to save a template with one of the default keyboard shortcuts if you manually set it to them?

No. If manually setup shortcut is already been used in system/application, it shouldn't be allowed to be mapped to the template here. Otherwise, it will overwrite the action of already mapped keyboard shortcut within the system/application. You can see which action is already been mapped to the entered shortcut when you hover over the error icon next to the keyboard shortcut label.

On the help information you've provided it suggests that Ctrl + 1 through to Ctrl + 5 are the default shortcuts, which sounds like that means they are the shortcuts you are meant to use for these templates but when I tried to use one of them it said they weren't available. When I first open the Save Template dialog it suggests using Ctrl + Alt + Shift + 1 which is complicated shortcut to assign. Originally the Ctrl + a number shortcuts were the suggested ones for this ticket.

Currently it looks like the Ctrl + a number shortcuts are assigned to the Named Selections View which would mean they wouldn't do anything in the Data Access View. I think shortcuts that are specific to a single view shouldn't be unusable here as the views handle the shortcuts themselves.

In that case, need to correct the help page. It had been tested with having Data Access View and Named selection both are open and if you press Ctrl+1 in Data Access View Tab, it opens Named selection view as Ctrl+1 for Named selection view had been mapped at application level.

@OrionsGuardian
Copy link
Collaborator

On the help information you've provided it suggests that Ctrl + 1 through to Ctrl + 5 are the default shortcuts, which sounds like that means they are the shortcuts you are meant to use for these templates but when I tried to use one of them it said they weren't available. When I first open the Save Template dialog it suggests using Ctrl + Alt + Shift + 1 which is complicated shortcut to assign. Originally the Ctrl + a number shortcuts were the suggested ones for this ticket.
Currently it looks like the Ctrl + a number shortcuts are assigned to the Named Selections View which would mean they wouldn't do anything in the Data Access View. I think shortcuts that are specific to a single view shouldn't be unusable here as the views handle the shortcuts themselves.

In that case, need to correct the help page. It had been tested with having Data Access View and Named selection both are open and if you press Ctrl+1 in Data Access View Tab, it opens Named selection view as Ctrl+1 for Named selection view had been mapped at application level.

Could consider using Alt+1 through to Alt+5 as default shortcuts for templates. They don't seem to be mapped to anything else.

@OrionsGuardian
Copy link
Collaborator

I've found a bug. If you create a shortcut with no name (e.g ctrl + alt + shift + 1) then override it that same shortcut, also with no name, then pressing ctrl + alt + shift + 1 will use the first created template.

I think the second attempt to create a template with the same name as an existing template should be blocked (whether its a blank name or otherwise). Show a warning/error message stating "A template already exists with that name".

Review fixes
@spica198
Copy link
Collaborator Author

Fixed review comments

@spica198
Copy link
Collaborator Author

I've found a bug. If you create a shortcut with no name (e.g ctrl + alt + shift + 1) then override it that same shortcut, also with no name, then pressing ctrl + alt + shift + 1 will use the first created template.

For example, if I overrode the template with the 2nd configuration below, then pressed ctrl + alt + shift + 1, the 1st configuration would appear. TemplateBug

Fixed. Please re-review

Review fixes
@spica198 spica198 requested a review from OrionsGuardian July 14, 2025 02:24
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
72.7% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants