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 <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2013-10-17 16:30:32 -07:00
parent 8f623c2c72
commit 8259b1a59a
2 changed files with 18 additions and 7 deletions

View file

@ -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()

View file

@ -169,7 +169,7 @@
<x>0</x>
<y>0</y>
<width>763</width>
<height>23</height>
<height>32</height>
</rect>
</property>
<widget class="QMenu" name="menuFile">
@ -344,6 +344,9 @@
</property>
</action>
<action name="actionAutoGroup">
<property name="checkable">
<bool>true</bool>
</property>
<property name="text">
<string>Auto Group</string>
</property>
@ -443,11 +446,12 @@
</property>
</action>
<action name="actionImportCSV">
<property name="text">
<string>Import CSV</string>
</property>
<property name="toolTip">
</property>
<property name="text">
<string>Import CSV</string>
</property>
<property name="toolTip">
<string>Import CSV</string>
</property>
</action>
</widget>
<customwidgets>