21 #include <QPluginLoader> |
21 #include <QPluginLoader> |
22 #include <QStringList> |
22 #include <QStringList> |
23 #include <HbDataform> |
23 #include <HbDataform> |
24 #include <HbDataFormModel> |
24 #include <HbDataFormModel> |
25 #include <HbDataFormViewItem> |
25 #include <HbDataFormViewItem> |
|
26 #include <HbParameterLengthLimiter> |
26 #include <cpbasesettingview.h> |
27 #include <cpbasesettingview.h> |
27 #include <cpitemdatahelper.h> |
28 #include <cpitemdatahelper.h> |
28 #include <cpsettingformentryitemdataimpl.h> |
29 #include <cpsettingformentryitemdataimpl.h> |
29 #include <cpsettingformitemdata.h> |
30 #include <cpsettingformitemdata.h> |
30 #include <cmmanager_shim.h> |
31 #include <cmmanager_shim.h> |
131 destDataItem->setContentWidgetData(QString("text"), dest); |
132 destDataItem->setContentWidgetData(QString("text"), dest); |
132 destDataItem->setContentWidgetData(QString("additionalText"), iapCount); |
133 destDataItem->setContentWidgetData(QString("additionalText"), iapCount); |
133 destDataItem->setDestinationId(destId); |
134 destDataItem->setDestinationId(destId); |
134 destDataItem->setDestinationName(dest); |
135 destDataItem->setDestinationName(dest); |
135 connect(destDataItem, SIGNAL(destChanged()), this, SLOT(updateDestinationInformation())); |
136 connect(destDataItem, SIGNAL(destChanged()), this, SLOT(updateDestinationInformation())); |
136 |
|
137 // Use ItemDataHelper to make connections |
|
138 QObject* form = this->model()->parent(); |
|
139 mItemDataHelper->bindToForm(static_cast<HbDataForm*>(form)); |
|
140 |
137 |
141 // Insert Child to correct position |
138 // Insert Child to correct position |
142 QList<QSharedPointer<CmDestinationShim> > destinationList; |
139 QList<QSharedPointer<CmDestinationShim> > destinationList; |
143 fetchDestinations(destinationList); |
140 fetchDestinations(destinationList); |
144 insertChild(destinationList.count() - 1, destDataItem); |
141 insertChild(destinationList.count() - 1, destDataItem); |
234 |
231 |
235 QString iapCount = getDestinationAdditionalText(apCount); |
232 QString iapCount = getDestinationAdditionalText(apCount); |
236 destDataItem->setContentWidgetData(QString("additionalText"), iapCount); |
233 destDataItem->setContentWidgetData(QString("additionalText"), iapCount); |
237 destDataItem->setContentWidgetData(QString("text"), destDataItem->destinationName()); |
234 destDataItem->setContentWidgetData(QString("text"), destDataItem->destinationName()); |
238 } |
235 } |
239 // Update UI |
|
240 HbDataForm *form = static_cast<HbDataForm*>(this->model()->parent()); |
|
241 HbDataFormModel* model = static_cast<HbDataFormModel*>(this->model()); |
|
242 QModelIndex index = model->indexFromItem(this); |
|
243 HbDataFormViewItem *viewItem = form->dataFormViewItem(index); |
|
244 viewItem->setExpanded(false); |
|
245 viewItem->setExpanded(true); |
|
246 OstTraceFunctionExit0(CPDESTINATIONGROUP_UPDATEDESTINATIONINFORMATION_EXIT); |
236 OstTraceFunctionExit0(CPDESTINATIONGROUP_UPDATEDESTINATIONINFORMATION_EXIT); |
247 } |
237 } |
248 |
238 |
249 /*! |
239 /*! |
250 Creates item for uncategorized access points to destination group item |
240 Creates item for uncategorized access points to destination group item |
334 QString CpDestinationGroup::getDestinationAdditionalText(int iapCount) |
324 QString CpDestinationGroup::getDestinationAdditionalText(int iapCount) |
335 { |
325 { |
336 OstTraceFunctionEntry0(CPDESTINATIONGROUP_GETDESTINATIONADDITIONALTEXT_ENTRY); |
326 OstTraceFunctionEntry0(CPDESTINATIONGROUP_GETDESTINATIONADDITIONALTEXT_ENTRY); |
337 QString result = ""; |
327 QString result = ""; |
338 if (iapCount > 0) { |
328 if (iapCount > 0) { |
339 result = hbTrId("txt_occ_dblist_internet_val_ln_access_points", iapCount); |
329 //result = hbTrId("txt_occ_dblist_internet_val_ln_access_points", iapCount); |
|
330 result = HbParameterLengthLimiter("txt_occ_dblist_internet_val_ln_access_points").arg(iapCount); |
340 } else { |
331 } else { |
341 result = hbTrId("txt_occ_dblist_internet_val_no_access_points"); |
332 result = hbTrId("txt_occ_dblist_internet_val_no_access_points"); |
342 } |
333 } |
343 OstTrace0(TRACE_FLOW, CPDESTINATIONGROUP_GETDESTINATIONADDITIONALTEXT_EXIT, "Exit"); |
334 OstTrace0(TRACE_FLOW, CPDESTINATIONGROUP_GETDESTINATIONADDITIONALTEXT_EXIT, "Exit"); |
344 return result; |
335 return result; |