Commit Graph

729 Commits

Author SHA1 Message Date
Mark Liversedge
014c6301f6 Free references in WkoFileReader 2009-12-13 14:57:00 -05:00
Mark Liversedge
3773ec573e Misleading code comments adjusted
Attribution in header of IntervalItem.{h,cpp}
Commented out code removed
2009-12-13 14:45:25 -05:00
Mark Liversedge
bfc0d1575a IntervalItem::name removed
The class member IntervalItem::name is redundant since it is a duplicate
of the text() member of the base class QTreeWidgetItem. By removing it
we both simplify the code and remove the need to keep name and text in
sync when renaming and creating intervals.

As a result the itemChanged signal that was connected for renames and
then disconnected when the items are cleared can be connected once
and no disconnect is neccessary.

This connect/disconnect oddity was originally to avoid a SEGV that
resulted from accessing text() whilst the QTreeWidgetItem was being
destroyed. The code for removing intervals when a new ride is selected
no longer destroys and recreats MainWindow::allIntervals (which was also an
artefact of the original code to avoid a SEGV).
2009-12-13 13:07:17 -05:00
Sean Rhea
0dc9f6a4c0 delete MainWindow on close 2009-12-13 12:53:57 -05:00
Sean Rhea
6b7afe3353 remove global mainwindow ptr 2009-12-13 12:50:09 -05:00
Sean Rhea
9b6b1ba085 remove global ptr to main window from PfPvPlot 2009-12-13 12:46:50 -05:00
Sean Rhea
eb257e0746 remove global ptr to main window from ErgFile 2009-12-13 12:42:09 -05:00
Sean Rhea
890151a696 stop using global pointer, remove const cast 2009-12-13 12:34:32 -05:00
Sean Rhea
ffc63d539a fix leaked ConfigDialog and memory errors
The ConfigDialog is modal, so it needs to delete itself.  However, the
existing code contained a bunch of destructors with calls to delete on
widgets.  That's wrong.  Widgets are automatically parented on being added to
layouts, the parent widgets delete their children in their own destructors.
So remove all the explicit deletes.
2009-12-13 12:10:58 -05:00
Sean Rhea
db7f9a9ad2 remove global mainwindow pointer from ConfigDialog 2009-12-13 11:32:39 -05:00
Sean Rhea
1cf94fec6f change case of mainwindow to distinguish from global ptr 2009-12-13 11:24:26 -05:00
Sean Rhea
d36fb9eae0 remove global mainwindwo ptr from save dialogs
Also, allocate dialogs on stack to make free explicit.  I find
Qt::WA_DeleteOnClose to be really non-intuitive for modal dialogs.
2009-12-13 11:21:48 -05:00
Sean Rhea
4a79c95d37 remove global mainwindow pointer from PowerHist 2009-12-13 11:02:33 -05:00
Sean Rhea
c9aec66dcf remove global mainwindow pointer from AllPlotWindow.cpp
Also remove ugly const cast by introducing MainWindow::mutableIntervalItems.
2009-12-13 11:02:32 -05:00
Sean Rhea
01e1c22640 remove global mainwindow pointer from AllPlot.cpp 2009-12-13 11:02:32 -05:00
Mark Liversedge
a0c839514a PfPvPlot Display Fixes
The new intervals code removed some replots() to stop flickering but
they also removed critical refreshes after CP and Cadence values
are updated by the user using the entry fields on PfPvWindow.

Additionally, the setData() function was used to refresh all curves
when intervals were selected which caused user entries to be reset.

This patch introduces PfPvPlot::showIntervals() to only refresh the
intervals curve and fixes replots() to a) replot when neccessary
after a user entry but b) to not replot mid-refresh in the zones
background function.

The PfpvPlot::setData() function only sets the main curve (all the
black points).

When the user changes CP, CAD, CL in the window dialog they call
replot() explicitly rather than assuming the utility functions will
do it for them, since the utility functions are called within
setData (amongst others) and results in multiple replots() that are
ugly, but more importantly make it difficult to spot the deltas on
the plot as new intervals are overlayed because they all disappear
for a split second.
2009-12-13 10:59:10 -05:00
Sean Rhea
3c72be18ff adjust BS to DP scaling factor
This should have been part of commit 6a514f3.
2009-12-12 22:31:05 -05:00
Sean Rhea
a609738cca add parent pointer 2009-12-12 22:08:29 -05:00
Sean Rhea
c940517690 use more const 2009-12-12 22:07:53 -05:00
Sean Rhea
8f6237c5f6 don't need to call "return;" at end of function 2009-12-12 22:02:59 -05:00
Sean Rhea
bef469384b just call MainWindow::rideItem 2009-12-12 22:02:02 -05:00
Sean Rhea
d37a98ac9c include AllPlot.h first 2009-12-12 22:00:35 -05:00
Sean Rhea
f63dca40ef add combo to switch PM plot between BS and DP 2009-12-12 17:44:12 -05:00
Sean Rhea
293129c180 store ptr to MainWindow in PMWindow
I'm going to need it later when I add the ability to switch
from BikeScore to DanielsPoints.
2009-12-12 17:35:04 -05:00
Sean Rhea
a4459926b7 store both BikeScore and DanielsPoints in stress.cache 2009-12-12 17:00:17 -05:00
Sean Rhea
6a514f3043 scale DanielsPoints so that 1 hr @ FTP == 100 2009-12-12 16:40:37 -05:00
Damien Grauser
216bc6ef4b add language selector and French translations 2009-12-12 15:23:46 -05:00
Mark Liversedge
29a9e41444 Interval features and new GC file format 2009-12-12 11:41:35 -05:00
Sean Rhea
2db45dc0c5 introduce MainWindow rideSelected signal
...and use it to update the various tabs when a ride is selected.
2009-12-10 13:13:10 -08:00
Sean Rhea
4c7311e152 move htmlSummary into RideSummaryWindow 2009-12-10 11:50:50 -08:00
Sean Rhea
2f23582d08 call computeMetrics, not htmlSummary 2009-12-10 11:11:24 -08:00
Sean Rhea
5e4dc2ce57 add RideSummaryWindow
This change allows us to connect the zonesChanged signal to the ride summary,
so that we don't have to call ride->htmlSummary as a special case whenever
we call zonesChanged.  It will also come in useful later when I introduce a
rideSelected signal.
2009-12-10 11:05:10 -08:00
Sean Rhea
f5bee4ce89 rename function 2009-12-10 10:16:58 -08:00
Sean Rhea
e7a76022bb new zonesChanged signal 2009-12-10 10:16:58 -08:00
Sean Rhea
1169ca9239 public zones in MainWindow is const 2009-12-10 10:16:58 -08:00
Sean Rhea
19c63883d0 MetricAgg gets const Zones 2009-12-10 10:16:58 -08:00
Sean Rhea
f1a28616a6 ConfigDialog gets ptr to zones, not ptr to ptr 2009-12-10 10:16:58 -08:00
Sean Rhea
a4a2ca136a CyclistPage gets const Zones ptr 2009-12-10 10:16:57 -08:00
Sean Rhea
95b44b7752 make zones ptr const 2009-12-10 10:16:57 -08:00
Sean Rhea
1096fb4125 make some functions const 2009-12-10 10:16:57 -08:00
Sean Rhea
b2ef8940a7 cp plot gets zones in its constructor 2009-12-10 10:16:57 -08:00
Sean Rhea
90ce36f984 make some functions const 2009-12-10 10:16:57 -08:00
Sean Rhea
772de9f364 RideItem::zones is just a pointer
...not a pointer to a pointer.
2009-12-10 10:16:57 -08:00
Sean Rhea
eb9eddfb66 zones ptr is never null 2009-12-10 10:16:56 -08:00
Sean Rhea
3bb50ec996 whitespace and other nonfunctional cleanup 2009-12-10 10:16:56 -08:00
Sean Rhea
21782c4e6f remove duplicate addZoneRange function
The cp argument wasn't being used, so just call the one that
doesn't take a cp argument.
2009-12-10 10:16:56 -08:00
Sean Rhea
27d55025ac nit: cleanup function 2009-12-10 10:16:56 -08:00
Sean Rhea
d2d0ac9f1c QList<ZoneRange*> --> QList<ZoneRange>
Again, get rid of deletes at the slight expense of a few cheap copies.
2009-12-10 10:16:56 -08:00
Sean Rhea
9cb955e9b3 QList<ZoneInfo*> --> QList<ZoneInfo>
Gets rid of some deletes, and shouldn't be much slower,
as QStrings are copy-on-write.
2009-12-10 10:16:56 -08:00
Sean Rhea
1c5b8e4168 remove printfs and cleanup whitespace
No functional change.  Note, however, that removing the printf from
addZoneRange(int cp) revealed that the cp argument was unused.
2009-12-10 10:16:55 -08:00