mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-14 08:38:45 +00:00
introduce MainWindow rideSelected signal
...and use it to update the various tabs when a ride is selected.
This commit is contained in:
@@ -133,24 +133,18 @@ WeeklySummaryWindow::WeeklySummaryWindow(bool useMetricUnits,
|
||||
|
||||
setLayout(glayout);
|
||||
|
||||
connect(mainWindow, SIGNAL(zonesChanged()), this, SLOT(zonesChanged()));
|
||||
connect(mainWindow, SIGNAL(rideSelected()), this, SLOT(refresh()));
|
||||
connect(mainWindow, SIGNAL(zonesChanged()), this, SLOT(refresh()));
|
||||
}
|
||||
|
||||
void
|
||||
WeeklySummaryWindow::zonesChanged()
|
||||
{
|
||||
generateWeeklySummary(mainWindow->currentRideItem(),
|
||||
mainWindow->allRideItems(),
|
||||
mainWindow->zones());
|
||||
}
|
||||
|
||||
void
|
||||
WeeklySummaryWindow::generateWeeklySummary(const RideItem *ride,
|
||||
const QTreeWidgetItem *allRides,
|
||||
const Zones *zones)
|
||||
WeeklySummaryWindow::refresh()
|
||||
{
|
||||
const RideItem *ride = mainWindow->rideItem();
|
||||
if (!ride)
|
||||
return;
|
||||
const QTreeWidgetItem *allRides = mainWindow->allRideItems();
|
||||
const Zones *zones = mainWindow->zones();
|
||||
QDate wstart = ride->dateTime.date();
|
||||
wstart = wstart.addDays(Qt::Monday - wstart.dayOfWeek());
|
||||
assert(wstart.dayOfWeek() == Qt::Monday);
|
||||
|
||||
Reference in New Issue
Block a user