#include <QHBoxLayout>
#include "dialoglistsubproc.h"

DialogListSubProc::DialogListSubProc(QWidget *parent) :
    QDialog(parent,
              Qt::WindowSystemMenuHint
            | Qt::WindowMaximizeButtonHint
            | Qt::WindowMinimizeButtonHint
            | Qt::WindowCloseButtonHint),
    listSubProcCtrl(nullptr)
{
    listSubProcCtrl = new ListSubProc(this);
    connect(listSubProcCtrl, &ListSubProc::signal_Accepted, this, &DialogListSubProc::slot_Accepted);

    QHBoxLayout *layout = new QHBoxLayout(this);
    layout->addWidget(listSubProcCtrl);
    this->setWindowTitle(tr("List subprocedures"));

    this->setMinimumSize(1400, 700);
    this->setModal(true);
}

DialogListSubProc::~DialogListSubProc()
{
    delete listSubProcCtrl;
}

void DialogListSubProc::closeEvent(QCloseEvent *event)
{
    listSubProcCtrl->close();
}

void DialogListSubProc::slot_Accepted()
{
    this->accept();
}

void DialogListSubProc::setTask(TaskAmmFim *task)
{
    listSubProcCtrl->setTask(task);
}

bool DialogListSubProc::getListCheckedSubProc(QList<SubProc>* listSubProc)
{
    return listSubProcCtrl->getListCheckedSubProc(listSubProc);
}
