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:
Mark Liversedge
2012-12-02 18:10:26 +00:00
parent 5193deaf61
commit cf8d3b4bd8
4 changed files with 11 additions and 1 deletions

View File

@@ -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);

View File

@@ -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

View File

@@ -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

View File

@@ -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;