<commit_before>#include "SettingsTab.hpp"

/**
 * @brief SettingsTab::SettingsTab
 *
 * The constructor of the SettingsTab class.
 * Translates the QSettings into a list of strings and integers
 * we can make use of.
 */
SettingsTab::SettingsTab(QHash<QString, QVariant> *Settings, QWidget* parent) : QWidget(parent){
    settings = Settings;
}

/**
 * @brief LayoutTab::~LayoutTab
 *
 * Destructor of the LayoutTab class.
 * Deletes the GUI elements.
 */
LayoutTab::~LayoutTab(){
    delete design;
    delete highlighting;
    delete language;
}

/**
 * @brief LayoutTab::LayoutTab
 *
 * Constructor of the LayoutTab class.
 * Calls the addLayout member function.
 */
LayoutTab::LayoutTab(QHash<QString, QVariant> *Settings, QWidget* parent) : SettingsTab(Settings, parent){
    addLayout();
}

/**
 * @brief LayoutTab::addLayout
 *
 * Creates the layout tab UI and makes it interactive.
 */
void LayoutTab::addLayout(){
    design = new QGroupBox(tr("Design"));

    designBoxLabel = new QLabel(tr("Design:"));
    designBox = new QComboBox;
    QString designConfig = settings->value("Design").toString();
    for(const QString style : QStyleFactory::keys()){
        designBox->addItem(style);
        if(designConfig == style)
            designBox->setCurrentIndex(designBox->count() - 1);
    }

    connect(designBox, SIGNAL(currentTextChanged(QString)), this, SLOT(designSettings(QString)));

    verticalDesign = new QHBoxLayout;
    verticalDesign->addWidget(designBoxLabel);
    verticalDesign->addWidget(designBox);

    horizontalDesign = new QVBoxLayout;
    horizontalDesign->addLayout(verticalDesign);
    design->setLayout(horizontalDesign);

    highlighting = new QGroupBox(tr("Highlighting"));

    hlBoxLabel = new QLabel(tr("Highlighting:"));
    hlBox = new QComboBox;
    hlBox->addItem(tr("GLSL"));
    hlBox->addItem(tr("Python"));
    hlBox->addItem(tr("QT"));
    hlBox->addItem(tr("Variable Names"));    
    hlBox->addItem(tr("None"));

    int hlConfig = settings->value("Highlighting").toInt();
    if(hlConfig >= 0 || hlConfig <= 4)
        hlBox->setCurrentIndex(hlConfig);

    connect(hlBox, SIGNAL(currentIndexChanged(int)),<commit_msg>Fixed a settings bug and removed unnecessary highlighting<commit_after>#include "SettingsTab.hpp"

/**
 * @brief SettingsTab::SettingsTab
 *
 * The constructor of the SettingsTab class.
 * Translates the QSettings into a list of strings and integers
 * we can make use of.
 */
SettingsTab::SettingsTab(QHash<QString, QVariant> *Settings, QWidget* parent) : QWidget(parent){
    settings = Settings;
}

/**
 * @brief LayoutTab::~LayoutTab
 *
 * Destructor of the LayoutTab class.
 * Deletes the GUI elements.
 */
LayoutTab::~LayoutTab(){
    delete design;
    delete highlighting;
    delete language;
}

/**
 * @brief LayoutTab::LayoutTab
 *
 * Constructor of the LayoutTab class.
 * Calls the addLayout member function.
 */
LayoutTab::LayoutTab(QHash<QString, QVariant> *Settings, QWidget* parent) : SettingsTab(Settings, parent){
    addLayout();
}

/**
 * @brief LayoutTab::addLayout
 *
 * Creates the layout tab UI and makes it interactive.
 */
void LayoutTab::addLayout(){
    design = new QGroupBox(tr("Design"));

    designBoxLabel = new QLabel(tr("Design:"));
    designBox = new QComboBox;
    QString designConfig = settings->value("Design").toString();
    for(const QString style : QStyleFactory::keys()){
        designBox->addItem(style);
        if(designConfig == style)
            designBox->setCurrentIndex(designBox->count() - 1);
    }

    connect(designBox, SIGNAL(currentTextChanged(QString)), this, SLOT(designSettings(QString)));

    verticalDesign = new QHBoxLayout;
    verticalDesign->addWidget(designBoxLabel);
    verticalDesign->addWidget(designBox);

    horizontalDesign = new QVBoxLayout;
    horizontalDesign->addLayout(verticalDesign);
    design->setLayout(horizontalDesign);

    highlighting = new QGroupBox(tr("Highlighting"));

    hlBoxLabel = new QLabel(tr("Highlighting:"));
    hlBox = new QComboBox;
    hlBox->addItem(tr("GLSL"));
    hlBox->addItem(tr("Variable Names"));    
    hlBox->addItem(tr("None"));

    int hlConfig = settings->value("Highlighting").toInt();
    if(hlConfig >= 0 && hlConfig <= 2)
        hlBox->setCurrentIndex(hlConfig);

    connect(hlBox, SIGNAL(currentIndexChanged(int)),
{'fraction_non_alphanumeric': 0.1367205542725173, 'fraction_numerical': 0.0013856812933025404, 'mean_word_length': 4.28170731707317, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 37, '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': '5131743', 'n_tokens_mistral': 1315, 'n_tokens_neox': 1261, 'n_words': 292}