#NEWLINE# def delete_current_item( self ) : #NEWLINE# #INDENT# message_box = QtGui . QMessageBox ( ) #NEWLINE# message_box . setText ( 'Delete {0}?' . format ( self . currentItem ( ) . notemodel . title ) ) #NEWLINE# message_box . setInformativeText ( 'Are you sure you want to delete this note?' ) #NEWLINE# delete_btn = message_box . addButton ( 'Delete' , QtGui . QMessageBox . YesRole ) #NEWLINE# cancel_btn = message_box . addButton ( QtGui . QMessageBox . Cancel ) #NEWLINE# message_box . setEscapeButton ( QtGui . QMessageBox . Cancel ) #NEWLINE# message_box . setDefaultButton ( cancel_btn ) #NEWLINE# message_box . exec_ ( ) #NEWLINE# if ( message_box . clickedButton ( ) == delete_btn ) : #NEWLINE# #INDENT# i = self . currentRow ( ) #NEWLINE# item = self . takeItem ( i ) #NEWLINE# if ( not item . notemodel . remove ( ) ) : #NEWLINE# #INDENT# message_box = QtGui . QMessageBox ( ) #NEWLINE# message_box . setText ( 'Delete Error!' . format ( item . notemodel . title ) ) #NEWLINE# message_box . setInformativeText ( 'There was a problem deleting all the note files. Please check the {0} directory for any remaining data.' . format ( self . notes_dir ) ) #NEWLINE# message_box . exec_ ( ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# del item