Preferences UI: add reset tab

Add a separate preferences tab for resetting all preferences to their default values.
One or two very small alterations to other sections of the preferences UI code.

Signed-off-by: willemferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
willemferguson 2019-12-10 15:02:13 +02:00 committed by Dirk Hohndel
parent b6c3cdb20c
commit 75b5be8f40
11 changed files with 227 additions and 61 deletions

View file

@ -0,0 +1,34 @@
// SPDX-License-Identifier: GPL-2.0
#include "preferences_reset.h"
#include "ui_preferences_reset.h"
#include "core/dive.h"
#include "preferencesdialog.h"
PreferencesReset::PreferencesReset(): AbstractPreferencesWidget(tr("Reset"), QIcon(":preferences-reset-icon"), 11 ), ui(new Ui::PreferencesReset())
{
ui->setupUi(this);
int h = 2 * ui->resetWarningIcon->height();
QPixmap warning (":preferences-reset-warning-icon");
ui->resetWarningIcon->setPixmap(warning.scaled(h,h,Qt::KeepAspectRatio));
}
PreferencesReset::~PreferencesReset()
{
delete ui;
}
void PreferencesReset::on_resetSettings_clicked()
{
auto dialog = PreferencesDialog::instance();
dialog->defaultsRequested();
}
void PreferencesReset::refreshSettings()
{
}
void PreferencesReset::syncSettings()
{
}