mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-04-15 05:32:21 +00:00
UI Nits: LTM add chart use a default date range
When adding a chart to the home view no date range is set. This update ensures that the last selected date range is used, so when a chart is selected/configured some data will be shown.
This commit is contained in:
@@ -1272,7 +1272,8 @@ GcWindowDialog::GcWindowDialog(GcWinID type, MainWindow *mainWindow) : mainWindo
|
||||
|
||||
RideItem *notconst = (RideItem*)mainWindow->currentRideItem();
|
||||
win->setProperty("ride", QVariant::fromValue<RideItem*>(notconst));
|
||||
win->setProperty("dateRange", property("dateRange"));
|
||||
DateRange dr = mainWindow->currentDateRange();
|
||||
win->setProperty("dateRange", QVariant::fromValue<DateRange>(dr));
|
||||
|
||||
layout->setStretch(0, 100);
|
||||
layout->setStretch(1, 50);
|
||||
|
||||
@@ -128,6 +128,10 @@ LTMSidebar::LTMSidebar(MainWindow *parent, const QDir &home) : QWidget(parent),
|
||||
connect(seasons, SIGNAL(seasonsChanged()), this, SLOT(resetSeasons()));
|
||||
|
||||
connect(this, SIGNAL(dateRangeChanged(DateRange)), this, SLOT(setSummary(DateRange)));
|
||||
|
||||
// let everyone know what date range we are starting with
|
||||
dateRangeTreeWidgetSelectionChanged();
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -1128,6 +1128,7 @@ MainWindow::dateRangeChangedDiary(DateRange dr)
|
||||
// when we have multiple sidebars that change date we need to connect
|
||||
// them up individually.... i.e. LTM....
|
||||
diaryWindow->setProperty("dateRange", QVariant::fromValue<DateRange>(dr));
|
||||
_dr = dr;
|
||||
}
|
||||
|
||||
void
|
||||
@@ -1137,6 +1138,7 @@ MainWindow::dateRangeChangedLTM(DateRange dr)
|
||||
// when we have multiple sidebars that change date we need to connect
|
||||
// them up individually.... i.e. LTM....
|
||||
homeWindow->setProperty("dateRange", QVariant::fromValue<DateRange>(dr));
|
||||
_dr = dr;
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
#include "QuarqdClient.h"
|
||||
#include "RealtimeData.h"
|
||||
#include "SpecialFields.h"
|
||||
#include "TimeUtils.h"
|
||||
#include <boost/shared_ptr.hpp>
|
||||
|
||||
#ifdef Q_OS_MAC
|
||||
@@ -126,6 +127,7 @@ class MainWindow : public QMainWindow
|
||||
RideItem *rideItem() const { return ride; }
|
||||
const RideFile *currentRide();
|
||||
const RideItem *currentRideItem() { return ride; }
|
||||
DateRange currentDateRange() { return _dr; }
|
||||
void updateRideFileIntervals();
|
||||
RideMetadata *rideMetadata() { return _rideMetadata; }
|
||||
|
||||
@@ -347,6 +349,7 @@ class MainWindow : public QMainWindow
|
||||
IntervalItem *activeInterval; // currently active for context menu popup
|
||||
RideItem *activeRide; // currently active for context menu popup
|
||||
RideItem *ride; // the currently selected ride
|
||||
DateRange _dr; // the currently selected date range
|
||||
|
||||
ErgFile *workout; // the currently selected workout file
|
||||
long now;
|
||||
|
||||
Reference in New Issue
Block a user