diff options
author | Tomaz Canabrava <tomaz.canabrava@intel.com> | 2015-06-26 21:20:45 -0300 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-06-26 18:50:23 -0700 |
commit | dee59e5334629ff1fb89753f08f512981236a02f (patch) | |
tree | b0884739bd72a0e13d2880842ca76e8a7a9bfbfe /qt-ui/maintab.cpp | |
parent | c2f7702805067b121f68dd2fbf5b3ee366f280f0 (diff) | |
download | subsurface-dee59e5334629ff1fb89753f08f512981236a02f.tar.gz |
Dive site rewrite: fix adding a new dive and chaning notes / description
I had to create an event filter to deal with the missing callbacks from
QPlainTextEdit (it doesn't support editingFinished()).
Also we need to manually create a dive site on a newly added dive if the
user entered one.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/maintab.cpp')
-rw-r--r-- | qt-ui/maintab.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp index b960ebb03..45c0eb8d4 100644 --- a/qt-ui/maintab.cpp +++ b/qt-ui/maintab.cpp @@ -805,7 +805,10 @@ void MainTab::acceptChanges() addedId = added_dive->id; if (displayed_dive_site.uuid) copy_dive_site(&displayed_dive_site, get_dive_site_by_uuid(displayed_dive_site.uuid)); - + else if (ui.location->text().count()) { + uint32_t uuid = create_dive_site(qPrintable(ui.location->text())); + added_dive->dive_site_uuid = uuid; + } // unselect everything as far as the UI is concerned and select the new // dive - we'll have to undo/redo this later after we resort the dive_table // but we need the dive selected for the middle part of this function - this |