introduce MainWindow rideSelected signal

...and use it to update the various tabs when a ride is selected.
This commit is contained in:
Sean Rhea
2009-12-10 12:13:47 -08:00
parent 4c7311e152
commit 2db45dc0c5
14 changed files with 84 additions and 83 deletions

View File

@@ -25,7 +25,8 @@
#include <qwt_plot_panner.h>
#include <qwt_plot_zoomer.h>
AllPlotWindow::AllPlotWindow(MainWindow *mainWindow) : QWidget(mainWindow)
AllPlotWindow::AllPlotWindow(MainWindow *mainWindow) :
QWidget(mainWindow), mainWindow(mainWindow)
{
QVBoxLayout *vlayout = new QVBoxLayout;
@@ -130,12 +131,16 @@ AllPlotWindow::AllPlotWindow(MainWindow *mainWindow) : QWidget(mainWindow)
this, SLOT(setSmoothingFromSlider()));
connect(smoothLineEdit, SIGNAL(editingFinished()),
this, SLOT(setSmoothingFromLineEdit()));
connect(mainWindow, SIGNAL(rideSelected()), this, SLOT(rideSelected()));
connect(mainWindow, SIGNAL(zonesChanged()), this, SLOT(zonesChanged()));
}
void
AllPlotWindow::setData(RideItem *ride)
AllPlotWindow::rideSelected()
{
RideItem *ride = mainWindow->rideItem();
if (!ride)
return;
setAllPlotWidgets(ride);
allPlot->setData(ride);
allZoomer->setZoomBase();