128 const TVwsViewId& aPrevViewId, TUid aCustomMessageId, |
128 const TVwsViewId& aPrevViewId, TUid aCustomMessageId, |
129 const TDesC8& aCustomMessage) |
129 const TDesC8& aCustomMessage) |
130 { |
130 { |
131 TRACER ("CGlxMediaListViewBase::DoViewActivateL()"); |
131 TRACER ("CGlxMediaListViewBase::DoViewActivateL()"); |
132 iUiUtility->SetAppOrientationL( EGlxOrientationDefault ); |
132 iUiUtility->SetAppOrientationL( EGlxOrientationDefault ); |
|
133 // current navigational state |
|
134 CMPXCollectionPath* navigationalState = |
|
135 iCollectionUtility->Collection().PathL(); |
|
136 CleanupStack::PushL( navigationalState ); |
|
137 |
133 if ( iMediaList ) |
138 if ( iMediaList ) |
134 { |
139 { |
135 // may need to refresh the media list if it has got out of sync |
140 // may need to refresh the media list if it has got out of sync |
136 // with the current navigational state, e.g. when jumping back two views |
141 // with the current navigational state, e.g. when jumping back two views |
137 // instead of just one, the intermediate view's media list will not have |
142 // instead of just one, the intermediate view's media list will not have |
138 // been closed so if that view is subsequently re-opened its media list |
143 // been closed so if that view is subsequently re-opened its media list |
139 // could contain out of date items |
144 // could contain out of date items |
140 CMPXCollectionPath* path = iMediaList->PathLC(); |
145 CMPXCollectionPath* path = iMediaList->PathLC(); |
141 // current navigational state |
146 // current navigational state |
142 CMPXCollectionPath* navigationalState = |
|
143 iCollectionUtility->Collection().PathL(); |
|
144 CleanupStack::PushL( navigationalState ); |
|
145 // current node id in UI Hierarchy |
147 // current node id in UI Hierarchy |
146 TMPXItemId navStateNodeId = |
148 TMPXItemId navStateNodeId = |
147 navigationalState->Id( navigationalState->Levels() - 2 ); |
149 navigationalState->Id( navigationalState->Levels() - 2 ); |
148 // current media list's node id in UI hierarchy |
150 // current media list's node id in UI hierarchy |
149 TMPXItemId mediaListNodeId = path->Id( path->Levels() - 2 ); |
151 TMPXItemId mediaListNodeId = path->Id( path->Levels() - 2 ); |
164 iMediaList->AddContextL(iPreloadContextForCommandHandlers, 0); |
165 iMediaList->AddContextL(iPreloadContextForCommandHandlers, 0); |
165 } |
166 } |
166 __ASSERT_ALWAYS(iMediaList, Panic(EGlxPanicNullMediaList)); |
167 __ASSERT_ALWAYS(iMediaList, Panic(EGlxPanicNullMediaList)); |
167 |
168 |
168 |
169 |
169 CMPXCollectionPath* navigationalState = iCollectionUtility->Collection().PathL(); |
|
170 CleanupStack::PushL( navigationalState ); |
|
171 if (navigationalState->Id() == TMPXItemId(KGlxCollectionPluginImageViewerImplementationUid)) |
170 if (navigationalState->Id() == TMPXItemId(KGlxCollectionPluginImageViewerImplementationUid)) |
172 { |
171 { |
173 // As image viewer is direct fullscreen view, |
172 // As image viewer is direct fullscreen view, |
174 // it will not have title. |
173 // it will not have title. |
175 SetTitleL(KBlankTitle); |
174 SetTitleL(KBlankTitle); |
187 |
186 |
188 CMPXCollectionPath* path = iMediaList->PathLC( NGlxListDefs::EPathParent ); |
187 CMPXCollectionPath* path = iMediaList->PathLC( NGlxListDefs::EPathParent ); |
189 iTitleFetcher = CGlxTitleFetcher::NewL(*this, path); |
188 iTitleFetcher = CGlxTitleFetcher::NewL(*this, path); |
190 CleanupStack::PopAndDestroy(path); |
189 CleanupStack::PopAndDestroy(path); |
191 } |
190 } |
192 CleanupStack::PopAndDestroy( navigationalState ); |
|
193 |
191 |
194 //Allow the MskController to observe medialist everytime a view with a valid |
192 //Allow the MskController to observe medialist everytime a view with a valid |
195 //medialist becomes active |
193 //medialist becomes active |
196 if( iCbaControl && Cba()&& iEnableMidddleSoftkey ) |
194 if( iCbaControl && Cba()&& iEnableMidddleSoftkey ) |
197 { |
195 { |
198 CMPXCollectionPath* navigationalState = iCollectionUtility->Collection().PathL(); |
|
199 CleanupStack::PushL(navigationalState); |
|
200 iCbaControl->AddToObserverL(*iMediaList,Cba()); |
196 iCbaControl->AddToObserverL(*iMediaList,Cba()); |
201 if(!(1 == navigationalState->Levels())) // Checking for the main list view |
197 if(!(1 == navigationalState->Levels())) // Checking for the main list view |
202 { |
198 { |
203 iCbaControl->SetStatusOnViewActivationL(iMediaList); |
199 iCbaControl->SetStatusOnViewActivationL(iMediaList); |
204 } |
200 } |
205 else |
201 else |
206 { |
202 { |
207 iCbaControl->SetMainStatusL(); |
203 iCbaControl->SetMainStatusL(); |
208 } |
204 } |
209 CleanupStack::PopAndDestroy(navigationalState); |
205 } |
210 } |
206 |
|
207 CleanupStack::PopAndDestroy( navigationalState ); |
211 |
208 |
212 DoMLViewActivateL(aPrevViewId, aCustomMessageId, aCustomMessage); |
209 DoMLViewActivateL(aPrevViewId, aCustomMessageId, aCustomMessage); |
213 //Allow the toolbarController to observe medialist everytime a view with a valid |
210 //Allow the toolbarController to observe medialist everytime a view with a valid |
214 //medialist becomes active |
211 //medialist becomes active |
215 if( GetToolBar() && iToolbarControl ) |
212 if( GetToolBar() && iToolbarControl ) |