15 * Description: |
15 * Description: |
16 * |
16 * |
17 * ============================================================================== |
17 * ============================================================================== |
18 */ |
18 */ |
19 |
19 |
20 #include <stringresourcereader.h> |
|
21 #include <data_caging_path_literals.hrh> |
|
22 #include <bautils.h> |
20 #include <bautils.h> |
23 |
21 |
24 #include <dcmo.rsg> |
22 #include <hbtextresolversymbian.h> |
25 #include <btfeaturescfg.h> |
23 #include <btfeaturescfg.h> |
26 |
24 |
27 #include "btctrldcmoadapter.h" |
25 #include "btctrldcmoadapter.h" |
|
26 |
|
27 |
|
28 // ---------------------------------------------------------------------- |
|
29 |
|
30 #ifndef DBG |
|
31 #ifdef _DEBUG |
|
32 #define DBG(a) a |
|
33 #else |
|
34 #define DBG(a) |
|
35 #endif |
|
36 #endif |
|
37 |
|
38 // ---------------------------------------------------------------------- |
28 |
39 |
29 _LIT(KBluetoothDcmoPanicName, "BT DCMO Adapter"); |
40 _LIT(KBluetoothDcmoPanicName, "BT DCMO Adapter"); |
30 |
41 |
31 _LIT( KBluetoothControlProperty, "Bluetooth" ); |
42 _LIT( KBluetoothControlProperty, "Bluetooth" ); |
32 _LIT( KDisableBluetoothDescription, "Used to enable/disable the Bluetooth connectivity." ); // Description |
43 _LIT( KDisableBluetoothDescription, "Used to enable/disable the Bluetooth connectivity." ); // Description |
33 _LIT( KRuntimeResourceFileName, "z:dcmo.rsc" ); |
44 _LIT( KdcmoResourceFileName, "deviceupdates_" ); |
|
45 _LIT( KdcmoResourceFilePath, "z:/resource/qt/translations/" ); |
34 |
46 |
35 TDCMOStatus CBluetoothCtrlDcmoAdapter::MapFeatureControlError(TInt aErrorCode) |
47 TDCMOStatus CBluetoothCtrlDcmoAdapter::MapFeatureControlError(TInt aErrorCode) |
36 { |
48 { |
37 TDCMOStatus status = EDcmoFail; |
49 TDCMOStatus status = EDcmoFail; |
38 |
50 |
232 return status; |
244 return status; |
233 } |
245 } |
234 |
246 |
235 void CBluetoothCtrlDcmoAdapter::GetLocalizedNameL(HBufC*& aLocName) |
247 void CBluetoothCtrlDcmoAdapter::GetLocalizedNameL(HBufC*& aLocName) |
236 { |
248 { |
237 TFileName* fileName = new(ELeave) TFileName; |
249 TBool result = HbTextResolverSymbian::Init(KdcmoResourceFileName, KdcmoResourceFilePath ); |
238 CleanupStack::PushL(fileName); |
250 _LIT(KTextBluetooth, "txt_device_update_info_bluetooth"); |
239 TParse* parseObj = new(ELeave) TParse(); |
251 aLocName = HbTextResolverSymbian::LoadL(KTextBluetooth); |
240 CleanupStack::PushL(parseObj); |
252 DBG(RDebug::Print(aLocName->Des())); |
241 User::LeaveIfError(parseObj->Set(KRuntimeResourceFileName(), &KDC_RESOURCE_FILES_DIR, NULL)); |
|
242 *fileName = parseObj->FullName(); |
|
243 CleanupStack::PopAndDestroy(parseObj); |
|
244 |
|
245 CStringResourceReader* resReader = CStringResourceReader::NewL(*fileName); |
|
246 CleanupStack::PushL(resReader); |
|
247 |
|
248 TPtrC buf; |
|
249 buf.Set(resReader->ReadResourceString(R_DM_RUN_TIME_VAR_BLUETOOTH)); |
|
250 aLocName = buf.AllocL() ; |
|
251 |
|
252 CleanupStack::PopAndDestroy(2,fileName); //resReader,fileName |
|
253 } |
253 } |
254 |
254 |
255 void CBluetoothCtrlDcmoAdapter::Panic(TBluetoothDcmoPanic aPanic) |
255 void CBluetoothCtrlDcmoAdapter::Panic(TBluetoothDcmoPanic aPanic) |
256 { |
256 { |
257 User::Panic(KBluetoothDcmoPanicName, aPanic); |
257 User::Panic(KBluetoothDcmoPanicName, aPanic); |