summaryrefslogtreecommitdiffstats
path: root/desktop-widgets/tab-widgets
diff options
context:
space:
mode:
Diffstat (limited to 'desktop-widgets/tab-widgets')
-rw-r--r--desktop-widgets/tab-widgets/TabDiveSite.cpp5
-rw-r--r--desktop-widgets/tab-widgets/TabDiveSite.h1
-rw-r--r--desktop-widgets/tab-widgets/TabDiveSite.ui7
3 files changed, 13 insertions, 0 deletions
diff --git a/desktop-widgets/tab-widgets/TabDiveSite.cpp b/desktop-widgets/tab-widgets/TabDiveSite.cpp
index f021f73dc..dc0b6be67 100644
--- a/desktop-widgets/tab-widgets/TabDiveSite.cpp
+++ b/desktop-widgets/tab-widgets/TabDiveSite.cpp
@@ -69,3 +69,8 @@ void TabDiveSite::diveSiteChanged(struct dive_site *ds, int field)
QModelIndex localIdx = model.mapFromSource(globalIdx);
ui.diveSites->view()->scrollTo(localIdx);
}
+
+void TabDiveSite::on_purgeUnused_clicked()
+{
+ Command::purgeUnusedDiveSites();
+}
diff --git a/desktop-widgets/tab-widgets/TabDiveSite.h b/desktop-widgets/tab-widgets/TabDiveSite.h
index a31b1629d..b9c07ed69 100644
--- a/desktop-widgets/tab-widgets/TabDiveSite.h
+++ b/desktop-widgets/tab-widgets/TabDiveSite.h
@@ -16,6 +16,7 @@ private slots:
void add();
void diveSiteAdded(struct dive_site *, int idx);
void diveSiteChanged(struct dive_site *ds, int field);
+ void on_purgeUnused_clicked();
private:
Ui::TabDiveSite ui;
DiveSiteSortedModel model;
diff --git a/desktop-widgets/tab-widgets/TabDiveSite.ui b/desktop-widgets/tab-widgets/TabDiveSite.ui
index 1d52555e3..b536f101a 100644
--- a/desktop-widgets/tab-widgets/TabDiveSite.ui
+++ b/desktop-widgets/tab-widgets/TabDiveSite.ui
@@ -15,6 +15,13 @@
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
+ <widget class="QToolButton" name="purgeUnused">
+ <property name="text">
+ <string>Purge unused dive sites</string>
+ </property>
+ </widget>
+ </item>
+ <item>
<widget class="TableView" name="diveSites" native="true"/>
</item>
</layout>