diff --git a/src/AllPlotWindow.cpp b/src/AllPlotWindow.cpp index 1956ba769..c57cb47a9 100644 --- a/src/AllPlotWindow.cpp +++ b/src/AllPlotWindow.cpp @@ -239,15 +239,22 @@ AllPlotWindow::rideSelected() if (mainWindow->activeTab() != this) return; RideItem *ride = mainWindow->rideItem(); - if (!ride) + if (!ride || ride == current) return; + current = ride; + + int showit = showStack->isChecked(); + if (showit) allPlot->hide(); + else allPlot->show(); + + // set it up anyway since the stack plots + // reuse the arrays clearSelection(); // clear any ride interval selection data setAllPlotWidgets(ride); allPlot->setDataI(ride); allZoomer->setZoomBase(); // update stacked view if that is set - int showit = showStack->isChecked(); setShowStack(0); // zap whats there setShowStack(showit); } diff --git a/src/AllPlotWindow.h b/src/AllPlotWindow.h index db7013143..f5ed33d0a 100644 --- a/src/AllPlotWindow.h +++ b/src/AllPlotWindow.h @@ -99,6 +99,8 @@ class AllPlotWindow : public QWidget QSlider *smoothSlider; QLineEdit *smoothLineEdit; + RideItem *current; + private: void showInfo(QString); void resetStackedDatas(); diff --git a/src/GoogleMapControl.cpp b/src/GoogleMapControl.cpp index 733380a4f..06de56b56 100644 --- a/src/GoogleMapControl.cpp +++ b/src/GoogleMapControl.cpp @@ -156,12 +156,13 @@ GoogleMapControl::GoogleMapControl(MainWindow *mw) void GoogleMapControl::rideSelected() { - if (parent->activeTab() != this) - return; - RideItem * ride = parent->rideItem(); + if (parent->activeTab() != this) return; - if (!ride) + RideItem * ride = parent->rideItem(); + if (ride == current || !ride || !ride->ride()) return; + else + current = ride; int zone =ride->zoneRange(); if(zone < 0) @@ -177,8 +178,6 @@ GoogleMapControl::rideSelected() double prevLon = 0; double prevLat = 0; - if (ride == NULL || ride->ride() == NULL) return; - foreach(RideFilePoint *rfp,ride->ride()->dataPoints()) { RideFilePoint curRfp = *rfp; @@ -204,8 +203,15 @@ GoogleMapControl::rideSelected() void GoogleMapControl::resizeEvent(QResizeEvent * ) { - newRideToLoad = true; - loadRide(); + static bool first = true; + if (parent->activeTab() != this) return; + + if (first == true) { + first = false; + } else { + newRideToLoad = true; + loadRide(); + } } void GoogleMapControl::loadStarted() diff --git a/src/GoogleMapControl.h b/src/GoogleMapControl.h index dfa2a6841..a9bae91f9 100644 --- a/src/GoogleMapControl.h +++ b/src/GoogleMapControl.h @@ -64,6 +64,7 @@ Q_OBJECT int rideCP; // current HTML for the ride std::ostringstream currentPage; + RideItem *current; public slots: void rideSelected(); diff --git a/src/ModelWindow.cpp b/src/ModelWindow.cpp index eed006f4a..c944934a2 100644 --- a/src/ModelWindow.cpp +++ b/src/ModelWindow.cpp @@ -92,6 +92,7 @@ ModelWindow::ModelWindow(MainWindow *parent, const QDir &home) : styleSelector->addItem(tr("Bar")); styleSelector->addItem(tr("Grid")); styleSelector->addItem(tr("Surface")); + styleSelector->addItem(tr("Dots")); styleSelector->setCurrentIndex(0); ignore = new QCheckBox(tr("Ignore Zero")); @@ -188,6 +189,10 @@ ModelWindow::rideSelected() if (main->activeTab() != this) return; ride = main->rideItem(); + + if (!ride || !ride->ride() || ride == current) + + current = ride; setData(true); } diff --git a/src/ModelWindow.h b/src/ModelWindow.h index b9ea60794..3a9a822c8 100644 --- a/src/ModelWindow.h +++ b/src/ModelWindow.h @@ -115,6 +115,8 @@ class ModelWindow : public QWidget // z pane slider QSlider *zpane; + RideItem *current; + private: void addStandardChannels(QComboBox *); diff --git a/src/PfPvWindow.cpp b/src/PfPvWindow.cpp index 87a77dc8b..4468fb9a9 100644 --- a/src/PfPvWindow.cpp +++ b/src/PfPvWindow.cpp @@ -91,11 +91,16 @@ PfPvWindow::rideSelected() { if (mainWindow->activeTab() != this) return; + + RideItem *ride = mainWindow->rideItem(); - if (!ride || !ride->ride()) + if (ride == current || !ride || !ride->ride()) return; pfPvPlot->setData(ride); + + current = ride; + // update the QLabel widget with the CP value set in PfPvPlot::setData() qaCPValue->setText(QString("%1").arg(pfPvPlot->getCP())); } diff --git a/src/PfPvWindow.h b/src/PfPvWindow.h index fd91c53bd..4d78f70cc 100644 --- a/src/PfPvWindow.h +++ b/src/PfPvWindow.h @@ -60,6 +60,7 @@ class PfPvWindow : public QWidget QLineEdit *qaCPValue; QLineEdit *qaCadValue; QLineEdit *qaClValue; + RideItem *current; }; #endif // _GC_PfPvWindow_h