subsurface/desktop-widgets/preferences/preferences_georeference.cpp
willemferguson b6c3cdb20c Preferences UI: add dive log tab
This adds a tab for dive log - related preferences.
A suitable test programs is still required.

Signed-off-by: willemferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-25 02:57:42 +09:00

36 lines
1.3 KiB
C++

// SPDX-License-Identifier: GPL-2.0
#include "preferences_georeference.h"
#include "ui_preferences_georeference.h"
#include "core/qthelper.h"
#include "core/settings/qPrefGeocoding.h"
#include "qt-models/divelocationmodel.h"
#include <ctime>
PreferencesGeoreference::PreferencesGeoreference() : AbstractPreferencesWidget(tr("Georeference"), QIcon(":geotag-icon"), 8)
{
ui = new Ui::PreferencesGeoreference();
ui->setupUi(this);
ui->first_item->setModel(GeoReferencingOptionsModel::instance());
ui->second_item->setModel(GeoReferencingOptionsModel::instance());
ui->third_item->setModel(GeoReferencingOptionsModel::instance());
}
PreferencesGeoreference::~PreferencesGeoreference()
{
delete ui;
}
void PreferencesGeoreference::refreshSettings()
{
ui->first_item->setCurrentIndex(prefs.geocoding.category[0]);
ui->second_item->setCurrentIndex(prefs.geocoding.category[1]);
ui->third_item->setCurrentIndex(prefs.geocoding.category[2]);
}
void PreferencesGeoreference::syncSettings()
{
qPrefGeocoding::set_first_taxonomy_category((taxonomy_category) ui->first_item->currentIndex());
qPrefGeocoding::set_second_taxonomy_category((taxonomy_category) ui->second_item->currentIndex());
qPrefGeocoding::set_third_taxonomy_category((taxonomy_category) ui->third_item->currentIndex());
}