From cd3a8ba354c67b322c07b3c29899bc1ad7d5887c Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Sat, 16 Mar 2019 11:35:44 +0100 Subject: 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 --- desktop-widgets/mainwindow.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'desktop-widgets/mainwindow.cpp') 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); -- cgit v1.2.3-70-g09d2