289 iAttachmentStylusPopup->SetItemDimmed( EFsEmailUiCmdOpenAttachment, ETrue ); |
289 iAttachmentStylusPopup->SetItemDimmed( EFsEmailUiCmdOpenAttachment, ETrue ); |
290 iAttachmentStylusPopup->SetItemDimmed( EFsEmailUiCmdSave, ETrue ); |
290 iAttachmentStylusPopup->SetItemDimmed( EFsEmailUiCmdSave, ETrue ); |
291 iAttachmentStylusPopup->SetItemDimmed( EFsEmailUiCmdSaveAll, ETrue ); |
291 iAttachmentStylusPopup->SetItemDimmed( EFsEmailUiCmdSaveAll, ETrue ); |
292 iAttachmentStylusPopup->SetItemDimmed( EFsEmailUiCmdCancelDownload, ETrue ); |
292 iAttachmentStylusPopup->SetItemDimmed( EFsEmailUiCmdCancelDownload, ETrue ); |
293 |
293 |
|
294 const TBool isMessage( iAttachmentsListModel->IsMessage( aAttachment ) ); |
|
295 |
294 if ( iAppUi.DownloadInfoMediator()->IsDownloading( aAttachment.partData.iMessagePartId ) ) |
296 if ( iAppUi.DownloadInfoMediator()->IsDownloading( aAttachment.partData.iMessagePartId ) ) |
295 { |
297 { |
296 iAttachmentStylusPopup->SetItemDimmed( EFsEmailUiCmdCancelDownload, EFalse ); |
298 iAttachmentStylusPopup->SetItemDimmed( EFsEmailUiCmdCancelDownload, EFalse ); |
297 } |
299 } |
298 else if ( aAttachment.downloadProgress == KComplete ) |
300 else if ( aAttachment.downloadProgress == KComplete ) |
300 iAttachmentStylusPopup->SetItemDimmed( EFsEmailUiCmdOpenAttachment, EFalse ); |
302 iAttachmentStylusPopup->SetItemDimmed( EFsEmailUiCmdOpenAttachment, EFalse ); |
301 |
303 |
302 // block saving of embedded messages if needed. |
304 // block saving of embedded messages if needed. |
303 if ( iView.IsEmbeddedMsgView() ) |
305 if ( iView.IsEmbeddedMsgView() ) |
304 { |
306 { |
305 if ( iView.IsEmbeddedMsgSavingAllowed() || !iAttachmentsListModel->IsMessage( aAttachment ) ) |
307 if ( iView.IsEmbeddedMsgSavingAllowed() || !isMessage ) |
306 { |
308 { |
307 iAttachmentStylusPopup->SetItemDimmed( EFsEmailUiCmdSave, EFalse ); |
309 iAttachmentStylusPopup->SetItemDimmed( EFsEmailUiCmdSave, EFalse ); |
308 } |
310 } |
309 } |
311 } |
310 else |
312 else |
311 { |
313 { |
312 iAttachmentStylusPopup->SetItemDimmed( EFsEmailUiCmdSave, EFalse ); |
314 iAttachmentStylusPopup->SetItemDimmed( EFsEmailUiCmdSave, isMessage && !iView.IsEmbeddedMsgSavingAllowed() ); |
313 } |
315 } |
314 |
316 |
315 if ( iAttachmentsListModel->GetModel().Count() > 1 ) |
317 if ( iAttachmentsListModel->GetModel().Count() > 1 ) |
316 { |
318 { |
317 // In embedded message mode, save all needs to be blocked if there |
319 // Save all cannot be shown if there is one message attachment and saving is not supported |
318 // are any message type attachments. This is due to limitations of Activesync plugin. |
320 if ( !( iAttachmentsListModel->IsThereAnyMessageAttachments() && !iView.IsEmbeddedMsgSavingAllowed() ) ) |
319 if( !(iView.IsEmbeddedMsgView() && iAttachmentsListModel->IsThereAnyMessageAttachments()) ) |
|
320 { |
321 { |
321 iAttachmentStylusPopup->SetItemDimmed( EFsEmailUiCmdSaveAll, EFalse ); |
322 // In embedded message mode, save all needs to be blocked if there |
322 } |
323 // are any message type attachments. This is due to limitations of Activesync plugin. |
|
324 if( !(iView.IsEmbeddedMsgView() && iAttachmentsListModel->IsThereAnyMessageAttachments()) ) |
|
325 { |
|
326 iAttachmentStylusPopup->SetItemDimmed( EFsEmailUiCmdSaveAll, EFalse ); |
|
327 } |
|
328 } |
323 } |
329 } |
324 } |
330 } |
325 else |
331 else |
326 { |
332 { |
327 iAttachmentStylusPopup->SetItemDimmed( EFsEmailUiCmdOpenAttachment, EFalse ); |
333 iAttachmentStylusPopup->SetItemDimmed( EFsEmailUiCmdOpenAttachment, EFalse ); |
328 iAttachmentStylusPopup->SetItemDimmed( EFsEmailUiCmdSave, EFalse ); |
334 iAttachmentStylusPopup->SetItemDimmed( EFsEmailUiCmdSave, isMessage ); |
329 if ( iAttachmentsListModel->GetModel().Count() > 1 ) |
335 if ( iAttachmentsListModel->GetModel().Count() > 1 ) |
330 { |
336 { |
331 iAttachmentStylusPopup->SetItemDimmed( EFsEmailUiCmdSaveAll, EFalse ); |
337 iAttachmentStylusPopup->SetItemDimmed( EFsEmailUiCmdSaveAll, |
|
338 iAttachmentsListModel->IsThereAnyMessageAttachments() && !iView.IsEmbeddedMsgSavingAllowed() ); |
332 } |
339 } |
333 } |
340 } |
334 iAttachmentStylusPopup->SetPosition( iAppUi.ClientRect().Center(), |
341 |
335 CAknStylusPopUpMenu::EPositionTypeRightBottom ); |
342 |
|
343 iAttachmentStylusPopup->SetPosition( iAppUi.LastSeenPointerPosition(), |
|
344 CAknStylusPopUpMenu::EPositionTypeLeftTop ); |
336 iAttachmentStylusPopup->ShowMenu(); |
345 iAttachmentStylusPopup->ShowMenu(); |
337 } |
346 } |
338 |
347 |
339 //Open the Avkon stylus popup when a web address link was pressed |
348 //Open the Avkon stylus popup when a web address link was pressed |
340 void CFreestyleMessageHeaderURLEventHandler::LaunchWebAddressMenuL() |
349 void CFreestyleMessageHeaderURLEventHandler::LaunchWebAddressMenuL() |