Commit Graph

39 Commits

Author SHA1 Message Date
Joern
3556499c54 Remove AM/PM from time formatting (to be Locale neutral)
... sync all format strings for time input/output to 'hh:mm:ss'
... remove any 'AM/PM' time formats
... remove tr() commands from time formats (since 'hh:mm:ss' is
reasonable around the globe)

... main reason: QT5 does not follow the pure formatting rules any more
(like QT4), but considers the system.locale in formatting as well (so
for system which have no AM/PM, even if the format string is set, the QT
routines ignore that - having some side effect on GC)
2014-06-29 11:24:56 +02:00
Mark Liversedge
0cc28b1eb3 Compromise on import
.. signal when importing a relatively small number
   of items (less than 20)

.. don't signal when importing a lot of items (more
   than 20).
2014-01-11 10:55:23 +00:00
Mark Liversedge
3c73d6edd4 Fix Mass Import Memory Exhaustion
.. don't signal when adding a ride, which kicks off
   all manner of updates across the code, instead
   we let the metric refresh kick in at the end.

.. this is great for an initial load and mass import
   of large numbers of rides, but sucks for a small number
   of rides when maybe downloading

.. we could make the signalling dependent on the number of
   rides being imported, so small number still updates the
   CP charts etc.

THIS IS A TEMPORARY FIX TO THE MORE SIGNIFICANT PERFORMANCE
ISSUE -- BUT WE DO NEED TO CONSIDER THE ISSUE OF CHART UPDATES
2014-01-10 22:02:46 +00:00
Mark Liversedge
77278b2ed1 A lot less assert
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.
2013-08-04 11:06:07 +01:00
Mark Liversedge
47814846d9 MainWindow Refactor Part 3 of 5
Slowly migrating code  and data from the MainWindow
class to Athlete and Context classes.

This update moves the ride and interval lists and
data structures from MainWindow to Athlete.
2013-07-13 19:46:03 +01:00
Mark Liversedge
65182f70c1 Move isclean from MainWindow to Athlete
.. rather unfortunate use of English as it leads
   to athlete->isclean == false :)
2013-07-12 18:15:14 +01:00
Mark Liversedge
0fcbbe1b77 Refactor MainWindow Part 2 of 5
Decoupled classes from MainWindow to reference Context
and Athlete (and introduced a couple of new headers).

We no longer pass around a MainWindow pointer to children
but pass a context instead.

There are still a few pieces left in MainWindow that need
to move to a better place;
    * Setting/clearing filter selection
    * Working with Intervals
    * Adding/Deleting Rides
    * Save on Exit

As mentioned previously there are lots of other parts to
this refactor left to do;
    * break MainWindow Gui elements into Toolbar and Views

    * migrate from RideItem and Ridelist to ActivityCollection
      and Activity classes that are not tied into gui elements.

    * introduce Application Context and AthleteCollection
2013-07-11 14:02:02 +01:00
Mark Liversedge
c56c5a9567 MainWindow Refactor Part 1 of 5
Breaking the MainWindow 'god object' into
separate classes for Athlete and Context.

Further updates will need to;
- break MainWindow Gui elements into Toolbar and Views

- migrate from RideItem and Ridelist to ActivityCollection
  and Activity classes that are not tied into gui elements.

- introduce Application Context and AthleteCollection

Once these are done we will be in a position to decouple
most classes from mainwindow and also introduce tabbed
athletes.
2013-07-07 15:50:28 +01:00
Mark Liversedge
87ec4081c4 Deprecate overwrite existing files on import
.. just for release 3.0 until the major bugs are fixed.

Fixes #620
2013-05-30 11:42:52 +01:00
Mark Liversedge
4e512bac2e RideImport MUST notify charts
Essentially reverting the commit 0ba93fe61
2013-04-10 12:43:20 +01:00
Mark Liversedge
a2dbd911f1 Defer metric refresh till end RideImportWizard
.. speeds up large imports considerably.
2013-03-30 20:33:36 +00:00
Mark Liversedge
4d8f8a3230 Code Cleanup: ? and + operator precedence warnings
.. in RideImportWizard resizing .. nasty bit of code.
2013-02-13 09:09:39 +00:00
Mark Liversedge
caec4ee0fe Code Cleanup: Remove #if 0 code
As a personal habit I tend to use the C pre-processor to
comment out code blocks I don't want to remove. This is in
case the code will be required in the future.

I think it is now safe to say the code commented out is not
required -- most of it is legacy and marks the transition from
earlier designs or legacy code.

I've done this in one big commit since in theory it has no
functional change, and in future can look in this commit for any
code we may want to reinstate.
2013-02-11 15:00:00 +00:00
Mark Liversedge
46c2ceb048 UI Nits: Importing GTC Export screen updates
When importing a GTC export (which contains multiple ride
files in a single .TCX) the screen update stalls whilst the
file is split. The import dialog is half drawn and looks
ugly to the user for a split second.

We now delay updates until the export has been expanded
into separate files, which means there is a slightly longer
delay as the file is initially processed, but the screen
updates are cleaner.
2012-12-02 08:16:35 +00:00
Damien
aedc39e423 Choose Metric/Imperial units in New Athlete dialog
fixes #34
2012-11-26 23:35:35 +01:00
Mark Liversedge
047c1dd140 File Export (part 1 of 2)
The export functions in mainwindow are getting quite
cumbersome with multiple menu options.

This patch creates a single menu option "Export.." which
allows the user to select a supported format and a filename.

To support this the ridefile reader code needed to be adjusted
to allow registered readers to declare capability to write and
use a consistent (virtual) method to do so.

By modifying the base class for ride file reader we now allow
new readers to register both read and write capability.
2011-10-12 14:19:14 +01:00
Mark Liversedge
b6cf7acfda Check Duplicates when importing rides
When importing a ridefile we have never checked that the
same ride (date/time) does not already exist but in a
different ridefile format.

For example, importing a TCX file when a .RAW file already
exists for the same date/time causes conflicts with the
.cpx and .notes file (it is not possible to distinguish
which ridefile the notes/cpx file belong to).

Fixes #389.
2011-08-21 14:43:13 +01:00
Mark Liversedge
94e49e4fe3 Free Memory in Ride Import
... after reading a GTC export. Also zapped
the boost dependency.
2011-08-05 22:31:31 +01:00
Mark Liversedge
7a0634cdda Missed off previous commit
An errant git rebase lost these changes, this is
to support the GTC export file support and updates
the Json parser to use the new call semantics and
gets the Import wizard to clear up temporary files
when it closes.
2011-08-05 21:37:28 +01:00
Mark Liversedge
a1fa22149a Support Garmin Training Center Export Files
GTC will export all rides as a single TCX file so they
can be imported en-masse into another application.

We did not support >1 rides in a single ride file. This
patch adds support for reading multiple rides (if the ride
file reader supports it).

The ride import wizard will now extract and parse files from
a GTC export.  Many thanks to Damien for writing the TCX file writer.

Fixes #371.
2011-08-05 20:53:13 +01:00
Mark Liversedge
b98e563536 Fix date/time handling when importing rides
The ride import wizard would only allow the user to
change the ride date/time if it was a .gc .json or
.csv file. This was because (wrongly) it was because
we could not update the date/time defined within the
ride file itself.

Of course, we encode the ride date/time in the filename
and so it could be changed. However, not all the RideFile
readers supported this.

To get around this, the import wizard now does let you
change the date and time for any file type and the ride
file factory method openRideFile() will override whatever
date and time is returned by examining the filename. The
user needs to double click the date or time to edit it.

Additionally, the select date... combo would only register
when you changed the selection, it now defaults back to
the 'select date..' option after each selection.

Lastly, the 'choose date' function now works as advertised
and triggers editing the date for the ride selected.

This patch needs plenty of testing and is potentially going
to resolve the 'misleading UI' bug numer 11, but will need
to be cherry-picked back to v2 master once it has been
adequately tested.
2011-08-01 21:45:00 +01:00
Mark Liversedge
cee3813566 Clean compile time nits
Lots of nitty fixups, largely for uninitialised temporary
variables.

I have left the use of boost::function and boost::bind in the
DownloadRideDialog alone, so it will vomit when compiled
with boost 1.46 and gcc 4.5 or higher. Will look into this
more carefully at a later stage.

I am working up to resolving issues identified from -pedantic next.
2011-05-12 22:12:36 +01:00
Mark Liversedge
fff3f83064 Version 3 - No Ridefiles Bugs Bonanza
When no ridefiles are available (new cyclist) or the last ridefile
is deleted the current ride will be null. In addition the ride
importer deletes the memory for a ride imported to ensure VM is not
exhausted on large imports.

This patch fixes a whole host of null errors across the codebase. They
were identified by creating a new cyclist, executing every menu option
and tab/chart and then importing a file choosing everything and then
deleting the file and choosing every option again.

This negative testing should be performed before every stable release since
it has identified at least 6 bugs which are almost certainly present in the
current V2 code.
2011-04-09 11:24:40 +01:00
Mark Liversedge
805e74de5a Inital V3 Branch 2010-12-30 17:35:23 +00:00
Mark Liversedge
852a2bdcf1 fix crash for man .gc file import
checks for empty datapoints and also checks for overrides for time
and distance.
2010-04-01 10:29:14 -04:00
Mark Liversedge
75074d1430 Honour RideFile::startTime
When saving the value of startTime should be checked to see
if the filename/notes need to be renamed. In addition, RideItem
now allows the startTime to be modified and reflected in the
ride list. When importing .gc ridefiles the file is serialized
with the correct startTime if the user edited it during import.
2010-03-25 09:16:28 -07:00
Sean Rhea
5c6cbd0f1f mark warnings as such in import wizard 2010-01-17 20:40:32 -08:00
Keisuke Yamaguchi
01de09e69c Added translation support for RideImportWizard Finish/Abort button
fixed bug "when non-English language is selected, Import Wizard
cannot be closed/aborted with abortButton".
2010-01-16 10:35:48 -05:00
Sean Rhea
1bbe58e7c5 fix indentation -- no functional change 2009-12-30 17:15:14 -05:00
Sean Rhea
e8ec1c8009 respect user's unit pref in import wizard
Based on a patch by Thomas Weichmann.
2009-12-30 17:13:28 -05:00
Mark Liversedge
c01d0f969e RideFile reading refactoring
With the introduction of the rideSelected signal the RideFile was
opened (as previously) by the RideSummaryWindow::htmlSummary()
member. In some cases, this signal was processed by RideSummary window
AFTER the other charts (AllPlot etc) this results in 'No data' being
shown on other charts.

This patch moves the file reading to RideItem::ride() which was previously
a public RideFile * (that is now a protected member ride_). As a happy by
product it removes the need to check if the file has already been read
across all other functions ensuring in-core values are not accidentally
overwritten. The read errors are made available by a new RideItem::errors()
member.

This modification is required to support the RideImportWizard in freeing
loaded RideFiles during batch import to ensure virtual memory is not
exhausted when large numbers of files are imported at once. This modification
is also included in this patch.
2009-12-18 19:39:29 -05:00
Mitsukuni Sato
93937badee add calls to tr() for translation 2009-12-17 19:10:36 -05:00
Sean Rhea
b5be5867ef change case of mainwindow to distinguish from global ptr 2009-12-13 11:24:26 -05:00
Sean Rhea
bdcd24af5b add RideFileFactory::suffixes() and use it
...to eliminate the problem of enumerating all possible file suffixes
all over the code.
2009-10-30 19:13:37 -04:00
Greg Lonnon
650cee7051 Computrainer 3dp file support 2009-10-29 09:47:45 -04:00
Mark Liversedge
0630c8350c more messing around with dates in ride import
- Allow user to edit any file date during import.
- WKO reader uses filename date over metadata in the file after import.
2009-09-30 08:59:59 -04:00
Mark Liversedge
3c43353097 report errors up from WkoRideFile 2009-09-26 16:15:59 -04:00
Mark Liversedge
3871cb9305 Allow upper and lower case suffixes in filenames when importing 2009-09-21 21:57:31 -07:00
Mark Liversedge
6eabaa1709 unified ride import wizard
All the file import options are now supported by one dialog.  As an extra
special bonus, GC now supports dragging and dropping files to import them.
2009-09-19 18:05:43 -07:00