|
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 #include "cpprofileactivatorentryitem.h" |
|
18 |
|
19 #include "cpprofileactivatordialog.h" |
|
20 #include <cpitemdatahelper.h> |
|
21 #include <cpprofilemodel.h> |
|
22 #include <QScopedPointer> |
|
23 CpProfileActivatorEntryItem::CpProfileActivatorEntryItem(CpItemDataHelper &itemDataHelper, |
|
24 const QString &text, |
|
25 const QString &description, |
|
26 const HbIcon &icon, |
|
27 const HbDataFormModelItem *parent) |
|
28 :CpSettingFormEntryItemData(itemDataHelper,text,description, |
|
29 icon,parent) |
|
30 { |
|
31 mProfileModel = new CpProfileModel(); |
|
32 int currentId = mProfileModel->activeProfileId(); |
|
33 QString currentName = mProfileModel->profileName(currentId); |
|
34 this->setDescription(currentName); |
|
35 } |
|
36 CpProfileActivatorEntryItem::~CpProfileActivatorEntryItem() |
|
37 { |
|
38 delete mProfileModel; |
|
39 } |
|
40 void CpProfileActivatorEntryItem::onLaunchView() |
|
41 { |
|
42 QScopedPointer<CpProfileActivatorDialog> dialog |
|
43 (new CpProfileActivatorDialog(this, *mProfileModel)); |
|
44 dialog->exec(); |
|
45 // //launch media fetcher |
|
46 // if (!mReq) |
|
47 // { |
|
48 // mReq = mAppMgr.create("com.nokia.services.media.Music", "fetch(QString)", true); |
|
49 // |
|
50 // if (!mReq) |
|
51 // { |
|
52 // return; |
|
53 // } |
|
54 // else |
|
55 // { |
|
56 // connect(mReq, SIGNAL(requestOk(const QVariant&)), SLOT(handleOk(const QVariant&))); |
|
57 // connect(mReq, SIGNAL(requestError(int,const QString&)), SLOT(handleError(int,const QString&))); |
|
58 // } |
|
59 // } |
|
60 // |
|
61 // // Set arguments for request (music fetcher application title) |
|
62 // QList<QVariant> args; |
|
63 // args << QVariant( text() ); |
|
64 // mReq->setArguments(args); |
|
65 // |
|
66 // // Make the request |
|
67 // if (!mReq->send()) |
|
68 // { |
|
69 // //report error |
|
70 // return; |
|
71 // } |
|
72 |
|
73 } |
|
74 /*void CpPersonalizationEntryItemData::handleOk(const QVariant &result) |
|
75 { |
|
76 if (!result.canConvert<QString>()) |
|
77 { |
|
78 setDescription( "Corrupt result" ); |
|
79 } |
|
80 else |
|
81 { |
|
82 setDescription( result.value<QString>() ); |
|
83 } |
|
84 } |
|
85 void CpPersonalizationEntryItemData::handleError(int errorCode, const QString& errorMessage) |
|
86 { |
|
87 // |
|
88 Q_UNUSED(errorCode); |
|
89 Q_UNUSED(errorMessage); |
|
90 setDescription("Error"); |
|
91 }*/ |
|
92 |
|
93 CpBaseSettingView *CpProfileActivatorEntryItem::createSettingView() const |
|
94 { |
|
95 return 0; |
|
96 } |