Implemented saving of text files from main window.