emailuis/nmailui/src/nmeditorview.cpp
changeset 57 ae34e1715e21
parent 56 15bc1d5d6267
child 62 a8c646b56683
equal deleted inserted replaced
56:15bc1d5d6267 57:ae34e1715e21
    20 static const char *NMUI_EDITOR_VIEW_XML = ":/docml/nmeditorview.docml";
    20 static const char *NMUI_EDITOR_VIEW_XML = ":/docml/nmeditorview.docml";
    21 static const char *NMUI_EDITOR_VIEW = "editorview";
    21 static const char *NMUI_EDITOR_VIEW = "editorview";
    22 
    22 
    23 // extension list item frame.
    23 // extension list item frame.
    24 static const QString NmPopupListFrame = "qtg_fr_popup_list_normal";
    24 static const QString NmPopupListFrame = "qtg_fr_popup_list_normal";
    25 
       
    26 static const QString NmDelimiter("; ");
    25 static const QString NmDelimiter("; ");
       
    26 static const QString NmPriorityLow("low");
       
    27 static const QString NmPriorityNormal("normal");
       
    28 static const QString NmPriorityHigh("high");
    27 
    29 
    28 /*!
    30 /*!
    29 	\class NmEditorView
    31 	\class NmEditorView
    30 	\brief Mail editor view
    32 	\brief Mail editor view
    31 */
    33 */
    54       mWaitDialog(NULL),
    56       mWaitDialog(NULL),
    55       mQueryDialog(NULL),
    57       mQueryDialog(NULL),
    56       mAttachmentPicker(NULL),
    58       mAttachmentPicker(NULL),
    57       mCcBccFieldVisible(false),
    59       mCcBccFieldVisible(false),
    58       mServiceSendingDialog(NULL),
    60       mServiceSendingDialog(NULL),
    59       mIsNotFetchedBefore(true)
    61       mIsNotFetchedBefore(true),
       
    62       mHiddenPriorityName(NmPriorityNormal)
    60 {
    63 {
    61     NM_FUNCTION;
    64     NM_FUNCTION;
    62     
    65     
    63     mDocumentLoader	= new HbDocumentLoader();
    66     mDocumentLoader	= new HbDocumentLoader();
    64     // Set object name
    67     // Set object name
   407             mAttaManager.setObserver(this);
   410             mAttaManager.setObserver(this);
   408             mAttaManager.fetchAllMessageParts(
   411             mAttaManager.fetchAllMessageParts(
   409                 startParam.mailboxId(),
   412                 startParam.mailboxId(),
   410                 startParam.folderId(),
   413                 startParam.folderId(),
   411                 startParam.messageId());
   414                 startParam.messageId());
   412 			mIsNotFetchedBefore = false;
       
   413         }
   415         }
   414         else {
   416         else {
   415             startMessageCreation(startParam);
   417             startMessageCreation(startParam);
   416         }
   418         }
       
   419         
       
   420         mIsNotFetchedBefore = false;
   417     }
   421     }
   418 }
   422 }
   419 
   423 
   420 /*!
   424 /*!
   421     Slot. Called when attachments fetch progress changes.
   425     Slot. Called when attachments fetch progress changes.
   956             mStartParam->messageId());
   960             mStartParam->messageId());
   957     NmUiExtensionManager &extMngr = mApplication.extManager();
   961     NmUiExtensionManager &extMngr = mApplication.extManager();
   958     QList<NmAction*> list;
   962     QList<NmAction*> list;
   959     extMngr.getActions(request, list);
   963     extMngr.getActions(request, list);
   960     for (int i = 0; i < list.count(); i++) {
   964     for (int i = 0; i < list.count(); i++) {
   961         mPrioritySubMenu->addAction(list[i]);
   965         // check what priority has already been selected and hide it from options menu
       
   966         if (!list[i]->objectName().contains(mHiddenPriorityName)) {
       
   967             mPrioritySubMenu->addAction(list[i]);
       
   968         }
   962     }
   969     }
   963     mPrioritySubMenu->setObjectName("editorPrioritySubMenu");
   970     mPrioritySubMenu->setObjectName("editorPrioritySubMenu");
   964     mPrioritySubMenu->setTitle(hbTrId("txt_mail_opt_add_priority"));
   971     mPrioritySubMenu->setTitle(hbTrId("txt_mail_opt_add_priority"));
   965     menu()->addMenu(mPrioritySubMenu);
   972     menu()->addMenu(mPrioritySubMenu);
   966 }
   973 }
  1369     
  1376     
  1370     mHeaderWidget->setPriority(priority);
  1377     mHeaderWidget->setPriority(priority);
  1371 
  1378 
  1372     if (mMessage) {
  1379     if (mMessage) {
  1373         NmMessagePriority messagePriority = NmMessagePriorityNormal;
  1380         NmMessagePriority messagePriority = NmMessagePriorityNormal;
       
  1381         mHiddenPriorityName = NmPriorityNormal;
  1374         
  1382         
  1375         if (priority == NmActionResponseCommandPriorityHigh) {
  1383         if (priority == NmActionResponseCommandPriorityHigh) {
  1376             messagePriority = NmMessagePriorityHigh;
  1384             messagePriority = NmMessagePriorityHigh;
       
  1385             mHiddenPriorityName = NmPriorityHigh;
  1377         }
  1386         }
  1378         else if (priority == NmActionResponseCommandPriorityLow) {
  1387         else if (priority == NmActionResponseCommandPriorityLow) {
  1379             messagePriority = NmMessagePriorityLow;
  1388             messagePriority = NmMessagePriorityLow;
       
  1389             mHiddenPriorityName = NmPriorityLow;
  1380         }
  1390         }
  1381         mMessage->envelope().setPriority(messagePriority);
  1391         mMessage->envelope().setPriority(messagePriority);
  1382     }
  1392     }
  1383 }
  1393 }
  1384 
  1394