2012-07-10 15:38:12 +00:00
|
|
|
#include "inputlayers.h"
|
|
|
|
|
|
|
|
#include <QLabel>
|
|
|
|
#include <QPushButton>
|
2012-07-10 19:39:12 +00:00
|
|
|
#include "dialoglayers.h"
|
2012-07-10 15:38:12 +00:00
|
|
|
|
2012-07-10 19:39:12 +00:00
|
|
|
InputLayers::InputLayers(QWidget* form, QString label, Layers* value, FormLayerBuilder form_builder):
|
2012-07-10 15:38:12 +00:00
|
|
|
BaseInput(form, label)
|
|
|
|
{
|
|
|
|
_value = value;
|
2012-07-10 19:39:12 +00:00
|
|
|
_form_builder = form_builder;
|
2012-07-10 15:38:12 +00:00
|
|
|
|
|
|
|
_preview = new QLabel(form);
|
|
|
|
((QLabel*)_preview)->setAlignment(Qt::AlignCenter);
|
|
|
|
_control = new QPushButton(tr("Editer"), form);
|
2012-07-10 19:39:12 +00:00
|
|
|
|
|
|
|
connect(_control, SIGNAL(clicked()), this, SLOT(editLayers()));
|
2012-07-10 15:38:12 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void InputLayers::updatePreview()
|
|
|
|
{
|
|
|
|
((QLabel*)_preview)->setText(tr("%1 layers").arg(layersCount(_value)));
|
|
|
|
|
|
|
|
BaseInput::updatePreview();
|
|
|
|
}
|
2012-07-10 19:39:12 +00:00
|
|
|
|
|
|
|
void InputLayers::editLayers()
|
|
|
|
{
|
|
|
|
if (DialogLayers::editLayers(_control, _value, _label->text(), _form_builder))
|
|
|
|
{
|
2012-07-11 13:18:43 +00:00
|
|
|
applyValue();
|
2012-07-10 19:39:12 +00:00
|
|
|
}
|
|
|
|
}
|