2017-04-27 18:26:05 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0
|
2015-09-17 22:22:19 +00:00
|
|
|
#include "preferences_georeference.h"
|
|
|
|
#include "ui_prefs_georeference.h"
|
2016-04-05 05:02:03 +00:00
|
|
|
#include "core/prefs-macros.h"
|
|
|
|
#include "core/qthelper.h"
|
2016-08-08 13:34:48 +00:00
|
|
|
#include "core/subsurface-qt/SettingsObjectWrapper.h"
|
2015-09-17 22:22:19 +00:00
|
|
|
#include "qt-models/divelocationmodel.h"
|
|
|
|
|
|
|
|
#include <ctime>
|
|
|
|
|
2017-11-29 09:57:08 +00:00
|
|
|
PreferencesGeoreference::PreferencesGeoreference() : AbstractPreferencesWidget(tr("Georeference"), QIcon(":geotag-icon"), 9)
|
2015-09-17 22:22:19 +00:00
|
|
|
{
|
|
|
|
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()
|
|
|
|
{
|
2016-08-08 13:34:48 +00:00
|
|
|
auto geocoding = SettingsObjectWrapper::instance()->geocoding;
|
|
|
|
geocoding->setFirstTaxonomyCategory((taxonomy_category) ui->first_item->currentIndex());
|
|
|
|
geocoding->setSecondTaxonomyCategory((taxonomy_category) ui->second_item->currentIndex());
|
|
|
|
geocoding->setThirdTaxonomyCategory((taxonomy_category) ui->third_item->currentIndex());
|
2016-04-05 05:02:03 +00:00
|
|
|
}
|