116 CleanupStack::PushL( mainView ); |
116 CleanupStack::PushL( mainView ); |
117 iViewAppUi->AddViewL( mainView ); |
117 iViewAppUi->AddViewL( mainView ); |
118 CleanupStack::Pop( mainView ); |
118 CleanupStack::Pop( mainView ); |
119 |
119 |
120 // laucher for adding widgets. |
120 // laucher for adding widgets. |
121 iLauncher = CPeriodic::NewL( CActive::EPriorityIdle ); |
121 iLauncher = CPeriodic::NewL( CActive::EPriorityUserInput + 1 ); |
122 } |
122 } |
123 |
123 |
124 // --------------------------------------------------------- |
124 // --------------------------------------------------------- |
125 // CWmPlugin::Activate |
125 // CWmPlugin::Activate |
126 // --------------------------------------------------------- |
126 // --------------------------------------------------------- |
127 // |
127 // |
128 void CWmPlugin::Activate() |
128 void CWmPlugin::Activate() |
129 { |
129 { |
130 CWmMainContainerView* view = static_cast<CWmMainContainerView*>( |
130 // prevents opening wm if adding widget is ongoing. |
131 iViewAppUi->View( TUid::Uid(EWmMainContainerViewId) ) ); |
131 if ( !iLauncher->IsActive() ) |
132 if ( !IsActive() && view && iHsContentController ) |
132 { |
133 { |
133 CWmMainContainerView* view = static_cast<CWmMainContainerView*>( |
134 // stop displaying menubar before starting fullscreen effects |
134 iViewAppUi->View( TUid::Uid(EWmMainContainerViewId) ) ); |
135 CEikMenuBar* menuBar = CEikonEnv::Static()->AppUiFactory()->MenuBar(); |
135 if ( !IsActive() && view && iHsContentController ) |
136 if ( menuBar && menuBar->IsDisplayed() ) |
136 { |
137 { |
137 // stop displaying menubar before starting fullscreen effects |
138 menuBar->StopDisplayingMenuBar(); |
138 CEikMenuBar* menuBar = CEikonEnv::Static()->AppUiFactory()->MenuBar(); |
139 } |
139 if ( menuBar && menuBar->IsDisplayed() ) |
140 |
140 { |
141 TRAP_IGNORE( |
141 menuBar->StopDisplayingMenuBar(); |
142 iEffectManager->BeginFullscreenEffectL( |
142 } |
143 KAppStartEffectStyle ); |
143 |
144 iViewAppUi->ActivateLocalViewL( |
144 TRAP_IGNORE( |
145 TUid::Uid( EWmMainContainerViewId ) ); |
145 iEffectManager->BeginFullscreenEffectL( |
146 ); |
146 KAppStartEffectStyle ); |
|
147 iViewAppUi->ActivateLocalViewL( |
|
148 TUid::Uid( EWmMainContainerViewId ) ); |
|
149 ); |
|
150 } |
147 } |
151 } |
148 } |
152 } |
149 |
153 |
150 // --------------------------------------------------------- |
154 // --------------------------------------------------------- |
151 // CWmPlugin::DeActivate |
155 // CWmPlugin::DeActivate |
260 } |
264 } |
261 |
265 |
262 if ( !iEffectManager->IsEffectActive() ) |
266 if ( !iEffectManager->IsEffectActive() ) |
263 { |
267 { |
264 // launch effect without delay |
268 // launch effect without delay |
265 iExecutionCount = KMaxCmdExecutionCount; |
269 if ( !iLauncher->IsActive() ) |
266 iLauncher->Start( 0, 0, TCallBack( ExecuteCommand, this ) ); |
270 { |
|
271 iExecutionCount = KMaxCmdExecutionCount; |
|
272 iLauncher->Start( 0, 0, TCallBack( ExecuteCommand, this ) ); |
|
273 } |
267 } |
274 } |
268 else |
275 else |
269 { |
276 { |
270 // maximum wait time is 300ms (6 x 50ms) |
277 // maximum wait time is 300ms (6 x 50ms) |
271 if ( !iLauncher->IsActive() ) |
278 if ( !iLauncher->IsActive() ) |