#include "Dialog_choose.h"


namespace MM
{

Dialog_choose::
Dialog_choose (Text const& question, Array <Text> const& list, QWidget *parent)
:
    QDialog  (parent)/*,
    question_(question),
    list_    (list)*/
{
    setupUi (this);

    label->setText (question);

    for (int i=0;  i<list.size();  ++i)
        listWidget->addItem (list[i]);


    connect (pushButton_OK,     SIGNAL (clicked()),
             this,              SLOT   (accept()));

    connect (pushButton_Cancel, SIGNAL (clicked()),
             this,              SLOT   (reject()));
}

Text Dialog_choose::
text ()
{
    return listWidget->currentItem()->text ();
}

int Dialog_choose::
n ()
{
    return listWidget->currentRow ();
}

}//MM
