emailuis/emailui/src/FreestyleMessageHeaderURLEventHandler.cpp
branchRCL_3
changeset 13 0396474f30f5
parent 8 e1b6206813b4
child 16 4ce476e64c59
--- a/emailuis/emailui/src/FreestyleMessageHeaderURLEventHandler.cpp	Fri Mar 12 15:41:14 2010 +0200
+++ b/emailuis/emailui/src/FreestyleMessageHeaderURLEventHandler.cpp	Mon Mar 15 12:39:10 2010 +0200
@@ -291,6 +291,8 @@
     iAttachmentStylusPopup->SetItemDimmed( EFsEmailUiCmdSaveAll, ETrue );
     iAttachmentStylusPopup->SetItemDimmed( EFsEmailUiCmdCancelDownload, ETrue );   
 
+    const TBool isMessage( iAttachmentsListModel->IsMessage( aAttachment ) );
+    
     if ( iAppUi.DownloadInfoMediator()->IsDownloading( aAttachment.partData.iMessagePartId ) )
         {        
         iAttachmentStylusPopup->SetItemDimmed( EFsEmailUiCmdCancelDownload, EFalse );  
@@ -302,37 +304,44 @@
         // block saving of embedded messages if needed.
         if ( iView.IsEmbeddedMsgView() )
             {
-            if ( iView.IsEmbeddedMsgSavingAllowed() || !iAttachmentsListModel->IsMessage( aAttachment ) )
+            if ( iView.IsEmbeddedMsgSavingAllowed() || !isMessage )
                 {
                 iAttachmentStylusPopup->SetItemDimmed( EFsEmailUiCmdSave, EFalse );    
                 }              
             }
         else
             {
-            iAttachmentStylusPopup->SetItemDimmed( EFsEmailUiCmdSave, EFalse );
+            iAttachmentStylusPopup->SetItemDimmed( EFsEmailUiCmdSave, isMessage && !iView.IsEmbeddedMsgSavingAllowed() );
             }
         
         if ( iAttachmentsListModel->GetModel().Count() > 1 )
             {
-            // In embedded message mode, save all needs to be blocked if there
-            // are any message type attachments. This is due to limitations of Activesync plugin.
-            if( !(iView.IsEmbeddedMsgView() && iAttachmentsListModel->IsThereAnyMessageAttachments()) )
+            // Save all cannot be shown if there is one message attachment and saving is not supported
+            if ( !( iAttachmentsListModel->IsThereAnyMessageAttachments() && !iView.IsEmbeddedMsgSavingAllowed() ) )
                 {
-                iAttachmentStylusPopup->SetItemDimmed( EFsEmailUiCmdSaveAll, EFalse );    
-                }            
+                // In embedded message mode, save all needs to be blocked if there
+                // are any message type attachments. This is due to limitations of Activesync plugin.
+                if( !(iView.IsEmbeddedMsgView() && iAttachmentsListModel->IsThereAnyMessageAttachments()) )
+                    {
+                    iAttachmentStylusPopup->SetItemDimmed( EFsEmailUiCmdSaveAll, EFalse );    
+                    }
+                }
             }         
         }
     else
         {
         iAttachmentStylusPopup->SetItemDimmed( EFsEmailUiCmdOpenAttachment, EFalse );
-        iAttachmentStylusPopup->SetItemDimmed( EFsEmailUiCmdSave, EFalse ); 
+        iAttachmentStylusPopup->SetItemDimmed( EFsEmailUiCmdSave, isMessage ); 
         if ( iAttachmentsListModel->GetModel().Count() > 1 )
             {
-            iAttachmentStylusPopup->SetItemDimmed( EFsEmailUiCmdSaveAll, EFalse );
+            iAttachmentStylusPopup->SetItemDimmed( EFsEmailUiCmdSaveAll,
+                    iAttachmentsListModel->IsThereAnyMessageAttachments() && !iView.IsEmbeddedMsgSavingAllowed() );
             }         
         }
-    iAttachmentStylusPopup->SetPosition( iAppUi.ClientRect().Center(), 
-                                         CAknStylusPopUpMenu::EPositionTypeRightBottom );
+   
+    
+    iAttachmentStylusPopup->SetPosition( iAppUi.LastSeenPointerPosition(), 
+                                         CAknStylusPopUpMenu::EPositionTypeLeftTop );
     iAttachmentStylusPopup->ShowMenu();
     }