mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Dive site: implement purge of unused dive sites
Add a "purge unused dive sites" button to the dive site list. Connect it to a new PurgeUnusedDiveSites command. Implementation was trivial: simply copy the DeleteDiveSites command. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
fde80eeaa5
commit
8858bfa1f8
7 changed files with 59 additions and 0 deletions
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -14,6 +14,13 @@
|
|||
<string>Dive sites</string>
|
||||
</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>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue