1
0
Fork 0
mirror of https://github.com/subsurface/subsurface.git synced 2025-02-19 22:16:15 +00:00

Make nextDC and previousDC work and assign shortcuts

Cursor right and left now work again to switch between divecomputers.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2013-05-10 10:45:13 -07:00
parent 56c4cced53
commit e69dbebf21
3 changed files with 17 additions and 4 deletions

View file

@ -45,6 +45,11 @@ MainWindow::MainWindow() : ui(new Ui::MainWindow()),
ui->ListWidget->setCurrentIndex(firstDiveOrTrip); ui->ListWidget->setCurrentIndex(firstDiveOrTrip);
} }
void MainWindow::redrawProfile()
{
ui->ProfileWidget->plot(get_dive(selected_dive));
}
void MainWindow::on_actionNew_triggered() void MainWindow::on_actionNew_triggered()
{ {
qDebug("actionNew"); qDebug("actionNew");
@ -96,7 +101,7 @@ void MainWindow::dive_selection_changed(const QItemSelection& newSelection, cons
continue; continue;
select_dive(get_divenr(d)); select_dive(get_divenr(d));
} }
ui->ProfileWidget->plot(get_dive(selected_dive)); redrawProfile();
ui->InfoWidget->updateDiveInfo(selected_dive); ui->InfoWidget->updateDiveInfo(selected_dive);
} }
@ -239,12 +244,14 @@ void MainWindow::on_actionViewAll_triggered()
void MainWindow::on_actionPreviousDC_triggered() void MainWindow::on_actionPreviousDC_triggered()
{ {
qDebug("actionPreviousDC"); dc_number--;
redrawProfile();
} }
void MainWindow::on_actionNextDC_triggered() void MainWindow::on_actionNextDC_triggered()
{ {
qDebug("actionNextDC"); dc_number++;
redrawProfile();
} }
void MainWindow::on_actionSelectEvents_triggered() void MainWindow::on_actionSelectEvents_triggered()

View file

@ -82,7 +82,7 @@ private:
bool askSaveChanges(); bool askSaveChanges();
void readSettings(); void readSettings();
void writeSettings(); void writeSettings();
void redrawProfile();
}; };
#endif #endif

View file

@ -315,11 +315,17 @@
<property name="text"> <property name="text">
<string>Prev DC</string> <string>Prev DC</string>
</property> </property>
<property name="shortcut">
<string>Left</string>
</property>
</action> </action>
<action name="actionNextDC"> <action name="actionNextDC">
<property name="text"> <property name="text">
<string>Next DC</string> <string>Next DC</string>
</property> </property>
<property name="shortcut">
<string>Right</string>
</property>
</action> </action>
<action name="actionSelectEvents"> <action name="actionSelectEvents">
<property name="text"> <property name="text">