Workout Library Part 1 of 3

Implementing a workout library that keeps
track of media and workouts that can be used
in train view.

This first part implements;
- library.xml to record search paths
- search dialog to find media/workouts

Part 2 and 3 will bring:
- Sqllite libraryDB to store found details
- Update traintool to use libraryDB and display
  icons, duration/distance, IF and TSS in list
- import and drag-n-drop of new media/workouts
This commit is contained in:
Mark Liversedge
2012-12-20 13:30:49 +00:00
parent e222bd90eb
commit d2ebedac20
15 changed files with 833 additions and 67 deletions

View File

@@ -21,6 +21,25 @@
#include <stdint.h>
#include "Units.h"
// Supported file types
static QStringList supported;
static bool setSupported()
{
::supported << ".erg";
::supported << ".mrc";
::supported << ".crs";
::supported << ".pgmf";
return true;
}
static bool isinit = setSupported();
bool ErgFile::isWorkout(QString name)
{
foreach(QString extension, supported) {
if (name.endsWith(extension, Qt::CaseInsensitive))
return true;
}
return false;
}
ErgFile::ErgFile(QString filename, int &mode, double Cp, MainWindow *main) :
Cp(Cp), filename(filename), main(main), mode(mode)
{