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

@@ -24,7 +24,8 @@
#include <QtGui>
#include <assert.h>
HistogramWindow::HistogramWindow(MainWindow *mainWindow) : QWidget(mainWindow)
HistogramWindow::HistogramWindow(MainWindow *mainWindow) :
QWidget(mainWindow), mainWindow(mainWindow)
{
QVBoxLayout *vlayout = new QVBoxLayout;
QHBoxLayout *binWidthLayout = new QHBoxLayout;
@@ -72,12 +73,16 @@ HistogramWindow::HistogramWindow(MainWindow *mainWindow) : QWidget(mainWindow)
this, SLOT(setWithZerosFromCheckBox()));
connect(histParameterCombo, SIGNAL(currentIndexChanged(int)),
this, SLOT(setHistSelection(int)));
connect(mainWindow, SIGNAL(rideSelected()), this, SLOT(rideSelected()));
connect(mainWindow, SIGNAL(zonesChanged()), this, SLOT(zonesChanged()));
}
void
HistogramWindow::setData(RideItem *ride)
HistogramWindow::rideSelected()
{
RideItem *ride = mainWindow->rideItem();
if (!ride)
return;
// set the histogram data
powerHist->setData(ride);
// make sure the histogram has a legal selection