bluetoothengine/btui/btcpplugin/btcpuisettingitem.cpp
author hgs
Mon, 17 May 2010 11:06:23 +0300
changeset 31 a0ea99b6fa53
parent 29 48ae3789ce00
child 40 997690c3397a
child 42 b72428996822
permissions -rw-r--r--
201019_1

/*
 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0""
 * which accompanies this distribution, and is available
 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
 *
 * Initial Contributors:
 * Nokia Corporation - initial contribution.
 *
 * Contributors:
 *
 * Description:  
 *   
 */

#include "btcpuisettingitem.h"
#include <cpitemdatahelper.h>

#include <HbInstance>

BtCpUiSettingItem::BtCpUiSettingItem(CpItemDataHelper &itemDataHelper,
													   const QString &text /*= QString()*/,
													   const QString &description /*= QString()*/,
													   const HbIcon &icon /*= HbIcon()*/,
													   const HbDataFormModelItem *parent /*= 0*/)
													   : CpSettingFormEntryItemData(itemDataHelper,
													   text,
													   description,
													   icon,
													   parent)
{
}

BtCpUiSettingItem::~BtCpUiSettingItem()
{

}

void BtCpUiSettingItem::onLaunchView()
{
    mSettingModel = new BtSettingModel(this);
    mDeviceModel = new BtDeviceModel(this);
    
    mMainWindow = hbInstance->allMainWindows().first();
    
    mBtMainView = new BtCpUiMainView(*mSettingModel, *mDeviceModel);
    
    mCpView = mMainWindow->currentView();
    
    mMainWindow->addView(mBtMainView);
    mMainWindow->setCurrentView(mBtMainView);
    
    connect(mBtMainView, SIGNAL(aboutToClose()), this, SLOT(handleCloseView()));
    
}

void BtCpUiSettingItem::handleCloseView()
{
    mBtMainView->deactivateView();
    mMainWindow->setCurrentView(mCpView);
}


CpBaseSettingView *BtCpUiSettingItem::createSettingView() const
{
	return 0;
}