#NEWLINE# def renamePage( self , item ) : #NEWLINE# #INDENT# oldAttDir = self . itemToAttachmentDir ( item ) #NEWLINE# parent = item . parent ( ) #NEWLINE# parentPage = self . itemToPage ( parent ) #NEWLINE# parentPath = os . path . join ( self . notePath , parentPage ) #NEWLINE# dialog = LineEditDialog ( parentPath , self ) #NEWLINE# dialog . setText ( item . text ( 0 ) ) #NEWLINE# if dialog . exec_ ( ) : #NEWLINE# #INDENT# newPageName = dialog . editor . text ( ) #NEWLINE# if ( parentPage != '' ) : #NEWLINE# #INDENT# parentPage = ( parentPage + '/' ) #NEWLINE# #UNINDENT# oldFile = self . itemToFile ( item ) #NEWLINE# newFile = ( ( parentPage + newPageName ) + self . settings . fileExt ) #NEWLINE# QDir ( self . notePath ) . rename ( oldFile , newFile ) #NEWLINE# if ( item . childCount ( ) != 0 ) : #NEWLINE# #INDENT# oldDir = ( dialog + item . text ( 0 ) ) #NEWLINE# newDir = ( parentPage + newPageName ) #NEWLINE# QDir ( self . notePath ) . rename ( oldDir , newDir ) #NEWLINE# #UNINDENT# item . setText ( 0 , newPageName ) #NEWLINE# self . sortItems ( 0 , Qt . AscendingOrder ) #NEWLINE# if QDir ( ) . exists ( oldAttDir ) : #NEWLINE# #INDENT# newAttDir = self . itemToAttachmentDir ( item ) #NEWLINE# QDir ( ) . rename ( oldAttDir , newAttDir ) #NEWLINE# self . parent . updateAttachmentView ( )