diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2019-03-16 11:35:44 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2019-04-12 18:19:07 +0300 |
commit | cd3a8ba354c67b322c07b3c29899bc1ad7d5887c (patch) | |
tree | 5ad0e51822c043d76db78d0c3415750ee287d229 /desktop-widgets | |
parent | d4282e2689ec8647e9deb842ac434f274218a63a (diff) | |
download | subsurface-cd3a8ba354c67b322c07b3c29899bc1ad7d5887c.tar.gz |
Dive site: add edit field to dive site table
Add an edit column that calls the new editDiveSite() function
of MainWindow. The calling code is in DiveSiteSortedModel.
Quite illogical, but that's how TableView works, for now.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'desktop-widgets')
-rw-r--r-- | desktop-widgets/mainwindow.cpp | 11 | ||||
-rw-r--r-- | desktop-widgets/mainwindow.h | 1 |
2 files changed, 10 insertions, 2 deletions
diff --git a/desktop-widgets/mainwindow.cpp b/desktop-widgets/mainwindow.cpp index 7c9cf9ba2..8c7124c7c 100644 --- a/desktop-widgets/mainwindow.cpp +++ b/desktop-widgets/mainwindow.cpp @@ -378,12 +378,19 @@ void MainWindow::setStateProperties(const QByteArray& state, const PropertyList& stateProperties[state] = PropertiesForQuadrant(tl, tr, bl, br); } -void MainWindow::on_actionDiveSiteEdit_triggered() +void MainWindow::editDiveSite(dive_site *ds) { - diveSiteEdit->initFields(get_dive_site_for_dive(&displayed_dive)); + if (!ds) + return; + diveSiteEdit->initFields(ds); setApplicationState("EditDiveSite"); } +void MainWindow::on_actionDiveSiteEdit_triggered() +{ + editDiveSite(get_dive_site_for_dive(&displayed_dive)); +} + void MainWindow::enableDisableCloudActions() { ui.actionCloudstorageopen->setEnabled(prefs.cloud_verification_status == qPrefCloudStorage::CS_VERIFIED); diff --git a/desktop-widgets/mainwindow.h b/desktop-widgets/mainwindow.h index 859cafed1..4282938a6 100644 --- a/desktop-widgets/mainwindow.h +++ b/desktop-widgets/mainwindow.h @@ -82,6 +82,7 @@ public: void enableDisableOtherDCsActions(); void enterEditState(); void exitEditState(); + void editDiveSite(dive_site *ds); MainTab *mainTab; PlannerDetails *plannerDetails; |