Keyboard shortcuts#134
Open
osn07 wants to merge 4 commits intotoolsforexperiments:masterfrom
Open
Conversation
…es a user's individual shortcut preferences. ShortcutEditorDialog handles UI interactions and updates a KSM class instance accordingly. base_instrument.py was updated to implement these new classes and add a button to edit keyboard shortcuts.
…to Station or Log. alert column on right side indicates three states: ok (white), unsaved (orange), and duplicate (red). alert displays tooltip for each tooltip. ServerGui now holds a shortcut editor and shortcut manager, which is passed to an instrument tab when opened.
marcosfrenkel
requested changes
May 7, 2026
|
|
||
| from instrumentserver import QtCore, QtGui, QtWidgets | ||
|
|
||
| from .shortcuts import KeyboardShortcutManager |
Collaborator
There was a problem hiding this comment.
don't use . in the imports
|
|
||
| @staticmethod | ||
| def _matches_any_pattern(name: str, patterns: List[str]) -> bool: | ||
| def _matches_any_pattern(name: str, patterns: Optional[List[str]]) -> bool: |
Collaborator
There was a problem hiding this comment.
why add the Optional but not a None argument? is this really optional?
|
|
||
| # Indicates if a column is using delegates. | ||
| self.delegateColumns = delegateColumns | ||
| self.delegateColumns: List[int] = delegateColumns or [] |
Collaborator
There was a problem hiding this comment.
does changing the default change the behaviour downstream?
| proxyModelType: type = InstrumentSortFilterProxyModel, | ||
| viewType: type = InstrumentTreeViewBase, | ||
| callSignals: bool = True, | ||
| shortcutManager: Optional[KeyboardShortcutManager] = None, |
Collaborator
There was a problem hiding this comment.
Add this argument to the docstring
| when Save is clicked. Use 'Save to file' / 'Load from file' to persist across sessions. | ||
|
|
||
| Each row has a small colored indicator dot in the rightmost column: | ||
| - white : saved and unique |
Collaborator
There was a problem hiding this comment.
I haven't been able to make it white even when saved
| kwargs["sub_port"] = kwargs.get("sub_port", self.stationServer.port + 1) # type: ignore[union-attr] | ||
| station_server = self.stationServer | ||
| if station_server is None: | ||
| raise RuntimeError("addInstrumentToGui called before server started") |
Collaborator
There was a problem hiding this comment.
what is this error and what is it catching?
| else QtCore.Qt.SortOrder.DescendingOrder | ||
| ) | ||
| header.setSortIndicator(col, new_order) | ||
|
|
Collaborator
There was a problem hiding this comment.
why do we need all these new slots?
Collaborator
|
On top of the specific coding things 2 things are left on this:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds customizable keyboard shortcuts that a user can execute to streamline instrumentserver workflow