#NEWLINE# def _prompt_for_save( self ) : #NEWLINE# #INDENT# ' Prompts the user to save if necessary. Returns whether the dialog\n            was cancelled.\n        ' #NEWLINE# if self . window . central_pane . editor . dirty : #NEWLINE# #INDENT# message = 'The current file has unsaved changes. Do you want to save your changes?' #NEWLINE# dialog = ConfirmationDialog ( parent = self . window . control , message = message , cancel = True , default = CANCEL , title = 'Save Changes?' ) #NEWLINE# result = dialog . open ( ) #NEWLINE# if ( result == CANCEL ) : #NEWLINE# #INDENT# return False #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( result == YES ) : #NEWLINE# #INDENT# if ( not self . save ( ) ) : #NEWLINE# #INDENT# return self . _prompt_for_save ( ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# return True