From 3055f4ac2212fef67a6e191538fe615f48be7042 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Wed, 1 Jul 2015 12:33:48 -0700 Subject: Geo taxonomy: show the chosen taxonomy entries in the notes pane This isn't perfect - I'd like to have them show behind the word Location instead as what we have now creates movement in the position of the fields on the screen which I think is distracting. Signed-off-by: Dirk Hohndel --- qt-ui/maintab.cpp | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'qt-ui') diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp index d60e22a79..b5981c977 100644 --- a/qt-ui/maintab.cpp +++ b/qt-ui/maintab.cpp @@ -496,9 +496,26 @@ void MainTab::updateDiveInfo(bool clear) if (!clear) { struct dive_site *ds = get_dive_site_by_uuid(displayed_dive.dive_site_uuid); + qDebug() << "showing dive site uuid" << ds->uuid << ds; if (ds) { + // construct the location tags + QString locationTag; + if (ds->taxonomy.nr) { + QString connector = ""; + for (int i = 0; i < 3; i++) { + qDebug() << "looking for category" << prefs.geocoding.category[i]; + for (int j = 0; j < NR_CATEGORIES; j++) { + qDebug() << "seeing category" << ds->taxonomy.category[j].category; + if (ds->taxonomy.category[j].category == prefs.geocoding.category[i]) { + locationTag += connector + QString(ds->taxonomy.category[j].value); + connector = " / "; + break; + } + } + } + } ui.location->setText(ds->name); - ui.locationTags->setText(ds->description); // TODO: This should be three tags following davide's explanation. + ui.locationTags->setText(locationTag); if (displayed_dive.dive_site_uuid) copy_dive_site(get_dive_site_by_uuid(displayed_dive.dive_site_uuid), &displayed_dive_site); } else { -- cgit v1.2.3-70-g09d2