mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-04-15 05:32:21 +00:00
User Chart refresh on filter changes
.. quite a few of the standard signals are ignored. this one fixes up refresh when the home filters are changed.
This commit is contained in:
@@ -529,6 +529,10 @@ GenericPlot::addCurve(QString name, QVector<double> xseries, QVector<double> yse
|
||||
QLineSeries *add = new QLineSeries();
|
||||
add->setName(name);
|
||||
|
||||
// get setup for click thru
|
||||
connect(add, SIGNAL(clicked(QPointF)), selector, SLOT(seriesClicked())); // catch series clicks
|
||||
filenames.insert(add, fseries);
|
||||
|
||||
// aesthetics
|
||||
add->setBrush(Qt::NoBrush);
|
||||
QPen pen(color);
|
||||
|
||||
@@ -414,7 +414,7 @@ GenericSelectTool::clicked(QPointF pos)
|
||||
bool updatescene = false;
|
||||
|
||||
// click on a point to click-thru
|
||||
if (hoverpoint.index != -1) { // hovering and clicked
|
||||
if (hoverpoint.index != -1) { // scatter plot
|
||||
emit seriesClicked(hoverseries, hoverpoint);
|
||||
|
||||
// not sure need to do this....
|
||||
|
||||
@@ -54,6 +54,8 @@ UserChart::UserChart(Context *context, bool rangemode) : GcChartWindow(context),
|
||||
connect(this, SIGNAL(rideItemChanged(RideItem*)), this, SLOT(setRide(RideItem*)));
|
||||
} else {
|
||||
connect(this, SIGNAL(dateRangeChanged(DateRange)), SLOT(setDateRange(DateRange)));
|
||||
connect(context, SIGNAL(homeFilterChanged()), this, SLOT(refresh()));
|
||||
connect(context, SIGNAL(filterChanged()), this, SLOT(refresh()));
|
||||
}
|
||||
|
||||
// need to refresh when chart settings change
|
||||
@@ -139,6 +141,8 @@ UserChart::setRide(RideItem *item)
|
||||
void
|
||||
UserChart::refresh()
|
||||
{
|
||||
if (!amVisible()) { stale=true; return; }
|
||||
|
||||
// ok, we've run out of excuses, looks like we need to plot
|
||||
chart->initialiseChart(chartinfo.title, chartinfo.type, chartinfo.animate, chartinfo.legendpos, chartinfo.stack, chartinfo.orientation);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user