28 |
28 |
29 #include <glxnavigationalstate.h> |
29 #include <glxnavigationalstate.h> |
30 #include <mpxcollectionpath.h> |
30 #include <mpxcollectionpath.h> |
31 #include <glxcollectionpluginimageviewer.hrh> |
31 #include <glxcollectionpluginimageviewer.hrh> |
32 #include <centralrepository.h> // for checking the ShareOnline version |
32 #include <centralrepository.h> // for checking the ShareOnline version |
|
33 #include <glxuiutility.h> |
33 |
34 |
34 // CONSTANTS AND DEFINITIONS |
35 // CONSTANTS AND DEFINITIONS |
35 namespace |
36 namespace |
36 { |
37 { |
37 // ShareOnline application UID |
38 // ShareOnline application UID |
290 // |
291 // |
291 void CGlxToolbarController::SetStatusL(MGlxMediaList* aList) |
292 void CGlxToolbarController::SetStatusL(MGlxMediaList* aList) |
292 { |
293 { |
293 TRACER("CGlxToolbarController::SetStatusL"); |
294 TRACER("CGlxToolbarController::SetStatusL"); |
294 |
295 |
295 GLX_LOG_INFO1("CGlxToolbarController::SetStatusL(%d)", aList->Count()); |
296 GLX_LOG_INFO1("CGlxToolbarController::SetStatusL(%d)", aList->Count()); |
296 if (aList->Count() <= 0) |
297 // When going back from fullscreen to grid, when the attributes are already |
297 { |
298 // available in the cache, there is no HandleAttributeAvailable callback. Hence, |
298 SetToolbarItemsDimmed(ETrue); |
299 // checking for medialist count and backward navigation |
299 } |
300 CGlxUiUtility* uiUtility = CGlxUiUtility::UtilityL(); |
300 else if (KErrNotFound != aList->FocusIndex()) |
301 CleanupClosePushL(*uiUtility); |
301 { |
302 if (aList->Count() <= 0 && (uiUtility->ViewNavigationDirection() |
302 CGlxNavigationalState* navigationalState = |
303 == EGlxNavigationBackwards)) |
303 CGlxNavigationalState::InstanceL(); |
304 { |
304 CleanupClosePushL(*navigationalState); |
305 SetToolbarItemsDimmed(ETrue); |
305 if (navigationalState->ViewingMode() == NGlxNavigationalState::EView) |
306 } |
306 { |
307 else if (KErrNotFound != aList->FocusIndex()) |
307 SetToolbarItemsDimmed(EFalse); |
308 { |
308 } |
309 CGlxNavigationalState* navigationalState = |
309 else if (navigationalState->ViewingMode() |
310 CGlxNavigationalState::InstanceL(); |
310 == NGlxNavigationalState::EBrowse) |
311 CleanupClosePushL(*navigationalState); |
311 { |
312 if (navigationalState->ViewingMode() == NGlxNavigationalState::EView) |
312 TBool dimmed = aList->SelectionCount() ? EFalse : ETrue; |
313 { |
313 iToolbar->SetItemDimmed(EGlxCmdSend, dimmed, ETrue); |
314 SetToolbarItemsDimmed(EFalse); |
314 iToolbar->SetItemDimmed(EGlxCmdUpload, dimmed, ETrue); |
315 } |
315 } |
316 else if (navigationalState->ViewingMode() |
316 CleanupStack::PopAndDestroy(navigationalState); |
317 == NGlxNavigationalState::EBrowse) |
317 } |
318 { |
318 } |
319 TBool dimmed = aList->SelectionCount() ? EFalse : ETrue; |
|
320 iToolbar->SetItemDimmed(EGlxCmdSend, dimmed, ETrue); |
|
321 iToolbar->SetItemDimmed(EGlxCmdUpload, dimmed, ETrue); |
|
322 } |
|
323 CleanupStack::PopAndDestroy(navigationalState); |
|
324 } |
|
325 CleanupStack::PopAndDestroy(uiUtility); |
|
326 } |
319 |
327 |
320 //---------------------------------------------------------------------------- |
328 //---------------------------------------------------------------------------- |
321 // EnableLatch |
329 // EnableLatch |
322 //---------------------------------------------------------------------------- |
330 //---------------------------------------------------------------------------- |
323 // |
331 // |
348 TRACER("CGlxToolbarController::HandlePopulatedL()"); |
356 TRACER("CGlxToolbarController::HandlePopulatedL()"); |
349 if (aList->Count() <= 0) |
357 if (aList->Count() <= 0) |
350 { |
358 { |
351 SetToolbarItemsDimmed(ETrue); |
359 SetToolbarItemsDimmed(ETrue); |
352 } |
360 } |
|
361 if (!iToolbar->IsVisible()) |
|
362 { |
|
363 GLX_DEBUG1("CGlxToolbarController::HandlePopulatedL()" |
|
364 " - SetToolbarVisibility(ETrue)"); |
|
365 iToolbar->SetToolbarVisibility(ETrue); |
|
366 } |
353 } |
367 } |
354 |
368 |
355 // ---------------------------------------------------------------------------- |
369 // ---------------------------------------------------------------------------- |
356 // SetToolbarItemsDimmed |
370 // SetToolbarItemsDimmed |
357 // ---------------------------------------------------------------------------- |
371 // ---------------------------------------------------------------------------- |