author | hgs |
Fri, 15 Oct 2010 12:58:46 +0300 | |
changeset 78 | baacf668fe89 |
parent 76 | cfea66083b62 |
permissions | -rw-r--r-- |
37 | 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 <cpsettingformentryitemdataimpl.h> |
|
78 | 18 |
|
37 | 19 |
#include "cpnetworkplugin.h" |
20 |
#include "cpnetworkpluginview.h" |
|
21 |
#include "cppluginlogging.h" |
|
22 |
||
23 |
||
24 |
/*! |
|
25 |
CpNetworkPlugin::CpNetworkPlugin |
|
26 |
*/ |
|
27 |
CpNetworkPlugin::CpNetworkPlugin() : |
|
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
28 |
QObject(NULL), |
78 | 29 |
m_translator(NULL), |
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
30 |
m_networkStatus(NULL) |
37 | 31 |
{ |
32 |
INSTALL_TRACE_MSG_HANDLER; |
|
33 |
DPRINT << ": IN"; |
|
34 |
||
78 | 35 |
m_translator.reset(new HbTranslator(QString("telephone_cp"))); |
36 |
m_translator->loadCommon(); |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
37 |
m_networkStatus.reset(new CpNetworkStatus); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
38 |
|
37 | 39 |
DPRINT << ": OUT"; |
40 |
} |
|
41 |
||
42 |
||
43 |
/*! |
|
44 |
CpNetworkPlugin::~CpNetworkPlugin |
|
45 |
*/ |
|
46 |
CpNetworkPlugin::~CpNetworkPlugin() |
|
47 |
{ |
|
48 |
DPRINT; |
|
49 |
UNINSTALL_TRACE_MSG_HANDLER; |
|
50 |
} |
|
51 |
||
52 |
||
53 |
/*! |
|
54 |
CpNetworkPlugin::createSettingFormItemData |
|
55 |
*/ |
|
56 |
QList<CpSettingFormItemData*> CpNetworkPlugin::createSettingFormItemData( |
|
57 |
CpItemDataHelper &itemDataHelper) const |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
58 |
{ |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
59 |
DPRINT << ": IN"; |
37 | 60 |
QList<CpSettingFormItemData*> ret; |
61 |
ret.append(new CpSettingFormEntryItemDataImpl<CpNetworkPluginView>( |
|
62 |
itemDataHelper, |
|
63 |
hbTrId("txt_cp_dblist_mobile_network"), |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
64 |
m_networkStatus->statusText(), |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
65 |
m_networkStatus->statusIcon())); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
66 |
|
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
67 |
m_networkStatus->setSettingFormItemData(ret.first()); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
68 |
|
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
69 |
DPRINT << ": OUT"; |
37 | 70 |
return ret; |
71 |
} |
|
72 |
||
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
73 |
/*! |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
74 |
CpNetworkPlugin::createSettingView |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
75 |
*/ |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
76 |
CpBaseSettingView *CpNetworkPlugin::createSettingView(const QVariant &hint) const |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
77 |
{ |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
78 |
DPRINT << ": IN"; |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
79 |
|
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
80 |
CpItemDataHelper *itemDataHelper(NULL); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
81 |
QScopedPointer<CpSettingFormEntryItemDataImpl<CpNetworkPluginView> > |
50 | 82 |
data(new CpSettingFormEntryItemDataImpl<CpNetworkPluginView>( |
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
83 |
*itemDataHelper, |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
84 |
hbTrId("txt_cp_dblist_mobile_network"), |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
85 |
m_networkStatus->statusText())); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
86 |
CpBaseSettingView *view = data->createSettingView(); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
87 |
|
50 | 88 |
CpNetworkPluginView *networkPluginView = qobject_cast<CpNetworkPluginView*>(view); |
89 |
QVariantHash hash = hint.value<QVariantHash>(); |
|
90 |
if ((hash.value("command").toString().compare("searchAvailableNetworks",Qt::CaseInsensitive) == 0) && |
|
91 |
networkPluginView){ |
|
92 |
networkPluginView->searchAvailableNetworks(); |
|
93 |
} |
|
94 |
||
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
95 |
DPRINT << ": OUT"; |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
96 |
return view; |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
97 |
} |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
98 |
|
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
99 |
Q_EXPORT_PLUGIN2(CpNetworkPlugin, CpNetworkPlugin); |
37 | 100 |