appinstaller/AppinstUi/sisxsifplugin/src/sisxsifpluginuihandler.cpp
changeset 80 9dcba1ee99f7
parent 69 b18a4bf55ddb
equal deleted inserted replaced
77:d1838696558c 80:9dcba1ee99f7
    32 
    32 
    33 const TInt KFreeSpaceTreshold = 128*1024;   // bytes
    33 const TInt KFreeSpaceTreshold = 128*1024;   // bytes
    34 
    34 
    35 // TODO: replace with proper tracing support
    35 // TODO: replace with proper tracing support
    36 #ifdef _DEBUG
    36 #ifdef _DEBUG
    37 #define FLOG(x)         RDebug::Print(x);
    37 #define FLOG(x)         RDebug::Print(x)
    38 #define FLOG_1(x,y)     RDebug::Print(x, y);
    38 #define FLOG_1(x,y)     RDebug::Print((x),(y))
    39 #define FLOG_2(x,y,z)   RDebug::Print(x, y, z);
    39 #define FLOG_2(x,y,z)   RDebug::Print((x),(y),(z))
    40 #else
    40 #else
    41 #define FLOG(x)
    41 #define FLOG(x)
    42 #define FLOG_1(x,y)
    42 #define FLOG_1(x,y)
    43 #define FLOG_2(x,y,z)
    43 #define FLOG_2(x,y,z)
    44 #endif
    44 #endif
   101             break;
   101             break;
   102         default:
   102         default:
   103             break;
   103             break;
   104         }
   104         }
   105 
   105 
       
   106     FLOG_1( _L("CSisxSifPluginUiHandler::DisplayTextL, okToContinue=%d"), okToContinue );
   106     return okToContinue;
   107     return okToContinue;
   107     }
   108     }
   108 
   109 
   109 // ---------------------------------------------------------------------------
   110 // ---------------------------------------------------------------------------
   110 // CSisxSifPluginUiHandler::DisplayErrorL()
   111 // CSisxSifPluginUiHandler::DisplayErrorL()
   129 
   130 
   130     // TODO: localized UI string needed
   131     // TODO: localized UI string needed
   131     _LIT( KText, "Removal may stop other applications working. Continue?" );
   132     _LIT( KText, "Removal may stop other applications working. Continue?" );
   132     okToContinue = ShowQuestionL( KText );
   133     okToContinue = ShowQuestionL( KText );
   133 
   134 
       
   135     FLOG_1( _L("CSisxSifPluginUiHandler::DisplayDependencyBreakL, okToContinue=%d"),
       
   136         okToContinue );
   134     return okToContinue;
   137     return okToContinue;
   135     }
   138     }
   136 
   139 
   137 // ---------------------------------------------------------------------------
   140 // ---------------------------------------------------------------------------
   138 // CSisxSifPluginUiHandler::DisplayApplicationsInUseL()
   141 // CSisxSifPluginUiHandler::DisplayApplicationsInUseL()
   174         default:
   177         default:
   175             okToContinue = ETrue;   // silently accepted
   178             okToContinue = ETrue;   // silently accepted
   176             break;
   179             break;
   177         }
   180         }
   178 
   181 
       
   182     FLOG_1( _L("CSisxSifPluginUiHandler::DisplayQuestionL, okToContinue=%d"), okToContinue );
   179     return okToContinue;
   183     return okToContinue;
   180     }
   184     }
   181 
   185 
   182 // ---------------------------------------------------------------------------
   186 // ---------------------------------------------------------------------------
   183 // CSisxSifPluginUiHandler::DisplayInstallL()
   187 // CSisxSifPluginUiHandler::DisplayInstallL()
   199 TBool CSisxSifPluginUiHandler::DisplayGrantCapabilitiesL( const Swi::CAppInfo& /*aAppInfo*/,
   203 TBool CSisxSifPluginUiHandler::DisplayGrantCapabilitiesL( const Swi::CAppInfo& /*aAppInfo*/,
   200         const TCapabilitySet& aCapabilitySet )
   204         const TCapabilitySet& aCapabilitySet )
   201     {
   205     {
   202     FLOG( _L("CSisxSifPluginUiHandler::DisplayGrantCapabilitiesL") );
   206     FLOG( _L("CSisxSifPluginUiHandler::DisplayGrantCapabilitiesL") );
   203     TBool okToContinue = iSifUi->ShowGrantCapabilitiesL( aCapabilitySet );
   207     TBool okToContinue = iSifUi->ShowGrantCapabilitiesL( aCapabilitySet );
       
   208     FLOG_1( _L("CSisxSifPluginUiHandler::DisplayGrantCapabilitiesL, okToContinue=%d"),
       
   209         okToContinue );
   204     return okToContinue;
   210     return okToContinue;
   205     }
   211     }
   206 
   212 
   207 // ---------------------------------------------------------------------------
   213 // ---------------------------------------------------------------------------
   208 // CSisxSifPluginUiHandler::DisplayLanguageL()
   214 // CSisxSifPluginUiHandler::DisplayLanguageL()
   211 TInt CSisxSifPluginUiHandler::DisplayLanguageL( const Swi::CAppInfo& /*aAppInfo*/,
   217 TInt CSisxSifPluginUiHandler::DisplayLanguageL( const Swi::CAppInfo& /*aAppInfo*/,
   212         const RArray<TLanguage>& aLanguages )
   218         const RArray<TLanguage>& aLanguages )
   213     {
   219     {
   214     FLOG( _L("CSisxSifPluginUiHandler::DisplayLanguageL") );
   220     FLOG( _L("CSisxSifPluginUiHandler::DisplayLanguageL") );
   215     TInt langIndex = iSifUi->ShowSelectLanguageL( aLanguages );
   221     TInt langIndex = iSifUi->ShowSelectLanguageL( aLanguages );
       
   222     FLOG_1( _L("CSisxSifPluginUiHandler::DisplayLanguageL, langIndex=%d"), langIndex );
   216     return langIndex;
   223     return langIndex;
   217     }
   224     }
   218 
   225 
   219 // ---------------------------------------------------------------------------
   226 // ---------------------------------------------------------------------------
   220 // CSisxSifPluginUiHandler::DisplayDriveL()
   227 // CSisxSifPluginUiHandler::DisplayDriveL()
   241         }
   248         }
   242 
   249 
   243     TInt index = aDriveLetters.Find( driveLetter );
   250     TInt index = aDriveLetters.Find( driveLetter );
   244     if( index >= 0 && index < aDriveLetters.Count() )
   251     if( index >= 0 && index < aDriveLetters.Count() )
   245         {
   252         {
       
   253         FLOG_1( _L("CSisxSifPluginUiHandler::DisplayDriveL, return %d"), index );
   246         return index;
   254         return index;
   247         }
   255         }
       
   256     FLOG( _L("CSisxSifPluginUiHandler::DisplayDriveL, return default 0") );
   248     return 0;
   257     return 0;
   249     }
   258     }
   250 
   259 
   251 // ---------------------------------------------------------------------------
   260 // ---------------------------------------------------------------------------
   252 // CSisxSifPluginUiHandler::DisplayUpgradeL()
   261 // CSisxSifPluginUiHandler::DisplayUpgradeL()
   284         for( TInt index = 0; index < selectionsCount; index++ )
   293         for( TInt index = 0; index < selectionsCount; index++ )
   285             {
   294             {
   286             aSelections[ index ] = ( selectedIndexes.Find( index ) != KErrNotFound );
   295             aSelections[ index ] = ( selectedIndexes.Find( index ) != KErrNotFound );
   287             }
   296             }
   288         }
   297         }
       
   298     FLOG_1( _L("CSisxSifPluginUiHandler::DisplayOptionsL, isSelected=%d"), isSelected );
   289     return isSelected;
   299     return isSelected;
   290     }
   300     }
   291 
   301 
   292 // ---------------------------------------------------------------------------
   302 // ---------------------------------------------------------------------------
   293 // CSisxSifPluginUiHandler::HandleInstallEventL()
   303 // CSisxSifPluginUiHandler::HandleInstallEventL()
   294 // ---------------------------------------------------------------------------
   304 // ---------------------------------------------------------------------------
   295 //
   305 //
   296 TBool CSisxSifPluginUiHandler::HandleInstallEventL( const Swi::CAppInfo& aAppInfo,
   306 TBool CSisxSifPluginUiHandler::HandleInstallEventL( const Swi::CAppInfo& aAppInfo,
   297         Swi::TInstallEvent aEvent, TInt aValue, const TDesC& /*aDes*/ )
   307         Swi::TInstallEvent aEvent, TInt aValue, const TDesC& /*aDes*/ )
   298     {
   308     {
   299     FLOG_2( _L("CSisxSifPluginUiHandler::HandleInstallEventL: aEvent %d, aValue %d"), aEvent, aValue );
   309     FLOG_2( _L("CSisxSifPluginUiHandler::HandleInstallEventL: aEvent=%d, aValue=%d"),
       
   310         aEvent, aValue );
   300     TBool okToContinue = EFalse;
   311     TBool okToContinue = EFalse;
   301 
   312 
   302     if( !iSifUi->IsCancelled() )
   313     if( !iSifUi->IsCancelled() )
   303         {
   314         {
   304         okToContinue = ETrue;
   315         okToContinue = ETrue;
   336             default:
   347             default:
   337                 break;
   348                 break;
   338             }
   349             }
   339         }
   350         }
   340 
   351 
       
   352     FLOG_1( _L("CSisxSifPluginUiHandler::HandleInstallEventL: okToContinue %d"),
       
   353         okToContinue);
   341     return okToContinue;
   354     return okToContinue;
   342     }
   355     }
   343 
   356 
   344 // ---------------------------------------------------------------------------
   357 // ---------------------------------------------------------------------------
   345 // CSisxSifPluginUiHandler::HandleCancellableInstallEventL()
   358 // CSisxSifPluginUiHandler::HandleCancellableInstallEventL()
   347 //
   360 //
   348 void CSisxSifPluginUiHandler::HandleCancellableInstallEventL( const Swi::CAppInfo& aAppInfo,
   361 void CSisxSifPluginUiHandler::HandleCancellableInstallEventL( const Swi::CAppInfo& aAppInfo,
   349         Swi::TInstallCancellableEvent aEvent, Swi::MCancelHandler& aCancelHandler,
   362         Swi::TInstallCancellableEvent aEvent, Swi::MCancelHandler& aCancelHandler,
   350         TInt aValue, const TDesC& /*aDes*/ )
   363         TInt aValue, const TDesC& /*aDes*/ )
   351     {
   364     {
   352     FLOG_2( _L("CSisxSifPluginUiHandler::HandleCancellableInstallEventL: aEvent %d, aValue %d"), aEvent, aValue );
   365     FLOG_2( _L("CSisxSifPluginUiHandler::HandleCancellableInstallEventL: aEvent=%d, aValue=%d"),
       
   366         aEvent, aValue );
   353 
   367 
   354     if( iSifUi->IsCancelled() )
   368     if( iSifUi->IsCancelled() )
   355         {
   369         {
       
   370         FLOG( _L("CSisxSifPluginUiHandler::HandleCancellableInstallEventL: cancelling") );
   356         aCancelHandler.HandleCancel();
   371         aCancelHandler.HandleCancel();
   357         }
   372         }
   358     else
   373     else
   359         {
   374         {
   360         switch( aEvent )
   375         switch( aEvent )
   415 
   430 
   416         default:
   431         default:
   417             break;
   432             break;
   418         }
   433         }
   419 
   434 
       
   435     FLOG_1( _L("CSisxSifPluginUiHandler::DisplaySecurityWarningL, result=%d"), result );
   420     return result;
   436     return result;
   421     }
   437     }
   422 
   438 
   423 // ---------------------------------------------------------------------------
   439 // ---------------------------------------------------------------------------
   424 // CSisxSifPluginUiHandler::DisplayOcspResultL()
   440 // CSisxSifPluginUiHandler::DisplayOcspResultL()
   444     if( !okToContinue )
   460     if( !okToContinue )
   445         {
   461         {
   446         SetOcspErrorL( aMessage );
   462         SetOcspErrorL( aMessage );
   447         }
   463         }
   448 
   464 
       
   465     FLOG_1( _L("CSisxSifPluginUiHandler::DisplayOcspResultL, okToContinue=%d"), okToContinue );
   449     return okToContinue;
   466     return okToContinue;
   450     }
   467     }
   451 
   468 
   452 // ---------------------------------------------------------------------------
   469 // ---------------------------------------------------------------------------
   453 // CSisxSifPluginUiHandler::DisplayCannotOverwriteFileL()
   470 // CSisxSifPluginUiHandler::DisplayCannotOverwriteFileL()
   522 // CSisxSifPluginUiHandler::CancelDialogs()
   539 // CSisxSifPluginUiHandler::CancelDialogs()
   523 // ---------------------------------------------------------------------------
   540 // ---------------------------------------------------------------------------
   524 //
   541 //
   525 void CSisxSifPluginUiHandler::CancelDialogs()
   542 void CSisxSifPluginUiHandler::CancelDialogs()
   526     {
   543     {
       
   544     FLOG( _L("CSisxSifPluginUiHandler::CancelDialogs") );
   527     iSifUi->CancelDialogs();
   545     iSifUi->CancelDialogs();
   528     }
   546     }
   529 
   547 
   530 // ---------------------------------------------------------------------------
   548 // ---------------------------------------------------------------------------
   531 // CSisxSifPluginUiHandler::CSisxSifPluginUiHandler()
   549 // CSisxSifPluginUiHandler::CSisxSifPluginUiHandler()