/*
Copyright (c) 2007 Matt Williams matt@milliams.com

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License or (at
your option) version 3 or, at the discretion of KDE e.V. (which shall
act as a proxy as in section 14 of the GPLv3), any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

#include "keducachoiceeditor.h"

#include <QStandardItemModel>

KEducaChoiceEditor::KEducaChoiceEditor(QWidget* parent) : QWidget(parent)
{
    setupUi(this);
    mModel = new QStandardItemModel();
    choicesTableView->setModel(mModel);
    choicesButtonBox->addButton(i18n("Add"), QDialogButtonBox::ActionRole, this, SLOT(addChoice()));
    choicesButtonBox->addButton(i18n("Remove"), QDialogButtonBox::DestructiveRole, this, SLOT(removeChoice()));
    choicesButtonBox->addButton(i18n("Move up"), QDialogButtonBox::ActionRole, this, SLOT(moveChoiceUp()));
    choicesButtonBox->addButton(i18n("Move down"), QDialogButtonBox::ActionRole, this, SLOT(moveChoiceDown()));
}

KEducaChoiceEditor::~KEducaChoiceEditor()
{
}

void KEducaChoiceEditor::addChoice()
{
    QList<QStandardItem*> list;
    list.append(new QStandardItem(i18n("Choice")));
    list.append(new QStandardItem(i18n("yes"))); //TODO make checkbox
    list.append(new QStandardItem(i18n("0"))); //make a spin-box
    mModel->appendRow(list);
}

void KEducaChoiceEditor::removeChoice()
{
    choicesTableView->currentIndex();
}

void KEducaChoiceEditor::moveChoiceUp()
{
}

void KEducaChoiceEditor::moveChoiceDown()
{
}

#include "keducachoiceeditor.moc"
