diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2019-03-13 21:36:31 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2019-04-12 18:19:07 +0300 |
commit | aac8eacfa2b4621efadf1fb2b6d255f69394be55 (patch) | |
tree | 2d9b1764619b8578fd8e63237d8d3e6535de48f9 /desktop-widgets/tab-widgets/TabDiveSite.h | |
parent | 56dcbd9588fa3b7d70a4b639b71cb18e1c462067 (diff) | |
download | subsurface-aac8eacfa2b4621efadf1fb2b6d255f69394be55.tar.gz |
Dive site: on first addition of dive site, edit name
When adding a dive site, enter the name field of the new dive site.
Thus, when adding a new dive site, the user can immediately edit the
name.
The code is rather subtle: It hooks into the dive site added signal
before executing the command and unhooks afterwards. This only works,
because signals are executed in order of connect - thus the model
adds the index first and only *then* is the field edited.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'desktop-widgets/tab-widgets/TabDiveSite.h')
-rw-r--r-- | desktop-widgets/tab-widgets/TabDiveSite.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/desktop-widgets/tab-widgets/TabDiveSite.h b/desktop-widgets/tab-widgets/TabDiveSite.h index 2538166b4..32badadc3 100644 --- a/desktop-widgets/tab-widgets/TabDiveSite.h +++ b/desktop-widgets/tab-widgets/TabDiveSite.h @@ -14,6 +14,7 @@ public: void clear() override; private slots: void add(); + void diveSiteAdded(struct dive_site *, int idx); private: Ui::TabDiveSite ui; DiveSiteSortedModel model; |