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
179 stars 69 forks source link

Autosave feature is implemented #487

Closed vinayakjeet closed 3 months ago

vinayakjeet commented 3 months ago

WIP (#182 ) This pull request introduces a new autosave feature to the Avogadro application. The feature aims to enhance the user experience by automatically saving the current molecule document at a specified interval of 5 minutes, reducing the risk of data loss in case of unexpected application closure.

The implementation includes setting up an autosave interval with QTimer, determining the autosave directory based on the application data location, and saving the document in the CJSON format. This autosave functionality is careful to activate only if there are unsaved changes, ensuring efficient use of resources and avoiding unnecessary writes. The feature also involves updates to the MainWindow class to incorporate autosave setup and execution logic. This addition is expected to provide a safety net for users, securing their work without requiring manual intervention for frequent saves.

vinayakjeet commented 3 months ago

hello maintainers @ghutchis I have tried to a lot to prevent the DCO error but it's still coming, can you please help me with it?Thanks

vinayakjeet commented 3 months ago

Also can you please review my logic and if it's correct should I also implement a Destructor for deleting autosaves files?