From 8259b1a59aa679a65df2130d507fcccab9fa4fe1 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Thu, 17 Oct 2013 16:30:32 -0700 Subject: [PATCH] Implement hook up autogroup menu This tracks the autogroup state remembered in data files. Toggling the checkable menu item causes the divelist to be marked as changed. This might actually be untrue - but that's really hard to track so this is the "better safe than sorry" approach. Signed-off-by: Dirk Hohndel --- qt-ui/mainwindow.cpp | 9 ++++++++- qt-ui/mainwindow.ui | 16 ++++++++++------ 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp index d9019fa00..72dc1a00e 100644 --- a/qt-ui/mainwindow.cpp +++ b/qt-ui/mainwindow.cpp @@ -287,7 +287,13 @@ void MainWindow::on_actionRenumber_triggered() void MainWindow::on_actionAutoGroup_triggered() { - qDebug("actionAutoGroup"); + autogroup = ui.actionAutoGroup->isChecked(); + if (autogroup) + autogroup_dives(); + else + remove_autogen_trips(); + refreshDisplay(); + mark_divelist_changed(true); } void MainWindow::on_actionToggleZoom_triggered() @@ -802,6 +808,7 @@ void MainWindow::loadFiles(const QStringList fileNames) ui.ListWidget->setFocus(); WSInfoModel *wsim = WSInfoModel::instance(); wsim->updateInfo(); + ui.actionAutoGroup->setChecked(autogroup); } void MainWindow::on_actionImportCSV_triggered() diff --git a/qt-ui/mainwindow.ui b/qt-ui/mainwindow.ui index 8a108118e..ffe55c1f9 100644 --- a/qt-ui/mainwindow.ui +++ b/qt-ui/mainwindow.ui @@ -169,7 +169,7 @@ 0 0 763 - 23 + 32 @@ -344,6 +344,9 @@ + + true + Auto Group @@ -443,11 +446,12 @@ - - Import CSV - - - + + Import CSV + + + Import CSV +