.. sync with a dropbox folder
This is based upon the TPDownloadDialog but refactored for
use with a FileStore (in this case Dropbox). It should be
extensible to use with any kind of FileStore object.
... change storage format to .INI files (which is QTs cross-system format)
... differentiate between System, Global and Athlete specific settings
... store the Global Settings in the AthleteDirectory (root)
... store the Athlete specific Settings in the Athletes Names subdir /config
... migrate existing Settings from current location into new formats "on-the-fly"
.. GoldenCheetah --server [dir]
Will run without a GUI as a console application sending
log messages to stdout. A web server is never started
when in normal GUI mode.
The optional 'dir' parameter can be used to specify the
location of the athlete data -- you could run several
servers on different directories since the config for the
server is located in the root of the directory.
.. added the http listener, with a default handler
that just returns a 501 Not Implemented result.
.. now the basic server is available we can start to
add a request handler and build up an API that can
be called externally when GC is running.
.. the default config file is written to the gc home
directory above the athlete directories and sets the
server port to 12021.
.. 12021 was chosen as a memorable port number that does
not seem to be used by any other application that is
popular or well known.
.. Needed to move about some of the color config
methods and remove the unneeded object from
mainwindow and initialise global color settings
in main() instead.
... create folder structure for existing and new athletes
... upgrade existing athlete to new structure when opening / incl.
logging and error handling
... convert any "Downloaded" file to .JSON directly - store source file
in /downloads
... convert any "Imported" file to .JSON directly - store source file in
/imports
... import Ride Files automatically from a defined Directory per
Athlete
... runs silently/without "Import Rides" Widget if the files can be
imported/copied/... without error or warning
... Preferences->Athlete- defines
... the directory - per Athlete and- if the function is active at all
(default is OFF)
... the error handling
... report back ALL errors and warnings by opening the RideImportWizard
popup
... report back Errors and Warnings - but ignore the "File exists"
warning (so that the import directory can be continously supplied with
new files, without the need to remove the already imported ones)
.. if we cannot start due to permissions / create library folder
we now output a dialog rather than a qDebug -- this is better
for Windows or those that start from a menu etc
.. its complicated .. basically, if a local directory exists it will
*always* be used for application settings.
.. when you run GC for the first time with a local Library/GoldenCheetah
then the HOMEDIR_GC will not be set as there is no config in there
.. the code checks this setting for blanks (but that fails because the
value actually returned is "0") and so the local library is set to the
value returned "0"
.. but the local library doesn't exist so it falls back to opening from
the default location but using config from Library/GoldenCheetah !
.. the next time you launch all this gets resolved and you use
Library/GoldenCheetah with the settings you set the last time.
Fixes#936
.. no longer need to append 'GoldenCheetah' to the location
since on QT 5 the executable name is used, which is GoldenCheetah
.. by sticking with this we can rename the binary to use a different
location, which may be useful for testing
The final part (and one of the reasons) for the mainwindow
refactoring -- we now support tabbed athletes rather than
having a new mainwindow for each athlete opened.
Context is saved/restored and there are new functions for
opening and closing tabs and windows of tabs.
The tabbar itself is fugly -- the next few days will spend
some time looking at making it prettier on Linux/Win and
more native on Mac (see MMTabBar).
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.