22 |
22 |
23 /*! |
23 /*! |
24 CpNetworkPlugin::CpNetworkPlugin |
24 CpNetworkPlugin::CpNetworkPlugin |
25 */ |
25 */ |
26 CpNetworkPlugin::CpNetworkPlugin() : |
26 CpNetworkPlugin::CpNetworkPlugin() : |
27 QObject(0), |
27 QObject(NULL), |
28 m_localisation(0) |
28 m_localisation(NULL), |
|
29 m_networkStatus(NULL) |
29 { |
30 { |
30 INSTALL_TRACE_MSG_HANDLER; |
31 INSTALL_TRACE_MSG_HANDLER; |
31 DPRINT << ": IN"; |
32 DPRINT << ": IN"; |
32 |
33 |
33 // Set scoped pointer |
34 // Create guarded objects |
34 m_localisation.reset(new CpPhoneLocalisation); |
35 m_localisation.reset(new CpPhoneLocalisation); |
|
36 m_networkStatus.reset(new CpNetworkStatus); |
35 |
37 |
36 // Install required translations |
38 // Install required translations |
37 m_localisation->installTranslator( |
39 m_localisation->installTranslator( |
38 CpPhoneLocalisation:: |
40 CpPhoneLocalisation:: |
39 TranslationFileCommon); |
41 TranslationFileCommon); |
55 /*! |
57 /*! |
56 CpNetworkPlugin::createSettingFormItemData |
58 CpNetworkPlugin::createSettingFormItemData |
57 */ |
59 */ |
58 QList<CpSettingFormItemData*> CpNetworkPlugin::createSettingFormItemData( |
60 QList<CpSettingFormItemData*> CpNetworkPlugin::createSettingFormItemData( |
59 CpItemDataHelper &itemDataHelper) const |
61 CpItemDataHelper &itemDataHelper) const |
60 { |
62 { |
61 DPRINT; |
63 DPRINT << ": IN"; |
62 |
|
63 QList<CpSettingFormItemData*> ret; |
64 QList<CpSettingFormItemData*> ret; |
64 ret.append(new CpSettingFormEntryItemDataImpl<CpNetworkPluginView>( |
65 ret.append(new CpSettingFormEntryItemDataImpl<CpNetworkPluginView>( |
65 itemDataHelper, |
66 itemDataHelper, |
66 hbTrId("txt_cp_dblist_mobile_network"), |
67 hbTrId("txt_cp_dblist_mobile_network"), |
67 hbTrId(""))); |
68 m_networkStatus->statusText(), |
|
69 m_networkStatus->statusIcon())); |
|
70 |
|
71 m_networkStatus->setSettingFormItemData(ret.first()); |
|
72 |
|
73 DPRINT << ": OUT"; |
68 return ret; |
74 return ret; |
69 } |
75 } |
70 |
76 |
|
77 /*! |
|
78 CpNetworkPlugin::createSettingView |
|
79 */ |
|
80 CpBaseSettingView *CpNetworkPlugin::createSettingView(const QVariant &hint) const |
|
81 { |
|
82 Q_UNUSED(hint) |
|
83 DPRINT << ": IN"; |
|
84 |
|
85 CpItemDataHelper *itemDataHelper(NULL); |
|
86 QScopedPointer<CpSettingFormEntryItemDataImpl<CpNetworkPluginView> > |
|
87 data( new CpSettingFormEntryItemDataImpl<CpNetworkPluginView>( |
|
88 *itemDataHelper, |
|
89 hbTrId("txt_cp_dblist_mobile_network"), |
|
90 m_networkStatus->statusText())); |
|
91 CpBaseSettingView *view = data->createSettingView(); |
|
92 |
|
93 DPRINT << ": OUT"; |
|
94 return view; |
|
95 } |
|
96 |
|
97 Q_EXPORT_PLUGIN2(CpNetworkPlugin, CpNetworkPlugin); |
71 |
98 |
72 Q_EXPORT_PLUGIN2(CpNetworkPlugin, CpNetworkPlugin); |
|