#include <AddSingleNeuron.h>
#include <QtGui>


AddSingleNeuron::AddSingleNeuron()
{
    atLayer = new QLabel(tr("Add Neuron at Layer: "));
    layer = new QLineEdit();

    QIntValidator *val = new QIntValidator(0, 100, this);

    layer->setValidator(val);

    add = new QPushButton(tr("Add Neuron"));

    connect(add, SIGNAL(clicked()), this, SLOT(addN()));

    QHBoxLayout *h = new QHBoxLayout();
    h->addWidget(atLayer);
    h->addWidget(layer);

    QVBoxLayout *v = new QVBoxLayout();
    v->addLayout(h);
    v->addWidget(add);

    this->setLayout(v);
}

AddSingleNeuron::~AddSingleNeuron()
{

}

void AddSingleNeuron::addN()
{
    emit complete(layer->text().toInt());
    this->hide();
    this->close();
}

