<commit_before>#include "HumbugWindow.h"
#include "HumbugTrayIcon.h"
#include "ui_HumbugWindow.h"

#include <iostream>
#include <QMenuBar>
#include <QSystemTrayIcon>
#include <QWebFrame>
#include <QDesktopServices>

#include <stdio.h>

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

    start = QUrl("http://localhost:9991/");

    ui->webView->load(start);
    this->setMinimumWidth(400);

    statusBar()->hide();

    HumbugTrayIcon *tray = new HumbugTrayIcon(this);
    tray->setIcon(QIcon(":/images/hat.svg"));

    QMenu *menu = new QMenu(this);
    QAction *exit_action = menu->addAction("Exit");
    connect(exit_action, SIGNAL(triggered()), this, SLOT(userQuit()));
    connect(tray, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this, SLOT(trayClicked()));
    tray->setContextMenu(menu);
    tray->show();

    wb = new HumbugWebBridge(this, ui->webView, tray);
    connect(ui->webView->page(), SIGNAL(linkClicked(QUrl)), this, SLOT(linkClicked(QUrl)));
    connect(ui->webView->page()->mainFrame(), SIGNAL(javaScriptWindowObjectCleared()), this, SLOT(addJavaScriptObject()));

    ui->webView->page()->setLinkDelegationPolicy(QWebPage::DelegateExternalLinks);

}

void HumbugWindow::userQuit()
{
    QApplication::quit();
}

void HumbugWindow::trayClicked()<commit_msg>Update initialisation of HWB<commit_after>#include "HumbugWindow.h"
#include "HumbugTrayIcon.h"
#include "ui_HumbugWindow.h"

#include <iostream>
#include <QMenuBar>
#include <QSystemTrayIcon>
#include <QWebFrame>
#include <QDesktopServices>

#include <stdio.h>

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

    start = QUrl("http://localhost:9991/");

    ui->webView->load(start);
    this->setMinimumWidth(400);

    statusBar()->hide();

    HumbugTrayIcon *tray = new HumbugTrayIcon(this);
    tray->setIcon(QIcon(":/images/hat.svg"));

    QMenu *menu = new QMenu(this);
    QAction *exit_action = menu->addAction("Exit");
    connect(exit_action, SIGNAL(triggered()), this, SLOT(userQuit()));
    connect(tray, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this, SLOT(trayClicked()));
    tray->setContextMenu(menu);
    tray->show();

    wb = new HumbugWebBridge(this);
    connect(ui->webView->page(), SIGNAL(linkClicked(QUrl)), this, SLOT(linkClicked(QUrl)));
    connect(ui->webView->page()->mainFrame(), SIGNAL(javaScriptWindowObjectCleared()), this, SLOT(addJavaScriptObject()));

    ui->webView->page()->setLinkDelegationPolicy(QWebPage::DelegateExternalLinks);

}

void HumbugWindow::userQuit()
{
    QApplication::quit();
}

void HumbugWindow::trayClicked()
{'fraction_non_alphanumeric': 0.17130307467057102, 'fraction_numerical': 0.005124450951683748, 'mean_word_length': 5.815461346633416, 'pattern_counts': {'":': 2, '<': 15, '<?xml version=': 0, '>': 50, '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': '3177954', 'n_tokens_mistral': 1002, 'n_tokens_neox': 958, 'n_words': 140}