# HG changeset patch # User hgs # Date 1287576415 -10800 # Node ID 083fd884d7dd0b886404976633af63295ecb7eb4 # Parent f5508c13dfe054c322c16abaf1d4164a84891fc4 201041_02 diff -r f5508c13dfe0 -r 083fd884d7dd bluetoothengine/btnotif/btdevicedialogplugin/inc/btdevicedialognotifwidget.h --- a/bluetoothengine/btnotif/btdevicedialogplugin/inc/btdevicedialognotifwidget.h Tue Oct 19 15:09:34 2010 +0300 +++ b/bluetoothengine/btnotif/btdevicedialogplugin/inc/btdevicedialognotifwidget.h Wed Oct 20 15:06:55 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -23,7 +23,7 @@ #include #include -#include +#include #include /*! diff -r f5508c13dfe0 -r 083fd884d7dd bluetoothengine/btnotif/btdevicedialogplugin/inc/btdevicedialogplugin.h --- a/bluetoothengine/btnotif/btdevicedialogplugin/inc/btdevicedialogplugin.h Tue Oct 19 15:09:34 2010 +0300 +++ b/bluetoothengine/btnotif/btdevicedialogplugin/inc/btdevicedialogplugin.h Wed Oct 20 15:06:55 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -71,6 +71,7 @@ HbTranslator* mDialogTranslator; HbTranslator* mViewTranslator; HbTranslator* mCommonErrorsTranslator; + HbTranslator* mCommonTranslator; }; #endif // BTDEVICEDIALOGPLUGIN_P_H diff -r f5508c13dfe0 -r 083fd884d7dd bluetoothengine/btnotif/btdevicedialogplugin/src/btdevicedialognotifwidget.cpp --- a/bluetoothengine/btnotif/btdevicedialogplugin/src/btdevicedialognotifwidget.cpp Tue Oct 19 15:09:34 2010 +0300 +++ b/bluetoothengine/btnotif/btdevicedialogplugin/src/btdevicedialognotifwidget.cpp Wed Oct 20 15:06:55 2010 +0300 @@ -20,7 +20,7 @@ #include "btdevicedialogplugintrace.h" #include #include -#include +#include #include #include "btdevicedialogpluginerrors.h" #include diff -r f5508c13dfe0 -r 083fd884d7dd bluetoothengine/btnotif/btdevicedialogplugin/src/btdevicedialogplugin.cpp --- a/bluetoothengine/btnotif/btdevicedialogplugin/src/btdevicedialogplugin.cpp Tue Oct 19 15:09:34 2010 +0300 +++ b/bluetoothengine/btnotif/btdevicedialogplugin/src/btdevicedialogplugin.cpp Wed Oct 20 15:06:55 2010 +0300 @@ -42,6 +42,7 @@ const char* BTDIALOG_TRANSLATION = "btdialogs"; const char* BTVIEW_TRANSLATION = "btviews"; const char* COMMON_ERRORS_TRANSLATION = "common_errors"; +const char* COMMON_TRANSLATION = "common"; // This plugin implements one device dialog type static const struct { @@ -69,7 +70,7 @@ BtDeviceDialogPlugin Constructor */ BtDeviceDialogPlugin::BtDeviceDialogPlugin(): - mDialogTranslator(0),mViewTranslator(0),mCommonErrorsTranslator(0) + mDialogTranslator(0),mViewTranslator(0),mCommonErrorsTranslator(0), mCommonTranslator(0) { d = new BtDeviceDialogPluginPrivate; } @@ -83,6 +84,7 @@ delete mDialogTranslator; delete mViewTranslator; delete mCommonErrorsTranslator; + delete mCommonTranslator; } /*! @@ -123,6 +125,10 @@ { mCommonErrorsTranslator = new HbTranslator(COMMON_ERRORS_TRANSLATION); } + if(!mCommonTranslator) + { + mCommonTranslator = new HbTranslator(COMMON_TRANSLATION); + } // verify that requested dialog type is supported const int numTypes = sizeof(noteInfos) / sizeof(noteInfos[0]); @@ -149,10 +155,31 @@ bool BtDeviceDialogPlugin::deviceDialogInfo(const QString &deviceDialogType, const QVariantMap ¶meters, DeviceDialogInfo *info) const { - Q_UNUSED(parameters) + Q_UNUSED(deviceDialogType) // set return values - info->group = GenericDeviceDialogGroup; + // Construct the key of EDialogType + QString keyStr; + keyStr.setNum( TBluetoothDialogParams::EDialogType ); + // Find the const iterator with key EDialogType + QVariantMap::const_iterator i = parameters.constFind( keyStr ); + + // item with key EDialogType is not found + if ( i == parameters.constEnd() ) { + d->mError = UnknownDeviceDialogError; + return false; + } + int type = i.value().toInt(); + if(type == TBluetoothDialogParams::EGlobalNotif || + type == TBluetoothDialogParams::ENote || + type == TBluetoothDialogParams::bt_054_d_entered_popup) + { + info->group = DeviceNotificationDialogGroup; + } + else + { + info->group = GenericDeviceDialogGroup; + } info->flags = NoDeviceDialogFlags; info->priority = DefaultPriority; return true; @@ -267,9 +294,6 @@ delete deviceDialog; deviceDialog = NULL; } - else { - d->mError = UnknownDeviceDialogError; - } } return deviceDialog; } diff -r f5508c13dfe0 -r 083fd884d7dd bluetoothengine/btnotif/btdevicedialogplugin/src/btrecvcompleteddialogwidget.cpp --- a/bluetoothengine/btnotif/btdevicedialogplugin/src/btrecvcompleteddialogwidget.cpp Tue Oct 19 15:09:34 2010 +0300 +++ b/bluetoothengine/btnotif/btdevicedialogplugin/src/btrecvcompleteddialogwidget.cpp Wed Oct 20 15:06:55 2010 +0300 @@ -110,10 +110,7 @@ { float sizeInMB = 0; sizeInMB = ((float)mFileSz ) / (1024*1024); - QString fileSzMb; - fileSzMb.setNum(sizeInMB); - //TODO - check for localization - fileSzMb.append(QString(" Mb")); + QString fileSzMb = QString(hbTrId("txt_common_info_l1_mb")).arg(sizeInMB); mFileSize->setPlainText(fileSzMb); } @@ -121,19 +118,13 @@ { TInt64 sizeInKB = 0; sizeInKB = mFileSz >> 10; - QString fileSzKb; - fileSzKb.setNum(sizeInKB); - //TODO - check for localization - fileSzKb.append(QString(" Kb")); + QString fileSzKb = QString(hbTrId("txt_common_info_l1_kb")).arg(sizeInKB); mFileSize->setPlainText(fileSzKb); } else // size is unknown or less than 1K { - QString fileSzB; - fileSzB.setNum(mFileSz); - //TODO - check for localization - fileSzB.append(QString(" Bytes")); + QString fileSzB = QString(hbTrId("txt_common_info_l1_byte")).arg(mFileSz); mFileSize->setPlainText(fileSzB); } diff -r f5508c13dfe0 -r 083fd884d7dd bluetoothengine/btnotif/btdevicedialogplugin/src/btrecvprgrsdialogwidget.cpp --- a/bluetoothengine/btnotif/btdevicedialogplugin/src/btrecvprgrsdialogwidget.cpp Tue Oct 19 15:09:34 2010 +0300 +++ b/bluetoothengine/btnotif/btdevicedialogplugin/src/btrecvprgrsdialogwidget.cpp Wed Oct 20 15:06:55 2010 +0300 @@ -125,10 +125,7 @@ { float sizeInMB = 0; sizeInMB = ((float)mFileSz ) / (1024*1024); - QString fileSzMb; - fileSzMb.setNum(sizeInMB); - //TODO - check for localization - fileSzMb.append(QString(" Mb")); + QString fileSzMb = QString(hbTrId("txt_common_info_l1_mb")).arg(sizeInMB); mFileSize->setPlainText(fileSzMb); } @@ -136,19 +133,13 @@ { TInt64 sizeInKB = 0; sizeInKB = mFileSz >> 10; - QString fileSzKb; - fileSzKb.setNum(sizeInKB); - //TODO - check for localization - fileSzKb.append(QString(" Kb")); + QString fileSzKb = QString(hbTrId("txt_common_info_l1_kb")).arg(sizeInKB); mFileSize->setPlainText(fileSzKb); } else // size is unknown or less than 1K { - QString fileSzB; - fileSzB.setNum(mFileSz); - //TODO - check for localization - fileSzB.append(QString(" Bytes")); + QString fileSzB = QString(hbTrId("txt_common_info_l1_byte")).arg(mFileSz); mFileSize->setPlainText(fileSzB); } diff -r f5508c13dfe0 -r 083fd884d7dd bluetoothengine/btnotif/btnotifsrv/src/bluetoothnotification.cpp --- a/bluetoothengine/btnotif/btnotifsrv/src/bluetoothnotification.cpp Tue Oct 19 15:09:34 2010 +0300 +++ b/bluetoothengine/btnotif/btnotifsrv/src/bluetoothnotification.cpp Wed Oct 20 15:06:55 2010 +0300 @@ -179,7 +179,7 @@ delete iReturnData; iReturnData = NULL; iReturnData = CHbSymbianVariantMap::NewL(); - iDialog->Show( KBTDevDialogId(), *iNotificationData, this ); + User::LeaveIfError(iDialog->Show( KBTDevDialogId(), *iNotificationData, this )); BOstraceFunctionExit1( DUMMY_DEVLIST, this ); } diff -r f5508c13dfe0 -r 083fd884d7dd btobexprofiles/obexserviceman/utils/src/obexutilsdialog.cpp --- a/btobexprofiles/obexserviceman/utils/src/obexutilsdialog.cpp Tue Oct 19 15:09:34 2010 +0300 +++ b/btobexprofiles/obexserviceman/utils/src/obexutilsdialog.cpp Wed Oct 20 15:06:55 2010 +0300 @@ -22,6 +22,7 @@ #include "obexutilsdebug.h" #include #include +#include _LIT(KSendingDialog, "com.nokia.hb.btdevicedialog/1.0"); _LIT(KCurrentFileIndex,"currentFileIdx" ); @@ -37,6 +38,13 @@ const TInt KMinStringSize = 10; const TInt KMaxDisplayFileName = 20; +_LIT(KLocFileName, "common_"); +_LIT(KPath, "z:/resource/qt/translations/"); + +_LIT(KFileSizeMb,"txt_common_info_l1_mb"); +_LIT(KFileSizeKb,"txt_common_info_l1_kb"); +_LIT(KFileSizeB,"txt_common_info_l1_byte"); + // ============================ MEMBER FUNCTIONS =============================== @@ -185,35 +193,58 @@ AddDataL( map, *key, &shortname, CHbSymbianVariant::EDes ); - // todo: localiation is needed for code below: HBufC* value = HBufC::NewL(KMaxDescriptionLength); CleanupStack::PushL(value); key->Des().Copy(KFileSizeTxt()); value->Des().Zero(); + TBool retVal = HbTextResolverSymbian::Init(KLocFileName, KPath); + //Format the file size into a more readable format if ( aFileSize >> 20 ) // size in MB { TReal32 sizeInMB = 0; sizeInMB = ((TReal32)aFileSize ) / (1024*1024); - value->Des().AppendNum(sizeInMB); - //TODO - check for localization - value->Des().Append(_L(" Mb")); + TBuf sizeInMbBuf; + sizeInMbBuf.AppendNum(sizeInMB); + if(retVal) + { + value = HbTextResolverSymbian::LoadL(KFileSizeMb, sizeInMbBuf); + } + else + { + value->Des().Append(KFileSizeMb()); + } } else if( aFileSize >> 10 ) // size in KB { TInt64 sizeInKB = 0; sizeInKB = aFileSize >> 10; - value->Des().AppendNum(sizeInKB); - //TODO - check for localization - value->Des().Append(_L(" Kb")); + TBuf sizeInKbBuf; + sizeInKbBuf.AppendNum(sizeInKB); + if(retVal) + { + value = HbTextResolverSymbian::LoadL(KFileSizeKb, sizeInKbBuf); + } + else + { + value->Des().Append(KFileSizeKb()); + } } else // size is unknown or less than 1K { - value->Des().AppendNum(aFileSize); - value->Des().Append(_L(" Bytes")); + TBuf sizeInBBuf; + sizeInBBuf.AppendNum(aFileSize); + if(retVal) + { + value = HbTextResolverSymbian::LoadL(KFileSizeB, sizeInBBuf); + } + else + { + value->Des().Append(KFileSizeB()); + } } diff -r f5508c13dfe0 -r 083fd884d7dd package_definition.xml --- a/package_definition.xml Tue Oct 19 15:09:34 2010 +0300 +++ b/package_definition.xml Wed Oct 20 15:06:55 2010 +0300 @@ -144,11 +144,6 @@ - - - - -