2017-04-27 18:26:05 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0
|
2015-09-25 19:15:37 +00:00
|
|
|
#include "preferences_defaults.h"
|
|
|
|
#include "ui_preferences_defaults.h"
|
2018-06-29 06:57:27 +00:00
|
|
|
#include "core/dive.h"
|
2019-12-10 13:02:13 +00:00
|
|
|
#include "preferencesdialog.h"
|
2018-09-08 17:46:11 +00:00
|
|
|
#include "core/settings/qPrefGeneral.h"
|
|
|
|
#include "core/settings/qPrefDisplay.h"
|
|
|
|
#include "core/settings/qPrefCloudStorage.h"
|
2018-09-22 17:24:38 +00:00
|
|
|
#include "core/settings/qPrefDiveComputer.h"
|
2015-09-25 19:15:37 +00:00
|
|
|
|
|
|
|
#include <QFileDialog>
|
2019-07-05 19:41:21 +00:00
|
|
|
#include <QProcess>
|
|
|
|
#include <QMessageBox>
|
2015-09-25 19:15:37 +00:00
|
|
|
|
2019-12-09 18:58:20 +00:00
|
|
|
PreferencesDefaults::PreferencesDefaults(): AbstractPreferencesWidget(tr("Display"), QIcon(":preferences-display-icon"), 0 ), ui(new Ui::PreferencesDefaults())
|
2015-09-25 19:15:37 +00:00
|
|
|
{
|
|
|
|
ui->setupUi(this);
|
|
|
|
}
|
|
|
|
|
|
|
|
PreferencesDefaults::~PreferencesDefaults()
|
|
|
|
{
|
|
|
|
delete ui;
|
|
|
|
}
|
|
|
|
|
|
|
|
void PreferencesDefaults::refreshSettings()
|
|
|
|
{
|
2018-08-15 09:50:53 +00:00
|
|
|
ui->font->setCurrentFont(qPrefDisplay::divelist_font());
|
|
|
|
ui->fontsize->setValue(qPrefDisplay::font_size());
|
2018-08-20 09:51:48 +00:00
|
|
|
ui->velocitySlider->setValue(qPrefDisplay::animation_speed());
|
2015-09-25 19:15:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void PreferencesDefaults::syncSettings()
|
|
|
|
{
|
2018-08-15 09:50:53 +00:00
|
|
|
qPrefDisplay::set_divelist_font(ui->font->currentFont().toString());
|
|
|
|
qPrefDisplay::set_font_size(ui->fontsize->value());
|
2018-08-20 09:51:48 +00:00
|
|
|
qPrefDisplay::set_animation_speed(ui->velocitySlider->value());
|
2015-09-25 19:15:37 +00:00
|
|
|
}
|