29
|
1 |
/*
|
|
2 |
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
3 |
* All rights reserved.
|
|
4 |
* This component and the accompanying materials are made available
|
|
5 |
* under the terms of "Eclipse Public License v1.0""
|
|
6 |
* which accompanies this distribution, and is available
|
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
8 |
*
|
|
9 |
* Initial Contributors:
|
|
10 |
* Nokia Corporation - initial contribution.
|
|
11 |
*
|
|
12 |
* Contributors:
|
|
13 |
*
|
|
14 |
* Description:
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
#include "btcpuisettingitem.h"
|
|
19 |
#include <cpitemdatahelper.h>
|
|
20 |
|
|
21 |
#include <HbInstance>
|
|
22 |
|
|
23 |
BtCpUiSettingItem::BtCpUiSettingItem(CpItemDataHelper &itemDataHelper,
|
|
24 |
const QString &text /*= QString()*/,
|
|
25 |
const QString &description /*= QString()*/,
|
|
26 |
const HbIcon &icon /*= HbIcon()*/,
|
|
27 |
const HbDataFormModelItem *parent /*= 0*/)
|
|
28 |
: CpSettingFormEntryItemData(itemDataHelper,
|
|
29 |
text,
|
|
30 |
description,
|
|
31 |
icon,
|
|
32 |
parent)
|
|
33 |
{
|
|
34 |
}
|
|
35 |
|
|
36 |
BtCpUiSettingItem::~BtCpUiSettingItem()
|
|
37 |
{
|
|
38 |
|
|
39 |
}
|
|
40 |
|
|
41 |
void BtCpUiSettingItem::onLaunchView()
|
|
42 |
{
|
|
43 |
mModel = new BtuiModel();
|
|
44 |
|
|
45 |
mMainWindow = hbInstance->allMainWindows().first();
|
|
46 |
|
|
47 |
mBtMainView = new BtCpUiMainView(*mModel);
|
|
48 |
|
|
49 |
mCpView = mMainWindow->currentView();
|
|
50 |
|
|
51 |
mMainWindow->addView(mBtMainView);
|
|
52 |
mMainWindow->setCurrentView(mBtMainView);
|
|
53 |
|
|
54 |
connect(mBtMainView, SIGNAL(aboutToClose()), this, SLOT(handleCloseView()));
|
|
55 |
|
|
56 |
}
|
|
57 |
|
|
58 |
void BtCpUiSettingItem::handleCloseView()
|
|
59 |
{
|
|
60 |
mBtMainView->deactivateView();
|
|
61 |
mMainWindow->setCurrentView(mCpView);
|
|
62 |
delete mBtMainView;
|
|
63 |
delete mModel;
|
|
64 |
}
|
|
65 |
|
|
66 |
|
|
67 |
CpBaseSettingView *BtCpUiSettingItem::createSettingView() const
|
|
68 |
{
|
|
69 |
return 0;
|
|
70 |
}
|