<commit_before>/*!
  \copyright (c) RDO-Team, 2013
  \file      new_model_dialog.cpp
  \author    <NAME> (<EMAIL>)
  \date      04.01.2013
  \brief     
  \indent    4T
*/

// ---------------------------------------------------------------------------- PCH
#include "app/rdo_studio/pch/stdpch.h"
// ----------------------------------------------------------------------- INCLUDES
#include "utils/warning_disable.h"
#include <QDir>
#include <QFileDialog>
#include "utils/warning_enable.h"
// ----------------------------------------------------------------------- SYNOPSIS
#include "app/rdo_studio/src/dialog/new_model_dialog.h"
// --------------------------------------------------------------------------------

NewModelDialog::NewModelDialog(QWidget* pParent)
	: QDialog(pParent, Qt::Dialog | Qt::CustomizeWindowHint | Qt::WindowTitleHint | Qt::WindowCloseButtonHint)
{
	setupUi(this);

	layout()->setSizeConstraint(QLayout::SetFixedSize);

	m_font    = labelError->font();
	m_fontRed = m_font;
	m_fontRed.setBold(true);

	m_palette    = labelError->palette();
	m_paletteRed = m_palette;
	m_paletteRed.setColor(labelError->foregroundRole(), Qt::red);

	connect(modelName, SIGNAL(textChanged(const QString&)), this, SLOT(updateUI()));
	connect(modelPathButton, SIGNAL(clicked(bool)), this, SLOT(onPathButtonClicked()));

	setPath(QDir::homePath());
}

NewModelDialog::~NewModelDialog()
{}

void NewModelDialog::setPath(CREF(QString) path)
{
	QString normPath(path);
	if (!normPath.isEmpty())
	{
		if (normPath.at(normPath.length()-1) != QChar('/') && normPath.at(normPath.length()-1) != QChar('\\'))
		{
			normPath += "/";<commit_msg> - для новой модели выбирается папка документы<commit_after>/*!
  \copyright (c) RDO-Team, 2013
  \file      new_model_dialog.cpp
  \author    <NAME> (<EMAIL>)
  \date      04.01.2013
  \brief     
  \indent    4T
*/

// ---------------------------------------------------------------------------- PCH
#include "app/rdo_studio/pch/stdpch.h"
// ----------------------------------------------------------------------- INCLUDES
#include "utils/warning_disable.h"
#include <QDir>
#include <QFileDialog>
#include <QStandardPaths>
#include "utils/warning_enable.h"
// ----------------------------------------------------------------------- SYNOPSIS
#include "app/rdo_studio/src/dialog/new_model_dialog.h"
// --------------------------------------------------------------------------------

NewModelDialog::NewModelDialog(QWidget* pParent)
	: QDialog(pParent, Qt::Dialog | Qt::CustomizeWindowHint | Qt::WindowTitleHint | Qt::WindowCloseButtonHint)
{
	setupUi(this);

	layout()->setSizeConstraint(QLayout::SetFixedSize);

	m_font    = labelError->font();
	m_fontRed = m_font;
	m_fontRed.setBold(true);

	m_palette    = labelError->palette();
	m_paletteRed = m_palette;
	m_paletteRed.setColor(labelError->foregroundRole(), Qt::red);

	connect(modelName, SIGNAL(textChanged(const QString&)), this, SLOT(updateUI()));
	connect(modelPathButton, SIGNAL(clicked(bool)), this, SLOT(onPathButtonClicked()));

	QString path = QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation);
	if (path.isEmpty())
	{
		path = QDir::homePath();
	}
	setPath(path);
}

NewModelDialog::~NewModelDialog()
{}

void NewModelDialog::setPath(CREF(QString) path)
{
	QString normPath(path);
	if (!normPath.isEmpty())
	{
		if (normPath.at(normPath.length()-1) != QChar('/') && normPath.at(normPath.length()-1) != QChar('\\'))
		{
			normPath += "/";
{'fraction_non_alphanumeric': 0.31203007518796994, 'fraction_numerical': 0.008675534991324466, 'mean_word_length': 2.241799437675726, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 20, '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': '5104168', 'n_tokens_mistral': 1119, 'n_tokens_neox': 1080, 'n_words': 163}