<commit_before>#include "Settings.h"
#include "ui_Settings.h"
#include "Wizard.h"

#include <QtWidgets>
#include <QDebug>

/** Settings constructor
* Initialize the settings UI
* \param p Inherited palette configuration for setting StyleSheets.
* \param parent Pointer to parent widget.
*/
Settings::Settings(QSettings* p, QWidget* parent) : QWidget(parent), ui(new Ui::Settings)
{
		ui->setupUi(this);
		this->setObjectName("settingsUI");
		this->setStyleSheet("background-color: " + p->value("Primary/SecondaryBase").toString() + ";} "
			"QPushButton {"
			"color: " + p->value("Primary/LightText").toString() + "; "
			"background-color: " + p->value("Primary/DarkElement").toString() + "; "
			"border: none; margin: 0px; padding: 0px;} "
			"QPushButton:hover {"
			"background-color: " + p->value("Primary/InactiveSelection").toString() + ";} "
			"color: " + p->value("Primary/LightText").toString() + ";");
		QFont buttonFont("SourceSansPro", 9);
		ui->WizardButton->setFont(buttonFont);
		ui->WizardButton->setText("Add Games to Ascension");
		ui->ClearDatabaseButton->setFont(buttonFont);
		ui->ClearDatabaseButton->setText("Clear Database");
		connect(ui->WizardButton, SIGNAL(clicked()), QApplication::instance(), SLOT(Settings::on_WizardButton_clicked()));
		connect(ui->ClearDatabaseButton, SIGNAL(clicked()), QApplication::instance(), SLOT(Settings::on_ClearDatabaseButton_clicked()));
}

/** Event handler for Wizard Button
* Runs setup wizard on click
*/
void Settings::on_WizardButton_clicked()
{
	Wizard* wiz = new Wizard();
	wiz->show();
}

void Settings::on_ClearDatabaseButton_clicked()
{
	int ret = QMessageBox(QMessageBox::Question, "Deleting Database", "Proceeding will delete the database, the database will be non-recoverable. Proceed?", QMessageBox::Yes | QMessageBox::No).exec();
	switch (ret)
	{
	case QMessageBox::Yes:
		db.reset();
		break;
	case QMessageBox::No:
		break;
	default:
		break;
	}
}

Settings::~Settings()
{
	delete ui;
}
<commit_msg>Settings Widget<commit_after>#include "Settings.h"
#include "ui_Settings.h"
#include "Wizard.h"

#include <QtWidgets>
#include <QDebug>

/** Settings constructor
* Initialize the settings UI
* \param p Inherited palette configuration for setting StyleSheets.
* \param parent Pointer to parent widget.
*/
Settings::Settings(QSettings* p, QWidget* parent) : QWidget(parent), ui(new Ui::Settings)
{
	ui->setupUi(this);
	this->setObjectName("settingsUI");
	this->setStyleSheet("background-color: " + p->value("Primary/SecondaryBase").toString() + ";} "
		"QPushButton {"
		"color: " + p->value("Primary/LightText").toString() + "; "
		"background-color: " + p->value("Primary/DarkElement").toString() + "; "
		"border: none; margin: 0px; padding: 0px;} "
		"QPushButton:hover {"
		"background-color: " + p->value("Primary/InactiveSelection").toString() + ";} "
		"color: " + p->value("Primary/LightText").toString() + ";");
	QFont buttonFont("SourceSansPro", 9);
	ui->WizardButton->setFont(buttonFont);
	ui->WizardButton->setText("Add Games to Ascension");
	ui->ClearDatabaseButton->setFont(buttonFont);
	ui->ClearDatabaseButton->setText("Clear Database");
	connect(ui->WizardButton, SIGNAL(clicked()), QApplication::instance(), SLOT(Settings::on_WizardButton_clicked()));
	connect(ui->ClearDatabaseButton, SIGNAL(clicked()), QApplication::instance(), SLOT(Settings::on_ClearDatabaseButton_clicked()));
	if (!db.init())
	{
		QMessageBox error;
		error.critical(0, "Error!", "An error occured while trying to load the database.");
		exit(EXIT_FAILURE);
	}
}

/** Event handler for Wizard Button
* Runs setup wizard on click
*/
void Settings::on_WizardButton_clicked()
{
	Wizard* wiz = new Wizard();
	wiz->show();
}

void Settings::on_ClearDatabaseButton_clicked()
{
	int ret = QMessageBox(QMessageBox::Question, "Deleting Database", "Proceeding will delete the database, the database will be non-recoverable. Proceed?", QMessageBox::Yes | QMessageBox::No).exec();
	switch (ret)
	{
	case QMessageBox::Yes:
		db.reset();
		break;
	case QMessageBox::No:
		break;
	default:
		break;
	}
}

Settings::~Settings()
{
	delete ui;
}

{'fraction_non_alphanumeric': 0.1712612832398146, 'fraction_numerical': 0.0017077335935594047, 'mean_word_length': 5.960950764006792, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 45, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6111969', 'n_tokens_mistral': 1384, 'n_tokens_neox': 1321, 'n_words': 271}