summaryrefslogtreecommitdiffstats
path: root/desktop-widgets/tab-widgets/TabDiveSite.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'desktop-widgets/tab-widgets/TabDiveSite.cpp')
-rw-r--r--desktop-widgets/tab-widgets/TabDiveSite.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/desktop-widgets/tab-widgets/TabDiveSite.cpp b/desktop-widgets/tab-widgets/TabDiveSite.cpp
index 5e2831c93..648df6395 100644
--- a/desktop-widgets/tab-widgets/TabDiveSite.cpp
+++ b/desktop-widgets/tab-widgets/TabDiveSite.cpp
@@ -1,6 +1,7 @@
// SPDX-License-Identifier: GPL-2.0
#include "TabDiveSite.h"
#include "qt-models/divelocationmodel.h"
+#include "desktop-widgets/command.h"
#include <qt-models/divecomputerextradatamodel.h>
@@ -16,6 +17,8 @@ TabDiveSite::TabDiveSite(QWidget *parent) : TabBase(parent)
// Show only the first few columns
for (int i = LocationInformationModel::COORDS; i < LocationInformationModel::COLUMNS; ++i)
ui.diveSites->view()->setColumnHidden(i, true);
+
+ connect(ui.diveSites, &TableView::addButtonClicked, this, &TabDiveSite::add);
}
void TabDiveSite::updateData()
@@ -25,3 +28,8 @@ void TabDiveSite::updateData()
void TabDiveSite::clear()
{
}
+
+void TabDiveSite::add()
+{
+ Command::addDiveSite(tr("New dive site"));
+}