controlpanel/tsrc/unit/pluginfortest/secondpluginfortest/src/secondpluginviewfortest.cpp
author hgs
Tue, 24 Aug 2010 10:30:25 +0800
changeset 52 58cebe0861a8
child 64 5136fef23c4b
permissions -rw-r--r--
201033

#include "secondpluginviewfortest.h"

#include <hbdataform.h>
#include <qstringlist>
#include <QDebug>
#include <hbdataformmodel.h>
#include <cpsettingformitemdata.h>
#include <hbmessagebox.h>

SecondPluginViewForTest::SecondPluginViewForTest(QGraphicsItem *parent) 
    : CpBaseSettingView(0,parent),
    mGroupItem(0),
    mSliderItem(0)
{
    HbDataForm *form = qobject_cast<HbDataForm*>(widget());
    if (form) {
        HbDataFormModel *model = new HbDataFormModel;
        
        form->setHeading(tr("View from test plugin"));
        mGroupItem = new HbDataFormModelItem(HbDataFormModelItem::GroupItem, QString("Group"));
        
        model->appendDataFormItem(mGroupItem);
        
        mSliderItem = new CpSettingFormItemData(HbDataFormModelItem::SliderItem,
                QString("New Slider"));
        mSliderItem->setContentWidgetData("iconEnabled","FALSE");
        form->addConnection(mSliderItem,SIGNAL(valueChanged(int)),this,SLOT(sliderValueChanged(int)));
        mGroupItem->appendChild(mSliderItem);      
        
        form->setModel(model);
    }
}
SecondPluginViewForTest::~SecondPluginViewForTest()
{
}

void SecondPluginViewForTest::testClose()
{
    close();
}
void SecondPluginViewForTest::sliderValueChanged(int value)
{
    //Disable the slider alert.
	HbMessageBox::information(QString("slider value changed to:%1").arg(value));
}