#ifndef BUTTONSELECTIONDIALOG_H
#define BUTTONSELECTIONDIALOG_H

#include "dialogbase.h"
#include "scrollingwidget.h"

class QButtonGroup;

class ButtonSelectionDialog : public DialogBase
{
    Q_OBJECT
public:
    ButtonSelectionDialog();

    template< class T>
    void setupDialog( bool isExclusive,  const QString &text,  int listHeight, const QStringList &tags, const QStringList &labels, QList<bool> areChecked, const QStringList &helps, bool noTags )
    {
        setText(text);
        m_buttonGroup->setExclusive(isExclusive);
        for( int idx = 0; idx < tags.size(); ++idx )
            addCheckbox( new T(m_fieldContainer->widget()), tags[idx], labels[idx], areChecked[idx], helps[idx], noTags);
        m_fieldContainer->setMaxLines( listHeight );
    }

protected slots:
    void slotInputAccepted();

private:
    void addCheckbox( QAbstractButton *button, const QString &tag, const QString &label, bool isChecked, const QString &help, bool noTag );
    QButtonGroup *m_buttonGroup;
    ScrollingWidget *m_fieldContainer;
};

#endif // BUTTONSELECTIONDIALOG_H

