54 #include "xncomponentnodeimpl.h" |
53 #include "xncomponentnodeimpl.h" |
55 #include "xnnodepluginif.h" |
54 #include "xnnodepluginif.h" |
56 #include "xnoomsyshandler.h" |
55 #include "xnoomsyshandler.h" |
57 #include "xnbackgroundmanager.h" |
56 #include "xnbackgroundmanager.h" |
58 #include "xneffectmanager.h" |
57 #include "xneffectmanager.h" |
|
58 #include "xnkeyeventdispatcher.h" |
59 |
59 |
60 // Constants |
60 // Constants |
61 _LIT8( KEmptyWidgetUid, "0x2001f47f" ); |
61 _LIT8( KEmptyWidgetUid, "0x2001f47f" ); |
62 _LIT8( KTemplateViewUID, "0x20026f50" ); |
62 _LIT8( KTemplateViewUID, "0x20026f50" ); |
63 |
63 |
64 const TInt KPSCategoryUid( 0x200286E3 ); |
64 const TInt KPSCategoryUid( 0x200286E3 ); |
65 const TInt KPSCrashCountKey( 1 ); |
65 const TInt KPSCrashCountKey( 1 ); |
66 const TInt KStabilityInterval( 60000000 ); // 1 minute |
66 const TInt KStabilityInterval( 60000000 ); // 1 minute |
|
67 const TInt KActivationCompleteInterval( 2000000 ); // 2s |
67 const TInt KCrashRestoreDefaultThreshold( 3 ); |
68 const TInt KCrashRestoreDefaultThreshold( 3 ); |
68 const TInt KCrashRestoreAllTreshold( 4 ); |
69 const TInt KCrashRestoreAllTreshold( 4 ); |
69 |
70 |
70 // ============================ LOCAL FUNCTIONS =============================== |
71 // ============================ LOCAL FUNCTIONS =============================== |
71 // ----------------------------------------------------------------------------- |
72 // ----------------------------------------------------------------------------- |
323 iEditor = CXnEditor::NewL( *this, uid ); |
326 iEditor = CXnEditor::NewL( *this, uid ); |
324 |
327 |
325 iHspsWrapper = &iEditor->HspsWrapper(); |
328 iHspsWrapper = &iEditor->HspsWrapper(); |
326 |
329 |
327 iComposer = CXnComposer::NewL( *iHspsWrapper ); |
330 iComposer = CXnComposer::NewL( *iHspsWrapper ); |
328 |
331 |
329 iIsLandscapeOrientation = Layout_Meta_Data::IsLandscapeOrientation(); |
332 iAsyncCb = CPeriodic::NewL( CActive::EPriorityIdle ); |
330 |
333 |
331 DoRobustnessCheckL(); |
334 DoRobustnessCheckL(); |
332 } |
335 } |
333 |
336 |
334 // ----------------------------------------------------------------------------- |
337 // ----------------------------------------------------------------------------- |
335 // CXnViewManager::LoadUiL() |
338 // CXnViewManager::LoadUiL() |
361 #ifdef _XN_PERFORMANCE_TEST_ |
364 #ifdef _XN_PERFORMANCE_TEST_ |
362 RDebug::Print( _L( "CXnViewManager::ReloadUiL() - start" ) ); |
365 RDebug::Print( _L( "CXnViewManager::ReloadUiL() - start" ) ); |
363 #endif //_XN_PERFORMANCE_TEST_ |
366 #endif //_XN_PERFORMANCE_TEST_ |
364 |
367 |
365 NotifyViewDeactivatedL( ActiveViewData() ); |
368 NotifyViewDeactivatedL( ActiveViewData() ); |
|
369 |
|
370 if ( iAsyncCb->IsActive() ) |
|
371 { |
|
372 iAsyncCb->Cancel(); |
|
373 |
|
374 ContainerActivated( this ); |
|
375 } |
366 |
376 |
367 delete iWidgetAmountTrigger; |
377 delete iWidgetAmountTrigger; |
368 iWidgetAmountTrigger = NULL; |
378 iWidgetAmountTrigger = NULL; |
369 |
379 |
370 // Destroy active view data |
380 // Destroy active view data |
458 // Report widget amount in the view |
469 // Report widget amount in the view |
459 ReportWidgetAmountL( viewData ); |
470 ReportWidgetAmountL( viewData ); |
460 } |
471 } |
461 else if ( retval == KErrNoMemory ) |
472 else if ( retval == KErrNoMemory ) |
462 { |
473 { |
463 aPluginData.ShowOutOfMemError(); |
474 TRAP_IGNORE( ShowErrorL( R_QTN_HS_HS_MEMORY_FULL ) ); |
464 } |
475 } |
465 else if ( retval == KXnErrPluginFailure ) |
476 else if ( retval == KXnErrPluginFailure ) |
466 { |
477 { |
467 aPluginData.ShowContentRemovedError(); |
478 TRAP_IGNORE( ShowErrorL( R_QTN_HS_ERROR_WIDGETS_REMOVED ) ); |
468 } |
479 } |
469 |
480 |
470 CleanupStack::PopAndDestroy(); // DisableRenderUiLC |
481 CleanupStack::PopAndDestroy(); // DisableRenderUiLC |
471 } |
482 } |
472 |
483 |
473 return retval; |
484 return retval; |
474 } |
485 } |
475 |
486 |
476 // ----------------------------------------------------------------------------- |
487 // ----------------------------------------------------------------------------- |
477 // CXnViewManager::UnloadWidgetFromPluginL() |
488 // CXnViewManager::UnloadWidgetFromPluginL() |
|
489 // |
478 // ----------------------------------------------------------------------------- |
490 // ----------------------------------------------------------------------------- |
479 // |
491 // |
480 TInt CXnViewManager::UnloadWidgetFromPluginL( CXnPluginData& aPluginData, |
492 TInt CXnViewManager::UnloadWidgetFromPluginL( CXnPluginData& aPluginData, |
481 TBool aForce ) |
493 TBool aForce ) |
482 { |
494 { |
863 void CXnViewManager::ActivateNextViewL( TInt /*aEffectId*/ ) |
877 void CXnViewManager::ActivateNextViewL( TInt /*aEffectId*/ ) |
864 { |
878 { |
865 CXnViewData& next( NextViewData() ); |
879 CXnViewData& next( NextViewData() ); |
866 |
880 |
867 if ( !next.Occupied() ) |
881 if ( !next.Occupied() ) |
868 { |
882 { |
869 if ( next.Load() == KErrNoMemory ) |
883 TInt err( next.Load() ); |
870 { |
884 |
871 next.ShowOutOfMemError(); |
885 if ( err ) |
872 return; |
886 { |
|
887 if ( err == KErrNoMemory ) |
|
888 { |
|
889 TRAP_IGNORE( ShowErrorL( R_QTN_HS_HS_MEMORY_FULL ) ); |
|
890 } |
|
891 else if ( err == KXnErrPluginFailure ) |
|
892 { |
|
893 TRAP_IGNORE( ShowErrorL( R_QTN_HS_ERROR_WIDGETS_REMOVED ) ); |
|
894 } |
|
895 |
|
896 return; |
873 } |
897 } |
874 } |
898 } |
875 |
899 |
876 // Activate view |
900 // Activate view |
877 if ( next.Occupied() && !next.Active() ) |
901 if ( next.Occupied() && !next.Active() ) |
878 { |
902 { |
879 CXnControlAdapter* thisView( |
903 iAppUiAdapter.ViewAdapter().ActivateContainerL( |
880 ActiveViewData().ViewNode()->Control() ); |
904 next, EFalse, KGfxContextActivateNextView ); |
881 |
|
882 CXnControlAdapter* nextView( |
|
883 next.ViewNode()->Control() ); |
|
884 |
|
885 GfxTransEffect::Register( thisView, KGfxContextActivateNextView ); |
|
886 GfxTransEffect::Register( nextView, KGfxContextActivateNextView ); |
|
887 |
|
888 TInt ret( GfxTransEffect::BeginGroup() ); |
|
889 |
|
890 CFbsBitmap* currentBg( ActiveViewData().WallpaperImage() ); |
|
891 CFbsBitmap* nextBg( next.WallpaperImage() ); |
|
892 |
|
893 if ( currentBg || nextBg ) |
|
894 { |
|
895 CCoeControl* bg( &iAppUiAdapter.ViewAdapter().BgManager() ); |
|
896 |
|
897 if ( !currentBg && nextBg ) |
|
898 { |
|
899 GfxTransEffect::Begin( bg, KGfxControlActionBgAnimToImgAppear ); |
|
900 } |
|
901 else |
|
902 { |
|
903 GfxTransEffect::Begin( bg, KGfxControlActionBgImgToImgAppear ); |
|
904 } |
|
905 |
|
906 GfxTransEffect::SetDemarcation( bg, bg->Position() ); |
|
907 GfxTransEffect::End( bg ); |
|
908 } |
|
909 |
|
910 if ( iIsLandscapeOrientation ) |
|
911 { |
|
912 GfxTransEffect::Begin( thisView, KGfxControlActionDisappearLsc ); |
|
913 GfxTransEffect::Begin( nextView, KGfxControlActionAppearLsc ); |
|
914 } |
|
915 else |
|
916 { |
|
917 GfxTransEffect::Begin( thisView, KGfxControlActionDisappearPrt ); |
|
918 GfxTransEffect::Begin( nextView, KGfxControlActionAppearPrt ); |
|
919 } |
|
920 |
|
921 TRAP_IGNORE( iAppUiAdapter.ViewAdapter().ActivateContainerL( next ) ); |
|
922 |
|
923 GfxTransEffect::SetDemarcation( thisView, thisView->Position() ); |
|
924 GfxTransEffect::End( thisView ); |
|
925 |
|
926 GfxTransEffect::SetDemarcation( nextView, nextView->Position() ); |
|
927 GfxTransEffect::End( nextView ); |
|
928 |
|
929 GfxTransEffect::EndGroup( ret ); |
|
930 |
|
931 GfxTransEffect::Deregister( thisView ); |
|
932 GfxTransEffect::Deregister( nextView ); |
|
933 } |
905 } |
934 } |
906 } |
935 |
907 |
936 // ----------------------------------------------------------------------------- |
908 // ----------------------------------------------------------------------------- |
937 // CXnViewManager::ActivatePreviousViewL() |
909 // CXnViewManager::ActivatePreviousViewL() |
942 { |
914 { |
943 CXnViewData& prev( PreviousViewData() ); |
915 CXnViewData& prev( PreviousViewData() ); |
944 |
916 |
945 if ( !prev.Occupied() ) |
917 if ( !prev.Occupied() ) |
946 { |
918 { |
947 if ( prev.Load() == KErrNoMemory ) |
919 TInt err( prev.Load() ); |
948 { |
920 |
949 prev.ShowOutOfMemError(); |
921 if ( err ) |
950 return; |
922 { |
951 } |
923 if ( err == KErrNoMemory ) |
|
924 { |
|
925 TRAP_IGNORE( ShowErrorL( R_QTN_HS_HS_MEMORY_FULL ) ); |
|
926 } |
|
927 else if ( err == KXnErrPluginFailure ) |
|
928 { |
|
929 TRAP_IGNORE( ShowErrorL( R_QTN_HS_ERROR_WIDGETS_REMOVED ) ); |
|
930 } |
|
931 |
|
932 return; |
|
933 } |
952 } |
934 } |
953 |
935 |
954 // Activate view |
936 // Activate view |
955 if ( prev.Occupied() && !prev.Active() ) |
937 if ( prev.Occupied() && !prev.Active() ) |
956 { |
938 { |
957 CXnControlAdapter* thisView( |
939 iAppUiAdapter.ViewAdapter().ActivateContainerL( |
958 ActiveViewData().ViewNode()->Control() ); |
940 prev, EFalse, KGfxContextActivatePrevView ); |
959 |
|
960 CXnControlAdapter* prevView( |
|
961 prev.ViewNode()->Control() ); |
|
962 |
|
963 GfxTransEffect::Register( thisView, KGfxContextActivatePrevView ); |
|
964 GfxTransEffect::Register( prevView, KGfxContextActivatePrevView ); |
|
965 |
|
966 TInt ret( GfxTransEffect::BeginGroup() ); |
|
967 |
|
968 CFbsBitmap* currentBg( ActiveViewData().WallpaperImage() ); |
|
969 CFbsBitmap* prevBg( prev.WallpaperImage() ); |
|
970 |
|
971 if ( currentBg || prevBg ) |
|
972 { |
|
973 CCoeControl* bg( &iAppUiAdapter.ViewAdapter().BgManager() ); |
|
974 |
|
975 if ( !currentBg && prevBg ) |
|
976 { |
|
977 GfxTransEffect::Begin( bg, KGfxControlActionBgAnimToImgAppear ); |
|
978 } |
|
979 else |
|
980 { |
|
981 GfxTransEffect::Begin( bg, KGfxControlActionBgImgToImgAppear ); |
|
982 } |
|
983 |
|
984 GfxTransEffect::SetDemarcation( bg, bg->Position() ); |
|
985 GfxTransEffect::End( bg ); |
|
986 } |
|
987 |
|
988 if ( iIsLandscapeOrientation ) |
|
989 { |
|
990 GfxTransEffect::Begin( thisView, KGfxControlActionDisappearLsc ); |
|
991 GfxTransEffect::Begin( prevView, KGfxControlActionAppearLsc ); |
|
992 } |
|
993 else |
|
994 { |
|
995 GfxTransEffect::Begin( thisView, KGfxControlActionDisappearPrt ); |
|
996 GfxTransEffect::Begin( prevView, KGfxControlActionAppearPrt ); |
|
997 } |
|
998 |
|
999 TRAP_IGNORE( iAppUiAdapter.ViewAdapter().ActivateContainerL( prev ) ); |
|
1000 |
|
1001 GfxTransEffect::SetDemarcation( thisView, thisView->Position() ); |
|
1002 GfxTransEffect::End( thisView ); |
|
1003 |
|
1004 GfxTransEffect::SetDemarcation( prevView, prevView->Position() ); |
|
1005 GfxTransEffect::End( prevView ); |
|
1006 |
|
1007 GfxTransEffect::EndGroup( ret ); |
|
1008 |
|
1009 GfxTransEffect::Deregister( thisView ); |
|
1010 GfxTransEffect::Deregister( prevView ); |
|
1011 } |
941 } |
1012 } |
942 } |
1013 |
943 |
1014 // ----------------------------------------------------------------------------- |
944 // ----------------------------------------------------------------------------- |
1015 // CXnViewManager::AddViewL() |
945 // CXnViewManager::AddViewL() |
1095 // |
1029 // |
1096 void CXnViewManager::AddViewL( TInt aEffectId ) |
1030 void CXnViewManager::AddViewL( TInt aEffectId ) |
1097 { |
1031 { |
1098 if ( iRootData->PluginData().Count() >= iRootData->MaxPages() ) |
1032 if ( iRootData->PluginData().Count() >= iRootData->MaxPages() ) |
1099 { |
1033 { |
1100 HBufC* msg( StringLoader::LoadLC( |
1034 TRAP_IGNORE( ShowErrorL( R_QTN_HS_MAX_AMOUNT_OF_PAGES_NOTE ) ); |
1101 R_QTN_HS_MAX_AMOUNT_OF_PAGES_NOTE ) ); |
1035 |
1102 |
1036 return; |
1103 CAknErrorNote* note = new ( ELeave ) CAknErrorNote; |
|
1104 CleanupStack::PushL( note ); |
|
1105 |
|
1106 note->ExecuteLD( *msg ); |
|
1107 |
|
1108 CleanupStack::Pop( note ); |
|
1109 CleanupStack::PopAndDestroy( msg ); |
|
1110 |
|
1111 return; |
|
1112 } |
1037 } |
1113 |
1038 |
1114 // Add new view (template view) to hsps |
1039 // Add new view (template view) to hsps |
1115 CAddPluginResult* result = iHspsWrapper->AddPluginL( |
1040 CAddPluginResult* result = iHspsWrapper->AddPluginL( |
1116 iRootData->ConfigurationId(), KTemplateViewUID, |
1041 iRootData->ConfigurationId(), KTemplateViewUID, |
1210 // Destroy publishers here, must be plugin shutdown |
1139 // Destroy publishers here, must be plugin shutdown |
1211 view->DestroyPublishers( EAiFwPluginShutdown ); |
1140 view->DestroyPublishers( EAiFwPluginShutdown ); |
1212 |
1141 |
1213 // Activate the next view, or first if in the last view |
1142 // Activate the next view, or first if in the last view |
1214 CXnViewData& next( NextViewData() ); |
1143 CXnViewData& next( NextViewData() ); |
|
1144 |
1215 iAppUiAdapter.ViewAdapter().ActivateContainerL( next ); |
1145 iAppUiAdapter.ViewAdapter().ActivateContainerL( next ); |
1216 } |
1146 } |
1217 |
1147 |
1218 // Remove wallpaper from cache |
1148 // Remove wallpaper from cache |
1219 iAppUiAdapter.ViewAdapter().BgManager().DeleteWallpaper( *view ); |
1149 iAppUiAdapter.ViewAdapter().BgManager().DeleteWallpaper( *view ); |
1220 |
1150 |
1221 retval = iHspsWrapper->RemovePluginL( view->PluginId() ); |
1151 retval = iHspsWrapper->RemovePluginL( view->PluginId() ); |
1222 |
1152 |
1223 // Notify observers of view list change |
1153 // Notify observers of view list change |
1224 TRAPD( err, NotifyViewRemovalL( *view ) ); |
1154 TRAP_IGNORE( NotifyViewRemovalL( *view ) ); |
1225 if ( err != KErrNone ) |
|
1226 { |
|
1227 // ignored |
|
1228 } |
|
1229 |
1155 |
1230 iRootData->DestroyViewData( view ); |
1156 iRootData->DestroyViewData( view ); |
1231 |
1157 |
1232 // Need to update after view is removed |
1158 // Need to update after view is removed |
1233 UpdatePageManagementInformationL(); |
1159 UpdatePageManagementInformationL(); |
1296 |
1222 |
1297 // Remove plugin from HSPS |
1223 // Remove plugin from HSPS |
1298 iHspsWrapper->RemovePluginL( view->PluginId() ); |
1224 iHspsWrapper->RemovePluginL( view->PluginId() ); |
1299 |
1225 |
1300 // Notify observers of view list change |
1226 // Notify observers of view list change |
1301 TRAPD( err, NotifyViewRemovalL( *view ) ); |
1227 TRAP_IGNORE( NotifyViewRemovalL( *view ) ); |
1302 if ( err != KErrNone ) |
1228 |
1303 { |
|
1304 // ignored |
|
1305 } |
|
1306 |
1229 |
1307 iRootData->DestroyViewData( view ); |
1230 iRootData->DestroyViewData( view ); |
1308 |
1231 |
1309 // Need to update after view is removed |
1232 // Need to update after view is removed |
1310 UpdatePageManagementInformationL(); |
1233 UpdatePageManagementInformationL(); |
1311 } |
1234 } |
1312 } |
1235 } |
1313 |
1236 |
1314 // ----------------------------------------------------------------------------- |
1237 // ----------------------------------------------------------------------------- |
1315 // CXnViewManager::AddObserver() |
1238 // CXnViewManager::AddObserver() |
|
1239 // |
1316 // ----------------------------------------------------------------------------- |
1240 // ----------------------------------------------------------------------------- |
1317 // |
1241 // |
1318 void CXnViewManager::AddObserver( const MXnViewObserver& aObserver ) |
1242 void CXnViewManager::AddObserver( const MXnViewObserver& aObserver ) |
1319 { |
1243 { |
1320 TInt index( iObservers.Find( &aObserver ) ); |
1244 TInt index( iObservers.Find( &aObserver ) ); |
1433 |
1358 |
1434 // ----------------------------------------------------------------------------- |
1359 // ----------------------------------------------------------------------------- |
1435 // CXnViewManager::NotifyContainerChangedL() |
1360 // CXnViewManager::NotifyContainerChangedL() |
1436 // Notifies container is changed, this is called always by CXnViewAdapter |
1361 // Notifies container is changed, this is called always by CXnViewAdapter |
1437 // ----------------------------------------------------------------------------- |
1362 // ----------------------------------------------------------------------------- |
|
1363 // |
1438 void CXnViewManager::NotifyContainerChangedL( CXnViewData& aViewToActivate ) |
1364 void CXnViewManager::NotifyContainerChangedL( CXnViewData& aViewToActivate ) |
1439 { |
1365 { |
|
1366 iAsyncCb->Cancel(); |
|
1367 |
1440 CXnViewData& viewToDeactivate( ActiveViewData() ); |
1368 CXnViewData& viewToDeactivate( ActiveViewData() ); |
1441 |
1369 |
|
1370 TInt err( KErrNone ); |
|
1371 |
1442 if ( &aViewToActivate != &viewToDeactivate ) |
1372 if ( &aViewToActivate != &viewToDeactivate ) |
1443 { |
1373 { |
1444 NotifyViewDeactivatedL( viewToDeactivate ); |
1374 NotifyViewDeactivatedL( viewToDeactivate ); |
1445 |
1375 |
1446 viewToDeactivate.SetActive( EFalse ); |
1376 err = viewToDeactivate.SetActive( EFalse ); |
1447 aViewToActivate.SetActive( ETrue ); |
1377 aViewToActivate.SetActive( ETrue ); |
1448 |
1378 |
1449 iHspsWrapper->SetActivePluginL( aViewToActivate.PluginId() ); |
|
1450 |
|
1451 // Cache update is needed after view activation |
1379 // Cache update is needed after view activation |
1452 UpdateCachesL(); |
1380 UpdateCachesL(); |
1453 } |
1381 } |
1454 else |
1382 else |
1455 { |
1383 { |
1456 // Activate first view |
1384 // Activate first view |
1457 aViewToActivate.SetActive( ETrue ); |
1385 err = aViewToActivate.SetActive( ETrue ); |
1458 |
1386 |
1459 // Cache update is needed after view activation |
1387 // Cache update is needed after view activation |
1460 UpdateCachesL(); |
1388 UpdateCachesL(); |
1461 |
1389 |
1462 // Schedule remaining views loading |
1390 // Schedule remaining views loading |
1463 iRootData->LoadRemainingViews(); |
1391 iRootData->LoadRemainingViews(); |
1464 } |
1392 } |
1465 |
1393 |
1466 NotifyViewActivatedL( aViewToActivate ); |
1394 if ( err == KErrNoMemory ) |
1467 UpdatePageManagementInformationL(); |
1395 { |
|
1396 TRAP_IGNORE( ShowErrorL( R_QTN_HS_HS_MEMORY_FULL ) ); |
|
1397 } |
|
1398 else if ( err == KXnErrPluginFailure ) |
|
1399 { |
|
1400 TRAP_IGNORE( ShowErrorL( R_QTN_HS_ERROR_WIDGETS_REMOVED ) ); |
|
1401 } |
|
1402 |
|
1403 NotifyViewActivatedL( aViewToActivate ); |
|
1404 } |
|
1405 |
|
1406 // ----------------------------------------------------------------------------- |
|
1407 // CXnViewManager::PublishersReadyL() |
|
1408 // Notifies that aViewData activation is complete |
|
1409 // ----------------------------------------------------------------------------- |
|
1410 // |
|
1411 void CXnViewManager::PublishersReadyL( CXnViewData& aViewData, TInt aResult ) |
|
1412 { |
|
1413 if ( !aViewData.Active() ) |
|
1414 { |
|
1415 return; |
|
1416 } |
|
1417 |
|
1418 iAsyncCb->Cancel(); |
|
1419 |
|
1420 TCallBack cb( ContainerActivated, this ) ; |
|
1421 |
|
1422 iAsyncCb->Start( KActivationCompleteInterval, 0, cb ); |
|
1423 |
|
1424 if ( !iUiReady ) |
|
1425 { |
|
1426 iAppUiAdapter.HandleUiReadyEventL(); |
|
1427 iUiReady = ETrue; |
|
1428 } |
|
1429 |
|
1430 if ( aResult == KErrNoMemory ) |
|
1431 { |
|
1432 ShowErrorL( R_QTN_HS_HS_MEMORY_FULL ); |
|
1433 } |
|
1434 else if ( aResult == KXnErrPluginFailure ) |
|
1435 { |
|
1436 ShowErrorL( R_QTN_HS_ERROR_WIDGETS_REMOVED ); |
|
1437 } |
|
1438 } |
|
1439 |
|
1440 // ----------------------------------------------------------------------------- |
|
1441 // CXnViewManager::ContainerActivated() |
|
1442 // Notifies that a container activation is complete |
|
1443 // ----------------------------------------------------------------------------- |
|
1444 // |
|
1445 /* static */ TInt CXnViewManager::ContainerActivated( TAny* aAny ) |
|
1446 { |
|
1447 CXnViewManager* self = static_cast< CXnViewManager* >( aAny ); |
|
1448 |
|
1449 self->iAsyncCb->Cancel(); |
|
1450 |
|
1451 CXnViewData& active( self->ActiveViewData() ); |
|
1452 |
|
1453 TRAP_IGNORE( self->iHspsWrapper->SetActivePluginL( active.PluginId() ) ); |
|
1454 |
|
1455 CXnBackgroundManager& bg( self->iAppUiAdapter.ViewAdapter().BgManager() ); |
|
1456 |
|
1457 TRAP_IGNORE( bg.StoreWallpaperL() ); |
|
1458 |
|
1459 return KErrNone; |
1468 } |
1460 } |
1469 |
1461 |
1470 // ----------------------------------------------------------------------------- |
1462 // ----------------------------------------------------------------------------- |
1471 // CXnViewManager::NotifyViewActivatedL() |
1463 // CXnViewManager::NotifyViewActivatedL() |
1472 // Notifies view is activated |
1464 // Notifies view is activated |
1650 |
1644 |
1651 node->ReportXuikonEventL( *iWidgetAmountTrigger ); |
1645 node->ReportXuikonEventL( *iWidgetAmountTrigger ); |
1652 } |
1646 } |
1653 |
1647 |
1654 // ----------------------------------------------------------------------------- |
1648 // ----------------------------------------------------------------------------- |
1655 // CXnViewManager::ShowOperationFailedMessageL |
1649 // CXnViewManager::ShowErrorL |
1656 // ----------------------------------------------------------------------------- |
1650 // |
1657 // |
1651 // ----------------------------------------------------------------------------- |
1658 void CXnViewManager::ShowDiskFullMessageL() const |
1652 // |
1659 { |
1653 void CXnViewManager::ShowErrorL( TInt aResource ) const |
1660 HBufC* msg( StringLoader::LoadLC( R_QTN_HS_OPERATION_FAILED_NO_DISK ) ); |
1654 { |
1661 |
1655 if ( aResource == R_QTN_HS_HS_MEMORY_FULL ) |
1662 CAknErrorNote* note = new ( ELeave ) CAknErrorNote; |
1656 { |
1663 CleanupStack::PushL( note ); |
1657 iOomSysHandler->HandlePotentialOomL(); |
1664 |
1658 } |
1665 note->ExecuteLD( *msg ); |
1659 else |
1666 |
1660 { |
1667 CleanupStack::Pop( note ); |
1661 HBufC* msg( StringLoader::LoadLC( aResource ) ); |
1668 CleanupStack::PopAndDestroy( msg ); |
1662 |
|
1663 CAknErrorNote* note = new ( ELeave ) CAknErrorNote; |
|
1664 note->ExecuteLD( *msg ); |
|
1665 |
|
1666 CleanupStack::PopAndDestroy( msg ); |
|
1667 } |
1669 } |
1668 } |
1670 |
1669 |
1671 // ----------------------------------------------------------------------------- |
1670 // ----------------------------------------------------------------------------- |
1672 // CXnViewManager::OOMSysHandler |
1671 // CXnViewManager::OOMSysHandler |
|
1672 // |
1673 // ----------------------------------------------------------------------------- |
1673 // ----------------------------------------------------------------------------- |
1674 // |
1674 // |
1675 CXnOomSysHandler& CXnViewManager::OomSysHandler() const |
1675 CXnOomSysHandler& CXnViewManager::OomSysHandler() const |
1676 { |
1676 { |
1677 return *iOomSysHandler; |
1677 return *iOomSysHandler; |
1757 return KErrNone; |
1757 return KErrNone; |
1758 } |
1758 } |
1759 |
1759 |
1760 // ----------------------------------------------------------------------------- |
1760 // ----------------------------------------------------------------------------- |
1761 // CXnViewManager::ResetCrashCount |
1761 // CXnViewManager::ResetCrashCount |
|
1762 // |
1762 // ----------------------------------------------------------------------------- |
1763 // ----------------------------------------------------------------------------- |
1763 void CXnViewManager::ResetCrashCount() |
1764 void CXnViewManager::ResetCrashCount() |
1764 { |
1765 { |
1765 RProperty::Set( TUid::Uid( KPSCategoryUid ), KPSCrashCountKey, 0 ); |
1766 RProperty::Set( TUid::Uid( KPSCategoryUid ), KPSCrashCountKey, 0 ); |
1766 } |
1767 } |
1767 |
1768 |
1768 // ----------------------------------------------------------------------------- |
1769 // ----------------------------------------------------------------------------- |
1769 // CXnViewManager::ShowErrorNoteL |
1770 // CXnViewManager::DoRobustnessCheckL |
1770 // ----------------------------------------------------------------------------- |
1771 // |
1771 void CXnViewManager::ShowErrorNoteL() |
|
1772 { |
|
1773 CAknQueryDialog* query = CAknQueryDialog::NewL(); |
|
1774 query->PrepareLC( R_HS_CONTENT_REMOVED_VIEW ); |
|
1775 |
|
1776 HBufC* queryText( StringLoader::LoadLC( R_HS_ERROR_CONTENT_REMOVED ) ); |
|
1777 query->SetPromptL( queryText->Des() ); |
|
1778 CleanupStack::PopAndDestroy( queryText ); |
|
1779 |
|
1780 query->RunLD(); |
|
1781 } |
|
1782 |
|
1783 // ----------------------------------------------------------------------------- |
|
1784 // CXnViewManager::DoRobustnessCheckL |
|
1785 // ----------------------------------------------------------------------------- |
1772 // ----------------------------------------------------------------------------- |
1786 void CXnViewManager::DoRobustnessCheckL() |
1773 void CXnViewManager::DoRobustnessCheckL() |
1787 { |
1774 { |
1788 TInt crashCount = 0; |
1775 TInt crashCount = 0; |
|
1776 |
1789 RProperty::Get( TUid::Uid( KPSCategoryUid ), |
1777 RProperty::Get( TUid::Uid( KPSCategoryUid ), |
1790 KPSCrashCountKey, |
1778 KPSCrashCountKey, |
1791 crashCount ); |
1779 crashCount ); |
1792 |
1780 |
1793 if( crashCount == KCrashRestoreDefaultThreshold ) |
1781 if( crashCount == KCrashRestoreDefaultThreshold ) |
1794 { |
1782 { |
1795 TInt err = iHspsWrapper->RestoreDefaultConfL(); |
1783 iHspsWrapper->RestoreDefaultConfL(); |
1796 ShowErrorNoteL(); |
1784 |
|
1785 CAknQueryDialog* query = CAknQueryDialog::NewL(); |
|
1786 query->PrepareLC( R_HS_CONTENT_REMOVED_VIEW ); |
|
1787 |
|
1788 HBufC* queryText( StringLoader::LoadLC( R_HS_ERROR_CONTENT_REMOVED ) ); |
|
1789 query->SetPromptL( queryText->Des() ); |
|
1790 CleanupStack::PopAndDestroy( queryText ); |
|
1791 |
|
1792 query->RunLD(); |
1797 } |
1793 } |
1798 else if( crashCount >= KCrashRestoreAllTreshold ) |
1794 else if( crashCount >= KCrashRestoreAllTreshold ) |
1799 { |
1795 { |
1800 TInt err = iHspsWrapper->RestoreRootL(); |
1796 iHspsWrapper->RestoreRootL(); |
|
1797 |
1801 ResetCrashCount(); |
1798 ResetCrashCount(); |
1802 return; |
1799 return; |
1803 } |
1800 } |
1804 |
1801 |
1805 if( crashCount > 0 ) |
1802 if( crashCount > 0 ) |