When closing down we left the training database open
and this caused problems when looking to implement
a restart function.
The problems stemmed from the way the QSqlDatabase
code was implemented in TrainDB which was modelled on
code in DBAccess that was cleaned up subsequently.
TrainDB code now mirrors the approach taken in DBAccess
and relinquishes resources correctly. The TrainDB is now
closed as well as being opened in main.cpp at startup.
Also, removed reference to obsolete dbconn member in the
DBAccess class definition since it is no longer used.
.. but only deletes references and db entry
.. we do not delete from the filesystem -- need to add a dialog
to ask the user to confirm deleting the file from disk.
Some fixups to recent update for the workout
library support;
- ergDB download now updates the DB
- mainwindow menu options names more consistent
- sort order in the video and workout list
- hooks for import/drag and drop
Will now write the importer for drag-n-drop and
import workouts menu option.
Linked up the training db to the train tool to
allow users to select from the db.
Further enhancements to the list could be made,
but leaving this till we move to OpenTrainer.
Still need to add drag and drop to copy into
the library or add reference to the file.
Fixes#301.
Add trainDB sqlite database of workouts and videos
found during a library search. A bit ghetto but
works well enough.
Part 3 will need to;
- update traintool to list contents from db
- allow drag-n-drop of files into db (and worry
about copy to library vs add path).