gssettingsuis/Gs/GSApplication/Src/GSMainView.cpp
branchRCL_3
changeset 13 23553eb4e470
parent 8 f62c3a3d66b8
child 20 9941bcf99348
equal deleted inserted replaced
12:c8b9b0986973 13:23553eb4e470
    97 
    97 
    98     iPluginLoader = CGSPluginLoader::NewL( iAppUi );
    98     iPluginLoader = CGSPluginLoader::NewL( iAppUi );
    99     iPluginLoader->SetObserver( this );
    99     iPluginLoader->SetObserver( this );
   100     iPluginLoader->LoadAsyncL( KGSPluginInterfaceUid, KGSMainViewUid,
   100     iPluginLoader->LoadAsyncL( KGSPluginInterfaceUid, KGSMainViewUid,
   101         iPluginArray );
   101         iPluginArray );
       
   102     iPosition.Reset();
   102     }
   103     }
   103 
   104 
   104 
   105 
   105 // ---------------------------------------------------------------------------
   106 // ---------------------------------------------------------------------------
   106 // CGSMainView::~CGSMainView()
   107 // CGSMainView::~CGSMainView()
   130     if( iContainer && iAppUi )
   131     if( iContainer && iAppUi )
   131         {
   132         {
   132         iAppUi->RemoveFromViewStack( *this, iContainer );
   133         iAppUi->RemoveFromViewStack( *this, iContainer );
   133         delete iContainer;
   134         delete iContainer;
   134         }
   135         }
   135     if (iPosition.Count() > 0)
       
   136 		{
       
   137 		iPosition.Close();
       
   138 		}
       
   139     }
   136     }
   140 
   137 
   141 
   138 
   142 // ---------------------------------------------------------------------------
   139 // ---------------------------------------------------------------------------
   143 // TUid CGSMainView::OpenLocalizedResourceFileL()
   140 // TUid CGSMainView::OpenLocalizedResourceFileL()
   205     TBuf<1> empty( KEmptyText );
   202     TBuf<1> empty( KEmptyText );
   206     iContainer->SetListBoxEmptyTextL( empty );
   203     iContainer->SetListBoxEmptyTextL( empty );
   207     
   204     
   208     // Do this to update listbox from already existing iPluginArray.
   205     // Do this to update listbox from already existing iPluginArray.
   209     iContainer->UpdateListBoxL();
   206     iContainer->UpdateListBoxL();
   210     if (iPosition.Count() > 0)
   207     if ( iPosition.iCurrentItemIndex != -1 )
   211 		{
   208 		{
   212 		if (iScreenMode == Layout_Meta_Data::IsLandscapeOrientation())
   209 		if ( iIsLandscapeOrientation == Layout_Meta_Data::IsLandscapeOrientation() )
   213 			{
   210 			{
   214 			iContainer->SetPosition(iPosition, EFalse);
   211 			iContainer->RestoreListBoxPositionL( iPosition, EFalse );
   215 			}
   212 			}
   216 		else
   213 		else
   217 			{
   214 			{
   218 			iContainer->SetPosition(iPosition, ETrue);
   215 			iContainer->RestoreListBoxPositionL( iPosition, ETrue );
   219 			}
   216 			}
   220 		}
   217 		}
   221     iAppUi->AddToViewStackL( *this, iContainer );
   218     iAppUi->AddToViewStackL( *this, iContainer );
   222     // Navigating to main view will reset all child plugin selected indexes:
   219     // Navigating to main view will reset all child plugin selected indexes:
   223     for( TInt i = 0; i < iPluginArray->Count(); i++ )
   220     for( TInt i = 0; i < iPluginArray->Count(); i++ )
   241     
   238     
   242     iPluginLoader->RequestPriority( CActive::EPriorityLow );
   239     iPluginLoader->RequestPriority( CActive::EPriorityLow );
   243     
   240     
   244     if ( iContainer )
   241     if ( iContainer )
   245         {
   242         {
   246 		if (iPosition.Count() > 0)
   243 		
   247 			{
   244 		iPosition.Reset();
   248 			iPosition.Reset();
   245 		TRAPD( err, iContainer->StoreListBoxPositionL( iPosition ) );
   249 			}
   246 		iIsLandscapeOrientation = Layout_Meta_Data::IsLandscapeOrientation();
   250 		TRAPD(err, iContainer->GetPositionL(iPosition));
       
   251 		iScreenMode = Layout_Meta_Data::IsLandscapeOrientation();
       
   252 		iAppUi->RemoveFromViewStack(*this, iContainer);
   247 		iAppUi->RemoveFromViewStack(*this, iContainer);
   253         delete iContainer;
   248         delete iContainer;
   254         iContainer = NULL;
   249         iContainer = NULL;
   255         }
   250         }
   256     }
   251     }