Skip to content
/ Slicer Public
forked from Slicer/Slicer

Commit

Permalink
ENH: Improve self-discovery of Endoscopy UI by providing all tooltips
Browse files Browse the repository at this point in the history
Co-authored-by: Lee Newberg <lee.newberg@kitware.com>
  • Loading branch information
jcfr and Leengit committed Nov 28, 2023
1 parent cc0168c commit eda7a41
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions Modules/Scripted/Endoscopy/Endoscopy.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,21 +153,23 @@ def setupFlythroughUI(self):

# Play button
playButton = qt.QPushButton(_("Play flythrough"))
playButton.toolTip = _("Fly through curve.")
playButton.toolTip = _("Start or stop the flythrough animation.")
playButton.checkable = True
playButton.connect("toggled(bool)", self.onPlayButtonToggled)
flythroughFormLayout.addRow(playButton)
self.playButton = playButton

# Frame slider
frameSlider = ctk.ctkSliderWidget()
frameSlider.toolTip = _("The current frame along the path.")
frameSlider.decimals = 0
frameSlider.connect("valueChanged(double)", self.frameSliderValueChanged)
flythroughFormLayout.addRow(_("Frame:"), frameSlider)
self.frameSlider = frameSlider

# Frame skip slider
frameSkipSlider = ctk.ctkSliderWidget()
frameSkipSlider.toolTip = _("Number of frames to skip.")
frameSkipSlider.decimals = 0
frameSkipSlider.minimum = 0
frameSkipSlider.maximum = 50
Expand All @@ -176,6 +178,7 @@ def setupFlythroughUI(self):

# Frame delay slider
frameDelaySlider = ctk.ctkSliderWidget()
frameDelaySlider.toolTip = _("Time delay between animation frames.")
frameDelaySlider.decimals = 0
frameDelaySlider.minimum = 5
frameDelaySlider.maximum = 100
Expand All @@ -186,6 +189,7 @@ def setupFlythroughUI(self):

# View angle slider
viewAngleSlider = ctk.ctkSliderWidget()
viewAngleSlider.toolTip = _("Field of view of the camera in degrees.")
viewAngleSlider.decimals = 0
viewAngleSlider.minimum = 30
viewAngleSlider.maximum = 180
Expand All @@ -197,15 +201,15 @@ def setupFlythroughUI(self):

# Button for saving the camera orientation of a location
saveOrientationButton = qt.QPushButton(_("Save Keyframe Orientation"))
saveOrientationButton.toolTip = _("Save the camera orientation for this frame")
saveOrientationButton.toolTip = _("Save the camera orientation for this frame.")
saveOrientationButton.enabled = False
saveOrientationButton.connect("clicked()", self.onSaveOrientationButtonClicked)
keyframeOrientationLayout.addWidget(saveOrientationButton)
self.saveOrientationButton = saveOrientationButton

# Button for deleting the camera orientation of a location
deleteOrientationButton = qt.QPushButton(_("Delete Keyframe Orientation"))
deleteOrientationButton.toolTip = _("Delete the camera orientation for this frame")
deleteOrientationButton.toolTip = _("Delete the saved camera orientation for this frame.")
deleteOrientationButton.enabled = False
deleteOrientationButton.connect("clicked()", self.onDeleteOrientationButtonClicked)
keyframeOrientationLayout.addWidget(deleteOrientationButton)
Expand All @@ -216,25 +220,25 @@ def setupFlythroughUI(self):
flythroughOrientationLayout = qt.QHBoxLayout()

firstOrientationButton = qt.QPushButton(_("First"))
firstOrientationButton.toolTip = _("Go to the first user-supplied keyframe")
firstOrientationButton.toolTip = _("Go to the first user-supplied keyframe.")
firstOrientationButton.enabled = True
firstOrientationButton.connect("clicked()", self.onFirstOrientationButtonClicked)
flythroughOrientationLayout.addWidget(firstOrientationButton)

backOrientationButton = qt.QPushButton(_("Back"))
backOrientationButton.toolTip = _("Go to the previous user-supplied keyframe")
backOrientationButton.toolTip = _("Go to the previous user-supplied keyframe.")
backOrientationButton.enabled = True
backOrientationButton.connect("clicked()", self.onBackOrientationButtonClicked)
flythroughOrientationLayout.addWidget(backOrientationButton)

nextOrientationButton = qt.QPushButton(_("Next"))
nextOrientationButton.toolTip = _("Go to the next user-supplied keyframe")
nextOrientationButton.toolTip = _("Go to the next user-supplied keyframe.")
nextOrientationButton.enabled = True
nextOrientationButton.connect("clicked()", self.onNextOrientationButtonClicked)
flythroughOrientationLayout.addWidget(nextOrientationButton)

lastOrientationButton = qt.QPushButton(_("Last"))
lastOrientationButton.toolTip = _("Go to the last user-supplied keyframe")
lastOrientationButton.toolTip = _("Go to the last user-supplied keyframe.")
lastOrientationButton.enabled = True
lastOrientationButton.connect("clicked()", self.onLastOrientationButtonClicked)
flythroughOrientationLayout.addWidget(lastOrientationButton)
Expand All @@ -256,7 +260,7 @@ def setupAdvancedUI(self):
# Select name for output model
outputPathNodeSelector = slicer.qMRMLNodeComboBox()
outputPathNodeSelector.objectName = "outputPathNodeSelector"
outputPathNodeSelector.toolTip = _("Create a model node.")
outputPathNodeSelector.toolTip = _("Select or create the destination model for exporting the flythrough path.")
outputPathNodeSelector.nodeTypes = ["vtkMRMLModelNode"]
outputPathNodeSelector.noneEnabled = False
outputPathNodeSelector.addEnabled = True
Expand All @@ -268,7 +272,7 @@ def setupAdvancedUI(self):

# Button for exporting a model
saveExportModelButton = qt.QPushButton(_("Export as model"))
saveExportModelButton.toolTip = _("Export as model")
saveExportModelButton.toolTip = _("Export the current flythrough path as a model.")
saveExportModelButton.enabled = False
saveExportModelButton.connect("clicked()", self.onSaveExportModelButtonClicked)
advancedFormLayout.addRow(saveExportModelButton)
Expand Down

0 comments on commit eda7a41

Please sign in to comment.