summaryrefslogtreecommitdiffstats
path: root/desktop-widgets
diff options
context:
space:
mode:
Diffstat (limited to 'desktop-widgets')
-rw-r--r--desktop-widgets/mainwindow.cpp11
-rw-r--r--desktop-widgets/mainwindow.h1
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;