Skip to content
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: Support restoring SliceViewAnnotations enabled state #7176

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 6 additions & 9 deletions Modules/Scripted/DataProbe/DataProbeLib/SliceViewAnnotations.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,10 +193,7 @@ def onLayoutManagerDestroyed(self):
self.layoutManager.connect("destroyed()", self.onLayoutManagerDestroyed)

def onSliceViewAnnotationsCheckBox(self):
if self.sliceViewAnnotationsCheckBox.checked:
self.sliceViewAnnotationsEnabled = 1
else:
self.sliceViewAnnotationsEnabled = 0
self.sliceViewAnnotationsEnabled = int(self.sliceViewAnnotationsCheckBox.checked)

settings = qt.QSettings()
settings.setValue('DataProbe/sliceViewAnnotations.enabled', self.sliceViewAnnotationsEnabled)
Expand All @@ -219,10 +216,7 @@ def onDisplayDisplayLevelRadioButton(self):
self.updateSliceViewFromGUI()

def onBackgroundLayerPersistenceCheckBox(self):
if self.backgroundPersistenceCheckBox.checked:
self.backgroundDICOMAnnotationsPersistence = 1
else:
self.backgroundDICOMAnnotationsPersistence = 0
self.backgroundDICOMAnnotationsPersistence = int(self.backgroundPersistenceCheckBox.checked)
settings = qt.QSettings()
settings.setValue('DataProbe/sliceViewAnnotations.bgDICOMAnnotationsPersistence',
self.backgroundDICOMAnnotationsPersistence)
Expand Down Expand Up @@ -266,6 +260,10 @@ def restoreDefaultValues(self):
def _defaultValue(key):
return SliceAnnotations.DEFAULTS[key]

self.sliceViewAnnotationsCheckBox.checked = _defaultValue("enabled")
self.sliceViewAnnotationsEnabled = _defaultValue("enabled")
self.updateEnabledButtons()

radioButtons = [self.level1RadioButton, self.level2RadioButton, self.level3RadioButton]
radioButtons[_defaultValue("displayLevel")].checked = True
self.annotationsDisplayAmount = _defaultValue("displayLevel")
Expand Down Expand Up @@ -312,7 +310,6 @@ def updateEnabledButtons(self):
self.activateCornersGroupBox.enabled = enabled
self.fontPropertiesGroupBox.enabled = enabled
self.annotationsAmountGroupBox.enabled = enabled
self.restoreDefaultsButton.enabled = enabled

def updateSliceViewFromGUI(self):
if not self.sliceViewAnnotationsEnabled:
Expand Down