ENH: Enable Find text at Slicer start/restart#73
Open
mhdiop wants to merge 1 commit into
Open
Conversation
mhdiop
commented
Apr 17, 2024
Collaborator
- Make Find text (Ctrl-6) enabling sticky when starting/restarting Slicer #16
lassoan
reviewed
Apr 19, 2024
lassoan
left a comment
Collaborator
There was a problem hiding this comment.
It mostly looks good. See some trivial tweaks in inline comments.
If the shortcut is enabled then I think it should not be necessary to open the LanguageTools module, but instead you can enable the shortcut in a callback function that is connected to application startupCompleted signal:
slicer.app.connect("startupCompleted()", self.setupFindTextShortcut()
|
|
||
| # Boolean values are stored as strings in the settings. | ||
| # False becomes 'false' and True becomes 'true' | ||
| textFinderIsEnabled = settings.value("EnableFindText", True) |
Collaborator
There was a problem hiding this comment.
Let's make it disabled by default.
Use slicer.util.toBool to always get Boolean.
Suggested change
| textFinderIsEnabled = settings.value("EnableFindText", True) | |
| textFinderIsEnabled = slicer.util.toBool(settings().value("EnableFindText", False)) |
| # Boolean values are stored as strings in the settings. | ||
| # False becomes 'false' and True becomes 'true' | ||
| textFinderIsEnabled = settings.value("EnableFindText", True) | ||
| self.ui.enableTextFindercheckBox.checked = True if (textFinderIsEnabled in [True, 'true']) else False |
Collaborator
There was a problem hiding this comment.
Suggested change
| self.ui.enableTextFindercheckBox.checked = True if (textFinderIsEnabled in [True, 'true']) else False | |
| self.ui.enableTextFindercheckBox.checked = textFinderIsEnabled |
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.