New strategy to enable build on QT5 or QT4.8 is quite
simple to enact as most of the fixes for QT5 can be
applied to earlier releases.
This patch fixes up some of the special cases for QT5 so
they will continue to build on earlier releases.
.. when building a debug build of GC with CONFIG += debug
then we define a macros GC_DEBUG.
.. main no longer redirects to goldencheetah.log if you have
GC_DEBUG set, so developers will continue to see debug
messages on the terminal output (for mac/linux only).
.. we could use the GC_DEBUG macros to allow debug messages
to be switched on / off in the code in future
.. don't use toLatin1() and fopen, use QFile and full QStrings
so we can support directory names with unicode characters.
.. add unistd.h for dup() and close()
Now accepts --debug to disable redirection of stderr to
goldencheetah.log, which is handy for developers.
Also refined the way the command line is processed to enable
new arguments to be added in the future.
In the home directory of GC (platform specific or configured
by the user). This is only relevant for OpenBSD, Linux and Mac.
Windows does not support applications that are GUI and console.
Now allows:
$ GoldenCheetah [[directory] athlete]
$ GoldenCheetah [--version|--help]
$ GoldenCheetah
Passing the athlete on its own is as before, but you can
now also pass the folder name in as well.
I've also added the option to get a help message if you
pass --version or --help.
Lastly, as before, with no command line paramaters you
open the last athlete worked on.
Since we now output the version and build info I have uplifted
the build and version numbers in GcUpgrade.h to reflect the fact
we are now developing v3.1.
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.
Allow the user to select a directory to use for the
athlete libary. Leaving it blank will continue to use
the default location (dependent on platform).
If it is changed the user will be asked to confirm
and then GC shuts down.
Restart wouldn't work due to issues with the DBAccess
QSqlDatabase connection (which is really annoying). I
will look into this as a restart option would be much
cleaner.
Its only taken 4 years to implement this feature! (ouch).
Fixes#282.
There still some assert left in the code, but removed
a fair number of the examples where, its just as easy
to handle the condition gracefully, without crashing.
By 3.1 we will have eradicated assert from the code.
Setup code to enable revealed chart controls. When
in tabbed mode, if the cursor is towards the title
then the chart controls are revealed, as the cursor
moves away or off the chart the controls are hidden.
Each chart, that wants revealed controls must implement;
bool hasReveal() -- return true if controls are available
void reveal() -- show controls (must be at top of chart and a single line)
void unrveal() -- hide controls
Will now work through each chart adding the controls as needed.
Will also probably end up with a 'standard' flat stylesheet for
the controls, can implement this later.
See description for this feature here:
https://github.com/GoldenCheetah/GoldenCheetah/issues/31#issuecomment-12040318
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).
The code setting metric names and units was moved from constructors to
an initialize method, to be called after translator initialization.
English Name is preserved as InternalName for metadata.xlm compatibility
in metric override.
Q_DECLARE_TR_FUNCTIONS(class-name) macro is used to set tr() context
when class-name is not QObject sub-class.
The menu drop down can appear on the list view. This is
now disabled via a window property "nomenu".
Also set the new attribute to set native widgets on a Mac.
No functional change, but fixed up some of the coding nits
in the WKO+ ride file reader.
References to static variables removed (for thread safety)
References to global WKO_HOME variable removed (multi athlete)
WkoParser class introduced (for further code refactoring)
Updates are pending for more robust parsing when users have
customised charts or the files contain running/pace charts
since these tend to cause a crash at present.
Update to training mode to improve the UI and overall
user experience. This initial patch introduces:
* Video Window - but ghetto and not fully functional
* Congigurable - drag and drop 'dials' onto homewindow
In future updates we need to:
* Support Video fully - Only Linux in this patch
* HomeWindow - Make Training mode the same as HomeWindow
* More Dials - Support metrics (e.g. BikeScore)
* RT Charts - Make RT plot drag/drop and support other
types of charts (e.g. Time In Zone)
* Controls - Add more controls for FFWD/REW, Skip etc
This patch has been tested on Linux ONLY. It is being committed
to support further build/deployment work for Win32 and Mac OSX.