Skip to content

Commit

Permalink
Merge pull request #6209 from ivanimanishi/OpDialogueEnumFix
Browse files Browse the repository at this point in the history
OpDialogue enum fix
  • Loading branch information
johnhaddon authored Jan 14, 2025
2 parents 27f8a7f + fe09c99 commit 12aae90
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions Changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ Fixes
- Fixed error when trying to visualise data unsupported data.
- TweakPlug : Fixed preservation of geometric interpretation when tweaking V3f values.
- ApplicationTest : Extended grace period when testing process name on slower hosts.
- OpDialogue : Fixed `DefaultButton` handling.

API
---
Expand Down
7 changes: 6 additions & 1 deletion python/GafferCortexUI/OpDialogue.py
Original file line number Diff line number Diff line change
Expand Up @@ -464,11 +464,16 @@ def __focusDefaultButton( self ) :
with IECore.IgnoredExceptions( KeyError ) :
d = self.__node.getParameterised()[0].userData()["UI"]["defaultButton"]
if d is not None :
for v in self.DefaultButton.values() :
for v in self.DefaultButton :
if str( v ).lower() == d.value.lower() :
defaultButton = v
break

# backwards compatibility for IECore.Enum()
if str( v ).lower() == f"DefaultButton.{d.value}".lower() :
defaultButton = v
break

if defaultButton == self.DefaultButton.None_ :
self._qtWidget().setFocus()
elif defaultButton == self.DefaultButton.Cancel :
Expand Down

0 comments on commit 12aae90

Please sign in to comment.