From 9d9619ef405776bdfcb090527a20cbff2f489944 Mon Sep 17 00:00:00 2001 From: Mark Liversedge Date: Mon, 29 Aug 2011 11:08:06 +0100 Subject: [PATCH] Re-instate zoom interval in MainWindow/AllPlot Added a new signal to MainWindow to trigger a zoom to interval. This signal has been trapped in AllPlot (Ride Plot), but will also need to be supported in; * Ride Editor - highlight/zoom to interval data * Aerolab - Same as ride plot * Maps - Zoom in to section --- src/AllPlotWindow.cpp | 3 ++- src/AllPlotWindow.h | 4 +--- src/MainWindow.cpp | 3 ++- src/MainWindow.h | 1 + 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/AllPlotWindow.cpp b/src/AllPlotWindow.cpp index b98982f76..7774537f0 100644 --- a/src/AllPlotWindow.cpp +++ b/src/AllPlotWindow.cpp @@ -315,7 +315,7 @@ AllPlotWindow::AllPlotWindow(MainWindow *mainWindow) : allPlotLayout->setStretch(1,20); QVBoxLayout *vlayout = new QVBoxLayout(this); - vlayout->setContentsMargins(10,10,10,10); + vlayout->setContentsMargins(2,2,2,2); vlayout->setSpacing(0); vlayout->addWidget(allPlotFrame); vlayout->addWidget(stackFrame); @@ -354,6 +354,7 @@ AllPlotWindow::AllPlotWindow(MainWindow *mainWindow) : connect(mainWindow, SIGNAL(rideDirty()), this, SLOT(rideSelected())); connect(mainWindow, SIGNAL(zonesChanged()), this, SLOT(zonesChanged())); connect(mainWindow, SIGNAL(intervalsChanged()), this, SLOT(intervalsChanged())); + connect(mainWindow, SIGNAL(intervalZoom(IntervalItem*)), this, SLOT(zoomInterval(IntervalItem*))); connect(mainWindow, SIGNAL(intervalSelected()), this, SLOT(intervalSelected())); connect(mainWindow, SIGNAL(configChanged()), allPlot, SLOT(configChanged())); connect(mainWindow, SIGNAL(configChanged()), this, SLOT(configChanged())); diff --git a/src/AllPlotWindow.h b/src/AllPlotWindow.h index 7f499f1e6..40520da74 100644 --- a/src/AllPlotWindow.h +++ b/src/AllPlotWindow.h @@ -71,9 +71,6 @@ class AllPlotWindow : public GcWindow void clearSelection(); void hideSelection(); - // zoom to interval range (via span-slider) - void zoomInterval(IntervalItem *); - // get properties - the setters are below bool isStacked() const { return showStack->isChecked(); } int isShowGrid() const { return showGrid->checkState(); } @@ -116,6 +113,7 @@ class AllPlotWindow : public GcWindow // trap widget signals void zoomChanged(); + void zoomInterval(IntervalItem *); void moveLeft(); void moveRight(); void showStackChanged(int state); diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index 8505c423e..48756ca9a 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -691,6 +691,7 @@ MainWindow::showContextMenuPopup(const QPoint &pos) connect(actFrontInt, SIGNAL(triggered(void)), this, SLOT(frontInterval(void))); connect(actBackInt, SIGNAL(triggered(void)), this, SLOT(backInterval(void))); + menu.addAction(actZoomInt); menu.addAction(actRenameInt); menu.addAction(actDeleteInt); menu.exec(intervalWidget->mapToGlobal( pos )); @@ -1451,7 +1452,7 @@ MainWindow::intervalEdited(QTreeWidgetItem *, int) { void MainWindow::zoomInterval() { // zoom into this interval on allPlot - //allPlotWindow->zoomInterval(activeInterval); + emit intervalZoom(activeInterval); } void diff --git a/src/MainWindow.h b/src/MainWindow.h index bb1e752b4..6fbb329e9 100644 --- a/src/MainWindow.h +++ b/src/MainWindow.h @@ -158,6 +158,7 @@ class MainWindow : public QMainWindow signals: void intervalSelected(); + void intervalZoom(IntervalItem*); void intervalsChanged(); void zonesChanged(); void seasonsChanged();