-
Notifications
You must be signed in to change notification settings - Fork 11
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
ENH: Enable Find text at Slicer start/restart #73
base: main
Are you sure you want to change the base?
Conversation
mhdiop
commented
Apr 17, 2024
- Make Find text (Ctrl-6) enabling sticky when starting/restarting Slicer #16
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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()
@@ -347,6 +347,10 @@ def updateGUIFromSettings(self): | |||
self.ui.weblateDownloadUrlEdit.text = settings.value("WeblateDownloadUrl", "https://hosted.weblate.org/download/3d-slicer") | |||
self.ui.githubRepositoryUrlEdit.text = settings.value("GitRepository", "https://github.com/Slicer/SlicerLanguageTranslations") | |||
|
|||
# Boolean values are stored as strings in the settings. | |||
# False becomes 'false' and True becomes 'true' | |||
textFinderIsEnabled = settings.value("EnableFindText", True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's make it disabled by default.
Use slicer.util.toBool to always get Boolean.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self.ui.enableTextFindercheckBox.checked = True if (textFinderIsEnabled in [True, 'true']) else False | |
self.ui.enableTextFindercheckBox.checked = textFinderIsEnabled |