<commit_before>#include "logindialog.h"
#include "ui_logindialog.h"
#include "ui_chatwindow.h"
#include "gui.h"

LoginDialog::LoginDialog(ChatWindow* chatPointer,Gui* guiPointer) :
QDialog(nullptr),
ui(new Ui::LoginDialog)
{
    ui->setupUi(this);
    this->setFixedSize(this->width(),this->height());
    ui->inputServer->setPlaceholderText("Example: name.server.com");
    ui->inputName->setPlaceholderText("Example: Name (max 32 characters)");
    ui->inputName->setInputMask("NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN");
    mainWindow = chatPointer;
    chatGui = guiPointer;
}

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

void LoginDialog::on_buttonBox_rejected()
{
    this->close();
    mainWindow->close();
}

void LoginDialog::on_buttonBox_accepted()
{   ui->errorMessage->setText("");
        chatGui->createClient(ui->inputName->text(),ui->inputServer->text());<commit_msg>User as user name not allowed<commit_after>#include "logindialog.h"
#include "ui_logindialog.h"
#include "ui_chatwindow.h"
#include "gui.h"

LoginDialog::LoginDialog(ChatWindow* chatPointer,Gui* guiPointer) :
QDialog(nullptr),
ui(new Ui::LoginDialog)
{
    ui->setupUi(this);
    this->setFixedSize(this->width(),this->height());
    ui->inputServer->setPlaceholderText("Example: name.server.com");
    ui->inputName->setPlaceholderText("Example: Name (max 32 characters)");
    ui->inputName->setInputMask("NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN");
    mainWindow = chatPointer;
    chatGui = guiPointer;
}

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

void LoginDialog::on_buttonBox_rejected()
{
    this->close();
    mainWindow->close();
}

void LoginDialog::on_buttonBox_accepted()
{   ui->errorMessage->setText("");
    if (ui->inputName->text()=="User"){
        ui->errorMessage->setText("Name not allowed");
    }
    else{
        chatGui->createClient(ui->inputName->text(),ui->inputServer->text());
    }
{'fraction_non_alphanumeric': 0.16957210776545167, 'fraction_numerical': 0.0021130480718436345, 'mean_word_length': 5.398648648648648, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 45, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, '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': '1313255', 'n_tokens_mistral': 635, 'n_tokens_neox': 637, 'n_words': 88}