<commit_before>#include "mainwindow.h"
#include "ui_mainwindow.h"

//#define TEST
#define REAL

//#define WINDOWS
#define MAC

MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);
}

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

void MainWindow::exit()
{
    close();
    qApp->quit();
}

void MainWindow::on_patchButton_clicked()
{
    bool ok;

    //Search kext file
    if(searchKernelExtensionFile(&kernelFile))
    {
        //Display Warning Message
        //TODO : Uncomment
        //int answer = QMessageBox::question(this, "Warning", "This will patch the kernel configuration file.\nAre you sure you want to procede ?", QMessageBox::Yes | QMessageBox::No);

        //if (answer == QMessageBox::Yes)
        if(1)
        {
            password = QInputDialog::getText(this,tr("Password"),tr("Password:"),QLineEdit::Password,"",&ok);

            if(!ok || password.isEmpty())
            {
                return;
            }

            logger->write(" ********** Starting MBP GPU Fix **********\n");
            patchKernelExtensionFile(&kernelFile);
            loadKernelExtension(&kernelFile);
        }
        else
        {
            logger->write(" ********** Discarded MBP GPU Fix **********n");
            return;
        }
    }
    else
    {
        return;
    }
}

void MainWindow::on_restoreButton_clicked()
{<commit_msg>Restore warning pop-up before patching (Fixes #10)<commit_after>#include "mainwindow.h"
#include "ui_mainwindow.h"

//#define TEST
#define REAL

//#define WINDOWS
#define MAC

MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);
}

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

void MainWindow::exit()
{
    close();
    qApp->quit();
}

void MainWindow::on_patchButton_clicked()
{
    bool ok;

    //Search kext file
    if(searchKernelExtensionFile(&kernelFile))
    {
        //Display Warning Message
        int answer = QMessageBox::question(this, "Warning", "This will patch the kernel configuration file.\nAre you sure you want to procede ?", QMessageBox::Yes | QMessageBox::No);
        if (answer == QMessageBox::Yes)
        {
            password = QInputDialog::getText(this,tr("Password"),tr("Password:"),QLineEdit::Password,"",&ok);

            if(!ok || password.isEmpty())
            {
                return;
            }

            logger->write(" ********** Starting MBP GPU Fix **********\n");
            patchKernelExtensionFile(&kernelFile);
            loadKernelExtension(&kernelFile);
        }
        else
        {
            logger->write(" ********** Discarded MBP GPU Fix **********n");
            return;
        }
    }
    else
    {
        return;
    }
}

void MainWindow::on_restoreButton_clicked()
{
{'fraction_non_alphanumeric': 0.15826577370461756, 'fraction_numerical': 0.0010574550581600281, 'mean_word_length': 2.482208588957055, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '2431389', 'n_tokens_mistral': 863, 'n_tokens_neox': 843, 'n_words': 175}