btobexprofiles/obexserviceman/utils/src/obexutilsdialog.cpp
changeset 41 0b2439c3e397
parent 40 997690c3397a
child 63 bcf742120177
equal deleted inserted replaced
40:997690c3397a 41:0b2439c3e397
   114 EXPORT_C void CObexUtilsDialog::LaunchProgressDialogL(
   114 EXPORT_C void CObexUtilsDialog::LaunchProgressDialogL(
   115     MObexUtilsProgressObserver* aObserverPtr, TInt aFileCount, 
   115     MObexUtilsProgressObserver* aObserverPtr, TInt aFileCount, 
   116     const TDesC& aDeviceName, TInt aTimeoutValue )
   116     const TDesC& aDeviceName, TInt aTimeoutValue )
   117     {
   117     {
   118     FLOG(_L("[OBEXUTILS]\t CObexUtilsDialog::LaunchProgressDialogL()"));
   118     FLOG(_L("[OBEXUTILS]\t CObexUtilsDialog::LaunchProgressDialogL()"));
   119 
   119     
       
   120     TBuf<KMinStringSize> key;
   120     if ( aObserverPtr )
   121     if ( aObserverPtr )
   121         {
   122         {
   122         // The observerPtr was given, so store it and start a timer
   123         // The observerPtr was given, so store it and start a timer
   123         //
   124         //
   124         iProgressObserverPtr = aObserverPtr;
   125         iProgressObserverPtr = aObserverPtr;
   136     iDeviceName.CreateL(aDeviceName);
   137     iDeviceName.CreateL(aDeviceName);
   137     iProgressDialog = CHbDeviceDialogSymbian::NewL();
   138     iProgressDialog = CHbDeviceDialogSymbian::NewL();
   138     
   139     
   139     CHbSymbianVariantMap* map = CHbSymbianVariantMap::NewL();
   140     CHbSymbianVariantMap* map = CHbSymbianVariantMap::NewL();
   140     CleanupStack::PushL(map);
   141     CleanupStack::PushL(map);
   141     TBuf<KMinStringSize> key;
       
   142     TInt data = TBluetoothDialogParams::ESend;
   142     TInt data = TBluetoothDialogParams::ESend;
   143     key.Num(TBluetoothDialogParams::EDialogType);
   143     key.Num(TBluetoothDialogParams::EDialogType);
   144     AddDataL( map, key, &data, CHbSymbianVariant::EInt );
   144     AddDataL( map, key, &data, CHbSymbianVariant::EInt );
   145     iProgressDialog->Show(KSendingDialog(),*map,this);
   145     User::LeaveIfError(iProgressDialog->Show(KSendingDialog(),*map,this));
   146     CleanupStack::PopAndDestroy(map);    
   146     CleanupStack::PopAndDestroy(map);    
   147 
   147 
   148     if ( iProgressObserverPtr )
   148     if ( iProgressObserverPtr )
   149         {
   149         {
   150         iObexDialogTimer->Tickle();
   150         iObexDialogTimer->Tickle();
   418     delete iObexDialogTimer;
   418     delete iObexDialogTimer;
   419     iObexDialogTimer = NULL;
   419     iObexDialogTimer = NULL;
   420     delete iProgressDialog;
   420     delete iProgressDialog;
   421     iProgressDialog = NULL;  
   421     iProgressDialog = NULL;  
   422     
   422     
   423     TRAP_IGNORE(
   423     TBool ok = HbTextResolverSymbian::Init(KLocFileName, KPath);
   424              TBool ok = HbTextResolverSymbian::Init(KLocFileName, KPath);
   424     if(ok)
   425              if (!ok) 
   425         {
   426                  {
   426         TRAP_IGNORE(
   427                  User::Leave( KErrNotFound );
   427                  HBufC* deviceName = HbTextResolverSymbian::LoadLC(KDeviceText,iDeviceName);
   428                  }
   428                  HBufC* sendText = HbTextResolverSymbian::LoadLC(KSendingCancelledText);
   429              HBufC* deviceName = HbTextResolverSymbian::LoadLC(KDeviceText,iDeviceName);
   429                  CHbDeviceNotificationDialogSymbian::NotificationL(
   430 			 HBufC* sendText = HbTextResolverSymbian::LoadLC(KSendingCancelledText);
   430                          KNullDesC, deviceName->Des(), sendText->Des());
   431              CHbDeviceNotificationDialogSymbian::NotificationL(
   431                  CleanupStack::PopAndDestroy( sendText );		 
   432                      KNullDesC, deviceName->Des(), sendText->Des());
   432                  CleanupStack::PopAndDestroy( deviceName );
   433  			 CleanupStack::PopAndDestroy( sendText );		 
   433                 );
   434              CleanupStack::PopAndDestroy( deviceName );
   434         }
   435             );
   435     else
   436 
   436         {
       
   437         CHbDeviceNotificationDialogSymbian::NotificationL(
       
   438                 KNullDesC, KDeviceText(), KSendingCancelledText());
       
   439         }
   437     if ( iDialogObserverPtr )
   440     if ( iDialogObserverPtr )
   438         {
   441         {
   439         iDialogObserverPtr->DialogDismissed(ECancelButton);
   442         iDialogObserverPtr->DialogDismissed(ECancelButton);
   440         }
   443         }
   441     }
   444     }