526 if (actionResponse.menuType() == NmActionOptionsMenu) { |
526 if (actionResponse.menuType() == NmActionOptionsMenu) { |
527 switch (actionResponse.responseCommand()) { |
527 switch (actionResponse.responseCommand()) { |
528 case NmActionResponseCommandNewMail: { |
528 case NmActionResponseCommandNewMail: { |
529 // Check that given start response has mailbox and folder id's |
529 // Check that given start response has mailbox and folder id's |
530 if (actionResponse.mailboxId()!=0){ |
530 if (actionResponse.mailboxId()!=0){ |
|
531 NM_TIMESTAMP("New Mail chose from menu."); |
531 NmUiStartParam *startParam = new NmUiStartParam(NmUiViewMessageEditor, |
532 NmUiStartParam *startParam = new NmUiStartParam(NmUiViewMessageEditor, |
532 actionResponse.mailboxId(), mStartParam->folderId()); |
533 actionResponse.mailboxId(), mStartParam->folderId()); |
533 // startParam ownerhips transfers |
534 // startParam ownerhips transfers |
534 mApplication.enterNmUiView(startParam); |
535 mApplication.enterNmUiView(startParam); |
535 } |
536 } |
562 // Handle context menu commands here |
563 // Handle context menu commands here |
563 else if (actionResponse.menuType()==NmActionContextMenu){ |
564 else if (actionResponse.menuType()==NmActionContextMenu){ |
564 switch (actionResponse.responseCommand()){ |
565 switch (actionResponse.responseCommand()){ |
565 case NmActionResponseCommandOpen:{ |
566 case NmActionResponseCommandOpen:{ |
566 if (mLongPressedItem){ |
567 if (mLongPressedItem){ |
567 NmUiStartParam *startParam = new NmUiStartParam(NmUiViewMessageViewer, |
568 NmFolderType folderType = mUiEngine.folderTypeById(mStartParam->mailboxId(), |
568 mStartParam->mailboxId(), mStartParam->folderId(), |
569 mStartParam->folderId()); |
569 mLongPressedItem->envelope().messageId()); |
570 if (folderType==NmFolderDrafts){ |
570 mApplication.enterNmUiView(startParam); |
571 NmUiStartParam *startParam = new NmUiStartParam(NmUiViewMessageEditor, |
|
572 mStartParam->mailboxId(), mStartParam->folderId(), |
|
573 mLongPressedItem->envelope().messageId(),NmUiEditorFromDrafts); |
|
574 mApplication.enterNmUiView(startParam); |
|
575 } |
|
576 else if (folderType!=NmFolderOutbox){ |
|
577 NmUiStartParam *startParam = new NmUiStartParam(NmUiViewMessageViewer, |
|
578 mStartParam->mailboxId(), mStartParam->folderId(), |
|
579 mLongPressedItem->envelope().messageId()); |
|
580 mApplication.enterNmUiView(startParam); |
|
581 } |
571 mLongPressedItem=NULL; |
582 mLongPressedItem=NULL; |
572 } |
583 } |
573 } |
584 break; |
574 break; |
585 } |
575 default: |
586 default: { |
576 break; |
587 break; |
|
588 } |
577 } |
589 } |
578 } |
590 } |
579 |
591 |
580 // Handle toolbar commands here |
592 // Handle toolbar commands here |
581 else if ( actionResponse.menuType() == NmActionToolbar ) { |
593 else if ( actionResponse.menuType() == NmActionToolbar ) { |
582 if ( actionResponse.responseCommand() == NmActionResponseCommandNewMail ) { |
594 if ( actionResponse.responseCommand() == NmActionResponseCommandNewMail ) { |
583 // Check that given start response has mailbox and folder id's |
595 // Check that given start response has mailbox and folder id's |
584 if (actionResponse.mailboxId()!=0){ |
596 if (actionResponse.mailboxId()!=0){ |
|
597 NM_TIMESTAMP("New Mail chose from toolbar."); |
585 NmUiStartParam *startParam = new NmUiStartParam(NmUiViewMessageEditor, |
598 NmUiStartParam *startParam = new NmUiStartParam(NmUiViewMessageEditor, |
586 actionResponse.mailboxId(), mStartParam->folderId()); |
599 actionResponse.mailboxId(), mStartParam->folderId()); |
587 // startParam ownerhips transfers |
600 // startParam ownerhips transfers |
588 mApplication.enterNmUiView(startParam); |
601 mApplication.enterNmUiView(startParam); |
589 } |
602 } |
634 } |
647 } |
635 tb->clearActions(); |
648 tb->clearActions(); |
636 NmActionRequest request(this, NmActionToolbar, NmActionContextViewMessageList, |
649 NmActionRequest request(this, NmActionToolbar, NmActionContextViewMessageList, |
637 NmActionContextDataNone, mStartParam->mailboxId(), mStartParam->folderId() ); |
650 NmActionContextDataNone, mStartParam->mailboxId(), mStartParam->folderId() ); |
638 NmUiExtensionManager &extMngr = mApplication.extManager(); |
651 NmUiExtensionManager &extMngr = mApplication.extManager(); |
639 if (!&extMngr) { |
|
640 return; |
|
641 } |
|
642 QList<NmAction *> list; |
652 QList<NmAction *> list; |
643 extMngr.getActions(request, list); |
653 extMngr.getActions(request, list); |
644 for (int i = 0; i < list.count(); i++) { |
654 for (int i = 0; i < list.count(); i++) { |
645 tb->addAction(list[i]); |
655 tb->addAction(list[i]); |
646 } |
656 } |