diff --git a/python/GafferUI/OpDialogue.py b/python/GafferUI/OpDialogue.py index 8cf93f9a128..0f3cb5fb8d1 100644 --- a/python/GafferUI/OpDialogue.py +++ b/python/GafferUI/OpDialogue.py @@ -189,6 +189,8 @@ 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 @@ -196,10 +198,31 @@ def __init__( 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 @@ -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( "