OpenChemistry / avogadroapp

Avogadro is an advanced molecular editor designed for cross-platform use in computational chemistry, molecular modeling, bioinformatics, materials science, and related areas.
https://two.avogadro.cc/
BSD 3-Clause "New" or "Revised" License
189 stars 72 forks source link

AUTO SAVE FEATURE (#182) #483

Closed vinayakjeet closed 8 months ago

vinayakjeet commented 8 months ago

WIP #182 Hi Mentors Vinayakjeet this side

Title: Implement Auto-save Feature for Avogadro

Description:

This pull request introduces an auto-save feature to Avogadro, automatically saving the current molecule to a temporary file at a predefined interval (every 5 minutes). This feature is designed to enhance data integrity by reducing the risk of data loss during unexpected application closures. The auto-save mechanism checks if there's a loaded and modified molecule before performing the save operation, using the CJSON format for the saved files.

Changes include:

Initialization of an auto-save timer in MainWindow. Implementation of autosaveDocument method to handle the auto-saving logic. Modification of MainWindow to support auto-save functionality, including managing the auto-save interval and temporary file creation. I'd appreciate feedback on the implemented logic and any suggestions for improvement. Also, should UI CHANGES be implemented to inform the user when an auto-save has occurred ? Additionally, is there a need to create a DESTRUCTOR or cleanup mechanism for managing extra autosaved files, ensuring that only a certain number of autosave files are kept at any time?

Your guidance and suggestions would be highly appreciated to refine this feature further.

welcome[bot] commented 8 months ago

Thanks for opening this pull request! Please check out our contributing guidelines and check for the automated tests.