1 /* |
1 /* |
2 * Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). |
2 * Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). |
3 * All rights reserved. |
3 * All rights reserved. |
4 * This component and the accompanying materials are made available |
4 * This component and the accompanying materials are made available |
5 * under the terms of "Eclipse Public License v1.0" |
5 * under the terms of "Eclipse Public License v1.0" |
6 * which accompanies this distribution, and is available |
6 * which accompanies this distribution, and is available |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
47 |
47 |
48 RWsSession& wsSession = iEikonEnv->WsSession(); |
48 RWsSession& wsSession = iEikonEnv->WsSession(); |
49 wsSession.ComputeMode( RWsSession::EPriorityControlDisabled ); |
49 wsSession.ComputeMode( RWsSession::EPriorityControlDisabled ); |
50 |
50 |
51 FeatureManager::InitializeLibL(); |
51 FeatureManager::InitializeLibL(); |
52 |
52 |
53 TFileName* fullName = TAppMngr2DriveUtils::NearestResourceFileLC( |
53 TFileName* fullName = TAppMngr2DriveUtils::NearestResourceFileLC( |
54 KSWInstCommonUIResourceFileName, iEikonEnv->FsSession() ); |
54 KSWInstCommonUIResourceFileName, iEikonEnv->FsSession() ); |
55 FLOG( "CAppMngr2AppUi::ConstructL, opening %S", fullName ); |
55 FLOG( "CAppMngr2AppUi::ConstructL, opening %S", fullName ); |
56 iResourceFileOffset = iEikonEnv->AddResourceFileL( *fullName ); |
56 iResourceFileOffset = iEikonEnv->AddResourceFileL( *fullName ); |
57 CleanupStack::PopAndDestroy( fullName ); |
57 CleanupStack::PopAndDestroy( fullName ); |
58 |
58 |
59 FLOG( "CAppMngr2AppUi::ConstructL, creting model" ); |
59 FLOG( "CAppMngr2AppUi::ConstructL, creting model" ); |
60 iModel = CAppMngr2Model::NewL( iEikonEnv->FsSession(), *this ); |
60 iModel = CAppMngr2Model::NewL( iEikonEnv->FsSession(), *this ); |
61 |
61 |
62 FLOG( "CAppMngr2AppUi::ConstructL, creting views" ); |
62 FLOG( "CAppMngr2AppUi::ConstructL, creting views" ); |
63 CAppMngr2InstalledView* installedView = CAppMngr2InstalledView::NewL(); |
63 CAppMngr2InstalledView* installedView = CAppMngr2InstalledView::NewL(); |
64 AddViewL( installedView ); // takes ownership |
64 AddViewL( installedView ); // takes ownership |
65 CAppMngr2PackagesView* packagesView = CAppMngr2PackagesView::NewL(); |
65 CAppMngr2PackagesView* packagesView = CAppMngr2PackagesView::NewL(); |
66 AddViewL( packagesView ); // takes ownership |
66 AddViewL( packagesView ); // takes ownership |
90 } |
90 } |
91 else |
91 else |
92 { |
92 { |
93 ActivateLocalViewL( KInstalledViewId ); |
93 ActivateLocalViewL( KInstalledViewId ); |
94 } |
94 } |
95 |
95 |
96 FLOG( "CAppMngr2AppUi::ConstructL, starting delayed construct" ); |
96 FLOG( "CAppMngr2AppUi::ConstructL, starting delayed construct" ); |
97 iIdle = CIdle::NewL( CActive::EPriorityStandard ); |
97 iIdle = CIdle::NewL( CActive::EPriorityStandard ); |
98 iIdle->Start( TCallBack( &CAppMngr2AppUi::DelayedConstructL, this ) ); |
98 iIdle->Start( TCallBack( &CAppMngr2AppUi::DelayedConstructL, this ) ); |
99 } |
99 } |
100 |
100 |
178 if( aSelf ) |
178 if( aSelf ) |
179 { |
179 { |
180 CAppMngr2AppUi* self = static_cast<CAppMngr2AppUi*>( aSelf ); |
180 CAppMngr2AppUi* self = static_cast<CAppMngr2AppUi*>( aSelf ); |
181 FLOG( "CAppMngr2AppUi::DelayedConstructL, step %d", |
181 FLOG( "CAppMngr2AppUi::DelayedConstructL, step %d", |
182 self->iDelayedConstructionStep ); |
182 self->iDelayedConstructionStep ); |
183 switch( self->iDelayedConstructionStep ) |
183 |
184 { |
184 // Only necessary part of the model is constructed. AppMngr2 runs |
185 case EFirstStep: |
185 // as embedded application in Control panel. It is started either |
186 if( self->iConstructInstallationFilesFirst ) |
186 // to display installed applications, or installation files. |
187 { |
187 if( self->iConstructInstallationFilesFirst ) |
188 self->iModel->StartFetchingInstallationFilesL(); |
188 { |
189 } |
189 self->iModel->StartFetchingInstallationFilesL(); |
190 else |
190 } |
191 { |
191 else |
192 self->iModel->StartFetchingInstalledAppsL(); |
192 { |
193 } |
193 self->iModel->StartFetchingInstalledAppsL(); |
194 self->iDelayedConstructionStep = ESecondStep; |
194 } |
195 return ETrue; // call DelayedConstruct again |
195 |
196 |
196 self->iDelayedConstructionStep = EAllDone; |
197 case ESecondStep: |
|
198 if( self->iConstructInstallationFilesFirst ) |
|
199 { |
|
200 self->iModel->StartFetchingInstalledAppsL(); |
|
201 } |
|
202 else |
|
203 { |
|
204 self->iModel->StartFetchingInstallationFilesL(); |
|
205 } |
|
206 self->iDelayedConstructionStep = EAllDone; |
|
207 break; |
|
208 |
|
209 default: |
|
210 break; |
|
211 } |
|
212 } |
197 } |
213 return EFalse; // all done |
198 return EFalse; // all done |
214 } |
199 } |
215 |
200 |
216 // --------------------------------------------------------------------------- |
201 // --------------------------------------------------------------------------- |