From dee59e5334629ff1fb89753f08f512981236a02f Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Fri, 26 Jun 2015 21:20:45 -0300 Subject: 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 Signed-off-by: Dirk Hohndel --- qt-ui/maintab.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'qt-ui/maintab.cpp') 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 -- cgit v1.2.3-70-g09d2