391 */ |
395 */ |
392 void NmEditorView::fetchMessageIfNeeded(NmUiStartParam &startParam) |
396 void NmEditorView::fetchMessageIfNeeded(NmUiStartParam &startParam) |
393 { |
397 { |
394 NM_FUNCTION; |
398 NM_FUNCTION; |
395 |
399 |
396 if (startParam.editorStartMode() == NmUiEditorForward |
400 if (mIsNotFetchedBefore == true) { |
397 || startParam.editorStartMode()== NmUiEditorReply |
401 if (startParam.editorStartMode() == NmUiEditorForward |
398 || startParam.editorStartMode() == NmUiEditorReplyAll) { |
402 || startParam.editorStartMode()== NmUiEditorReply |
|
403 || startParam.editorStartMode() == NmUiEditorReplyAll) { |
399 |
404 |
400 fetchProgressDialogShow(); |
405 fetchProgressDialogShow(); |
401 mAttaManager.clearObserver(); |
406 mAttaManager.clearObserver(); |
402 mAttaManager.setObserver(this); |
407 mAttaManager.setObserver(this); |
403 mAttaManager.fetchAllMessageParts( |
408 mAttaManager.fetchAllMessageParts( |
404 startParam.mailboxId(), |
409 startParam.mailboxId(), |
405 startParam.folderId(), |
410 startParam.folderId(), |
406 startParam.messageId()); |
411 startParam.messageId()); |
407 } |
412 mIsNotFetchedBefore = false; |
408 else { |
413 } |
409 startMessageCreation(startParam); |
414 else { |
|
415 startMessageCreation(startParam); |
|
416 } |
410 } |
417 } |
411 } |
418 } |
412 |
419 |
413 /*! |
420 /*! |
414 Slot. Called when attachments fetch progress changes. |
421 Slot. Called when attachments fetch progress changes. |
889 mAttachmentPicker = new NmAttachmentPicker(this); |
896 mAttachmentPicker = new NmAttachmentPicker(this); |
890 |
897 |
891 if (extension && mAttachmentPicker) { |
898 if (extension && mAttachmentPicker) { |
892 connect(mAttachmentPicker, SIGNAL(attachmentsFetchOk(const QVariant &)), |
899 connect(mAttachmentPicker, SIGNAL(attachmentsFetchOk(const QVariant &)), |
893 this, SLOT(onAttachmentReqCompleted(const QVariant &))); |
900 this, SLOT(onAttachmentReqCompleted(const QVariant &))); |
894 |
|
895 HbAction* actionPhoto = |
|
896 extension->addAction(hbTrId("txt_mail_list_photo"), extension, SLOT(close())); |
|
897 connect(actionPhoto, SIGNAL(triggered()), mAttachmentPicker, SLOT(fetchImage())); |
|
898 |
901 |
899 HbAction* actionMusic = |
902 list[i]->setToolBarExtension(extension); |
900 extension->addAction(hbTrId("txt_mail_list_music"), extension, SLOT(close())); |
|
901 connect(actionMusic, SIGNAL(triggered()), mAttachmentPicker, SLOT(fetchAudio())); |
|
902 |
903 |
903 HbAction* actionVideo = |
904 //content widget to get the items to a list |
904 extension->addAction(hbTrId("txt_mail_list_video"), extension, SLOT(close())); |
905 mTBExtnContentWidget = new HbListWidget(); |
905 connect(actionVideo, SIGNAL(triggered()), mAttachmentPicker, SLOT(fetchVideo())); |
906 mTBExtnContentWidget->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); |
906 |
907 |
907 HbAction* actionOther = |
908 mTBExtnContentWidget->addItem(hbTrId("txt_mail_list_photo")); |
908 extension->addAction(hbTrId("txt_mail_list_other"), extension, SLOT(close())); |
909 mTBExtnContentWidget->addItem(hbTrId("txt_mail_list_music")); |
909 connect(actionOther, SIGNAL(triggered()), mAttachmentPicker, SLOT(fetchOther())); |
910 mTBExtnContentWidget->addItem(hbTrId("txt_mail_list_video")); |
|
911 mTBExtnContentWidget->addItem(hbTrId("txt_mail_list_other")); |
|
912 mTBExtnContentWidget->addItem(hbTrId("txt_mail_list_new_photo")); |
|
913 mTBExtnContentWidget->addItem(hbTrId("txt_mail_list_new_video")); |
|
914 HbListViewItem *listView = mTBExtnContentWidget->listItemPrototype(); |
|
915 HbFrameBackground frame(NmPopupListFrame, HbFrameDrawer::NinePieces); |
|
916 listView->setDefaultFrame(frame); |
910 |
917 |
911 HbAction* actionCameraStill = |
918 connect(mTBExtnContentWidget, SIGNAL(activated(HbListWidgetItem*)), |
912 extension->addAction(hbTrId("txt_mail_list_new_photo"), extension, SLOT(close())); |
919 mAttachmentPicker, SLOT (selectFetcher(HbListWidgetItem*))); |
913 connect(actionCameraStill, SIGNAL(triggered()), mAttachmentPicker, SLOT(fetchCameraStill())); |
|
914 |
920 |
915 HbAction* actionCameraVideo = |
921 connect(mTBExtnContentWidget, SIGNAL(activated(HbListWidgetItem*)), |
916 extension->addAction(hbTrId("txt_mail_list_new_video"), extension, SLOT(close())); |
922 extension, SLOT(close())); |
917 connect(actionCameraVideo, SIGNAL(triggered()), mAttachmentPicker, SLOT(fetchCameraVideo())); |
|
918 |
923 |
919 list[i]->setToolBarExtension(extension); |
924 extension->setContentWidget(mTBExtnContentWidget); |
920 } |
925 } |
921 } |
926 } |
922 } |
927 } |
923 } |
928 } |
924 } |
929 } |