diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2015-07-01 12:33:48 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-07-01 12:38:40 -0700 |
commit | 3055f4ac2212fef67a6e191538fe615f48be7042 (patch) | |
tree | 617fc8c23fbfba622c8cec126c9820100f3fd209 | |
parent | a413141b334e89b0c9944bc403b8774f85427509 (diff) | |
download | subsurface-3055f4ac2212fef67a6e191538fe615f48be7042.tar.gz |
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 <dirk@hohndel.org>
-rw-r--r-- | qt-ui/maintab.cpp | 19 |
1 files changed, 18 insertions, 1 deletions
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 { |