Skip to content

Commit

Permalink
Merge pull request #913 from johnhaddon/opDialogueCustomisationBackport
Browse files Browse the repository at this point in the history
OpDialogue customisation backport
  • Loading branch information
andrewkaufman committed Jul 17, 2014
2 parents 4356d0f + 6392acf commit db7f665
Showing 1 changed file with 29 additions and 2 deletions.
31 changes: 29 additions & 2 deletions python/GafferUI/OpDialogue.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,17 +189,40 @@ def __init__(
self.__backButton = self._addButton( "Back" )
self.__forwardButton = self._addButton( "Forward" )

self.__preExecuteSignal = GafferUI.WidgetSignal()
self.__postExecuteSignal = Gaffer.Signal2()
self.__opExecutedSignal = Gaffer.Signal1()
self.__haveResizedToFitParameters = False

if executeImmediately :
self.__initiateExecution()
else :
self.__initiateParameterEditing()


## Returns the ParameterisedHolder used to store the Op.
# This may be used to edit parameter values.
def parameterisedHolder( self ) :

return self.__node

## Signal emitted before executing the Op.
# Slots should have the signature `bool slot( opDialogue )`,
# and may return True to cancel execution, or False to
# allow it to continue.
def preExecuteSignal( self ) :

return self.__preExecuteSignal

## Signal emitted after executing the Op.
# Slots should have the signature `slot( opDialogue, result )`.
def postExecuteSignal( self ) :

return self.__postExecuteSignal

## A signal called when the user has pressed the execute button
# and the Op has been successfully executed. This is passed the
# result of the execution.
## \deprecated Use postExecuteSignal() instead.
def opExecutedSignal( self ) :

return self.__opExecutedSignal
Expand Down Expand Up @@ -264,6 +287,9 @@ def __close( self, *unused ) :

def __initiateExecution( self, *unused ) :

if self.preExecuteSignal()( self ) :
return

self.__progressIconFrame.setChild( GafferUI.BusyWidget() )
self.__progressLabel.setText( "<h3>Processing...</h3>" )
self.__backButton.setEnabled( False )
Expand Down Expand Up @@ -307,7 +333,8 @@ def __finishExecution( self, result ) :
self.__initiateResultDisplay( result )

self.opExecutedSignal()( result )

self.postExecuteSignal()( self, result )

else :

self.__initiateErrorDisplay( result )
Expand Down

0 comments on commit db7f665

Please sign in to comment.