From e69dbebf21a8bf7c5d02a12d93069e99d363ea64 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Fri, 10 May 2013 10:45:13 -0700 Subject: Make nextDC and previousDC work and assign shortcuts Cursor right and left now work again to switch between divecomputers. Signed-off-by: Dirk Hohndel --- qt-ui/mainwindow.cpp | 13 ++++++++++--- qt-ui/mainwindow.h | 2 +- qt-ui/mainwindow.ui | 6 ++++++ 3 files changed, 17 insertions(+), 4 deletions(-) (limited to 'qt-ui') diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp index 160a657da..863e35088 100644 --- a/qt-ui/mainwindow.cpp +++ b/qt-ui/mainwindow.cpp @@ -45,6 +45,11 @@ MainWindow::MainWindow() : ui(new Ui::MainWindow()), ui->ListWidget->setCurrentIndex(firstDiveOrTrip); } +void MainWindow::redrawProfile() +{ + ui->ProfileWidget->plot(get_dive(selected_dive)); +} + void MainWindow::on_actionNew_triggered() { qDebug("actionNew"); @@ -96,7 +101,7 @@ void MainWindow::dive_selection_changed(const QItemSelection& newSelection, cons continue; select_dive(get_divenr(d)); } - ui->ProfileWidget->plot(get_dive(selected_dive)); + redrawProfile(); ui->InfoWidget->updateDiveInfo(selected_dive); } @@ -239,12 +244,14 @@ void MainWindow::on_actionViewAll_triggered() void MainWindow::on_actionPreviousDC_triggered() { - qDebug("actionPreviousDC"); + dc_number--; + redrawProfile(); } void MainWindow::on_actionNextDC_triggered() { - qDebug("actionNextDC"); + dc_number++; + redrawProfile(); } void MainWindow::on_actionSelectEvents_triggered() diff --git a/qt-ui/mainwindow.h b/qt-ui/mainwindow.h index 3b35d44e5..b76199a8b 100644 --- a/qt-ui/mainwindow.h +++ b/qt-ui/mainwindow.h @@ -82,7 +82,7 @@ private: bool askSaveChanges(); void readSettings(); void writeSettings(); - + void redrawProfile(); }; #endif diff --git a/qt-ui/mainwindow.ui b/qt-ui/mainwindow.ui index 377605326..b2969ac61 100644 --- a/qt-ui/mainwindow.ui +++ b/qt-ui/mainwindow.ui @@ -315,11 +315,17 @@ Prev DC + + Left + Next DC + + Right + -- cgit v1.2.3-70-g09d2